18 using namespace sipixelobjects;
48 includeErrors =
false;
53 includeErrors = ErrorStatus;
59 if (CRC_BIT == 0)
return true;
71 FEDHeader fedHeader( reinterpret_cast<const unsigned char*>(header));
72 if ( !fedHeader.
check() )
return false;
73 if ( fedHeader.
sourceID() != fedId) {
74 LogDebug(
"PixelDataFormatter::interpretRawData, fedHeader.sourceID() != fedId")
75 <<
", sourceID = " <<fedHeader.
sourceID()
76 <<
", fedId = "<<fedId<<
", errorType = 32";
89 FEDTrailer fedTrailer(reinterpret_cast<const unsigned char*>(trailer));
90 if ( !fedTrailer.
check()) {
98 <<
"fedTrailer.check failed, Fed: " << fedId <<
", errorType = 33";
101 if ( fedTrailer.
lenght()!= nWords) {
102 LogError(
"FedTrailerLenght")<<
"fedTrailer.lenght()!= nWords !! Fed: " << fedId <<
", errorType = 34";
103 errorsInEvent =
true;
119 LogDebug(
"")<<
" invalid ROC=25 found (errorType=25)";
120 errorsInEvent =
true;
132 LogDebug(
"")<<
" error fifo nearly full (errorType=28)";
133 errorsInEvent =
true;
137 LogDebug(
"")<<
" timeout on a channel (errorType=29)";
138 errorsInEvent =
true;
140 LogDebug(
"")<<
" ...first errorType=29 error, this gets masked out";
146 LogDebug(
"")<<
" TBM error trailer (errorType=30)";
147 errorsInEvent =
true;
151 LogDebug(
"")<<
" event number error (errorType=31)";
152 errorsInEvent =
true;
155 default:
return true;
161 int StateMach_bits = 4;
162 int StateMach_shift = 8;
163 uint32_t StateMach_mask = ~(~uint32_t(0) << StateMach_bits);
164 int StateMach = (errorWord >> StateMach_shift) & StateMach_mask;
165 if( StateMach==4 || StateMach==9 ) errorType = 40;
171 detId = errorDetId(converter, errorType, errorWord);
172 errors[detId].push_back(error);
181 LogDebug(
"ErrorChecker::conversionError") <<
" Fed: " << fedId <<
" invalid channel Id (errorType=35)";
185 cms_uint32_t detId = errorDetId(converter, errorType, errorWord);
186 errors[detId].push_back(error);
191 LogDebug(
"ErrorChecker::conversionError")<<
" Fed: " << fedId <<
" invalid ROC Id (errorType=36)";
195 cms_uint32_t detId = errorDetId(converter, errorType, errorWord);
196 errors[detId].push_back(error);
201 LogDebug(
"ErrorChecker::conversionError")<<
" Fed: " << fedId <<
" invalid dcol/pixel value (errorType=37)";
205 cms_uint32_t detId = errorDetId(converter, errorType, errorWord);
206 errors[detId].push_back(error);
211 LogDebug(
"ErrorChecker::conversionError")<<
" Fed: " << fedId <<
" dcol/pixel read out of order (errorType=38)";
215 cms_uint32_t detId = errorDetId(converter, errorType, errorWord);
216 errors[detId].push_back(error);
220 default:
LogDebug(
"ErrorChecker::conversionError")<<
" cabling check returned unexpected result, status = "<<
status;
226 int errorType,
const Word32 & word)
const
233 case 25 :
case 30 :
case 31 :
case 36 :
case 40 : {
248 const int DB0_shift = 0;
249 const int DB1_shift = DB0_shift + 1;
250 const int DB2_shift = DB1_shift + 1;
251 const int DB3_shift = DB2_shift + 1;
252 const int DB4_shift = DB3_shift + 1;
255 int CH1 = (word >> DB0_shift) & DataBit_mask;
256 int CH2 = (word >> DB1_shift) & DataBit_mask;
257 int CH3 = (word >> DB2_shift) & DataBit_mask;
258 int CH4 = (word >> DB3_shift) & DataBit_mask;
259 int CH5 = (word >> DB4_shift) & DataBit_mask;
263 int BLOCK = (word >> BLOCK_shift) & BLOCK_mask;
264 int localCH = 1*CH1+2*CH2+3*CH3+4*CH4+5*CH5;
265 if (BLOCK%2==0) chanNmbr=(BLOCK/2)*9+localCH;
266 else chanNmbr = ((BLOCK-1)/2)*9+4+localCH;
267 if ((chanNmbr<1)||(chanNmbr>36))
break;
273 cabling.
link = chanNmbr;
bool checkTrailer(bool &errorsInEvent, int fedId, int nWords, const Word64 *trailer, Errors &errors)
const ErrorChecker::Word32 OMIT_ERR_mask
const ErrorChecker::Word32 DCOL_mask
cms_uint32_t errorDetId(const SiPixelFrameConverter *converter, int errorType, const Word32 &word) const
bool checkROC(bool &errorsInEvent, int fedId, const SiPixelFrameConverter *converter, Word32 &errorWord, Errors &errors)
std::map< cms_uint32_t, DetErrors > Errors
bool checkCRC(bool &errorsInEvent, int fedId, const Word64 *trailer, Errors &errors)
const ErrorChecker::Word32 ROC_mask
const ErrorChecker::Word32 PXID_mask
void setErrorStatus(bool ErrorStatus)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
unsigned int cms_uint32_t
int lenght()
The length of the event fragment counted in 64-bit words including header and trailer.
void conversionError(int fedId, const SiPixelFrameConverter *converter, int status, Word32 &errorWord, Errors &errors)
const ErrorChecker::Word64 CRC_mask
const ErrorChecker::Word32 ERROR_mask
const ErrorChecker::Word32 LINK_mask
int toDetector(const sipixelobjects::ElectronicIndex &cabling, sipixelobjects::DetectorIndex &detector) const
const cms_uint32_t dummyDetId
Pixel error – collection of errors and error information.
bool checkHeader(bool &errorsInEvent, int fedId, const Word64 *header, Errors &errors)