Skip to content
Snippets Groups Projects
Commit 94a1c495 authored by Pierre-Alain Loizeau's avatar Pierre-Alain Loizeau
Browse files

[mRICH] fix error filter in both unpackers to support PASTA + single log per address

parent 40285ba7
No related branches found
No related tags found
No related merge requests found
...@@ -102,7 +102,8 @@ namespace cbm::algo::rich ...@@ -102,7 +102,8 @@ namespace cbm::algo::rich
totalSize += (1 + subSubEventSize); totalSize += (1 + subSubEventSize);
if (!isLast) { // all except last are DiRICH events 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++; ctx.monitor.fNumErrInvalidHubId++;
} }
if (totalSize == hubSize) { if (totalSize == hubSize) {
......
...@@ -103,9 +103,13 @@ void CbmRichUnpackAlgo2022::processHubBlock(CbmRichUnpackAlgoMicrosliceReader& r ...@@ -103,9 +103,13 @@ void CbmRichUnpackAlgo2022::processHubBlock(CbmRichUnpackAlgoMicrosliceReader& r
if (!isLast) { // DiRICH event if (!isLast) { // DiRICH event
// check correctness of subsub event, for safety reasons // check correctness of subsub event, for safety reasons
if (((subSubEventId >> 12) & 0xF) != 0x7) { uint16_t sSubSubEvtIdMsb = (subSubEventId >> 12) & 0xF;
LOG(error) << getLogHeader(reader) << "ERROR: subSubEventId has strange value:0x" << std::hex << subSubEventId if ((sSubSubEvtIdMsb != 0x7) && (sSubSubEvtIdMsb != 0x9)) {
<< std::dec; 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); processSubSubEvent(reader, subSubEventSize, subSubEventId);
} }
......
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
* @brief Baseclass for the TrdR unpacker algorithms * @brief Baseclass for the TrdR unpacker algorithms
* @version 0.1 * @version 0.1
* @date 2021-04-21 * @date 2021-04-21
* *
* @copyright Copyright (c) 2021 * @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. * 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 #ifndef CbmRichUnpackAlgo2022_H
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <cstdint> #include <cstdint>
#include <iomanip> #include <iomanip>
#include <memory> #include <memory>
#include <unordered_set>
#include <utility> #include <utility>
class CbmRichUnpackAlgo2022 : public CbmRichUnpackAlgoBase { class CbmRichUnpackAlgo2022 : public CbmRichUnpackAlgoBase {
...@@ -74,13 +75,13 @@ 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. * @brief Unpack a given microslice. To be implemented in the derived unpacker algos.
* *
* @param ts timeslice pointer * @param ts timeslice pointer
* @param icomp index to the component to be unpacked * @param icomp index to the component to be unpacked
* @param imslice index of the microslice to be unpacked * @param imslice index of the microslice to be unpacked
* @return true * @return true
* @return false * @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 * @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); bool unpack(const fles::Timeslice* ts, std::uint16_t icomp, UInt_t imslice);
...@@ -100,6 +101,8 @@ class CbmRichUnpackAlgo2022 : public CbmRichUnpackAlgoBase { ...@@ -100,6 +101,8 @@ class CbmRichUnpackAlgo2022 : public CbmRichUnpackAlgoBase {
int fCurrentSubSubEvent = 0; int fCurrentSubSubEvent = 0;
private: private:
std::unordered_set<uint16_t> fUnexpectedIds = {};
ClassDef(CbmRichUnpackAlgo2022, 2) ClassDef(CbmRichUnpackAlgo2022, 2)
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment