11#ifndef ALICEO2_EMCAL_ALTRODECODER_H
12#define ALICEO2_EMCAL_ALTRODECODER_H
63 const
char*
what() const noexcept
override {
return mErrorMessage.data(); }
146 std::string mErrorMessage;
176 mChannelHeader(channelHeader),
177 mPayloadWord(payloadword)
202 std::string
what() const noexcept;
281 uint32_t mChannelHeader;
282 uint32_t mPayloadWord;
354 void checkRCUTrailer();
359 bool checkChannelHWAddress(
int hwaddress);
363 std::vector<Channel> mChannels;
364 std::vector<MinorAltroDecodingError> mMinorDecodingErrors;
365 bool mChannelsInitialized =
false;
366 unsigned int mMaxBunchLength = UINT_MAX;
378std::ostream&
operator<<(std::ostream&
stream,
const AltroDecoderError& error);
396std::ostream&
operator<<(std::ostream&
stream,
const MinorAltroDecodingError& error);
Error handling of the ALTRO Decoder.
ErrorType_t
Error codes connected with the ALTRO decoding.
@ ALTRO_BUNCH_HEADER_ERROR
ALTRO bunch header cannot be decoded or is invalid.
@ ALTRO_MAPPING_ERROR
Incorrect ALTRO channel mapping.
@ RCU_TRAILER_SIZE_ERROR
RCU trailer size length.
@ CHANNEL_ERROR
Channels not initialized.
@ RCU_VERSION_ERROR
RCU trailer version not matching with the version in the raw header.
@ RCU_TRAILER_ERROR
RCU trailer cannot be decoded or invalid.
@ ALTRO_PAYLOAD_ERROR
ALTRO payload cannot be decoded.
@ ALTRO_BUNCH_LENGTH_ERROR
ALTRO bunch has incorrect length.
static int errorTypeToInt(ErrorType_t errortype)
convert the error type from symoblic constant into int
static const char * getErrorTypeDescription(unsigned int errortype)
Get the description connected to the error type.
static const char * getErrorTypeTitle(unsigned int errortype)
Get the title connected to the error type.
~AltroDecoderError() noexcept override=default
Destructor.
static ErrorType_t intToErrorType(int errornumber)
convert the error from number into a type (symbolic constant)
static constexpr int getNumberOfErrorTypes() noexcept
Get the number of error types handled by the AltroDecoderError.
static const char * getErrorTypeName(unsigned int errortype)
Get the name connected to the error type.
const ErrorType_t getErrorType() const noexcept
Access to the error type connected to the erro.
static const char * getErrorTypeTitle(ErrorType_t errortype)
Get the title connected to the error type.
AltroDecoderError(ErrorType_t errtype, const std::string_view message)
Constructor.
const char * what() const noexcept override
Access to error message cnnected to the error.
static const char * getErrorTypeDescription(ErrorType_t errortype)
Get the description connected to the error type.
static const char * getErrorTypeName(ErrorType_t errortype)
Get the name connected to the error type.
Decoder of the ALTRO data in the raw page.
void decode()
Decode the ALTRO stream.
const RCUTrailer & getRCUTrailer() const
Get reference to the RCU trailer object.
~AltroDecoder()=default
Destructor.
void readRCUTrailer()
Read RCU trailer for the current event in the raw buffer.
const std::vector< Channel > & getChannels() const
Get the reference to the channel container.
const std::vector< MinorAltroDecodingError > & getMinorDecodingErrors() const
Get list of minor decoding errors.
void setMaxBunchLength(int maxBunchLength)
Set the max. allowed bunch length.
void readChannels()
Read channels for the current event in the raw buffer.
Error handling for the ALTRO decoder for non-crashing errors.
MinorAltroDecodingError()=default
Dummy constructor.
static const char * getErrorTypeTitle(ErrorType_t errortype)
Get the title connected to the error type.
static const char * getErrorTypeDescription(unsigned int errortype)
Get the description connected to the error type.
ErrorType_t
Error codes connected with the ALTRO decoding.
@ CHANNEL_HEADER
Channel header corruption.
@ CHANNEL_ORDER
Channels not in increasing order.
@ BUNCH_LENGTH_ALLOW_EXCEED
Exceeds maximum allowed bunch length.
@ BUNCH_STARTTIME
Bunch start time exceeding.
@ BUNCH_LENGTH_EXCEED
Bunch length exceeding channel payload size.
@ CHANNEL_END_PAYLOAD_UNEXPECT
Unexpected end of payload (channel or trailer word in bunch words)
@ CHANNEL_PAYLOAD_EXCEED
Exceeding channel payload block.
@ BUNCH_HEADER_NULL
Bunch header is 0.
~MinorAltroDecodingError() noexcept=default
Destructor.
static ErrorType_t intToErrorType(int errornumber)
convert the error from number into a type (symbolic constant)
static int errorTypeToInt(ErrorType_t errortype)
convert the error type from symoblic constant into int
static const char * getErrorTypeName(unsigned int errortype)
Get the name connected to the error type.
uint32_t getPayloadWord() const noexcept
Get the payload word raising the error.
ErrorType_t getErrorType() const noexcept
Get the type of the error.
static const char * getErrorTypeTitle(unsigned int errortype)
Get the title connected to the error type.
static const char * getErrorTypeDescription(ErrorType_t errortype)
Get the description connected to the error type.
std::string what() const noexcept
Create and return error message for different error types.
MinorAltroDecodingError(ErrorType_t errtype, uint32_t channelHeader, uint32_t payloadword)
Constructor, initializing the object.
static const char * getErrorTypeName(ErrorType_t errortype)
Get the name connected to the error type.
static constexpr int getNumberOfErrorTypes() noexcept
Get the number of error types handled by the AltroDecoderError.
uint32_t getChannelHeader() const noexcept
Get the header of the channel raising the error.
Information stored in the RCU trailer.
Reader for raw data produced by the Readout application in in-memory format.
GLuint GLsizei const GLchar * message
std::ostream & operator<<(std::ostream &stream, const Cell &cell)
Stream operator for EMCAL cell.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...