9 sERROR[10] =
"ALCT CRC Error ";
11 sERROR[10] =
"ALCT CRC Error ( disabled ) ";
17 sERROR[15] =
"TMB CRC Error ";
19 sERROR[15] =
"TMB CRC Error ( disabled ) ";
23 checkCrcCFEB = enable;
25 sERROR[18] =
"CFEB CRC Error ";
27 sERROR[18] =
"CFEB CRC Error ( disabled ) ";
33 sERROR[25] =
"DCC Trailer Missing ";
34 sERROR[26] =
"DCC Header Missing ";
36 sERROR[25] =
"DCC Trailer Missing (disabled) ";
37 sERROR[26] =
"DCC Header Missing (disabled) ";
43 CSCDCCExaminer::CSCDCCExaminer(
ExaminerMaskType mask):nERRORS(29),nWARNINGS(5),nPAYLOADS(12),nSTATUSES(23),sERROR(nERRORS),sWARNING(nWARNINGS),sERROR_(nERRORS),sWARNING_(nWARNINGS),sDMBExpectedPayload(nPAYLOADS),sDMBEventStaus(nSTATUSES),examinerMask(mask){
46 sERROR[0] =
" Any errors ";
47 sERROR[1] =
" DDU Trailer Missing ";
48 sERROR[2] =
" DDU Header Missing ";
49 sERROR[3] =
" DDU CRC Error (not yet implemented) ";
50 sERROR[4] =
" DDU Word Count Error ";
51 sERROR[5] =
" DMB Trailer Missing ";
52 sERROR[6] =
" DMB Header Missing ";
53 sERROR[7] =
" ALCT Trailer Missing ";
54 sERROR[8] =
" ALCT Header Missing ";
55 sERROR[9] =
" ALCT Word Count Error ";
56 sERROR[10] =
"ALCT CRC Error ";
57 sERROR[11] =
"ALCT Trailer Bit Error ";
66 sERROR[12] =
"TMB Trailer Missing ";
67 sERROR[13] =
"TMB Header Missing ";
68 sERROR[14] =
"TMB Word Count Error ";
69 sERROR[15] =
"TMB CRC Error ";
70 sERROR[16] =
"CFEB Word Count Per Sample Error ";
71 sERROR[17] =
"CFEB Sample Count Error ";
72 sERROR[18] =
"CFEB CRC Error ";
73 sERROR[19] =
"DDU Event Size Limit Error ";
75 sERROR[21] =
"ALCT DAV Error ";
76 sERROR[22] =
"TMB DAV Error ";
77 sERROR[23] =
"CFEB DAV Error ";
78 sERROR[24] =
"DMB Active Error ";
79 sERROR[25] =
"DCC Trailer Missing ";
80 sERROR[26] =
"DCC Header Missing ";
81 sERROR[27] =
"DMB DAV vs. DMB Active mismatch Error ";
82 sERROR[28] =
"Extra words between DDU Header and first DMB header";
86 sWARNING[0] =
" Extra words between DDU Trailer and DDU Header ";
87 sWARNING[1] =
" DDU Header Incomplete ";
126 sERROR_[0] =
" Any errors: 00";
127 sERROR_[1] =
" DDU Trailer Missing: 01";
128 sERROR_[2] =
" DDU Header Missing: 02";
129 sERROR_[3] =
" DDU CRC Error (not yet implemented): 03";
130 sERROR_[4] =
" DDU Word Count Error: 04";
131 sERROR_[5] =
" DMB Trailer Missing: 05";
132 sERROR_[6] =
" DMB Header Missing: 06";
133 sERROR_[7] =
" ALCT Trailer Missing: 07";
134 sERROR_[8] =
" ALCT Header Missing: 08";
135 sERROR_[9] =
" ALCT Word Count Error: 09";
136 sERROR_[10] =
"ALCT CRC Error: 10";
137 sERROR_[11] =
"ALCT Trailer Bit Error: 11";
138 sERROR_[12] =
"TMB Trailer Missing: 12";
139 sERROR_[13] =
"TMB Header Missing: 13";
140 sERROR_[14] =
"TMB Word Count Error: 14";
141 sERROR_[15] =
"TMB CRC Error: 15";
142 sERROR_[16] =
"CFEB Word Count Per Sample Error: 16";
143 sERROR_[17] =
"CFEB Sample Count Error: 17";
144 sERROR_[18] =
"CFEB CRC Error: 18";
145 sERROR_[19] =
"DDU Event Size Limit Error: 19";
147 sERROR_[21] =
"ALCT DAV Error: 21";
148 sERROR_[22] =
"TMB DAV Error: 22";
149 sERROR_[23] =
"CFEB DAV Error: 23";
150 sERROR_[24] =
"DMB Active Error: 24";
151 sERROR_[25] =
"DCC Trailer Missing: 25";
152 sERROR_[26] =
"DCC Header Missing: 26";
153 sERROR_[27] =
"DMB DAV vs. DMB Active mismatch Error: 27";
154 sERROR_[28] =
"Extra words between DDU Header and first DMB header: 28";
157 sWARNING_[0] =
" Extra words between DDU Trailer and DDU Header: 00";
158 sWARNING_[1] =
" DDU Header Incomplete: 02";
208 bzero(
tmpbuf,
sizeof(uint16_t)*16);
212 if( length<=0 )
return -1;
219 bool fTMB_Scope_Start =
false;
220 bool fTMB_MiniScope_Start =
false;
221 bool fTMB_RPC_Start =
false;
222 bool fTMB_BlockedCFEBs_Start =
false;
224 bool fTMB_Scope =
false;
225 bool fTMB_MiniScope =
false;
226 bool fTMB_RPC =
false;
227 bool fTMB_BlockedCFEBs =
false;
229 fTMB_Scope = fTMB_Scope &&
true;
258 for(
int g=0;
g<4;
g++){
285 if ( ( ( (
buf0[3]&0xF000) == 0x5000 && (
buf0[0]&0x00FF) == 0x005F )
287 ( (
buf0[3]&0xF000) == 0x5000 && (
buf0[0]&0x000F) == 0x0008 ) )
291 (
buf1[3]&0xF000) == 0xD000 )
299 cerr<<
"\n\nDCC Header Occurrence ";
309 bzero(
tmpbuf,
sizeof(uint16_t)*16);
321 if(
fDDU_Header && ( (
buf0[0]&0xF000)==0xC000 || (
buf0[1]&0xF000)==0xC000 || (
buf0[2]&0xF000)==0xC000 || (
buf0[3]&0xF000)==0xC000 ) &&
334 if(
buf0[1]==0x8000 &&
buf0[2]==0x0001 &&
buf0[3]==0x8000 ){
376 for(
int err=1; err<
nERRORS; ++err)
391 bzero(
tmpbuf,
sizeof(uint16_t)*16);
446 for(
int bit=0; bit<15; bit++)
if(
DAV_DMB&(1<<bit) ) nDAV_DMBs++;
452 if( (
buf_1[3]&0xF000)!=0x5000 ){
456 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;
461 cout<<
"\n----------------------------------------------------------"<<endl;
466 if( (
buf0[0]&0xF000)==0xA000 && (
buf0[1]&0xF000)==0xA000 && (
buf0[2]&0xF000)==0xA000 && (
buf0[3]&0xF000)==0xA000 ){
491 for(
int err=0; err<
nERRORS; ++err)
518 fTMB_Scope_Start =
false;
519 fTMB_MiniScope_Start =
false;
520 fTMB_RPC_Start =
false;
521 fTMB_BlockedCFEBs_Start =
false;
524 fTMB_MiniScope =
false;
526 fTMB_BlockedCFEBs =
false;
539 cout<<
"Crate=" << setw(3) << setfill(
'0') << ((
buf0[1]>>4)&0x00FF) <<
" DMB="<<setw(2)<<setfill(
'0')<<(
buf0[1]&0x000F)<<
" ";
542 cout<<setw(1)<<((buf0[0]&0x0200)>>9)<<
" "<<((
buf0[0]&0x0800)>>11)<<
" ";
544 cout<<setw(1)<<((buf0[0]&0x0010)>>4)<<((
buf0[0]&0x0008)>>3)<<((
buf0[0]&0x0004)>>2)<<((
buf0[0]&0x0002)>>1)<<(
buf0[0]&0x0001);
566 if( (
buf0[0]==0xDB0A && (
buf0[1]&0xF000)==0xD000 && (
buf0[2]&0xF000)==0xD000 && (
buf0[3]&0xF000)==0xD000)
568 ( (
buf_1[0]&0xF000)==0xA000 && (
buf_1[1]&0xF000)==0xA000 && (
buf_1[2]&0xF000)==0xA000 && (
buf_1[3]&0xF000)==0xA000 ) ){
580 int nWGs_per_layer = ( (
buf1[2]&0x0007) + 1 ) * 16 ;
582 nWG_round_up = int(nWGs_per_layer/12)+(nWGs_per_layer%3?1:0);
584 bool config_present =
buf1[0]&0x4000;
586 bool lct_overflow =
buf1[0]&0x2000;
588 bool raw_overflow =
buf1[0]&0x1000;
590 int lct_tbins = (
buf1[3]&0x01E0)>>5;
592 int raw_tbins = (
buf1[3]&0x001F);
599 for (
int g=0;
g<4;
g++)
612 int config_size = ( config_present ? 3 + 5 : 0 );
614 int colreg_size = ( config_present ? nWGs_per_layer/4 : 0 );
616 int hot_ch_size = ( config_present ?
nWG_round_up*6 : 0 );
618 int alct_0_1_size = ( !lct_overflow ? 2*lct_tbins : 0 );
620 int raw_hit_dump_size=(!raw_overflow ?
nWG_round_up*6*raw_tbins : 0 );
624 ALCT_WordsExpected += config_size + colreg_size + hot_ch_size + alct_0_1_size + raw_hit_dump_size;
633 if( ( (
buf0 [0]&0xF800)==0x6000 && (
buf0 [1]&0x8F80)==0x0080 && (
buf0 [2]&0x8000)==0x0000 && (
buf0 [3]&0xc000)==0x0000 )
635 ( (
buf_1[0]&0xF000)==0xA000 && (
buf_1[1]&0xF000)==0xA000 && (
buf_1[2]&0xF000)==0xA000 && (
buf_1[3]&0xF000)==0xA000 ) ){
644 if( (
buf0[1]&0x0003)==1 ){
646 ( ((
buf0[3]&0x0001) )+((
buf0[3]&0x0002)>>1)+
647 ((
buf0[3]&0x0004)>>2)+((
buf0[3]&0x0008)>>3)+
648 ((
buf0[3]&0x0010)>>4)+((
buf0[3]&0x0020)>>5)+
649 ((
buf0[3]&0x0040)>>6) ) * 12 + 12;
656 if( (
buf0[0]&0xFFFF)==0xDB0C ){
670 if( (
buf0 [0]&0xFFFF)==0x6B0C && (
671 ( (
buf_1[0]&0xF000)==0xA000 && (
buf_1[1]&0xF000)==0xA000 && (
buf_1[2]&0xF000)==0xA000 && (
buf_1[3]&0xF000)==0xA000 )
673 ( (
buf_1[0]&0x0800)==0x0000 && (
buf_1[1]&0xF800)==0xD000 && (
buf_1[2]&0xFFFF)==0xDE0D && (
buf_1[3]&0xF000)==0xD000 )
688 if ( (
buf0[1]&0x3000) == 0x1000) {
774 for(uint16_t
j=0,
w=0;
j<4; ++
j){
777 for(uint32_t
i=15,
t=0, ncrc=0;
i<16;
i--){
809 fTMB_RPC_Start =
true;
814 fTMB_Scope_Start =
true;
819 fTMB_MiniScope_Start =
true;
824 fTMB_BlockedCFEBs_Start =
true;
843 fTMB_MiniScope =
true;
849 fTMB_BlockedCFEBs =
true;
931 if (fTMB_BlockedCFEBs)
939 for(uint16_t
j=0,
w=0;
j<4; ++
j){
942 for(uint32_t
i=15,
t=0, ncrc=0;
i<16;
i--){
944 ncrc = (
TMB_CRC << 1) & 0x3ffffc;
955 if( ((
buf0[1]&0xF000)==0x7000) &&
956 ((
buf0[2]&0xF000)==0x7000) &&
957 ((
buf0[1]!=0x7FFF) || (
buf0[2]!=0x7FFF)) &&
958 ( ((
buf0[3]&0xFFFF)==0x7FFF) ||
998 if( (
buf0[0]&0xF000)==0xB000 && (
buf0[1]&0xF000)==0xB000 && (
buf0[2]&0xF000)==0xB000 && (
buf0[3]&0xF000)==0xB000 ){
1025 if( (
buf0[0]&0xF000)==0xF000 && (
buf0[1]&0xF000)==0xF000 && (
buf0[2]&0xF000)==0xF000 && (
buf0[3]&0xF000)==0xF000 ){
1051 if( (
buf1[0]&0xF000)!=0xE000 || (
buf1[1]&0xF000)!=0xE000 || (
buf1[2]&0xF000)!=0xE000 || (
buf1[3]&0xF000)!=0xE000 ){
1052 for(
int err=1; err<
nERRORS; ++err)
1073 if( (
buf0[0]&0xF000)==0xE000 && (
buf0[1]&0xF000)==0xE000 && (
buf0[2]&0xF000)==0xE000 && (
buf0[3]&0xF000)==0xE000 ){
1092 for(
int err=0; err<
nERRORS; ++err)
1122 cout<<
" DMB="<<(buf0[1]&0x000F);
1136 for(
int err=0; err<
nERRORS; ++err)
1149 for(
int err=1; err<
nERRORS; ++err)
1173 if(
buf0[0]==0x8000 &&
buf0[1]==0x8000 &&
buf0[2]==0xFFFF &&
buf0[3]==0x8000 ){
1215 for(
int err=0; err<
nERRORS; ++err)
1227 for(
int err=1; err<
nERRORS; ++err)
1251 cout<<
"----------------------------------------------------------"<<endl;
1255 for(
int err=1; err<
nERRORS; ++err){
1260 cerr<<
" ERROR "<<err<<
" " <<
sERROR[err]<<endl;
1282 bzero(
tmpbuf,
sizeof(uint16_t)*16);
1291 if( (
buf1[3]&0xFF00) == 0xEF00 &&
1292 ( ((
buf2[3]&0xFF00) == 0xAF00 )
1294 ((
buf2[3]&0xFF00) == 0xA000 && (
buf2[0]&0x0003) == 0x0) ) ){
1318 bzero(
tmpbuf,
sizeof(uint16_t)*16);
1332 memcpy((
void*)
tmpbuf,(
void*)(buffer-16),
sizeof(
short)*16);
1495 for (
int err=0; err<
nERRORS; ++err)
1505 for (
int i=0;
i<length;
i++)
1507 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 redirect(std::ostream &str)
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)
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