32 sERROR[10] =
"ALCT CRC Error ";
34 sERROR[10] =
"ALCT CRC Error ( disabled ) ";
40 sERROR[15] =
"TMB CRC Error ";
42 sERROR[15] =
"TMB CRC Error ( disabled ) ";
48 sERROR[18] =
"CFEB CRC Error ";
50 sERROR[18] =
"CFEB CRC Error ( disabled ) ";
56 sERROR[25] =
"DCC Trailer Missing ";
57 sERROR[26] =
"DCC Header Missing ";
59 sERROR[25] =
"DCC Trailer Missing (disabled) ";
60 sERROR[26] =
"DCC Header Missing (disabled) ";
73 sDMBExpectedPayload(nPAYLOADS),
74 sDMBEventStaus(nSTATUSES),
81 sERROR[0] =
" Any errors ";
82 sERROR[1] =
" DDU Trailer Missing ";
83 sERROR[2] =
" DDU Header Missing ";
84 sERROR[3] =
" DDU CRC Error (not yet implemented) ";
85 sERROR[4] =
" DDU Word Count Error ";
86 sERROR[5] =
" DMB Trailer Missing ";
87 sERROR[6] =
" DMB Header Missing ";
88 sERROR[7] =
" ALCT Trailer Missing ";
89 sERROR[8] =
" ALCT Header Missing ";
90 sERROR[9] =
" ALCT Word Count Error ";
91 sERROR[10] =
"ALCT CRC Error ";
92 sERROR[11] =
"ALCT Trailer Bit Error ";
101 sERROR[12] =
"TMB Trailer Missing ";
102 sERROR[13] =
"TMB Header Missing ";
103 sERROR[14] =
"TMB Word Count Error ";
104 sERROR[15] =
"TMB CRC Error ";
105 sERROR[16] =
"CFEB Word Count Per Sample Error ";
106 sERROR[17] =
"CFEB Sample Count Error ";
107 sERROR[18] =
"CFEB CRC Error ";
108 sERROR[19] =
"DDU Event Size Limit Error ";
110 sERROR[21] =
"ALCT DAV Error ";
111 sERROR[22] =
"TMB DAV Error ";
112 sERROR[23] =
"CFEB DAV Error ";
113 sERROR[24] =
"DMB Active Error ";
114 sERROR[25] =
"DCC Trailer Missing ";
115 sERROR[26] =
"DCC Header Missing ";
116 sERROR[27] =
"DMB DAV vs. DMB Active mismatch Error ";
117 sERROR[28] =
"Extra words between DDU Header and first DMB header";
121 sWARNING[0] =
" Extra words between DDU Trailer and DDU Header ";
122 sWARNING[1] =
" DDU Header Incomplete ";
173 sERROR_[0] =
" Any errors: 00";
174 sERROR_[1] =
" DDU Trailer Missing: 01";
175 sERROR_[2] =
" DDU Header Missing: 02";
176 sERROR_[3] =
" DDU CRC Error (not yet implemented): 03";
177 sERROR_[4] =
" DDU Word Count Error: 04";
178 sERROR_[5] =
" DMB Trailer Missing: 05";
179 sERROR_[6] =
" DMB Header Missing: 06";
180 sERROR_[7] =
" ALCT Trailer Missing: 07";
181 sERROR_[8] =
" ALCT Header Missing: 08";
182 sERROR_[9] =
" ALCT Word Count Error: 09";
183 sERROR_[10] =
"ALCT CRC Error: 10";
184 sERROR_[11] =
"ALCT Trailer Bit Error: 11";
185 sERROR_[12] =
"TMB Trailer Missing: 12";
186 sERROR_[13] =
"TMB Header Missing: 13";
187 sERROR_[14] =
"TMB Word Count Error: 14";
188 sERROR_[15] =
"TMB CRC Error: 15";
189 sERROR_[16] =
"CFEB Word Count Per Sample Error: 16";
190 sERROR_[17] =
"CFEB Sample Count Error: 17";
191 sERROR_[18] =
"CFEB CRC Error: 18";
192 sERROR_[19] =
"DDU Event Size Limit Error: 19";
194 sERROR_[21] =
"ALCT DAV Error: 21";
195 sERROR_[22] =
"TMB DAV Error: 22";
196 sERROR_[23] =
"CFEB DAV Error: 23";
197 sERROR_[24] =
"DMB Active Error: 24";
198 sERROR_[25] =
"DCC Trailer Missing: 25";
199 sERROR_[26] =
"DCC Header Missing: 26";
200 sERROR_[27] =
"DMB DAV vs. DMB Active mismatch Error: 27";
201 sERROR_[28] =
"Extra words between DDU Header and first DMB header: 28";
204 sWARNING_[0] =
" Extra words between DDU Trailer and DDU Header: 00";
205 sWARNING_[1] =
" DDU Header Incomplete: 02";
261 bzero(
tmpbuf,
sizeof(uint16_t) * 16);
272 bool fTMB_MiniScope_Start =
false;
273 bool fTMB_RPC_Start =
false;
274 bool fTMB_GEM_Start =
false;
275 bool fTMB_BlockedCFEBs_Start =
false;
277 bool fTMB_MiniScope =
false;
278 bool fTMB_RPC =
false;
279 bool fTMB_GEM =
false;
280 bool fTMB_BlockedCFEBs =
false;
313 for (
int g = 0;
g < 4;
g++) {
314 if (
buf0[
g] == 0x1000) {
316 }
else if (
buf0[
g] != 0x3000)
345 if ((((
buf0[3] & 0xF000) == 0x5000 && (
buf0[0] & 0x00FF) == 0x005F) ||
346 ((
buf0[3] & 0xF000) == 0x5000 && (
buf0[0] & 0x000F) == 0x0008)) &&
349 (
buf1[3] & 0xF000) == 0xD000) {
357 CERR <<
"\n\nDCC Header Occurrence ";
358 CERR <<
" ERROR 25 " <<
sERROR[25] << endl;
368 bzero(
tmpbuf,
sizeof(uint16_t) * 16);
381 ((
buf0[0] & 0xF000) == 0xC000 || (
buf0[1] & 0xF000) == 0xC000 || (
buf0[2] & 0xF000) == 0xC000 ||
382 (
buf0[3] & 0xF000) == 0xC000) &&
392 CERR <<
" ERROR 20 " <<
sERROR[20] << endl;
397 if (
buf0[1] == 0x8000 &&
buf0[2] == 0x0001 &&
buf0[3] == 0x8000) {
412 CERR <<
" ERROR 1 " <<
sERROR[1] << endl;
429 CERR <<
" ERROR 5 " <<
sERROR[5] << endl;
459 bzero(
tmpbuf,
sizeof(uint16_t) * 16);
523 for (
int bit = 0; bit < 15; bit++)
531 if ((
buf_1[3] & 0xF000) != 0x5000) {
536 CERR <<
" WARNING 1 " <<
sWARNING[1] <<
". What must have been Header 1: 0x" << std::hex <<
buf_1[0] <<
" 0x"
544 COUT <<
"\n----------------------------------------------------------" << endl;
546 <<
" L1A = " << (((
buf_1[2] & 0xFFFF) + ((
buf_1[3] & 0x00FF) << 16))) << endl;
551 if ((
buf0[0] & 0xF000) == 0xA000 && (
buf0[1] & 0xF000) == 0xA000 && (
buf0[2] & 0xF000) == 0xA000 &&
552 (
buf0[3] & 0xF000) == 0xA000) {
606 fTMB_MiniScope_Start =
false;
607 fTMB_RPC_Start =
false;
608 fTMB_GEM_Start =
false;
609 fTMB_BlockedCFEBs_Start =
false;
611 fTMB_MiniScope =
false;
614 fTMB_BlockedCFEBs =
false;
627 COUT <<
"Crate=" << setw(3) << setfill(
'0') << ((
buf0[1] >> 4) & 0x00FF) <<
" DMB=" << setw(2) << setfill(
'0')
628 << (
buf0[1] & 0x000F) <<
" ";
631 COUT << setw(1) << ((buf0[0] & 0x0200) >> 9) <<
" " << ((
buf0[0] & 0x0800) >> 11)
634 COUT << setw(1) << ((buf0[0] & 0x0010) >> 4) << ((
buf0[0] & 0x0008) >> 3) << ((
buf0[0] & 0x0004) >> 2)
635 << ((
buf0[0] & 0x0002) >> 1) << (
buf0[0] & 0x0001);
646 if (
buf0[0] & 0x0001)
648 if (
buf0[0] & 0x0002)
650 if (
buf0[0] & 0x0004)
652 if (
buf0[0] & 0x0008)
654 if (
buf0[0] & 0x0010)
656 if (
buf0[0] & 0x0020)
658 if (
buf0[0] & 0x0040)
677 if (
buf0[0] & 0x0001)
679 if (
buf0[0] & 0x0002)
681 if (
buf0[0] & 0x0004)
683 if (
buf0[0] & 0x0008)
685 if (
buf0[0] & 0x0010)
698 if ((
buf0[0] == 0xDB0A && (
buf0[1] & 0xF000) == 0xD000 && (
buf0[2] & 0xF000) == 0xD000 &&
699 (
buf0[3] & 0xF000) == 0xD000) &&
700 ((
buf_1[0] & 0xF000) == 0xA000 && (
buf_1[1] & 0xF000) == 0xA000 && (
buf_1[2] & 0xF000) == 0xA000 &&
701 (
buf_1[3] & 0xF000) == 0xA000)) {
713 int nWGs_per_layer = ((
buf1[2] & 0x0007) + 1) * 16;
715 nWG_round_up = int(nWGs_per_layer / 12) + (nWGs_per_layer % 3 ? 1 : 0);
717 bool config_present =
buf1[0] & 0x4000;
719 bool lct_overflow =
buf1[0] & 0x2000;
721 bool raw_overflow =
buf1[0] & 0x1000;
723 int lct_tbins = (
buf1[3] & 0x01E0) >> 5;
725 int raw_tbins = (
buf1[3] & 0x001F);
731 for (
int g = 0;
g < 4;
g++) {
732 if (
buf1[
g] == 0x1000)
745 int config_size = (config_present ? 3 + 5 : 0);
747 int colreg_size = (config_present ? nWGs_per_layer / 4 : 0);
749 int hot_ch_size = (config_present ?
nWG_round_up * 6 : 0);
751 int alct_0_1_size = (!lct_overflow ? 2 * lct_tbins : 0);
753 int raw_hit_dump_size = (!raw_overflow ?
nWG_round_up * 6 * raw_tbins : 0);
759 ALCT_WordsExpected += config_size + colreg_size + hot_ch_size + alct_0_1_size + raw_hit_dump_size;
771 if (((
buf0[0] & 0xF800) == 0x6000 && (
buf0[1] & 0x8F80) == 0x0080 && (
buf0[2] & 0x8000) == 0x0000 &&
772 (
buf0[3] & 0xc000) == 0x0000) &&
773 ((
buf_1[0] & 0xF000) == 0xA000 && (
buf_1[1] & 0xF000) == 0xA000 && (
buf_1[2] & 0xF000) == 0xA000 &&
774 (
buf_1[3] & 0xF000) == 0xA000)) {
781 if ((
buf0[3] & 0x0003) == 0) {
785 if ((
buf0[1] & 0x0003) == 1)
788 (((
buf0[3] & 0x0001)) + ((
buf0[3] & 0x0002) >> 1) + ((
buf0[3] & 0x0004) >> 2) +
789 ((
buf0[3] & 0x0008) >> 3) + ((
buf0[3] & 0x0010) >> 4) + ((
buf0[3] & 0x0020) >> 5) +
790 ((
buf0[3] & 0x0040) >> 6)) *
803 if ((
buf0[0] & 0xFFFF) == 0xDB0C) {
821 if ((
buf1[1] & 0x3000) == 0x3000) {
824 if ((
buf1[1] & 0x3000) == 0x0000) {
833 if ((
buf0[0] & 0xFFFF) == 0x6B0C && (((
buf_1[0] & 0xF000) == 0xA000 && (
buf_1[1] & 0xF000) == 0xA000 &&
834 (
buf_1[2] & 0xF000) == 0xA000 && (
buf_1[3] & 0xF000) == 0xA000) ||
835 ((
buf_1[0] & 0x0800) == 0x0000 && (
buf_1[1] & 0xF800) == 0xD000 &&
836 (
buf_1[2] & 0xFFFF) == 0xDE0D && (
buf_1[3] & 0xF000) == 0xD000)
847 if ((
buf0[1] & 0x3000) == 0x3000) {
850 if ((
buf0[1] & 0x3000) == 0x0000) {
854 if ((
buf0[1] & 0x3000) == 0x1000) {
879 (
buf0[0] == 0xDE0D && (
buf0[1] & 0xF800) == 0xD000 && (
buf0[2] & 0xF800) == 0xD000 &&
882 ((
buf0[0] & 0x0800) == 0x0000 && (
buf0[1] & 0xF800) == 0xD000 && (
buf0[2] & 0xFFFF) == 0xDE0D &&
949 for (uint16_t
j = 0,
w = 0;
j < 4; ++
j) {
952 for (uint32_t
i = 15,
t = 0, ncrc = 0;
i < 16;
i--) {
978 bool isGEMfirmware =
false;
988 isGEMfirmware =
true;
992 uint16_t Enabled_GEMs = 0;
1018 fTMB_RPC_Start =
true;
1023 fTMB_GEM_Start =
true;
1028 fTMB_MiniScope_Start =
true;
1033 fTMB_BlockedCFEBs_Start =
true;
1048 fTMB_MiniScope =
true;
1053 fTMB_BlockedCFEBs =
true;
1059 ((
buf0[0] & 0xF000) == 0xD000 && (
buf0[1] & 0xF000) == 0xD000 && (
buf0[2] & 0xFFFF) == 0xDE0F &&
1062 (
buf0[0] == 0xDE0F && (
buf0[1] & 0xF000) == 0xD000 && (
buf0[2] & 0xF000) == 0xD000 &&
1120 else if (pos == 3) {
1137 if (fTMB_BlockedCFEBs)
1147 for (uint16_t
j = 0,
w = 0;
j < 4; ++
j) {
1150 for (uint32_t
i = 15,
t = 0, ncrc = 0;
i < 16;
i--) {
1152 ncrc = (
TMB_CRC << 1) & 0x3ffffc;
1163 ((
buf0[1] != 0x7FFF) || (
buf0[2] != 0x7FFF)) &&
1164 (((
buf0[3] & 0xFFFF) == 0x7FFF) ||
1214 if (!
fTMB_Header && (
buf0[0] & 0xF000) == 0xB000 && (
buf0[1] & 0xF000) == 0xB000 && (
buf0[2] & 0xF000) == 0xB000 &&
1215 (
buf0[3] & 0xF000) == 0xB000) {
1243 for (
int pos = 0; pos < 4; ++pos)
1248 if ((
buf0[0] & 0xF000) == 0xF000 && (
buf0[1] & 0xF000) == 0xF000 && (
buf0[2] & 0xF000) == 0xF000 &&
1249 (
buf0[3] & 0xF000) == 0xF000) {
1258 if (
buf0[0] & 0x0400)
1260 if (
buf0[0] & 0x0800)
1277 if ((
buf1[0] & 0xF000) != 0xE000 || (
buf1[1] & 0xF000) != 0xE000 || (
buf1[2] & 0xF000) != 0xE000 ||
1278 (
buf1[3] & 0xF000) != 0xE000) {
1301 if ((
buf0[0] & 0xF000) == 0xE000 && (
buf0[1] & 0xF000) == 0xE000 && (
buf0[2] & 0xF000) == 0xE000 &&
1302 (
buf0[3] & 0xF000) == 0xE000) {
1378 COUT <<
" DMB=" << (buf0[1] & 0x000F);
1424 if (
buf0[0] == 0x8000 &&
buf0[1] == 0x8000 &&
buf0[2] == 0xFFFF &&
buf0[3] == 0x8000) {
1447 COUT <<
" Ex-Err: DMB (Header, Trailer) " << std::endl;
1498 COUT <<
"----------------------------------------------------------" << endl;
1510 CERR <<
" ERROR " << err <<
" " <<
sERROR[
err] << endl;
1516 for (
int wrn = 1; wrn <
nWARNINGS; ++wrn) {
1519 COUT <<
" WARNING " << wrn <<
" " <<
sWARNING[wrn] << endl;
1536 bzero(
tmpbuf,
sizeof(uint16_t) * 16);
1545 if ((
buf1[3] & 0xFF00) == 0xEF00 &&
1546 (((
buf2[3] & 0xFF00) == 0xAF00) || ((
buf2[3] & 0xFF00) == 0xA000 && (
buf2[0] & 0x0003) == 0x0))) {
1570 bzero(
tmpbuf,
sizeof(uint16_t) * 16);
1584 memcpy((
void*)
tmpbuf, (
void*)(buffer - 16),
sizeof(
short) * 16);
1611 for (
int wrn = 0; wrn <
nWARNINGS; ++wrn)
1746 for (
int wrn = 0; wrn <
nWARNINGS; ++wrn)
1753 for (
int i = 0;
i < length;
i++) {
1754 if ((buffer[
i] & mask) == sig) {
uint32_t DDU_WordsSinceLastHeader
const uint16_t * buffer_start
std::map< CSCIdType, ExaminerStatusType > bCHAMB_ERR
void crcCFEB(bool enable)
std::map< DDUIdType, ExaminerStatusType > bDDU_ERR
uint32_t CFEB_SampleWordCount
std::map< DDUIdType, ExaminerStatusType > bDDU_WRN
std::set< CSCIdType > fCHAMB_ERR[29]
std::map< DDUIdType, uint32_t > dduOffsets
std::map< DDUIdType, uint32_t > dduSize
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
uint32_t DDU_WordsSinceLastTrailer
std::map< CSCIdType, ExaminerStatusType > bCHAMB_PAYLOAD
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::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
std::map< DDUIdType, const uint16_t * > dduBuffers
uint32_t TMB_Firmware_Revision
uint32_t nWG_round_up
check zero suppression mode
std::map< CSCIdType, uint32_t > cntCHAMB_Trailers
std::map< DDUIdType, std::map< CSCIdType, uint32_t > > dmbSize
std::vector< const char * > sDMBExpectedPayload
std::vector< const char * > sWARNING_
std::set< CSCIdType > fCHAMB_WRN[5]
uint32_t DDU_WordMismatch_Occurrences
uint32_t CFEB_SampleCount
ExaminerStatusType bSUM_ERROR
std::map< CSCIdType, ExaminerStatusType > bCHAMB_WRN
uint32_t TMB_WordsExpected
uint32_t CFEB_BSampleCount
std::map< DDUIdType, std::map< CSCIdType, uint32_t > > dmbOffsets
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
uint32_t ALCT_WordsSinceLastHeaderZeroSuppressed
int32_t check(const uint16_t *&buffer, int32_t length)
std::map< CSCIdType, ExaminerStatusType > bCHAMB_STATUS
void checkDAVs()
checks DAV_ALCT, DAV_TMB, and DAV_CFEB
ExaminerStatusType bWARNING
std::vector< const char * > sDMBEventStaus
std::map< DDUIdType, std::map< CSCIdType, const uint16_t * > > dmbBuffers
std::vector< const char * > sERROR_
std::map< CSCIdType, uint32_t > cntCHAMB_Headers