14 includeErrors_ =
false;
19 includeErrors_ = errorStatus;
24 int CRC_BIT = (*trailer >> CRC_shift) & CRC_mask;
25 if (CRC_BIT == 0)
return true;
28 <<
"CRC check failed, errorType = 39";
32 errors[dummyDetId].push_back(error);
39 FEDHeader fedHeader( reinterpret_cast<const unsigned char*>(header));
40 if ( !fedHeader.
check() )
return false;
42 LogDebug(
"CTPPSPixelDataFormatter::interpretRawData, fedHeader.sourceID() != fedId")
43 <<
", sourceID = " <<fedHeader.
sourceID()
44 <<
", fedId = "<<fedId<<
", errorType = 32";
49 errors[dummyDetId].push_back(error);
57 FEDTrailer fedTrailer(reinterpret_cast<const unsigned char*>(trailer));
58 if ( !fedTrailer.
check()) {
62 errors[dummyDetId].push_back(error);
66 <<
"fedTrailer.check failed, Fed: " << fedId <<
", errorType = 33";
70 LogDebug(
"FedTrailerLenght")<<
"fedTrailer.fragmentLength()!= nWords !! Fed: " << fedId <<
", errorType = 34";
75 errors[dummyDetId].push_back(error);
83 int errorType = (errorWord >> ROC_shift) & ERROR_mask;
84 if likely(errorType<25)
return true;
88 LogDebug(
"")<<
" invalid ROC=25 found (errorType=25)";
93 LogDebug(
"")<<
" gap word found (errorType=26)";
97 LogDebug(
"")<<
" dummy word found (errorType=27)";
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;
130 uint32_t stateMach_bits = 4;
131 uint32_t stateMach_shift = 8;
132 uint32_t stateMach_mask = ~(~uint32_t(0) << stateMach_bits);
133 uint32_t stateMach = (errorWord >> stateMach_shift) & stateMach_mask;
134 if( stateMach==4 || stateMach==9 ) errorType = 40;
140 errors[iD].push_back(error);
152 LogDebug(
"ErrorChecker::conversionError") <<
" Fed: " << fedId <<
" invalid channel Id (errorType=35)";
157 LogDebug(
"ErrorChecker::conversionError")<<
" Fed: " << fedId <<
" invalid ROC Id (errorType=36)";
162 LogDebug(
"ErrorChecker::conversionError")<<
" Fed: " << fedId <<
" invalid dcol/pixel value (errorType=37)";
167 default:
LogDebug(
"ErrorChecker::conversionError")<<
" cabling check returned unexpected result, status = "<< state;
170 if(includeErrors_ && errorType>0){
172 errors[iD].push_back(error);
void conversionError(int fedId, uint32_t iD, const State &state, const Word32 &errorWord, Errors &errors) const
bool checkCRC(bool &errorsInEvent, int fedId, const Word64 *trailer, Errors &errors) const
bool checkHeader(bool &errorsInEvent, int fedId, const Word64 *header, Errors &errors) const
bool check() const
Check that the trailer is OK.
bool moreTrailers() const
std::map< uint32_t, DetErrors > Errors
uint32_t fragmentLength() const
The length of the event fragment counted in 64-bit words including header and trailer.
static constexpr Word32 dummyDetId
void setErrorStatus(bool errorStatus)
bool checkTrailer(bool &errorsInEvent, int fedId, unsigned int nWords, const Word64 *trailer, Errors &errors) const
bool checkROC(bool &errorsInEvent, int fedId, uint32_t iD, const Word32 &errorWord, Errors &errors) const
Pixel error – collection of errors.