17 int CRC_BIT = (*trailer >> CRC_shift) & CRC_mask;
21 LogDebug(
"CRCCheck") <<
"CRC check failed, errorType = 39";
25 errors[dummyDetId].push_back(error);
31 FEDHeader fedHeader(reinterpret_cast<const unsigned char*>(header));
32 if (!fedHeader.
check())
35 LogDebug(
"CTPPSPixelDataFormatter::interpretRawData, fedHeader.sourceID() != fedId")
36 <<
", sourceID = " << fedHeader.
sourceID() <<
", fedId = " << fedId <<
", errorType = 32";
41 errors[dummyDetId].push_back(error);
49 FEDTrailer fedTrailer(reinterpret_cast<const unsigned char*>(trailer));
50 if (!fedTrailer.
check()) {
54 errors[dummyDetId].push_back(error);
57 LogDebug(
"FedTrailerCheck") <<
"fedTrailer.check failed, Fed: " << fedId <<
", errorType = 33";
61 LogDebug(
"FedTrailerLenght") <<
"fedTrailer.fragmentLength()!= nWords !! Fed: " << fedId <<
", errorType = 34";
66 errors[dummyDetId].push_back(error);
74 int errorType = (errorWord >> ROC_shift) & ERROR_mask;
76 LIKELY(errorType < 25)
return true;
80 LogDebug(
"") <<
" invalid ROC=25 found (errorType=25)";
85 LogDebug(
"") <<
" gap word found (errorType=26)";
89 LogDebug(
"") <<
" dummy word found (errorType=27)";
93 LogDebug(
"") <<
" error fifo nearly full (errorType=28)";
98 LogDebug(
"") <<
" timeout on a channel (errorType=29)";
100 if ((errorWord >> OMIT_ERR_shift) & OMIT_ERR_mask) {
101 LogDebug(
"") <<
" ...first errorType=29 error, this gets masked out";
107 LogDebug(
"") <<
" TBM error trailer (errorType=30)";
108 errorsInEvent =
true;
112 LogDebug(
"") <<
" event number error (errorType=31)";
113 errorsInEvent =
true;
120 if (includeErrors_) {
122 if (errorType == 30) {
123 uint32_t stateMach_bits = 4;
124 uint32_t stateMach_shift = 8;
125 uint32_t stateMach_mask = ~(~uint32_t(0) << stateMach_bits);
126 uint32_t stateMach = (errorWord >> stateMach_shift) & stateMach_mask;
127 if (stateMach == 4 || stateMach == 9)
134 errors[iD].push_back(error);
146 LogDebug(
"ErrorChecker::conversionError") <<
" Fed: " << fedId <<
" invalid channel Id (errorType=35)";
151 LogDebug(
"ErrorChecker::conversionError") <<
" Fed: " << fedId <<
" invalid ROC Id (errorType=36)";
156 LogDebug(
"ErrorChecker::conversionError") <<
" Fed: " << fedId <<
" invalid dcol/pixel value (errorType=37)";
162 LogDebug(
"ErrorChecker::conversionError") <<
" cabling check returned unexpected result, status = " << state;
165 if (includeErrors_ && errorType > 0) {
167 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.