1111#ifndef ALICEO2_EMCAL_RAWREADERMEMORY_H
1212#define ALICEO2_EMCAL_RAWREADERMEMORY_H
1313
14+ #include < vector>
1415#include < gsl/span>
1516#include < Rtypes.h>
1617
1718#include " EMCALBase/RCUTrailer.h"
1819#include " EMCALReconstruction/RawBuffer.h"
20+ #include " EMCALReconstruction/RawDecodingError.h"
1921#include " EMCALReconstruction/RawPayload.h"
2022#include " Headers/RAWDataHeader.h"
2123#include " Headers/RDHAny.h"
@@ -36,6 +38,46 @@ namespace emcal
3638class RawReaderMemory
3739{
3840 public:
41+ // / \class MinorError
42+ // / \brief Minor (non-crashing) raw decoding errors
43+ // /
44+ // / Minor errors share the same codes as major raw decoding errors,
45+ // / however are not crashing.
46+ class MinorError
47+ {
48+ public:
49+ // / \brief Dummy constructor
50+ MinorError () = default ;
51+
52+ // / \brief Main constructor
53+ // / \param errortype Type of the error
54+ // / \param feeID ID of the FEE equipment
55+ MinorError (RawDecodingError::ErrorType_t errortype, int feeID) : mErrorType (errortype), mFEEID (feeID) {}
56+
57+ // / \brief Destructor
58+ ~MinorError () = default ;
59+
60+ // / \brief Set the type of the error
61+ // / \param errortype Type of the error
62+ void setErrorType (RawDecodingError::ErrorType_t errortype) { mErrorType = errortype; }
63+
64+ // / \brief Set the ID of the FEE equipment
65+ // / \param feeID ID of the FEE
66+ void setFEEID (int feeID) { mFEEID = feeID; }
67+
68+ // / \brief Get type of the error
69+ // / \return Type of the error
70+ RawDecodingError::ErrorType_t getErrorType () const { return mErrorType ; }
71+
72+ // / \brief Get ID of the FEE
73+ // / \return ID of the FEE
74+ int getFEEID () const { return mFEEID ; }
75+
76+ private:
77+ RawDecodingError::ErrorType_t mErrorType ; // /< Type of the error
78+ int mFEEID ; // /< ID of the FEC responsible for the ERROR
79+ };
80+
3981 // / \brief Constructor
4082 RawReaderMemory (const gsl::span<const char > rawmemory);
4183
@@ -58,8 +100,7 @@ class RawReaderMemory
58100 // / \brief Read next payload from the stream
59101 // /
60102 // / Read the next pages until the stop bit is found.
61- void
62- next ();
103+ void next ();
63104
64105 // / \brief Read the next page from the stream (single DMA page)
65106 // / \param resetPayload If true the raw payload is reset
@@ -85,6 +126,10 @@ class RawReaderMemory
85126 // / \return Raw Payload of the data until the stop bit is received.
86127 const RawPayload& getPayload () const { return mRawPayload ; }
87128
129+ // / \brief Get minor (non-crashing) raw decoding errors
130+ // / \return Minor raw decoding errors
131+ gsl::span<const MinorError> getMinorErrors () const { return mMinorErrors ; }
132+
88133 // / \brief Return size of the payload
89134 // / \return size of the payload
90135 int getPayloadSize () const { return mRawPayload .getPayloadSize (); }
@@ -123,6 +168,7 @@ class RawReaderMemory
123168 int mCurrentFEE = -1 ; // /< Current FEE in the data stream
124169 bool mRawHeaderInitialized = false ; // /< RDH for current page initialized
125170 bool mPayloadInitialized = false ; // /< Payload for current page initialized
171+ std::vector<MinorError> mMinorErrors ; // /< Minor raw decoding errors
126172
127173 ClassDefNV (RawReaderMemory, 1 );
128174};
0 commit comments