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;
256 for(
int g=0;
g<4;
g++){
283 if ( ( ( (
buf0[3]&0xF000) == 0x5000 && (
buf0[0]&0x00FF) == 0x005F )
285 ( (
buf0[3]&0xF000) == 0x5000 && (
buf0[0]&0x000F) == 0x0008 ) )
287 (
buf1[3]&0xFF00) == 0xD900 )
295 cerr<<
"\n\nDCC Header Occurrence ";
305 bzero(
tmpbuf,
sizeof(uint16_t)*16);
316 if(
fDDU_Header && ( (
buf0[0]&0xF000)==0xC000 || (
buf0[1]&0xF000)==0xC000 || (
buf0[2]&0xF000)==0xC000 || (
buf0[3]&0xF000)==0xC000 ) &&
329 if(
buf0[1]==0x8000 &&
buf0[2]==0x0001 &&
buf0[3]==0x8000 ){
371 for(
int err=1; err<
nERRORS; ++err)
386 bzero(
tmpbuf,
sizeof(uint16_t)*16);
442 for(
int bit=0; bit<15; bit++)
if(
DAV_DMB&(1<<bit) ) nDAV_DMBs++;
448 if( (
buf_1[3]&0xF000)!=0x5000 ){
452 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;
457 cout<<
"\n----------------------------------------------------------"<<endl;
462 if( (
buf0[0]&0xF000)==0xA000 && (
buf0[1]&0xF000)==0xA000 && (
buf0[2]&0xF000)==0xA000 && (
buf0[3]&0xF000)==0xA000 ){
487 for(
int err=0; err<
nERRORS; ++err)
514 fTMB_Scope_Start =
false;
515 fTMB_MiniScope_Start =
false;
516 fTMB_RPC_Start =
false;
517 fTMB_BlockedCFEBs_Start =
false;
520 fTMB_MiniScope =
false;
522 fTMB_BlockedCFEBs =
false;
535 cout<<
"Crate=" << setw(3) << setfill(
'0') << ((
buf0[1]>>4)&0x00FF) <<
" DMB="<<setw(2)<<setfill(
'0')<<(
buf0[1]&0x000F)<<
" ";
538 cout<<setw(1)<<((buf0[0]&0x0200)>>9)<<
" "<<((
buf0[0]&0x0800)>>11)<<
" ";
540 cout<<setw(1)<<((buf0[0]&0x0010)>>4)<<((
buf0[0]&0x0008)>>3)<<((
buf0[0]&0x0004)>>2)<<((
buf0[0]&0x0002)>>1)<<(
buf0[0]&0x0001);
562 if( (
buf0[0]==0xDB0A && (
buf0[1]&0xF000)==0xD000 && (
buf0[2]&0xF000)==0xD000 && (
buf0[3]&0xF000)==0xD000)
564 ( (
buf_1[0]&0xF000)==0xA000 && (
buf_1[1]&0xF000)==0xA000 && (
buf_1[2]&0xF000)==0xA000 && (
buf_1[3]&0xF000)==0xA000 ) ){
576 int nWGs_per_layer = ( (
buf1[2]&0x0007) + 1 ) * 16 ;
578 nWG_round_up = int(nWGs_per_layer/12)+(nWGs_per_layer%3?1:0);
580 bool config_present =
buf1[0]&0x4000;
582 bool lct_overflow =
buf1[0]&0x2000;
584 bool raw_overflow =
buf1[0]&0x1000;
586 int lct_tbins = (
buf1[3]&0x01E0)>>5;
588 int raw_tbins = (
buf1[3]&0x001F);
602 int config_size = ( config_present ? 3 + 5 : 0 );
604 int colreg_size = ( config_present ? nWGs_per_layer/4 : 0 );
606 int hot_ch_size = ( config_present ?
nWG_round_up*6 : 0 );
608 int alct_0_1_size = ( !lct_overflow ? 2*lct_tbins : 0 );
610 int raw_hit_dump_size=(!raw_overflow ?
nWG_round_up*6*raw_tbins : 0 );
614 ALCT_WordsExpected += config_size + colreg_size + hot_ch_size + alct_0_1_size + raw_hit_dump_size;
623 if( ( (
buf0 [0]&0xF800)==0x6000 && (
buf0 [1]&0x8F80)==0x0080 && (
buf0 [2]&0x8000)==0x0000 && (
buf0 [3]&0xc000)==0x0000 )
625 ( (
buf_1[0]&0xF000)==0xA000 && (
buf_1[1]&0xF000)==0xA000 && (
buf_1[2]&0xF000)==0xA000 && (
buf_1[3]&0xF000)==0xA000 ) ){
634 if( (
buf0[1]&0x0003)==1 ){
636 ( ((
buf0[3]&0x0001) )+((
buf0[3]&0x0002)>>1)+
637 ((
buf0[3]&0x0004)>>2)+((
buf0[3]&0x0008)>>3)+
638 ((
buf0[3]&0x0010)>>4)+((
buf0[3]&0x0020)>>5)+
639 ((
buf0[3]&0x0040)>>6) ) * 12 + 12;
646 if( (
buf0[0]&0xFFFF)==0xDB0C ){
660 if( (
buf0 [0]&0xFFFF)==0x6B0C && (
661 ( (
buf_1[0]&0xF000)==0xA000 && (
buf_1[1]&0xF000)==0xA000 && (
buf_1[2]&0xF000)==0xA000 && (
buf_1[3]&0xF000)==0xA000 )
663 ( (
buf_1[0]&0x0800)==0x0000 && (
buf_1[1]&0xF800)==0xD000 && (
buf_1[2]&0xFFFF)==0xDE0D && (
buf_1[3]&0xF000)==0xD000 )
678 if ( (
buf0[1]&0x3000) == 0x1000) {
757 for(uint16_t
j=0, w=0;
j<4; ++
j){
760 for(uint32_t
i=15,
t=0, ncrc=0;
i<16;
i--){
792 fTMB_RPC_Start =
true;
797 fTMB_Scope_Start =
true;
802 fTMB_MiniScope_Start =
true;
807 fTMB_BlockedCFEBs_Start =
true;
826 fTMB_MiniScope =
true;
832 fTMB_BlockedCFEBs =
true;
914 if (fTMB_BlockedCFEBs)
922 for(uint16_t
j=0, w=0;
j<4; ++
j){
925 for(uint32_t
i=15,
t=0, ncrc=0;
i<16;
i--){
926 t = ((w >>
i) & 1) ^ ((
TMB_CRC >> 21) & 1);
927 ncrc = (
TMB_CRC << 1) & 0x3ffffc;
938 if( ((
buf0[1]&0xF000)==0x7000) &&
939 ((
buf0[2]&0xF000)==0x7000) &&
940 ((
buf0[1]!=0x7FFF) || (
buf0[2]!=0x7FFF)) &&
941 ( ((
buf0[3]&0xFFFF)==0x7FFF) ||
981 if( (
buf0[0]&0xF000)==0xB000 && (
buf0[1]&0xF000)==0xB000 && (
buf0[2]&0xF000)==0xB000 && (
buf0[3]&0xF000)==0xB000 ){
1008 if( (
buf0[0]&0xF000)==0xF000 && (
buf0[1]&0xF000)==0xF000 && (
buf0[2]&0xF000)==0xF000 && (
buf0[3]&0xF000)==0xF000 ){
1034 if( (
buf1[0]&0xF000)!=0xE000 || (
buf1[1]&0xF000)!=0xE000 || (
buf1[2]&0xF000)!=0xE000 || (
buf1[3]&0xF000)!=0xE000 ){
1035 for(
int err=1; err<
nERRORS; ++err)
1056 if( (
buf0[0]&0xF000)==0xE000 && (
buf0[1]&0xF000)==0xE000 && (
buf0[2]&0xF000)==0xE000 && (
buf0[3]&0xF000)==0xE000 ){
1075 for(
int err=0; err<
nERRORS; ++err)
1105 cout<<
" DMB="<<(buf0[1]&0x000F);
1119 for(
int err=0; err<
nERRORS; ++err)
1132 for(
int err=1; err<
nERRORS; ++err)
1156 if(
buf0[0]==0x8000 &&
buf0[1]==0x8000 &&
buf0[2]==0xFFFF &&
buf0[3]==0x8000 ){
1198 for(
int err=0; err<
nERRORS; ++err)
1210 for(
int err=1; err<
nERRORS; ++err)
1234 cout<<
"----------------------------------------------------------"<<endl;
1238 for(
int err=1; err<
nERRORS; ++err){
1243 cerr<<
" ERROR "<<err<<
" " <<
sERROR[err]<<endl;
1264 bzero(
tmpbuf,
sizeof(uint16_t)*16);
1273 if( (
buf1[3]&0xFF00) == 0xEF00 &&
1274 ( ((
buf2[3]&0xFF00) == 0xAF00 )
1276 ((
buf2[3]&0xFF00) == 0xA000 && (
buf2[0]&0x0003) == 0x0) ) ){
1300 bzero(
tmpbuf,
sizeof(uint16_t)*16);
1313 memcpy((
void*)
tmpbuf,(
void*)(buffer-16),
sizeof(
short)*16);
1470 for (
int i=0;
i<length;
i++)
1472 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
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
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