diff --git a/algo/detectors/rich/UnpackMS.cxx b/algo/detectors/rich/UnpackMS.cxx index c59e211949b6908031f3d15a779f351ea73878ab..0fa5bb9d794a08e3b46a3fce4d7c6fcfa0363b1b 100644 --- a/algo/detectors/rich/UnpackMS.cxx +++ b/algo/detectors/rich/UnpackMS.cxx @@ -102,7 +102,8 @@ namespace cbm::algo::rich totalSize += (1 + subSubEventSize); if (!isLast) { // all except last are DiRICH events - if (((subSubEventId >> 12) & 0xF) != 0x7) { // catch invalid ids + uint16_t sSubSubEvtIdMsb = (subSubEventId >> 12) & 0xF; + if ((sSubSubEvtIdMsb != 0x7) && (sSubSubEvtIdMsb != 0x9)) { // catch invalid ids: mRICH, mFSD, PASTA/MUST ctx.monitor.fNumErrInvalidHubId++; } if (totalSize == hubSize) { diff --git a/reco/detectors/rich/unpack/CbmRichUnpackAlgo2022.cxx b/reco/detectors/rich/unpack/CbmRichUnpackAlgo2022.cxx index 45f84e55e4b207c23aaa906013d7f827c9b0dd3d..e19d82510716d2a0e6305fc182a14ee4153a8baf 100644 --- a/reco/detectors/rich/unpack/CbmRichUnpackAlgo2022.cxx +++ b/reco/detectors/rich/unpack/CbmRichUnpackAlgo2022.cxx @@ -103,9 +103,13 @@ void CbmRichUnpackAlgo2022::processHubBlock(CbmRichUnpackAlgoMicrosliceReader& r if (!isLast) { // DiRICH event // check correctness of subsub event, for safety reasons - if (((subSubEventId >> 12) & 0xF) != 0x7) { - LOG(error) << getLogHeader(reader) << "ERROR: subSubEventId has strange value:0x" << std::hex << subSubEventId - << std::dec; + uint16_t sSubSubEvtIdMsb = (subSubEventId >> 12) & 0xF; + if ((sSubSubEvtIdMsb != 0x7) && (sSubSubEvtIdMsb != 0x9)) { + if (0 == fUnexpectedIds.count(subSubEventId)) { + LOG(error) << getLogHeader(reader) << "ERROR: subSubEventId has strange value:0x" << std::hex << subSubEventId + << std::dec; + fUnexpectedIds.insert(subSubEventId); + } } processSubSubEvent(reader, subSubEventSize, subSubEventId); } diff --git a/reco/detectors/rich/unpack/CbmRichUnpackAlgo2022.h b/reco/detectors/rich/unpack/CbmRichUnpackAlgo2022.h index 47a9a613739a8e7a47fd50a6d608f51138501eb7..ca6aaa6e52515970dd679ad287d7b201faed4f53 100644 --- a/reco/detectors/rich/unpack/CbmRichUnpackAlgo2022.h +++ b/reco/detectors/rich/unpack/CbmRichUnpackAlgo2022.h @@ -8,14 +8,14 @@ * @brief Baseclass for the TrdR unpacker algorithms * @version 0.1 * @date 2021-04-21 - * + * * @copyright Copyright (c) 2021 - * - * This is the base class for the algorithmic part of the tsa data unpacking + * + * This is the base class for the algorithmic part of the tsa data unpacking * processes of the CbmTrd. - * The actual translation from tsa to digi happens in the derived classes. - * - * + * The actual translation from tsa to digi happens in the derived classes. + * + * */ #ifndef CbmRichUnpackAlgo2022_H @@ -34,6 +34,7 @@ #include <cstdint> #include <iomanip> #include <memory> +#include <unordered_set> #include <utility> class CbmRichUnpackAlgo2022 : public CbmRichUnpackAlgoBase { @@ -74,13 +75,13 @@ class CbmRichUnpackAlgo2022 : public CbmRichUnpackAlgoBase { /** * @brief Unpack a given microslice. To be implemented in the derived unpacker algos. - * + * * @param ts timeslice pointer * @param icomp index to the component to be unpacked * @param imslice index of the microslice to be unpacked - * @return true - * @return false - * + * @return true + * @return false + * * @remark The content of the µslice can only be accessed via the timeslice. Hence, we need to pass the pointer to the full timeslice */ bool unpack(const fles::Timeslice* ts, std::uint16_t icomp, UInt_t imslice); @@ -100,6 +101,8 @@ class CbmRichUnpackAlgo2022 : public CbmRichUnpackAlgoBase { int fCurrentSubSubEvent = 0; private: + std::unordered_set<uint16_t> fUnexpectedIds = {}; + ClassDef(CbmRichUnpackAlgo2022, 2) };