From 94a1c49547a204d0946c7045a7c4fa91eef1cb79 Mon Sep 17 00:00:00 2001 From: P-A Loizeau <p.-a.loizeau@gsi.de> Date: Fri, 7 Feb 2025 16:36:43 +0100 Subject: [PATCH] [mRICH] fix error filter in both unpackers to support PASTA + single log per address --- algo/detectors/rich/UnpackMS.cxx | 3 ++- .../rich/unpack/CbmRichUnpackAlgo2022.cxx | 10 +++++--- .../rich/unpack/CbmRichUnpackAlgo2022.h | 23 +++++++++++-------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/algo/detectors/rich/UnpackMS.cxx b/algo/detectors/rich/UnpackMS.cxx index c59e211949..0fa5bb9d79 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 45f84e55e4..e19d825107 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 47a9a61373..ca6aaa6e52 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) }; -- GitLab