25 constexpr int PXID_shift = ADC_shift + ADC_bits;
26 constexpr int DCOL_shift = PXID_shift + PXID_bits;
27 constexpr int ROC_shift = DCOL_shift + DCOL_bits;
41 int CRC_BIT = (*trailer >> CRC_shift) & CRC_mask;
42 if (CRC_BIT == 0)
return true;
45 <<
"CRC check failed, errorType = 39";
51 FEDHeader fedHeader( reinterpret_cast<const unsigned char*>(header));
52 if ( !fedHeader.
check() )
return false;
53 if ( fedHeader.
sourceID() != fedId) {
54 LogError(
"CTPPSPixelDataFormatter::interpretRawData, fedHeader.sourceID() != fedId")
55 <<
", sourceID = " <<fedHeader.
sourceID()
56 <<
", fedId = "<<fedId<<
", errorType = 32";
65 FEDTrailer fedTrailer(reinterpret_cast<const unsigned char*>(trailer));
66 if ( !fedTrailer.
check()) {
70 <<
"fedTrailer.check failed, Fed: " << fedId <<
", errorType = 33";
73 if ( fedTrailer.
lenght()!= nWords) {
74 LogError(
"FedTrailerLenght")<<
"fedTrailer.lenght()!= nWords !! Fed: " << fedId <<
", errorType = 34";
83 int errorType = (errorWord >> ROC_shift) & ERROR_mask;
84 if likely(errorType<25)
return true;
88 LogDebug(
"")<<
" invalid ROC=25 found (errorType=25)";
101 LogDebug(
"")<<
" error fifo nearly full (errorType=28)";
102 errorsInEvent =
true;
106 LogDebug(
"")<<
" timeout on a channel (errorType=29)";
107 errorsInEvent =
true;
108 if ((errorWord >> OMIT_ERR_shift) & OMIT_ERR_mask) {
109 LogDebug(
"")<<
" ...first errorType=29 error, this gets masked out";
115 LogDebug(
"")<<
" TBM error trailer (errorType=30)";
116 errorsInEvent =
true;
120 LogDebug(
"")<<
" event number error (errorType=31)";
121 errorsInEvent =
true;
124 default:
return true;
bool checkCRC(bool &errorsInEvent, int fedId, const Word64 *trailer) const
bool checkHeader(bool &errorsInEvent, int fedId, const Word64 *header) const
bool checkTrailer(bool &errorsInEvent, int fedId, int nWords, const Word64 *trailer) const
int lenght()
The length of the event fragment counted in 64-bit words including header and trailer.
bool checkROC(bool &errorsInEvent, int fedId, Word32 &errorWord) const