31 checkCrcALCT = enable;
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 ) ";
49 checkCrcCFEB = enable;
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_Scope_Start =
false;
277 bool fTMB_MiniScope_Start =
false;
278 bool fTMB_RPC_Start =
false;
279 bool fTMB_BlockedCFEBs_Start =
false;
281 bool fTMB_Scope =
false;
282 bool fTMB_MiniScope =
false;
283 bool fTMB_RPC =
false;
284 bool fTMB_BlockedCFEBs =
false;
286 fTMB_Scope = fTMB_Scope &&
true;
325 for(
int g=0;
g<4;
g++)
364 if ( ( ( (
buf0[3]&0xF000) == 0x5000 && (
buf0[0]&0x00FF) == 0x005F )
366 ( (
buf0[3]&0xF000) == 0x5000 && (
buf0[0]&0x000F) == 0x0008 ) )
370 (
buf1[3]&0xF000) == 0xD000 )
380 CERR<<
"\n\nDCC Header Occurrence ";
381 CERR<<
" ERROR 25 "<<
sERROR[25]<<endl;
391 bzero(
tmpbuf,
sizeof(uint16_t)*16);
403 if(
fDDU_Header && ( (
buf0[0]&0xF000)==0xC000 || (
buf0[1]&0xF000)==0xC000 || (
buf0[2]&0xF000)==0xC000 || (
buf0[3]&0xF000)==0xC000 ) &&
414 CERR<<
" ERROR 20 "<<
sERROR[20]<<endl;
419 if(
buf0[1]==0x8000 &&
buf0[2]==0x0001 &&
buf0[3]==0x8000 )
436 CERR<<
" ERROR 1 "<<
sERROR[1]<<endl;
453 CERR<<
" ERROR 5 "<<
sERROR[5]<<endl;
469 for(
int err=1; err<
nERRORS; ++err)
485 bzero(
tmpbuf,
sizeof(uint16_t)*16);
553 for(
int bit=0; bit<15; bit++)
if(
DAV_DMB&(1<<bit) ) nDAV_DMBs++;
560 if( (
buf_1[3]&0xF000)!=0x5000 )
566 CERR<<
" WARNING 1 "<<
sWARNING[1]<<
". What must have been Header 1: 0x"<<std::hex<<
buf_1[0]<<
" 0x"<<
buf_1[1]<<
" 0x"<<
buf_1[2]<<
" 0x"<<
buf_1[3]<<std::dec<<endl;
573 COUT<<
"\n----------------------------------------------------------"<<endl;
580 if( (
buf0[0]&0xF000)==0xA000 && (
buf0[1]&0xF000)==0xA000 && (
buf0[2]&0xF000)==0xA000 && (
buf0[3]&0xF000)==0xA000 )
608 for(
int err=0; err<
nERRORS; ++err)
636 fTMB_Scope_Start =
false;
637 fTMB_MiniScope_Start =
false;
638 fTMB_RPC_Start =
false;
639 fTMB_BlockedCFEBs_Start =
false;
642 fTMB_MiniScope =
false;
644 fTMB_BlockedCFEBs =
false;
658 COUT<<
"Crate=" << setw(3) << setfill(
'0') << ((
buf0[1]>>4)&0x00FF) <<
" DMB="<<setw(2)<<setfill(
'0')<<(
buf0[1]&0x000F)<<
" ";
661 COUT<<setw(1)<<((buf0[0]&0x0200)>>9)<<
" "<<((
buf0[0]&0x0800)>>11)<<
" ";
663 COUT<<setw(1)<<((buf0[0]&0x0010)>>4)<<((
buf0[0]&0x0008)>>3)<<((
buf0[0]&0x0004)>>2)<<((
buf0[0]&0x0002)>>1)<<(
buf0[0]&0x0001);
715 if( (
buf0[0]==0xDB0A && (
buf0[1]&0xF000)==0xD000 && (
buf0[2]&0xF000)==0xD000 && (
buf0[3]&0xF000)==0xD000)
717 ( (
buf_1[0]&0xF000)==0xA000 && (
buf_1[1]&0xF000)==0xA000 && (
buf_1[2]&0xF000)==0xA000 && (
buf_1[3]&0xF000)==0xA000 ) )
730 int nWGs_per_layer = ( (
buf1[2]&0x0007) + 1 ) * 16 ;
732 nWG_round_up = int(nWGs_per_layer/12)+(nWGs_per_layer%3?1:0);
734 bool config_present =
buf1[0]&0x4000;
736 bool lct_overflow =
buf1[0]&0x2000;
738 bool raw_overflow =
buf1[0]&0x1000;
740 int lct_tbins = (
buf1[3]&0x01E0)>>5;
742 int raw_tbins = (
buf1[3]&0x001F);
749 for (
int g=0;
g<4;
g++)
763 int config_size = ( config_present ? 3 + 5 : 0 );
765 int colreg_size = ( config_present ? nWGs_per_layer/4 : 0 );
767 int hot_ch_size = ( config_present ?
nWG_round_up*6 : 0 );
769 int alct_0_1_size = ( !lct_overflow ? 2*lct_tbins : 0 );
771 int raw_hit_dump_size=(!raw_overflow ?
nWG_round_up*6*raw_tbins : 0 );
777 ALCT_WordsExpected += config_size + colreg_size + hot_ch_size + alct_0_1_size + raw_hit_dump_size;
791 if( ( (
buf0 [0]&0xF800)==0x6000 && (
buf0 [1]&0x8F80)==0x0080 && (
buf0 [2]&0x8000)==0x0000 && (
buf0 [3]&0xc000)==0x0000 )
793 ( (
buf_1[0]&0xF000)==0xA000 && (
buf_1[1]&0xF000)==0xA000 && (
buf_1[2]&0xF000)==0xA000 && (
buf_1[3]&0xF000)==0xA000 ) )
801 if( (
buf0[3]&0x0003)==0 )
806 if( (
buf0[1]&0x0003)==1 )
809 ( ((
buf0[3]&0x0001) )+((
buf0[3]&0x0002)>>1)+
810 ((
buf0[3]&0x0004)>>2)+((
buf0[3]&0x0008)>>3)+
811 ((
buf0[3]&0x0010)>>4)+((
buf0[3]&0x0020)>>5)+
812 ((
buf0[3]&0x0040)>>6) ) * 12 + 12;
823 if( (
buf0[0]&0xFFFF)==0xDB0C )
832 if ( (
buf1[1]&0x3000) == 0x3000)
836 if ( (
buf1[1]&0x3000) == 0x0000)
848 if( (
buf0 [0]&0xFFFF)==0x6B0C && (
849 ( (
buf_1[0]&0xF000)==0xA000 && (
buf_1[1]&0xF000)==0xA000 && (
buf_1[2]&0xF000)==0xA000 && (
buf_1[3]&0xF000)==0xA000 )
851 ( (
buf_1[0]&0x0800)==0x0000 && (
buf_1[1]&0xF800)==0xD000 && (
buf_1[2]&0xFFFF)==0xDE0D && (
buf_1[3]&0xF000)==0xD000 )
863 if ( (
buf0[1]&0x3000) == 0x3000)
867 if ( (
buf0[1]&0x3000) == 0x0000)
872 if ( (
buf0[1]&0x3000) == 0x1000)
972 for(uint16_t
j=0,
w=0;
j<4; ++
j)
976 for(uint32_t
i=15,
t=0, ncrc=0;
i<16;
i--)
1015 fTMB_RPC_Start =
true;
1021 fTMB_Scope_Start =
true;
1027 fTMB_MiniScope_Start =
true;
1033 fTMB_BlockedCFEBs_Start =
true;
1055 fTMB_MiniScope =
true;
1062 fTMB_BlockedCFEBs =
true;
1151 if (fTMB_BlockedCFEBs)
1162 for(uint16_t
j=0,
w=0;
j<4; ++
j)
1166 for(uint32_t
i=15,
t=0, ncrc=0;
i<16;
i--)
1169 ncrc = (
TMB_CRC << 1) & 0x3ffffc;
1180 if( ((
buf0[1]&0xF000)==0x7000) &&
1181 ((
buf0[2]&0xF000)==0x7000) &&
1182 ((
buf0[1]!=0x7FFF) || (
buf0[2]!=0x7FFF)) &&
1183 ( ((
buf0[3]&0xFFFF)==0x7FFF) ||
1240 if( (
buf0[0]&0xF000)==0xB000 && (
buf0[1]&0xF000)==0xB000 && (
buf0[2]&0xF000)==0xB000 && (
buf0[3]&0xF000)==0xB000 )
1271 for(
int pos=0; pos<4; ++pos)
1276 if( (
buf0[0]&0xF000)==0xF000 && (
buf0[1]&0xF000)==0xF000 && (
buf0[2]&0xF000)==0xF000 && (
buf0[3]&0xF000)==0xF000 )
1304 if( (
buf1[0]&0xF000)!=0xE000 || (
buf1[1]&0xF000)!=0xE000 || (
buf1[2]&0xF000)!=0xE000 || (
buf1[3]&0xF000)!=0xE000 )
1306 for(
int err=1; err<
nERRORS; ++err)
1329 if( (
buf0[0]&0xF000)==0xE000 && (
buf0[1]&0xF000)==0xE000 && (
buf0[2]&0xF000)==0xE000 && (
buf0[3]&0xF000)==0xE000 )
1379 for(
int err=0; err<
nERRORS; ++err)
1412 COUT<<
" DMB="<<(buf0[1]&0x000F);
1427 for(
int err=0; err<
nERRORS; ++err)
1441 for(
int err=1; err<
nERRORS; ++err)
1467 if(
buf0[0]==0x8000 &&
buf0[1]==0x8000 &&
buf0[2]==0xFFFF &&
buf0[3]==0x8000 )
1494 COUT <<
" Ex-Err: DMB (Header, Trailer) " << std::endl;
1508 for(
int err=0; err<
nERRORS; ++err)
1521 for(
int err=1; err<
nERRORS; ++err)
1549 COUT<<
"----------------------------------------------------------"<<endl;
1554 for(
int err=1; err<
nERRORS; ++err)
1562 CERR<<
" ERROR "<<err<<
" " <<
sERROR[err]<<endl;
1591 bzero(
tmpbuf,
sizeof(uint16_t)*16);
1601 if( (
buf1[3]&0xFF00) == 0xEF00 &&
1602 ( ((
buf2[3]&0xFF00) == 0xAF00 )
1604 ((
buf2[3]&0xFF00) == 0xA000 && (
buf2[0]&0x0003) == 0x0) ) )
1631 bzero(
tmpbuf,
sizeof(uint16_t)*16);
1645 memcpy((
void*)
tmpbuf,(
void*)(buffer-16),
sizeof(
short)*16);
1821 for (
int err=0; err<
nERRORS; ++err)
1831 for (
int i=0;
i<length;
i++)
1833 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