11#ifndef ALICEO2_PHOS_RCUTRAILER_H
12#define ALICEO2_PHOS_RCUTRAILER_H
60 class Error :
public std::exception
81 ~Error() noexcept override = default;
85 const
char*
what() const noexcept
override {
return mErrorMessage.data(); }
93 std::string mErrorMessage;
99 RCUTrailer(
const gsl::span<const uint32_t> payloadwords);
181 std::vector<uint32_t>
encode()
const;
187 unsigned char mFirmwareVersion = 0;
188 unsigned int mTrailerSize = 0;
189 unsigned int mPayloadSize = 0;
190 unsigned int mFECERRA = 0;
191 unsigned int mFECERRB = 0;
192 unsigned short mERRREG2 = 0;
193 unsigned int mERRREG3 = 0;
194 unsigned short mActiveFECsA = 0;
195 unsigned short mActiveFECsB = 0;
196 unsigned int mAltroCFG1 = 0;
197 unsigned int mAltroCFG2 = 0;
198 bool mIsInitialized =
false;
ErrorType_t
Error codes for different error types.
@ SIZE_INVALID
Invalid trailer size.
@ SAMPLINGFREQ_INVALID
Invalid sampling frequency.
@ DECODING_INVALID
Invalid words during decoding.
@ L1PHASE_INVALID
Invalid L1 phase.
ErrorType_t getErrorType() const noexcept
Access to error code.
const char * what() const noexcept override
Access to the error message.
Error(ErrorType_t errtype, const char *message)
Constructor.
~Error() noexcept override=default
Destructor.
Information stored in the RCU trailer.
void reset()
Reset the RCU trailer.
void setAltroCFGReg2(unsigned int value)
unsigned short getActiveFECsB() const
void setAltroCFGReg1(unsigned int value)
RCUTrailer()=default
Constructor.
bool getNumberOfAltroBuffers() const
unsigned char getGlitchFilter() const
static RCUTrailer constructFromPayloadWords(const gsl::span< const uint32_t > payloadwords)
unsigned short getNumberOfChannelAddressMismatch() const
void printStream(std::ostream &stream) const
Prints the contents of the RCU trailer data.
unsigned char getFirmwareVersion() const
unsigned int getAltroCFGReg2() const
bool isInitialized() const
checlks whether the RCU trailer is initialzied
void setTimeSample(double timesample)
set time sample
void setFECErrorsA(unsigned int value)
bool isSparseReadout() const
void setActiveFECsA(unsigned short value)
void setActiveFECsB(unsigned short value)
void setFirmwareVersion(unsigned char version)
unsigned int getFECErrorsA() const
void setPayloadSize(unsigned int size)
unsigned char getNumberOfNonZeroSuppressedPostsamples() const
unsigned short getErrorsG2() const
void setErrorsG2(unsigned short value)
void constructFromRawPayload(const gsl::span< const uint32_t > payloadwords)
Decode RCU trailer from the 32-bit words in the raw buffer.
unsigned char getNumberOfPresamples() const
unsigned int getPayloadSize() const
bool hasSecondBaselineCorr() const
double getTimeSample() const
Access to the sampling time.
unsigned short getNumberOfSamplesPerChannel() const
unsigned short getActiveFECsA() const
unsigned int getTrailerSize() const
void setErrorsG3(unsigned int value)
~RCUTrailer()=default
destructor
std::vector< uint32_t > encode() const
void setL1Phase(double l1phase)
Set the L1 phase.
unsigned int getAltroCFGReg1() const
double getL1Phase() const
Access to the L1 phase.
unsigned char getNumberOfPostsamples() const
unsigned short getNumberOfChannelLengthMismatch() const
unsigned int getErrorsG3() const
bool hasZeroSuppression() const
void setFECErrorsB(unsigned int value)
unsigned int getFECErrorsB() const
unsigned char getNumberOfPretriggerSamples() const
unsigned char getBaselineCorrection() const
unsigned char getNumberOfNonZeroSuppressedPresamples() const
GLsizei const GLfloat * value
GLuint GLsizei const GLchar * message
std::ostream & operator<<(std::ostream &in, const BadChannelsMap &bcm)
Printing bad channel map on the stream.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
uint32_t mWord1
Bits 10 - 19 : Word 1.
uint32_t mWord2
Bits 0 - 9 : Word 2.
uint32_t mWord0
Bits 20 - 29 : Word 0.
uint32_t mZero
Bits 30 - 31 : zeroed.