From 8f9dcf2914645fce678174d9952cd88dd71b1190 Mon Sep 17 00:00:00 2001 From: gwm17 Date: Mon, 7 Nov 2022 12:00:44 -0500 Subject: [PATCH] Fix bug in evaluating size of nscldaq data buffer and type mask of MesyTec unpacker --- Specter/src/Specter/Physics/nscldaq/CharonOnlineSource.cpp | 2 +- Specter/src/Specter/Physics/nscldaq/Unpackers/MesyTecUnpacker.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Specter/src/Specter/Physics/nscldaq/CharonOnlineSource.cpp b/Specter/src/Specter/Physics/nscldaq/CharonOnlineSource.cpp index 5d63070..0c5fb69 100644 --- a/Specter/src/Specter/Physics/nscldaq/CharonOnlineSource.cpp +++ b/Specter/src/Specter/Physics/nscldaq/CharonOnlineSource.cpp @@ -37,7 +37,7 @@ namespace Specter { void CharonOnlineSource::UnpackRawBuffer() { uint32_t* iter = (uint32_t*) m_rawBuffer.data(); - uint32_t* end = iter + m_rawBuffer.size(); + uint32_t* end = iter + m_rawBuffer.size() / sizeof(uint32_t); bool wasUnpacked = false; UnpackerResult result; diff --git a/Specter/src/Specter/Physics/nscldaq/Unpackers/MesyTecUnpacker.h b/Specter/src/Specter/Physics/nscldaq/Unpackers/MesyTecUnpacker.h index f8d7a5a..d574262 100644 --- a/Specter/src/Specter/Physics/nscldaq/Unpackers/MesyTecUnpacker.h +++ b/Specter/src/Specter/Physics/nscldaq/Unpackers/MesyTecUnpacker.h @@ -22,7 +22,7 @@ namespace Specter { virtual void UnpackDatum(uint32_t* word) override; - static constexpr uint32_t s_typeMask = 0xc000000; + static constexpr uint32_t s_typeMask = 0xc0000000; static constexpr uint32_t s_typeHeader = 0x40000000; static constexpr uint32_t s_typeBody = 0x00000000; static constexpr uint32_t s_typeEnd = 0xc0000000;