33 sERROR[10] =
"ALCT CRC Error ";
35 sERROR[10] =
"ALCT CRC Error ( disabled ) ";
42 sERROR[15] =
"TMB CRC Error ";
44 sERROR[15] =
"TMB CRC Error ( disabled ) ";
51 sERROR[18] =
"CFEB CRC Error ";
53 sERROR[18] =
"CFEB CRC Error ( disabled ) ";
61 sERROR[25] =
"DCC Trailer Missing ";
62 sERROR[26] =
"DCC Header Missing ";
66 sERROR[25] =
"DCC Trailer Missing (disabled) ";
67 sERROR[26] =
"DCC Header Missing (disabled) ";
74 :nERRORS(29),nWARNINGS(5),nPAYLOADS(16),nSTATUSES(29),sERROR(nERRORS),sWARNING(nWARNINGS),sERROR_(nERRORS),sWARNING_(nWARNINGS),sDMBExpectedPayload(nPAYLOADS),sDMBEventStaus(nSTATUSES),examinerMask(mask)
82 sERROR[0] =
" Any errors ";
83 sERROR[1] =
" DDU Trailer Missing ";
84 sERROR[2] =
" DDU Header Missing ";
85 sERROR[3] =
" DDU CRC Error (not yet implemented) ";
86 sERROR[4] =
" DDU Word Count Error ";
87 sERROR[5] =
" DMB Trailer Missing ";
88 sERROR[6] =
" DMB Header Missing ";
89 sERROR[7] =
" ALCT Trailer Missing ";
90 sERROR[8] =
" ALCT Header Missing ";
91 sERROR[9] =
" ALCT Word Count Error ";
92 sERROR[10] =
"ALCT CRC Error ";
93 sERROR[11] =
"ALCT Trailer Bit Error ";
102 sERROR[12] =
"TMB Trailer Missing ";
103 sERROR[13] =
"TMB Header Missing ";
104 sERROR[14] =
"TMB Word Count Error ";
105 sERROR[15] =
"TMB CRC Error ";
106 sERROR[16] =
"CFEB Word Count Per Sample Error ";
107 sERROR[17] =
"CFEB Sample Count Error ";
108 sERROR[18] =
"CFEB CRC Error ";
109 sERROR[19] =
"DDU Event Size Limit Error ";
111 sERROR[21] =
"ALCT DAV Error ";
112 sERROR[22] =
"TMB DAV Error ";
113 sERROR[23] =
"CFEB DAV Error ";
114 sERROR[24] =
"DMB Active Error ";
115 sERROR[25] =
"DCC Trailer Missing ";
116 sERROR[26] =
"DCC Header Missing ";
117 sERROR[27] =
"DMB DAV vs. DMB Active mismatch Error ";
118 sERROR[28] =
"Extra words between DDU Header and first DMB header";
122 sWARNING[0] =
" Extra words between DDU Trailer and DDU Header ";
123 sWARNING[1] =
" DDU Header Incomplete ";
177 sERROR_[0] =
" Any errors: 00";
178 sERROR_[1] =
" DDU Trailer Missing: 01";
179 sERROR_[2] =
" DDU Header Missing: 02";
180 sERROR_[3] =
" DDU CRC Error (not yet implemented): 03";
181 sERROR_[4] =
" DDU Word Count Error: 04";
182 sERROR_[5] =
" DMB Trailer Missing: 05";
183 sERROR_[6] =
" DMB Header Missing: 06";
184 sERROR_[7] =
" ALCT Trailer Missing: 07";
185 sERROR_[8] =
" ALCT Header Missing: 08";
186 sERROR_[9] =
" ALCT Word Count Error: 09";
187 sERROR_[10] =
"ALCT CRC Error: 10";
188 sERROR_[11] =
"ALCT Trailer Bit Error: 11";
189 sERROR_[12] =
"TMB Trailer Missing: 12";
190 sERROR_[13] =
"TMB Header Missing: 13";
191 sERROR_[14] =
"TMB Word Count Error: 14";
192 sERROR_[15] =
"TMB CRC Error: 15";
193 sERROR_[16] =
"CFEB Word Count Per Sample Error: 16";
194 sERROR_[17] =
"CFEB Sample Count Error: 17";
195 sERROR_[18] =
"CFEB CRC Error: 18";
196 sERROR_[19] =
"DDU Event Size Limit Error: 19";
198 sERROR_[21] =
"ALCT DAV Error: 21";
199 sERROR_[22] =
"TMB DAV Error: 22";
200 sERROR_[23] =
"CFEB DAV Error: 23";
201 sERROR_[24] =
"DMB Active Error: 24";
202 sERROR_[25] =
"DCC Trailer Missing: 25";
203 sERROR_[26] =
"DCC Header Missing: 26";
204 sERROR_[27] =
"DMB DAV vs. DMB Active mismatch Error: 27";
205 sERROR_[28] =
"Extra words between DDU Header and first DMB header: 28";
208 sWARNING_[0] =
" Extra words between DDU Trailer and DDU Header: 00";
209 sWARNING_[1] =
" DDU Header Incomplete: 02";
264 bzero(
tmpbuf,
sizeof(uint16_t)*16);
269 if( length<=0 )
return -1;
276 bool fTMB_MiniScope_Start =
false;
277 bool fTMB_RPC_Start =
false;
278 bool fTMB_BlockedCFEBs_Start =
false;
280 bool fTMB_MiniScope =
false;
281 bool fTMB_RPC =
false;
282 bool fTMB_BlockedCFEBs =
false;
321 for(
int g=0;
g<4;
g++)
360 if ( ( ( (
buf0[3]&0xF000) == 0x5000 && (
buf0[0]&0x00FF) == 0x005F )
362 ( (
buf0[3]&0xF000) == 0x5000 && (
buf0[0]&0x000F) == 0x0008 ) )
366 (
buf1[3]&0xF000) == 0xD000 )
376 CERR<<
"\n\nDCC Header Occurrence ";
377 CERR<<
" ERROR 25 "<<
sERROR[25]<<endl;
387 bzero(
tmpbuf,
sizeof(uint16_t)*16);
399 if(
fDDU_Header && ( (
buf0[0]&0xF000)==0xC000 || (
buf0[1]&0xF000)==0xC000 || (
buf0[2]&0xF000)==0xC000 || (
buf0[3]&0xF000)==0xC000 ) &&
410 CERR<<
" ERROR 20 "<<
sERROR[20]<<endl;
415 if(
buf0[1]==0x8000 &&
buf0[2]==0x0001 &&
buf0[3]==0x8000 )
432 CERR<<
" ERROR 1 "<<
sERROR[1]<<endl;
449 CERR<<
" ERROR 5 "<<
sERROR[5]<<endl;
465 for(
int err=1; err<
nERRORS; ++err)
481 bzero(
tmpbuf,
sizeof(uint16_t)*16);
549 for(
int bit=0; bit<15; bit++)
if(
DAV_DMB&(1<<bit) ) nDAV_DMBs++;
556 if( (
buf_1[3]&0xF000)!=0x5000 )
569 COUT<<
"\n----------------------------------------------------------"<<endl;
576 if( (
buf0[0]&0xF000)==0xA000 && (
buf0[1]&0xF000)==0xA000 && (
buf0[2]&0xF000)==0xA000 && (
buf0[3]&0xF000)==0xA000 )
604 for(
int err=0; err<
nERRORS; ++err)
632 fTMB_MiniScope_Start =
false;
633 fTMB_RPC_Start =
false;
634 fTMB_BlockedCFEBs_Start =
false;
636 fTMB_MiniScope =
false;
638 fTMB_BlockedCFEBs =
false;
652 COUT<<
"Crate=" << setw(3) << setfill(
'0') << ((
buf0[1]>>4)&0x00FF) <<
" DMB="<<setw(2)<<setfill(
'0')<<(
buf0[1]&0x000F)<<
" ";
655 COUT<<setw(1)<<((buf0[0]&0x0200)>>9)<<
" "<<((
buf0[0]&0x0800)>>11)<<
" ";
657 COUT<<setw(1)<<((buf0[0]&0x0010)>>4)<<((
buf0[0]&0x0008)>>3)<<((
buf0[0]&0x0004)>>2)<<((
buf0[0]&0x0002)>>1)<<(
buf0[0]&0x0001);
709 if( (
buf0[0]==0xDB0A && (
buf0[1]&0xF000)==0xD000 && (
buf0[2]&0xF000)==0xD000 && (
buf0[3]&0xF000)==0xD000)
711 ( (
buf_1[0]&0xF000)==0xA000 && (
buf_1[1]&0xF000)==0xA000 && (
buf_1[2]&0xF000)==0xA000 && (
buf_1[3]&0xF000)==0xA000 ) )
724 int nWGs_per_layer = ( (
buf1[2]&0x0007) + 1 ) * 16 ;
728 bool config_present =
buf1[0]&0x4000;
730 bool lct_overflow =
buf1[0]&0x2000;
732 bool raw_overflow =
buf1[0]&0x1000;
734 int lct_tbins = (
buf1[3]&0x01E0)>>5;
736 int raw_tbins = (
buf1[3]&0x001F);
743 for (
int g=0;
g<4;
g++)
757 int config_size = ( config_present ? 3 + 5 : 0 );
759 int colreg_size = ( config_present ? nWGs_per_layer/4 : 0 );
761 int hot_ch_size = ( config_present ?
nWG_round_up*6 : 0 );
763 int alct_0_1_size = ( !lct_overflow ? 2*lct_tbins : 0 );
765 int raw_hit_dump_size=(!raw_overflow ?
nWG_round_up*6*raw_tbins : 0 );
771 ALCT_WordsExpected += config_size + colreg_size + hot_ch_size + alct_0_1_size + raw_hit_dump_size;
785 if( ( (
buf0 [0]&0xF800)==0x6000 && (
buf0 [1]&0x8F80)==0x0080 && (
buf0 [2]&0x8000)==0x0000 && (
buf0 [3]&0xc000)==0x0000 )
787 ( (
buf_1[0]&0xF000)==0xA000 && (
buf_1[1]&0xF000)==0xA000 && (
buf_1[2]&0xF000)==0xA000 && (
buf_1[3]&0xF000)==0xA000 ) )
795 if( (
buf0[3]&0x0003)==0 )
800 if( (
buf0[1]&0x0003)==1 )
803 ( ((
buf0[3]&0x0001) )+((
buf0[3]&0x0002)>>1)+
804 ((
buf0[3]&0x0004)>>2)+((
buf0[3]&0x0008)>>3)+
805 ((
buf0[3]&0x0010)>>4)+((
buf0[3]&0x0020)>>5)+
806 ((
buf0[3]&0x0040)>>6) ) * 12 + 12;
817 if( (
buf0[0]&0xFFFF)==0xDB0C )
837 if ( (
buf1[1]&0x3000) == 0x3000)
841 if ( (
buf1[1]&0x3000) == 0x0000)
853 if( (
buf0 [0]&0xFFFF)==0x6B0C && (
854 ( (
buf_1[0]&0xF000)==0xA000 && (
buf_1[1]&0xF000)==0xA000 && (
buf_1[2]&0xF000)==0xA000 && (
buf_1[3]&0xF000)==0xA000 )
856 ( (
buf_1[0]&0x0800)==0x0000 && (
buf_1[1]&0xF800)==0xD000 && (
buf_1[2]&0xFFFF)==0xDE0D && (
buf_1[3]&0xF000)==0xD000 )
868 if ( (
buf0[1]&0x3000) == 0x3000)
872 if ( (
buf0[1]&0x3000) == 0x0000)
877 if ( (
buf0[1]&0x3000) == 0x1000)
977 for(uint16_t j=0,
w=0; j<4; ++j)
981 for(uint32_t
i=15,
t=0, ncrc=0;
i<16;
i--)
1025 fTMB_RPC_Start =
true;
1031 fTMB_MiniScope_Start =
true;
1037 fTMB_BlockedCFEBs_Start =
true;
1052 fTMB_MiniScope =
true;
1059 fTMB_BlockedCFEBs =
true;
1148 if (fTMB_BlockedCFEBs)
1159 for(uint16_t j=0,
w=0; j<4; ++j)
1163 for(uint32_t
i=15,
t=0, ncrc=0;
i<16;
i--)
1166 ncrc = (
TMB_CRC << 1) & 0x3ffffc;
1177 if( ((
buf0[1]&0xF000)==0x7000) &&
1178 ((
buf0[2]&0xF000)==0x7000) &&
1179 ((
buf0[1]!=0x7FFF) || (
buf0[2]!=0x7FFF)) &&
1180 ( ((
buf0[3]&0xFFFF)==0x7FFF) ||
1237 if( (
buf0[0]&0xF000)==0xB000 && (
buf0[1]&0xF000)==0xB000 && (
buf0[2]&0xF000)==0xB000 && (
buf0[3]&0xF000)==0xB000 )
1273 if( (
buf0[0]&0xF000)==0xF000 && (
buf0[1]&0xF000)==0xF000 && (
buf0[2]&0xF000)==0xF000 && (
buf0[3]&0xF000)==0xF000 )
1301 if( (
buf1[0]&0xF000)!=0xE000 || (
buf1[1]&0xF000)!=0xE000 || (
buf1[2]&0xF000)!=0xE000 || (
buf1[3]&0xF000)!=0xE000 )
1303 for(
int err=1; err<
nERRORS; ++err)
1326 if( (
buf0[0]&0xF000)==0xE000 && (
buf0[1]&0xF000)==0xE000 && (
buf0[2]&0xF000)==0xE000 && (
buf0[3]&0xF000)==0xE000 )
1376 for(
int err=0; err<
nERRORS; ++err)
1409 COUT<<
" DMB="<<(buf0[1]&0x000F);
1424 for(
int err=0; err<
nERRORS; ++err)
1438 for(
int err=1; err<
nERRORS; ++err)
1464 if(
buf0[0]==0x8000 &&
buf0[1]==0x8000 &&
buf0[2]==0xFFFF &&
buf0[3]==0x8000 )
1491 COUT <<
" Ex-Err: DMB (Header, Trailer) " << std::endl;
1505 for(
int err=0; err<
nERRORS; ++err)
1518 for(
int err=1; err<
nERRORS; ++err)
1546 COUT<<
"----------------------------------------------------------"<<endl;
1551 for(
int err=1; err<
nERRORS; ++err)
1559 CERR<<
" ERROR "<<err<<
" " <<
sERROR[err]<<endl;
1588 bzero(
tmpbuf,
sizeof(uint16_t)*16);
1598 if( (
buf1[3]&0xFF00) == 0xEF00 &&
1599 ( ((
buf2[3]&0xFF00) == 0xAF00 )
1601 ((
buf2[3]&0xFF00) == 0xA000 && (
buf2[0]&0x0003) == 0x0) ) )
1628 bzero(
tmpbuf,
sizeof(uint16_t)*16);
1642 memcpy((
void*)
tmpbuf,(
void*)(buffer-16),
sizeof(
short)*16);
1818 for (
int err=0; err<
nERRORS; ++err)
1828 for (
int i=0;
i<length;
i++)
1830 if ( (buffer[
i]&mask) == sig)
uint32_t DDU_WordsSinceLastHeader
const uint16_t * buffer_start
void crcCFEB(bool enable)
uint32_t CFEB_SampleWordCount
std::map< CSCIdType, ExaminerStatusType > bCHAMB_ERR
std::set< CSCIdType > fCHAMB_ERR[29]
int scanbuf(const uint16_t *&buf, int32_t length, uint16_t sig, uint16_t mask=0xFFFF)
void modeDDU(bool enable)
uint32_t ALCT_WordsSinceLastHeader
ExaminerStatusType bSUM_WARNING
std::map< DDUIdType, uint32_t > dduSize
uint32_t DDU_WordsSinceLastTrailer
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void crcALCT(bool enable)
uint32_t ALCT_WordsExpected
std::map< CSCIdType, uint32_t > cntCHAMB_Trailers
std::vector< const char * > sERROR
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
uint32_t TMB_Firmware_Revision
std::map< CSCIdType, ExaminerStatusType > bCHAMB_PAYLOAD
std::map< CSCIdType, uint32_t > cntCHAMB_Headers
uint32_t nWG_round_up
check zero suppression mode
std::map< DDUIdType, std::map< CSCIdType, uint32_t > > dmbOffsets
std::vector< const char * > sDMBExpectedPayload
std::vector< const char * > sWARNING_
std::set< CSCIdType > fCHAMB_WRN[5]
uint32_t DDU_WordMismatch_Occurrences
std::map< DDUIdType, ExaminerStatusType > bDDU_ERR
uint32_t CFEB_SampleCount
ExaminerStatusType bSUM_ERROR
uint32_t TMB_WordsExpected
uint32_t CFEB_BSampleCount
std::map< CSCIdType, ExaminerStatusType > bCHAMB_WRN
uint32_t TMB_WordsSinceLastHeader
to decode if zero suppression enabled
ExaminerStatusType bERROR
CSCDCCExaminer(ExaminerMaskType mask=0x1)
uint32_t DDU_Firmware_Revision
void checkTriggerHeadersAndTrailers()
std::vector< const char * > sWARNING
std::map< DDUIdType, std::map< CSCIdType, const uint16_t * > > dmbBuffers
uint32_t ALCT_WordsSinceLastHeaderZeroSuppressed
std::map< CSCIdType, ExaminerStatusType > bCHAMB_STATUS
int32_t check(const uint16_t *&buffer, int32_t length)
std::map< DDUIdType, const uint16_t * > dduBuffers
void checkDAVs()
checks DAV_ALCT, DAV_TMB, and DAV_CFEB
ExaminerStatusType bWARNING
std::map< DDUIdType, std::map< CSCIdType, uint32_t > > dmbSize
std::vector< const char * > sDMBEventStaus
std::map< DDUIdType, uint32_t > dduOffsets
std::vector< const char * > sERROR_
std::map< DDUIdType, ExaminerStatusType > bDDU_WRN