CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
CSCDCCExaminer Class Reference

#include <CSCDCCExaminer.h>

Public Member Functions

std::set< CSCIdTypechambersWithError (int num) const
 
std::set< CSCIdTypechambersWithWarning (int num) const
 
int32_t check (const uint16_t *&buffer, int32_t length)
 
void crcALCT (bool enable)
 
void crcCFEB (bool enable)
 
void crcTMB (bool enable)
 
 CSCDCCExaminer (ExaminerMaskType mask=0x1)
 
std::map< DDUIdType, const
uint16_t * > 
DDU_block (void) const
 
std::map< DDUIdType, uint32_t > DDU_ptrOffsets (void) const
 
std::map< DDUIdType, uint32_t > DDU_size (void) const
 
DDUIdType dduSourceID (void)
 
std::map< DDUIdType, std::map
< CSCIdType, const uint16_t * > > 
DMB_block (void) const
 
std::map< DDUIdType, std::map
< CSCIdType, uint32_t > > 
DMB_ptrOffsets (void) const
 
std::map< DDUIdType, std::map
< CSCIdType, uint32_t > > 
DMB_size (void) const
 
const char * errName (int num) const
 
bool error (int num) const
 
const char * errorName (int num) const
 
ExaminerStatusType errors (void) const
 
std::map< CSCIdType,
ExaminerStatusType
errorsDetailed (void) const
 
std::map< DDUIdType,
ExaminerStatusType
errorsDetailedDDU (void) const
 
ExaminerStatusType errorsForChamber (CSCIdType chamber) const
 
ExaminerStatusType errorsForDDU (DDUIdType dduSourceID) const
 
ExaminerMaskType getMask () const
 
bool isDDUmode ()
 
std::vector< DDUIdTypelistOfDDUs (void) const
 
void modeDDU (bool enable)
 
std::map< CSCIdType,
ExaminerStatusType
payloadDetailed (void) const
 
ExaminerStatusType payloadForChamber (CSCIdType chamber) const
 
const char * payloadName (int num) const
 
void setMask (ExaminerMaskType mask)
 
std::map< CSCIdType,
ExaminerStatusType
statusDetailed (void) const
 
ExaminerStatusType statusForChamber (CSCIdType chamber) const
 
const char * statusName (int num) const
 
bool warning (int num) const
 
const char * warningName (int num) const
 
ExaminerStatusType warnings (void) const
 
std::map< CSCIdType,
ExaminerStatusType
warningsDetailed (void) const
 
ExaminerStatusType warningsForChamber (CSCIdType chamber) const
 
ExaminerStatusType warningsForDDU (DDUIdType dduSourceID) const
 
const char * wrnName (int num) const
 
 ~CSCDCCExaminer (void)
 

Public Attributes

std::map< CSCIdType, uint32_t > cntCHAMB_Headers
 
std::map< CSCIdType, uint32_t > cntCHAMB_Trailers
 
uint32_t cntDDU_Headers
 
uint32_t cntDDU_Trailers
 
const uint16_t nERRORS
 
const uint16_t nPAYLOADS
 
const uint16_t nSTATUSES
 
const uint16_t nWARNINGS
 

Private Member Functions

void checkDAVs ()
 checks DAV_ALCT, DAV_TMB, and DAV_CFEB More...
 
void checkTriggerHeadersAndTrailers ()
 
void clear ()
 
int scanbuf (const uint16_t *&buf, int32_t length, uint16_t sig, uint16_t mask=0xFFFF)
 
void sync_stats ()
 
void zeroCounts ()
 

Private Attributes

uint32_t ALCT_CRC
 
uint32_t ALCT_WordCount
 
uint32_t ALCT_WordsExpected
 
uint32_t ALCT_WordsSinceLastHeader
 
uint32_t ALCT_WordsSinceLastHeaderZeroSuppressed
 
uint32_t ALCT_ZSE
 
std::map< CSCIdType,
ExaminerStatusType
bCHAMB_ERR
 
std::map< CSCIdType,
ExaminerStatusType
bCHAMB_PAYLOAD
 
std::map< CSCIdType,
ExaminerStatusType
bCHAMB_STATUS
 
std::map< CSCIdType,
ExaminerStatusType
bCHAMB_WRN
 
std::map< DDUIdType,
ExaminerStatusType
bDDU_ERR
 
std::map< DDUIdType,
ExaminerStatusType
bDDU_WRN
 
ExaminerStatusType bERROR
 
ExaminerStatusType bSUM_ERROR
 
ExaminerStatusType bSUM_WARNING
 
const uint16_t * buf0
 
const uint16_t * buf1
 
const uint16_t * buf2
 
const uint16_t * buf_1
 
const uint16_t * buf_2
 
const uint16_t * buffer_start
 
ExaminerStatusType bWARNING
 
uint32_t CFEB_BSampleCount
 
uint32_t CFEB_CRC
 
uint32_t CFEB_SampleCount
 
uint32_t CFEB_SampleWordCount
 
bool checkCrcALCT
 
bool checkCrcCFEB
 
bool checkCrcTMB
 
CSCIdType currentChamber
 
bool DAV_ALCT
 
int DAV_CFEB
 
int DAV_DMB
 
bool DAV_TMB
 
uint32_t DDU_Firmware_Revision
 
uint32_t DDU_WordCount
 
uint32_t DDU_WordMismatch_Occurrences
 
uint32_t DDU_WordsSinceLastHeader
 
uint32_t DDU_WordsSinceLastTrailer
 
std::map< DDUIdType, const
uint16_t * > 
dduBuffers
 
std::map< DDUIdType, uint32_t > dduOffsets
 
std::map< DDUIdType, uint32_t > dduSize
 
int DMB_Active
 
std::map< DDUIdType, std::map
< CSCIdType, const uint16_t * > > 
dmbBuffers
 
std::map< DDUIdType, std::map
< CSCIdType, uint32_t > > 
dmbOffsets
 
std::map< DDUIdType, std::map
< CSCIdType, uint32_t > > 
dmbSize
 
ExaminerMaskType examinerMask
 
bool fALCT_Format2007
 
bool fALCT_Header
 
std::set< CSCIdTypefCHAMB_ERR [29]
 
std::set< CSCIdTypefCHAMB_WRN [5]
 
bool fDCC_Header
 
bool fDCC_Trailer
 
bool fDDU_Header
 
bool fDDU_Trailer
 
bool fDMB_Header
 
bool fDMB_Trailer
 
bool fERROR [29]
 
bool fFormat2013
 
bool fSUM_ERROR [29]
 
bool fSUM_WARNING [5]
 
bool fTMB_Format2007
 
bool fTMB_Header
 
bool fWARNING [5]
 
bool modeDDUonly
 
int nDMBs
 
uint32_t nWG_round_up
 check zero suppression mode More...
 
std::vector< const char * > sDMBEventStaus
 
std::vector< const char * > sDMBExpectedPayload
 
std::vector< const char * > sERROR
 
std::vector< const char * > sERROR_
 
DDUIdType sourceID
 
std::vector< const char * > sWARNING
 
std::vector< const char * > sWARNING_
 
uint32_t TMB_CRC
 
uint32_t TMB_Firmware_Revision
 
uint32_t TMB_Tbins
 
uint32_t TMB_WordCount
 
uint32_t TMB_WordsExpected
 
uint32_t TMB_WordsGEM
 
uint32_t TMB_WordsRPC
 
uint32_t TMB_WordsSinceLastHeader
 to decode if zero suppression enabled More...
 
uint16_t tmpbuf [16]
 
bool uniqueALCT
 
bool uniqueTMB
 

Detailed Description

Definition at line 15 of file CSCDCCExaminer.h.

Constructor & Destructor Documentation

CSCDCCExaminer::CSCDCCExaminer ( ExaminerMaskType  mask = 0x1)

2013 Format additions

2013 Format additions

Definition at line 64 of file CSCDCCExaminer.cc.

References ALCT_CRC, ALCT_ZSE, buf0, buf1, buf2, buf_1, EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, CFEB_CRC, checkCrcALCT, checkCrcCFEB, checkCrcTMB, clear(), cntCHAMB_Headers, cntCHAMB_Trailers, cntDDU_Headers, cntDDU_Trailers, COUT, gather_cfg::cout, currentChamber, DAV_ALCT, DAV_CFEB, DAV_TMB, DDU_Firmware_Revision, DDU_WordCount, DDU_WordMismatch_Occurrences, DDU_WordsSinceLastHeader, DDU_WordsSinceLastTrailer, DMB_Active, fALCT_Format2007, fALCT_Header, fDCC_Header, fDCC_Trailer, fDDU_Header, fDDU_Trailer, fDMB_Header, fDMB_Trailer, fFormat2013, fTMB_Format2007, fTMB_Header, modeDDUonly, nDMBs, nWG_round_up, sDMBEventStaus, sDMBExpectedPayload, sERROR, sERROR_, sourceID, sWARNING, sWARNING_, TMB_CRC, TMB_Firmware_Revision, TMB_WordsGEM, TMB_WordsRPC, tmpbuf, and zeroCounts().

65  : nERRORS(29),
66  nWARNINGS(5),
67  nPAYLOADS(16),
68  nSTATUSES(29),
69  sERROR(nERRORS),
75  examinerMask(mask) {
76 #ifdef LOCAL_UNPACK
77  COUT.redirect(std::cout);
78  CERR.redirect(std::cerr);
79 #endif
80 
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 ";
93  // ^^^ This is due to seeing many events in ddu293 (also, some in ddu294)
94  // with some bits in the 1st ALCT D-Header being lost. This causes a chain of errors:
95  // - TMB Trailer is not identified and TMB word count mismatch occur when Trailer is found
96  // - CFEB sample count is not reset on ALCT Trailer.
97  // To merge all these errors in one,
98  // the D-signature in the 1st ALCT Trailer will not be required for identifying the ALCT Trailer;
99  // However, if these bits are found to be missing, ERROR[11] will be flagged.
100  // This is just a temporary patch to make the output look less clattered.
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 ";
109  sERROR[20] = "C-Words ";
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";
118 
119  // sERROR[21] = "DDU Header vs. Trailer mismatch for DAV or Avtive"; // oboslete since 16.09.05
120 
121  sWARNING[0] = " Extra words between DDU Trailer and DDU Header ";
122  sWARNING[1] = " DDU Header Incomplete ";
123 
124  sDMBExpectedPayload[0] = "CFEB1_ACTIVE";
125  sDMBExpectedPayload[1] = "CFEB2_ACTIVE";
126  sDMBExpectedPayload[2] = "CFEB3_ACTIVE";
127  sDMBExpectedPayload[3] = "CFEB4_ACTIVE";
128  sDMBExpectedPayload[4] = "CFEB5_ACTIVE";
129  sDMBExpectedPayload[5] = "ALCT_DAV";
130  sDMBExpectedPayload[6] = "TMB_DAV";
131  sDMBExpectedPayload[7] = "CFEB1_DAV";
132  sDMBExpectedPayload[8] = "CFEB2_DAV";
133  sDMBExpectedPayload[9] = "CFEB3_DAV";
134  sDMBExpectedPayload[10] = "CFEB4_DAV";
135  sDMBExpectedPayload[11] = "CFEB5_DAV";
137  sDMBExpectedPayload[12] = "CFEB6_DAV";
138  sDMBExpectedPayload[13] = "CFEB7_DAV";
139  sDMBExpectedPayload[14] = "CFEB6_ACTIVE";
140  sDMBExpectedPayload[15] = "CFEB7_ACTIVE";
141 
142  sDMBEventStaus[0] = "ALCT_FIFO_FULL";
143  sDMBEventStaus[1] = "TMB_FIFO_FULL";
144  sDMBEventStaus[2] = "CFEB1_FIFO_FULL";
145  sDMBEventStaus[3] = "CFEB2_FIFO_FULL";
146  sDMBEventStaus[4] = "CFEB3_FIFO_FULL";
147  sDMBEventStaus[5] = "CFEB4_FIFO_FULL";
148  sDMBEventStaus[6] = "CFEB5_FIFO_FULL";
149  sDMBEventStaus[7] = "ALCT_START_TIMEOUT";
150  sDMBEventStaus[8] = "TMB_START_TIMEOUT";
151  sDMBEventStaus[9] = "CFEB1_START_TIMEOUT";
152  sDMBEventStaus[10] = "CFEB2_START_TIMEOUT";
153  sDMBEventStaus[11] = "CFEB3_START_TIMEOUT";
154  sDMBEventStaus[12] = "CFEB4_START_TIMEOUT";
155  sDMBEventStaus[13] = "CFEB5_START_TIMEOUT";
156  sDMBEventStaus[14] = "ALCT_END_TIMEOUT";
157  sDMBEventStaus[15] = "TMB_END_TIMEOUT";
158  sDMBEventStaus[16] = "CFEB1_END_TIMEOUT";
159  sDMBEventStaus[17] = "CFEB2_END_TIMEOUT";
160  sDMBEventStaus[18] = "CFEB3_END_TIMEOUT";
161  sDMBEventStaus[19] = "CFEB4_END_TIMEOUT";
162  sDMBEventStaus[20] = "CFEB5_END_TIMEOUT";
163  sDMBEventStaus[21] = "CFEB Active-DAV mismatch";
164  sDMBEventStaus[22] = "B-words found";
166  sDMBEventStaus[23] = "CFEB6_FIFO_FULL";
167  sDMBEventStaus[24] = "CFEB7_FIFO_FULL";
168  sDMBEventStaus[25] = "CFEB6_START_TIMEOUT";
169  sDMBEventStaus[26] = "CFEB7_START_TIMEOUT";
170  sDMBEventStaus[27] = "CFEB6_END_TIMEOUT";
171  sDMBEventStaus[28] = "CFEB7_END_TIMEOUT";
172 
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";
193  sERROR_[20] = "C-Words: 20";
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";
202  // sERROR_[21] = "DDU Header vs. Trailer mismatch for DAV or Avtive: 21"; // oboslete since 16.09.05
203 
204  sWARNING_[0] = " Extra words between DDU Trailer and DDU Header: 00";
205  sWARNING_[1] = " DDU Header Incomplete: 02";
206 
207  fDCC_Header = false;
208  fDCC_Trailer = false;
209  fDDU_Header = false;
210  fDDU_Trailer = false;
211  fDMB_Header = false;
212  fDMB_Trailer = false;
213  fALCT_Header = false;
214  fTMB_Header = false;
215  fALCT_Format2007 = true;
216  fTMB_Format2007 = true;
217  fFormat2013 = false;
218 
219  cntDDU_Headers = 0;
220  cntDDU_Trailers = 0;
221  cntCHAMB_Headers.clear();
222  cntCHAMB_Trailers.clear();
223 
224  DAV_ALCT = false;
225  DAV_TMB = false;
226  DAV_CFEB = 0;
227  DMB_Active = 0;
228  nDMBs = 0;
230  DDU_WordCount = 0;
233  ALCT_ZSE = 0;
234  nWG_round_up = 0;
235 
236  TMB_WordsRPC = 0;
237  TMB_WordsGEM = 0;
240  zeroCounts();
241 
242  checkCrcALCT = false;
243  ALCT_CRC = 0;
244  checkCrcTMB = false;
245  TMB_CRC = 0;
246  checkCrcCFEB = false;
247  CFEB_CRC = 0;
248 
249  modeDDUonly = false;
250  sourceID = 0xFFF;
251  currentChamber = -1;
252 
253  //headerDAV_Active = -1; // Trailer vs. Header check // Obsolete since 16.09.05
254 
255  clear();
256  buf_1 = &(tmpbuf[0]);
257  buf0 = &(tmpbuf[4]);
258  buf1 = &(tmpbuf[8]);
259  buf2 = &(tmpbuf[12]);
260 
261  bzero(tmpbuf, sizeof(uint16_t) * 16);
262 }
uint32_t DDU_WordsSinceLastHeader
const uint16_t nSTATUSES
const uint16_t * buf0
const uint16_t * buf2
const uint16_t * buf1
const uint16_t nERRORS
uint32_t TMB_WordsGEM
uint32_t DDU_WordsSinceLastTrailer
uint32_t cntDDU_Headers
std::vector< const char * > sERROR
uint32_t TMB_Firmware_Revision
CSCIdType currentChamber
uint32_t nWG_round_up
check zero suppression mode
std::map< CSCIdType, uint32_t > cntCHAMB_Trailers
const uint16_t nWARNINGS
std::vector< const char * > sDMBExpectedPayload
std::vector< const char * > sWARNING_
uint32_t DDU_WordMismatch_Occurrences
uint32_t TMB_WordsRPC
#define COUT
const uint16_t * buf_1
const uint16_t nPAYLOADS
uint16_t tmpbuf[16]
uint32_t DDU_Firmware_Revision
std::vector< const char * > sWARNING
DDUIdType sourceID
uint32_t DDU_WordCount
ExaminerMaskType examinerMask
tuple cout
Definition: gather_cfg.py:144
std::vector< const char * > sDMBEventStaus
std::vector< const char * > sERROR_
std::map< CSCIdType, uint32_t > cntCHAMB_Headers
uint32_t cntDDU_Trailers
CSCDCCExaminer::~CSCDCCExaminer ( void  )
inline

Definition at line 327 of file CSCDCCExaminer.h.

327 {}

Member Function Documentation

std::set<CSCIdType> CSCDCCExaminer::chambersWithError ( int  num) const
inline

Definition at line 225 of file CSCDCCExaminer.h.

References fCHAMB_ERR, nERRORS, and pileupDistInMC::num.

225  {
226  if (num >= 0 && num < nERRORS)
227  return fCHAMB_ERR[num];
228  else
229  return std::set<int>();
230  }
std::set< CSCIdType > fCHAMB_ERR[29]
const uint16_t nERRORS
std::set<CSCIdType> CSCDCCExaminer::chambersWithWarning ( int  num) const
inline

Definition at line 231 of file CSCDCCExaminer.h.

References fCHAMB_WRN, pileupDistInMC::num, and nWARNINGS.

231  {
232  if (num >= 0 && num < nWARNINGS)
233  return fCHAMB_WRN[num];
234  else
235  return std::set<int>();
236  }
const uint16_t nWARNINGS
std::set< CSCIdType > fCHAMB_WRN[5]
int32_t CSCDCCExaminer::check ( const uint16_t *&  buffer,
int32_t  length 
)

'buffer' is a sliding pointer; keep track of the true buffer

Check for presence of data blocks inside TMB data

increment counter of 16-bit words since last DMB*ALCT Header match this counter is reset if ALCT Header is found right after DMB Header

decode the actual counting if zero suppression enabled

increment counter of 16-bit words without zero suppression decoding

  • 2013 Data format version check

2013 Data format

Moved around 7 CFEBs Active and CFEB DAV payload bits to be compatible with 5 CFEBs version

CFEBs DAV

CFEBs Active 5

CFEBs Active 6,7

CLCT-DAV-Mismatch

Pre-2013 DMB Format

Check if ALCT zero suppression enable:

Check calculated CRC sum against reported

w = buf0[j] & 0x7fff;

w = buf0[j] & 0x7fff;

2013 Data format

!!! Put correct bits positions

ALCT FIFO FULL

TMB FIFO Full

TMB End Timeout

CFEB 1-3 FIFO Full

CFEB 4-5 FIFO Full

CFEB 6-7 FIFO Full

ALCT Start Timeout

TMB Start Timeout

CFEB 1-5 Start Timeout

CFEB 6-7 Start Timeout

ALCT End Timeout

CFEB 1-5 End Timeout

CFEB 6-7 End Timeout

ALCT FIFO FULL

TMB FIFO Full

CFEB 1-5 FIFO Full

ALCT Start Timeout

TMB Start Timeout

CFEB 1-5 Start Timeout

ALCT End Timeout

TMB End Timeout

CFEB 1-5 End Timeout

Definition at line 264 of file CSCDCCExaminer.cc.

References ALCT_CRC, ALCT_WordCount, ALCT_WordsExpected, ALCT_WordsSinceLastHeader, ALCT_WordsSinceLastHeaderZeroSuppressed, ALCT_ZSE, bCHAMB_ERR, bCHAMB_PAYLOAD, bCHAMB_STATUS, bCHAMB_WRN, bDDU_ERR, bDDU_WRN, bERROR, buf0, buf1, buf2, buf_1, buf_2, edmScanValgrind::buffer, buffer_start, bWARNING, CFEB_BSampleCount, CFEB_CRC, CFEB_SampleCount, CFEB_SampleWordCount, checkCrcALCT, checkCrcCFEB, checkCrcTMB, checkDAVs(), checkTriggerHeadersAndTrailers(), clear(), cntCHAMB_Headers, cntCHAMB_Trailers, cntDDU_Headers, cntDDU_Trailers, COUT, currentChamber, DAV_ALCT, DAV_CFEB, DAV_DMB, DAV_TMB, DDU_Firmware_Revision, DDU_WordCount, DDU_WordsSinceLastHeader, DDU_WordsSinceLastTrailer, dduBuffers, dduOffsets, dduSize, TauDecayModes::dec, DMB_Active, dmbBuffers, dmbOffsets, dmbSize, dataset::end, submitPVValidationJobs::err, fALCT_Format2007, fALCT_Header, fCHAMB_ERR, fDCC_Header, fDCC_Trailer, fDDU_Header, fDDU_Trailer, fDMB_Header, fDMB_Trailer, fERROR, fFormat2013, spr::find(), fTMB_Format2007, fTMB_Header, fWARNING, g, mps_fire::i, dqmiolumiharvest::j, modeDDUonly, nDMBs, nERRORS, nWARNINGS, nWG_round_up, scanbuf(), sERROR, sourceID, sWARNING, sync_stats(), submitPVValidationJobs::t, TMB_CRC, TMB_Firmware_Revision, TMB_Tbins, TMB_WordCount, TMB_WordsExpected, TMB_WordsGEM, TMB_WordsRPC, TMB_WordsSinceLastHeader, tmpbuf, uniqueALCT, uniqueTMB, w, and zeroCounts().

Referenced by CSCOfflineMonitor::doBXMonitor(), CSCValidation::doTimeMonitoring(), and CSCDCCUnpacker::produce().

264  {
265  if (length <= 0)
266  return -1;
267 
270 
272  bool fTMB_MiniScope_Start = false;
273  bool fTMB_RPC_Start = false;
274  bool fTMB_GEM_Start = false;
275  bool fTMB_BlockedCFEBs_Start = false;
276 
277  bool fTMB_MiniScope = false;
278  bool fTMB_RPC = false;
279  bool fTMB_GEM = false;
280  bool fTMB_BlockedCFEBs = false;
281 
282  while (length > 0) {
283  // == Store last 4 read buffers in pipeline-like memory (note that memcpy works quite slower!)
284  buf_2 = buf_1; // This bufer was not needed so far
285  buf_1 = buf0;
286  buf0 = buf1;
287  buf1 = buf2;
288  buf2 = buffer;
289 
290  // check for too long event
291  if (!fERROR[19] && DDU_WordsSinceLastHeader > 100000) {
292  fERROR[19] = true;
293  bERROR |= 0x80000;
294  }
295 
296  // increment counter of 64-bit words since last DDU Header
297  // this counter is reset if DDU Header is found
298  if (fDDU_Header) {
300  }
301 
302  // increment counter of 64-bit words since last DDU Trailer
303  // this counter is reset if DDU Trailer is found
304  if (fDDU_Trailer) {
306  }
307 
310  if (fALCT_Header) {
312  if (ALCT_ZSE) {
313  for (int g = 0; g < 4; g++) {
314  if (buf0[g] == 0x1000) {
316  } else if (buf0[g] != 0x3000)
318  }
319  } else
323  }
324 
325  // increment counter of 16-bit words since last DMB*TMB Header match
326  // this counter is reset if TMB Header is found right after DMB Header or ALCT Trailer
327  if (fTMB_Header) {
329  }
330 
331  // increment counter of 16-bit words since last of DMB Header, ALCT Trailer, TMB Trailer,
332  // CFEB Sample Trailer, CFEB B-word; this counter is reset by all these conditions
333  if (fDMB_Header) {
335  }
336 
337  // If DDU header is missing we set unphysical 0xFFF value for DDU id
338  if (!fDDU_Header) {
339  sourceID = 0xFFF;
340  }
341 
342  if (!modeDDUonly) {
343  // DCC Header 1 && DCC Header 2
344  // =VB= Added support for Sep. 2008 CMS DAQ DCC format
345  if ((((buf0[3] & 0xF000) == 0x5000 && (buf0[0] & 0x00FF) == 0x005F) ||
346  ((buf0[3] & 0xF000) == 0x5000 && (buf0[0] & 0x000F) == 0x0008)) &&
347  // =VB= Why 0xD900 signature word if only 0xD part is constant???
348  // (buf1[3]&0xFF00) == 0xD900 )
349  (buf1[3] & 0xF000) == 0xD000) {
350  if (fDCC_Header) {
351  // == Another DCC Header before encountering DCC Trailer!
352  fERROR[25] = true;
353  bERROR |= 0x2000000;
354  fERROR[0] = true;
355  bERROR |= 0x1;
356 #ifdef LOCAL_UNPACK
357  CERR << "\n\nDCC Header Occurrence ";
358  CERR << " ERROR 25 " << sERROR[25] << endl;
359 #endif
360  fDDU_Header = false;
361 
362  // go backward for 3 DDU words ( buf2, buf1, and buf0 )
363  buffer -= 12;
364  buf_1 = &(tmpbuf[0]); // Just for safety
365  buf0 = &(tmpbuf[4]); // Just for safety
366  buf1 = &(tmpbuf[8]); // Just for safety
367  buf2 = &(tmpbuf[12]); // Just for safety
368  bzero(tmpbuf, sizeof(uint16_t) * 16);
369  sync_stats();
370  return length + 12;
371  }
372 
373  fDCC_Header = true;
374  clear();
375  }
376  }
377  // == Check for Format Control Words, set proper flags, perform self-consistency checks
378 
379  // C-words anywhere besides DDU Header
380  if (fDDU_Header &&
381  ((buf0[0] & 0xF000) == 0xC000 || (buf0[1] & 0xF000) == 0xC000 || (buf0[2] & 0xF000) == 0xC000 ||
382  (buf0[3] & 0xF000) == 0xC000) &&
383  (/*buf_1[0]!=0x8000 ||*/ buf_1[1] != 0x8000 || buf_1[2] != 0x0001 || buf_1[3] != 0x8000)) {
384  fERROR[0] = true;
385  bERROR |= 0x1;
386  fERROR[20] = true;
387  bERROR |= 0x100000;
388  // fCHAMB_ERR[20].insert(currentChamber);
389  // bCHAMB_ERR[currentChamber] |= 0x100000;
390 #ifdef LOCAL_UNPACK
391  CERR << "\nDDU Header Occurrence = " << cntDDU_Headers;
392  CERR << " ERROR 20 " << sERROR[20] << endl;
393 #endif
394  }
395 
396  // == DDU Header found
397  if (/*buf0[0]==0x8000 &&*/ buf0[1] == 0x8000 && buf0[2] == 0x0001 && buf0[3] == 0x8000) {
398  // headerDAV_Active = (buf1[1]<<16) | buf1[0]; // Obsolete since 16.09.05
400  checkDAVs();
403 
404  if (fDDU_Header) {
405  // == Another DDU Header before encountering DDU Trailer!
406  fERROR[1] = true;
407  bERROR |= 0x2;
408  fERROR[0] = true;
409  bERROR |= 0x1;
410 #ifdef LOCAL_UNPACK
411  CERR << "\n\nDDU Header Occurrence = " << cntDDU_Headers;
412  CERR << " ERROR 1 " << sERROR[1] << endl;
413 #endif
414  fDDU_Header = false;
415 
416  // Part of work for chambers that hasn't been done in absent trailer
417  if (fDMB_Header || fDMB_Trailer) {
418  fERROR[5] = true;
419  bERROR |= 0x20;
420  // Since here there are no chances to know what this chamber was, force it to be -2
421  if (currentChamber == -1)
422  currentChamber = -2;
423  fCHAMB_ERR[5].insert(currentChamber);
424  bCHAMB_ERR[currentChamber] |= 0x20;
425  fCHAMB_ERR[0].insert(currentChamber);
426  bCHAMB_ERR[currentChamber] |= 0x1;
427 #ifdef LOCAL_UNPACK
428  CERR << "\n\nDDU Header Occurrence = " << cntDDU_Headers;
429  CERR << " ERROR 5 " << sERROR[5] << endl;
430 #endif
431  } // One of DMB Trailers is missing ( or both )
432  fDMB_Header = false;
433  fDMB_Trailer = false;
434 
435  if (DMB_Active != nDMBs) {
436  fERROR[24] = true;
437  bERROR |= 0x1000000;
438  }
439  DMB_Active = 0;
440  nDMBs = 0;
441 
442  // Unknown chamber denoted as -2
443  // If it still remains in any of errors - put it in error 0
444  for (int err = 1; err < nERRORS; ++err)
445  if (fCHAMB_ERR[err].find(-2) != fCHAMB_ERR[err].end()) {
446  fCHAMB_ERR[0].insert(-2);
447  bCHAMB_ERR[-2] |= 0x1;
448  }
449 
452 
453  // go backward for 3 DDU words ( buf2, buf1, and buf0 )
454  buffer -= 12;
455  buf_1 = &(tmpbuf[0]); // Just for safety
456  buf0 = &(tmpbuf[4]); // Just for safety
457  buf1 = &(tmpbuf[8]); // Just for safety
458  buf2 = &(tmpbuf[12]); // Just for safety
459  bzero(tmpbuf, sizeof(uint16_t) * 16);
460  sync_stats();
461  return length + 12;
462  }
463 
464  currentChamber = -1; // Unknown yet
465 
467  // == Counted extraneous words between last DDU Trailer and this DDU Header
468  fWARNING[0] = true;
469  bWARNING |= 0x1;
470 #ifdef LOCAL_UNPACK
471  CERR << "\nDDU Header Occurrence = " << cntDDU_Headers;
472  CERR << " WARNING 0 " << sWARNING[0] << " " << DDU_WordsSinceLastTrailer << " extra 64-bit words" << endl;
473 #endif
474  }
475 
476  sourceID = ((buf_1[1] & 0xF) << 8) | ((buf_1[0] & 0xFF00) >> 8);
477 
479  DDU_Firmware_Revision = (buf_1[0] >> 4) & 0xF;
480  if (DDU_Firmware_Revision > 6) {
481  fFormat2013 = true;
482  modeDDUonly = true; // =VB= Force to use DDU only mode (no DCC Data)
483  }
484 
485  fDDU_Header = true;
486  fDDU_Trailer = false;
487  DDU_WordCount = 0;
488  fDMB_Header = false;
489  fDMB_Trailer = false;
490  fALCT_Header = false;
491  fALCT_Format2007 = true;
492  fTMB_Header = false;
493  fTMB_Format2007 = true;
494  uniqueALCT = true;
495  uniqueTMB = true;
496  zeroCounts();
497 
498  if (modeDDUonly) {
499  fDCC_Header = true;
500  clear();
501  }
502 
505  dduSize[sourceID] = 0;
506  dmbBuffers[sourceID].clear();
507  dmbOffsets[sourceID].clear();
508  dmbSize[sourceID].clear();
509 
510  // Reset all Error and Warning flags to be false
511  bDDU_ERR[sourceID] = 0;
512  bDDU_WRN[sourceID] = 0;
513  bERROR = 0;
514  bWARNING = 0;
515  bzero(fERROR, sizeof(bool) * nERRORS);
516  bzero(fWARNING, sizeof(bool) * nWARNINGS);
517 
518  nDMBs = 0;
519  DMB_Active = buf1[0] & 0xF;
520  DAV_DMB = buf1[1] & 0x7FFF;
521 
522  int nDAV_DMBs = 0;
523  for (int bit = 0; bit < 15; bit++)
524  if (DAV_DMB & (1 << bit))
525  nDAV_DMBs++;
526  if (DMB_Active != nDAV_DMBs) {
527  fERROR[27] = true;
528  bERROR |= 0x8000000;
529  }
530 
531  if ((buf_1[3] & 0xF000) != 0x5000) {
532  fWARNING[1] = true;
533  bWARNING |= 0x2;
534 #ifdef LOCAL_UNPACK
535  CERR << "\nDDU Header Occurrence = " << cntDDU_Headers;
536  CERR << " WARNING 1 " << sWARNING[1] << ". What must have been Header 1: 0x" << std::hex << buf_1[0] << " 0x"
537  << buf_1[1] << " 0x" << buf_1[2] << " 0x" << buf_1[3] << std::dec << endl;
538 #endif
539  }
540 
541  ++cntDDU_Headers;
542  DDU_WordsSinceLastHeader = 0; // Reset counter of DDU Words since last DDU Header
543 #ifdef LOCAL_UNPACK
544  COUT << "\n----------------------------------------------------------" << endl;
545  COUT << "DDU Header Occurrence " << cntDDU_Headers
546  << " L1A = " << (((buf_1[2] & 0xFFFF) + ((buf_1[3] & 0x00FF) << 16))) << endl;
547 #endif
548  }
549 
550  // == DMB Header found
551  if ((buf0[0] & 0xF000) == 0xA000 && (buf0[1] & 0xF000) == 0xA000 && (buf0[2] & 0xF000) == 0xA000 &&
552  (buf0[3] & 0xF000) == 0xA000) {
554  checkDAVs();
557 
559  fERROR[28] = true;
560  bERROR |= 0x10000000;
561  ;
562  }
563 
564  if (fDMB_Header || fDMB_Trailer) // F or E DMB Trailer is missed
565  {
566  fERROR[5] = true;
567  bERROR |= 0x20;
568  fCHAMB_ERR[5].insert(currentChamber);
569  bCHAMB_ERR[currentChamber] |= 0x20;
570  fCHAMB_ERR[0].insert(currentChamber);
571  bCHAMB_ERR[currentChamber] |= 0x1;
572  }
573  fDMB_Header = true;
574  fDMB_Trailer = false;
575 
576  // If previous DMB record was not assigned to any chamber ( it still has -1 indentificator )
577  // let's free -1 identificator for current use and call undefined chamber from previous record -2
578  // ( -2 may already exists in this sets but we have nothing to do with it )
579  for (int err = 0; err < nERRORS; ++err)
580  if (fCHAMB_ERR[err].find(-1) != fCHAMB_ERR[err].end()) {
581  fCHAMB_ERR[err].erase(-1);
582  fCHAMB_ERR[err].insert(-2);
583  }
584  // Two lines below are commented out because payloads never get filled if 0xA header is missing
585  // bCHAMB_PAYLOAD[-2] |= bCHAMB_PAYLOAD[-1];
586  // fCHAMB_PAYLOAD[-1] = 0;
587  bCHAMB_STATUS[-2] |= bCHAMB_STATUS[-1];
588  bCHAMB_STATUS[-1] = 0;
589  bCHAMB_ERR[-2] |= bCHAMB_ERR[-1];
590  bCHAMB_ERR[-1] = 0;
591  bCHAMB_WRN[-2] |= bCHAMB_WRN[-1];
592  bCHAMB_WRN[-1] = 0;
593 
594  // Chamber id ( DMB_ID + (DMB_CRATE<<4) ) from header
595  currentChamber = buf0[1] & 0x0FFF;
597  bCHAMB_ERR[currentChamber] |= 0; //Victor's line
598 
599  fALCT_Header = false;
600  fALCT_Format2007 = true;
601  fTMB_Header = false;
602  fTMB_Format2007 = true;
603  uniqueALCT = true;
604  uniqueTMB = true;
605 
606  fTMB_MiniScope_Start = false;
607  fTMB_RPC_Start = false;
608  fTMB_GEM_Start = false;
609  fTMB_BlockedCFEBs_Start = false;
610 
611  fTMB_MiniScope = false;
612  fTMB_RPC = false;
613  fTMB_GEM = false;
614  fTMB_BlockedCFEBs = false;
615 
616  zeroCounts();
617  CFEB_CRC = 0;
618 
619  nDMBs++;
620 
624 
625 #ifdef LOCAL_UNPACK
626  // Print DMB_ID from DMB Header
627  COUT << "Crate=" << setw(3) << setfill('0') << ((buf0[1] >> 4) & 0x00FF) << " DMB=" << setw(2) << setfill('0')
628  << (buf0[1] & 0x000F) << " ";
629  // Print ALCT_DAV and TMB_DAV from DMB Header
630  //COUT<<setw(1)<<((buf0[0]&0x0020)>>5)<<" "<<((buf0[0]&0x0040)>>6)<<" ";
631  COUT << setw(1) << ((buf0[0] & 0x0200) >> 9) << " " << ((buf0[0] & 0x0800) >> 11)
632  << " "; //change of format 16.09.05
633  // Print CFEB_DAV from DMB Header
634  COUT << setw(1) << ((buf0[0] & 0x0010) >> 4) << ((buf0[0] & 0x0008) >> 3) << ((buf0[0] & 0x0004) >> 2)
635  << ((buf0[0] & 0x0002) >> 1) << (buf0[0] & 0x0001);
636  // Print DMB Header Tag
637  COUT << " {";
638 #endif
639 
640  if (fFormat2013)
641  {
642  // Set variables if we are waiting ALCT, TMB and CFEB records to be present in event
643  DAV_ALCT = (buf0[0] & 0x0800) >> 11;
644  DAV_TMB = (buf0[0] & 0x0400) >> 10;
645  DAV_CFEB = 0;
646  if (buf0[0] & 0x0001)
647  ++DAV_CFEB;
648  if (buf0[0] & 0x0002)
649  ++DAV_CFEB;
650  if (buf0[0] & 0x0004)
651  ++DAV_CFEB;
652  if (buf0[0] & 0x0008)
653  ++DAV_CFEB;
654  if (buf0[0] & 0x0010)
655  ++DAV_CFEB;
656  if (buf0[0] & 0x0020)
657  ++DAV_CFEB;
658  if (buf0[0] & 0x0040)
659  ++DAV_CFEB;
660  if (DAV_ALCT)
662  if (DAV_TMB)
664 
666  bCHAMB_PAYLOAD[currentChamber] |= (buf0[0] & 0x007f) << 7;
667  bCHAMB_PAYLOAD[currentChamber] |= (buf_1[2] & 0x001f);
668  bCHAMB_PAYLOAD[currentChamber] |= ((buf_1[2] >> 5) & 0x0003) << 14;
669  bCHAMB_STATUS[currentChamber] |= (buf0[0] & 0x0080) << 14;
670 
671  } else
672  {
673  // Set variables if we are waiting ALCT, TMB and CFEB records to be present in event
674  DAV_ALCT = (buf0[0] & 0x0200) >> 9;
675  DAV_TMB = (buf0[0] & 0x0800) >> 11;
676  DAV_CFEB = 0;
677  if (buf0[0] & 0x0001)
678  ++DAV_CFEB;
679  if (buf0[0] & 0x0002)
680  ++DAV_CFEB;
681  if (buf0[0] & 0x0004)
682  ++DAV_CFEB;
683  if (buf0[0] & 0x0008)
684  ++DAV_CFEB;
685  if (buf0[0] & 0x0010)
686  ++DAV_CFEB;
687  if (DAV_ALCT)
689  if (DAV_TMB)
691  bCHAMB_PAYLOAD[currentChamber] |= (buf0[0] & 0x001f) << 7;
692  bCHAMB_PAYLOAD[currentChamber] |= ((buf_1[2] >> 5) & 0x001f);
693  bCHAMB_STATUS[currentChamber] |= (buf0[0] & 0x0040) << 15;
694  }
695  }
696 
697  // New ALCT data format:
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)) {
702  fALCT_Header = true;
703  fALCT_Format2007 = true;
704  ALCT_CRC = 0;
707 
708  // Calculate expected number of ALCT words
709  ALCT_WordsExpected = 12; // header and trailer always exists
710 
711  // Aauxilary variables
712  // number of wire groups per layer:
713  int nWGs_per_layer = ((buf1[2] & 0x0007) + 1) * 16;
714  // words in the layer
715  nWG_round_up = int(nWGs_per_layer / 12) + (nWGs_per_layer % 3 ? 1 : 0);
716  // configuration present:
717  bool config_present = buf1[0] & 0x4000;
718  // lct overflow:
719  bool lct_overflow = buf1[0] & 0x2000;
720  // raw overflow:
721  bool raw_overflow = buf1[0] & 0x1000;
722  // l1a_window:
723  int lct_tbins = (buf1[3] & 0x01E0) >> 5;
724  // fifo_tbins:
725  int raw_tbins = (buf1[3] & 0x001F);
726 
728  ALCT_ZSE = (buf1[1] & 0x1000) >> 12;
729 
730  if (ALCT_ZSE) {
731  for (int g = 0; g < 4; g++) {
732  if (buf1[g] == 0x1000)
734  }
735  }
736 #ifdef LOCAL_UNPACK
737 // COUT << " Number of Wire Groups: " << nWG_round_up << std::endl;
739 // COUT << " raw_tbins: " << std::dec << raw_tbins << std::endl;
740 // COUT << " LCT Tbins: " << lct_tbins << std::endl;
741 #endif
742 
743  // Data block sizes:
744  // 3 words of Vertex ID register + 5 words of config. register bits:
745  int config_size = (config_present ? 3 + 5 : 0);
746  // collision mask register:
747  int colreg_size = (config_present ? nWGs_per_layer / 4 : 0);
748  // hot channel mask:
749  int hot_ch_size = (config_present ? nWG_round_up * 6 : 0);
750  // ALCT0,1 (best tracks):
751  int alct_0_1_size = (!lct_overflow ? 2 * lct_tbins : 0);
752  // raw hit dump size:
753  int raw_hit_dump_size = (!raw_overflow ? nWG_round_up * 6 * raw_tbins : 0);
754 
755 #ifdef LOCAL_UNPACK
756  // COUT << " Raw Hit Dump: " << std::dec << raw_hit_dump_size << std::endl;
757 #endif
758 
759  ALCT_WordsExpected += config_size + colreg_size + hot_ch_size + alct_0_1_size + raw_hit_dump_size;
760 
761 #ifdef LOCAL_UNPACK
762  COUT << " <A";
763 #endif
764 
765  } else {
766  // Old ALCT data format
767 
768  // == ALCT Header found right after DMB Header
769  // (check for all currently reserved/fixed bits in ALCT first 4 words)
770  // if( ( (buf0 [0]&0xF800)==0x6000 && (buf0 [1]&0xFF80)==0x0080 && (buf0 [2]&0xF000)==0x0000 && (buf0 [3]&0xc000)==0x0000 )
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)) {
775  fALCT_Header = true;
776  fALCT_Format2007 = false;
777  ALCT_CRC = 0;
779 
780  // Calculate expected number of ALCT words
781  if ((buf0[3] & 0x0003) == 0) {
782  ALCT_WordsExpected = 12; // Short Readout
783  }
784 
785  if ((buf0[1] & 0x0003) == 1) // Full Readout
786  {
787  ALCT_WordsExpected = ((buf0[1] & 0x007c) >> 2) *
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)) *
791  12 +
792  12;
793  }
794 #ifdef LOCAL_UNPACK
795  COUT << " <A";
796 #endif
797  }
798  }
799 #ifdef LOCAL_UNPACK
800  //COUT << " ALCT Word Expected: " << ALCT_WordsExpected << std::endl;
801 #endif
802 
803  if ((buf0[0] & 0xFFFF) == 0xDB0C) {
804  // =VB= Handles one of the OTMB corrupted data cases.
805  // Double TMB data block with 2nd TMB Header is found.
806  // Set missing TMB Trailer error.
807  if (fTMB_Header) {
808  fERROR[12] = true; // TMB Trailer is missing
809  bERROR |= 0x1000;
810  fCHAMB_ERR[12].insert(currentChamber);
811  bCHAMB_ERR[currentChamber] |= 0x1000;
812  }
813 
814  fTMB_Header = true;
815  fTMB_Format2007 = true;
816  TMB_CRC = 0;
818  TMB_WordsExpected = 0;
819 
820  // Calculate expected number of TMB words (whether RPC included will be known later)
821  if ((buf1[1] & 0x3000) == 0x3000) {
822  TMB_WordsExpected = 12; // Short Header Only
823  }
824  if ((buf1[1] & 0x3000) == 0x0000) {
825  TMB_WordsExpected = 48; // Long Header Only
826  }
827 
828 #ifdef LOCAL_UNPACK
829  COUT << " <T";
830 #endif
831  } else {
832  // == TMB Header found right after DMB Header or right after ALCT Trailer
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)
837  // should've been (buf_1[0]&0xF800)==0xD000 - see comments for sERROR[11]
838  )) {
839  //if( (buf_1[2]&0xFFFF)==0xDE0D && (buf_1[3]&0xFC00)!=0xD000 && summer2004 ) ???
840 
841  fTMB_Header = true;
842  fTMB_Format2007 = false;
843  TMB_CRC = 0;
845 
846  // Calculate expected number of TMB words (whether RPC included will be known later)
847  if ((buf0[1] & 0x3000) == 0x3000) {
848  TMB_WordsExpected = 8; // Short Header Only
849  }
850  if ((buf0[1] & 0x3000) == 0x0000) {
851  TMB_WordsExpected = 32; // Long Header Only
852  }
853 
854  if ((buf0[1] & 0x3000) == 0x1000) {
855  // Full Readout = 28 + (#Tbins * #CFEBs * 6)
856  TMB_Tbins = (buf0[1] & 0x001F);
857  TMB_WordsExpected = 28 + TMB_Tbins * ((buf1[0] & 0x00E0) >> 5) * 6;
858  }
859 #ifdef LOCAL_UNPACK
860  COUT << " <T";
861 #endif
862  }
863  }
864  // New TMB format => very long header Find Firmware revision
867  }
868 
869  // New TMB format => very long header
871  // Full Readout = 44 + (#Tbins * #CFEBs * 6)
872  TMB_Tbins = (buf0[3] & 0x00F8) >> 3;
873  TMB_WordsExpected = 44 + TMB_Tbins * (buf0[3] & 0x0007) * 6;
874  }
875 
876  // == ALCT Trailer found
877  if (
878  // New ALCT data format:
879  (buf0[0] == 0xDE0D && (buf0[1] & 0xF800) == 0xD000 && (buf0[2] & 0xF800) == 0xD000 &&
880  (buf0[3] & 0xF000) == 0xD000 && fALCT_Format2007) ||
881  // Old ALCT data format; last check is added to avoid confusion with new TMB header (may not be needed):
882  ((buf0[0] & 0x0800) == 0x0000 && (buf0[1] & 0xF800) == 0xD000 && (buf0[2] & 0xFFFF) == 0xDE0D &&
883  (buf0[3] & 0xF000) == 0xD000 && !fALCT_Format2007 && !(fTMB_Header && fTMB_Format2007))) {
884  // should've been (buf0[0]&0xF800)==0xD000 - see comments for sERROR[11]
885 
886  // Second ALCT -> Lost both previous DMB Trailer and current DMB Header
887  if (!uniqueALCT)
888  currentChamber = -1;
889  // Check if this ALCT record have to exist according to DMB Header
890  if (DAV_ALCT)
891  DAV_ALCT = false;
892  else
893  DAV_ALCT = true;
894 
895  if (!fALCT_Header) {
896  fERROR[8] = true;
897  bERROR |= 0x100;
898  fCHAMB_ERR[8].insert(currentChamber);
899  bCHAMB_ERR[currentChamber] |= 0x100;
900  fCHAMB_ERR[0].insert(currentChamber);
901  bCHAMB_ERR[currentChamber] |= 0x1;
902  } // ALCT Header is missing
903 
904  if (!fALCT_Format2007 && (buf0[0] & 0xF800) != 0xD000) {
905  fERROR[11] = true;
906  bERROR |= 0x800;
907  fCHAMB_ERR[11].insert(currentChamber);
908  bCHAMB_ERR[currentChamber] |= 0x800;
909  fCHAMB_ERR[0].insert(currentChamber);
910  bCHAMB_ERR[currentChamber] |= 0x1;
911  } // some bits in 1st D-Trailer are lost
912 
913 #ifdef LOCAL_UNPACK
914  /*
916  COUT << " ALCT Word Since Last Header: " << ALCT_WordsSinceLastHeader << std::endl;
917  COUT << " ALCT Word Expected: " << ALCT_WordsExpected << std::endl;
918  COUT << " ALCT Word Since Last Header Zero Supressed: " << ALCT_WordsSinceLastHeaderZeroSuppressed << std::endl;
919  */
920 #endif
921  if (checkCrcALCT) {
923  uint32_t crc = (fALCT_Format2007 ? buf0[1] : buf0[0]) & 0x7ff;
924  crc |= ((uint32_t)((fALCT_Format2007 ? buf0[2] : buf0[1]) & 0x7ff)) << 11;
925  if (ALCT_CRC != crc) {
926  fERROR[10] = true;
927  bERROR |= 0x400;
928  fCHAMB_ERR[10].insert(currentChamber);
929  bCHAMB_ERR[currentChamber] |= 0x400;
930  fCHAMB_ERR[0].insert(currentChamber);
931  bCHAMB_ERR[currentChamber] |= 0x1;
932  }
933  }
934 
935  fALCT_Header = false;
936  uniqueALCT = false;
937  CFEB_CRC = 0;
938  //ALCT_WordCount = (buf0[3]&0x03FF);
939  ALCT_WordCount = (buf0[3] & 0x07FF);
940  //ALCT_WordCount = (buf0[3]&0x0FFF);
942 #ifdef LOCAL_UNPACK
943  COUT << "A> ";
944 #endif
945  }
946 
947  // Calculation of CRC sum ( algorithm is written by Madorsky )
948  if (fALCT_Header && checkCrcALCT) {
949  for (uint16_t j = 0, w = 0; j < 4; ++j) {
951  w = buf0[j] & (fALCT_Format2007 ? 0xffff : 0x7fff);
952  for (uint32_t i = 15, t = 0, ncrc = 0; i < 16; i--) {
953  t = ((w >> i) & 1) ^ ((ALCT_CRC >> 21) & 1);
954  ncrc = (ALCT_CRC << 1) & 0x3ffffc;
955  ncrc |= (t ^ (ALCT_CRC & 1)) << 1;
956  ncrc |= t;
957  ALCT_CRC = ncrc;
958  }
959  }
960  }
961 
962  // == Find Correction for TMB_WordsExpected due to RPC raw hits,
963  // should it turn out to be the new RPC-aware format
964  if (fTMB_Header && ((buf0[2] & 0xFFFF) == 0x6E0B)) {
965  if (fTMB_Format2007) {
966  /* Checks for TMB2007 firmware revisions ranges to detect data format
967  ----------------
968  * rev. code <0x4000 - TMB/OTMB firmware with changed firmware revision format
969  * 4 bits [12:9] = Data Format Version for the unpacker (can include TMB vs. OTMB etc here)
970  * 4 bits [8:5] = Major Version (major features which breaks compatibility, requires changes to other board firmware)
971  * 5 bits [4:0] = Minor version (minor features, internal fixes, bug fixes, etc).
972  * ----------------
973  * rev.0x50c3 - first revision with changed format
974  * rev.0x42D5 - oldest known from 06/21/2007
975  * There is 4-bits year value rollover in revision number (0 in 2016)
976  */
977  if ((TMB_Firmware_Revision >= 0x50c3) || (TMB_Firmware_Revision < 0x42D5)) {
978  bool isGEMfirmware = false;
979  if ((TMB_Firmware_Revision < 0x4000) &&
980  (TMB_Firmware_Revision > 0x0)) { /* New TMB firmware revision format */
981  /* Data Format Version codes
982  * 0=TMB
983  * 1=OTMB standard
984  * 2=OTMB+CCLUT+HMT Run3 data format
985  * 3=OTMB+CCLUT+HMT+GEM Run3 data format
986  */
987  if (((TMB_Firmware_Revision >> 9) & 0x3) == 0x3)
988  isGEMfirmware = true;
989  }
990 
991  if (isGEMfirmware) {
992  uint16_t Enabled_GEMs = 0;
993  /* GEM output format, based on the number of enabled fibers, not yet implemented in the firmware */
994  /*
995  for (int i = 0; i < 4; i++)
996  Enabled_GEMs += (buf_1[0] >> i) & 0x1;
997  */
998  Enabled_GEMs = 4; // Currently always assume that all 4 fibers are enabled
999  // Number of enabled GEM Fibers * nTimebins
1000  TMB_WordsGEM = Enabled_GEMs * ((buf_1[0] >> 5) & 0x1F) * 4;
1001  TMB_WordsGEM += 2; // add header/trailer for block of GEM raw hits
1002  }
1003  // On/off * nRPCs * nTimebins * 2 words/RPC/bin
1004  TMB_WordsRPC = ((buf_1[0] & 0x0010) >> 4) * ((buf_1[0] & 0x000c) >> 2) * ((buf_1[0] >> 5) & 0x1F) * 2;
1005  } else // original TMB2007 data format (may not work since TMB_Tbins != RPC_Tbins)
1006  {
1007  TMB_WordsRPC = ((buf_1[0] & 0x0040) >> 6) * ((buf_1[0] & 0x0030) >> 4) * TMB_Tbins * 2;
1008  }
1009  } else // Old format 2006
1010  {
1011  TMB_WordsRPC = ((buf_1[2] & 0x0040) >> 6) * ((buf_1[2] & 0x0030) >> 4) * TMB_Tbins * 2;
1012  }
1013  TMB_WordsRPC += 2; // add header/trailer for block of RPC raw hits
1014  }
1015 
1016  // Check for RPC data
1017  if (fTMB_Header && (scanbuf(buf0, 4, 0x6B04) >= 0)) {
1018  fTMB_RPC_Start = true;
1019  }
1020 
1021  // Check for GEM data
1022  if (fTMB_Header && (scanbuf(buf0, 4, 0x6C04) >= 0)) {
1023  fTMB_GEM_Start = true;
1024  }
1025 
1026  // Check for Mini-Scope data
1027  if (fTMB_Header && (scanbuf(buf0, 4, 0x6B07) >= 0)) {
1028  fTMB_MiniScope_Start = true;
1029  }
1030 
1031  // Check for Blocked CFEBs data
1032  if (fTMB_Header && (scanbuf(buf0, 4, 0x6BCB) >= 0)) {
1033  fTMB_BlockedCFEBs_Start = true;
1034  }
1035 
1036  // Check for end of RPC data
1037  if (fTMB_Header && fTMB_RPC_Start && (scanbuf(buf0, 4, 0x6E04) >= 0)) {
1038  fTMB_RPC = true;
1039  }
1040 
1041  // Check for end of GEM data
1042  if (fTMB_Header && fTMB_GEM_Start && (scanbuf(buf0, 4, 0x6D04) >= 0)) {
1043  fTMB_GEM = true;
1044  }
1045 
1046  // Check for end of Mini-Scope data
1047  if (fTMB_Header && fTMB_MiniScope_Start && (scanbuf(buf0, 4, 0x6E07) >= 0)) {
1048  fTMB_MiniScope = true;
1049  }
1050 
1051  // Check for end of Blocked CFEBs data
1052  if (fTMB_Header && fTMB_BlockedCFEBs_Start && (scanbuf(buf0, 4, 0x6ECB) >= 0)) {
1053  fTMB_BlockedCFEBs = true;
1054  }
1055 
1056  // == TMB Trailer found
1057  if (
1058  // Old TMB data format; last condition in needed not to confuse if with new ALCT data header
1059  ((buf0[0] & 0xF000) == 0xD000 && (buf0[1] & 0xF000) == 0xD000 && (buf0[2] & 0xFFFF) == 0xDE0F &&
1060  (buf0[3] & 0xF000) == 0xD000 && !fTMB_Format2007 && !(fALCT_Header && fALCT_Format2007)) ||
1061  // New TMB data format
1062  (buf0[0] == 0xDE0F && (buf0[1] & 0xF000) == 0xD000 && (buf0[2] & 0xF000) == 0xD000 &&
1063  (buf0[3] & 0xF000) == 0xD000 && fTMB_Format2007)) {
1064  // Second TMB -> Lost both previous DMB Trailer and current DMB Header
1065  if (!uniqueTMB)
1066  currentChamber = -1;
1067  // Check if this TMB record have to exist according to DMB Header
1068  if (DAV_TMB)
1069  DAV_TMB = false;
1070  else
1071  DAV_TMB = true;
1072 
1073  if (!fTMB_Header) {
1074  fERROR[13] = true;
1075  bERROR |= 0x2000;
1076  fCHAMB_ERR[13].insert(currentChamber);
1077  bCHAMB_ERR[currentChamber] |= 0x2000;
1078  fCHAMB_ERR[0].insert(currentChamber);
1079  bCHAMB_ERR[currentChamber] |= 0x1;
1080  } // TMB Header is missing
1081 
1082  // Check calculated CRC sum against reported
1083  if (checkCrcTMB) {
1084  uint32_t crc = (fTMB_Format2007 ? buf0[1] & 0x7ff : buf0[0] & 0x7ff);
1085  crc |= ((uint32_t)((fTMB_Format2007 ? buf0[2] & 0x7ff : buf0[1] & 0x7ff))) << 11;
1086  if (TMB_CRC != crc) {
1087  fERROR[15] = true;
1088  bERROR |= 0x8000;
1089  fCHAMB_ERR[15].insert(currentChamber);
1090  bCHAMB_ERR[currentChamber] |= 0x8000;
1091  fCHAMB_ERR[0].insert(currentChamber);
1092  bCHAMB_ERR[currentChamber] |= 0x1;
1093  }
1094  }
1095 
1096  fTMB_Header = false;
1097  uniqueTMB = false;
1098  CFEB_CRC = 0;
1099  TMB_WordCount = (buf0[3] & 0x07FF);
1100 
1101  // == Correct TMB_WordsExpected
1102  // 1) for 2 optional 0x2AAA and 0x5555 Words in the Trailer
1103  // 2) for extra 4 frames in the new TMB trailer and
1104  // for RPC raw hit data, if present
1105  //
1106  // If the scope data was enabled in readout, scope data markers (0x6B05
1107  // and 0x6E05) appear before 0x6E0C, and the optional 0x2AAA and 0x5555
1108  // trailer words are suppressed. So far, we only have data with the
1109  // empty scope content, so more corrections will be needed once
1110  // non-empty scope data is available. -SV, 5 Nov 2008.
1111  //
1112  // If word count is not multiple of 4, add 2 optional words and
1113  // 4 trailer words.
1114 
1115  int pos = scanbuf(buf_1, 4, 0x6E0C);
1116  if (pos == 1) {
1117  TMB_WordsExpected += 6;
1118  }
1119  // If word count is multiple of 4, add 4 trailer words.
1120  else if (pos == 3) {
1121  TMB_WordsExpected += 4;
1122  }
1123 
1124  // Correct expected wordcount by RPC data size
1125  if (fTMB_RPC)
1127 
1128  // Correct expected wordcount by GEM data size
1129  if (fTMB_GEM)
1131 
1132  // Correct expected wordcount by MiniScope data size (22 words + 2 signature words)
1133  if (fTMB_MiniScope)
1134  TMB_WordsExpected += 24;
1135 
1136  // Correct expected wordcount by BlockedCFEBs data size (20 words + 2 signature words)
1137  if (fTMB_BlockedCFEBs)
1138  TMB_WordsExpected += 22;
1139 
1141 #ifdef LOCAL_UNPACK
1142  COUT << "T> ";
1143 #endif
1144  }
1145 
1146  if (fTMB_Header && checkCrcTMB) {
1147  for (uint16_t j = 0, w = 0; j < 4; ++j) {
1149  w = buf0[j] & (fTMB_Format2007 ? 0xffff : 0x7fff);
1150  for (uint32_t i = 15, t = 0, ncrc = 0; i < 16; i--) {
1151  t = ((w >> i) & 1) ^ ((TMB_CRC >> 21) & 1);
1152  ncrc = (TMB_CRC << 1) & 0x3ffffc;
1153  ncrc |= (t ^ (TMB_CRC & 1)) << 1;
1154  ncrc |= t;
1155  TMB_CRC = ncrc;
1156  }
1157  }
1158  }
1159 
1160  // == CFEB Sample Trailer found
1161 
1162  if (!fTMB_Header && ((buf0[1] & 0xF000) == 0x7000) && ((buf0[2] & 0xF000) == 0x7000) &&
1163  ((buf0[1] != 0x7FFF) || (buf0[2] != 0x7FFF)) &&
1164  (((buf0[3] & 0xFFFF) == 0x7FFF) || // old format
1165  ((buf0[3] & buf0[0]) == 0x0000 && (buf0[3] + buf0[0]) == 0x7FFF) // 2007 format
1166  )) {
1167 #ifdef LOCAL_UNPACK
1168  if ((CFEB_SampleCount % 8) == 0) {
1169  COUT << " <";
1170  }
1171  if (CFEB_SampleWordCount == 100) {
1172  COUT << "+";
1173  }
1174 #endif
1175  if (CFEB_SampleWordCount != 100) {
1176 #ifdef LOCAL_UNPACK
1177  COUT << "-";
1178 #endif
1179 
1180  fERROR[16] = true;
1181  bERROR |= 0x10000;
1182  fCHAMB_ERR[16].insert(currentChamber);
1183  bCHAMB_ERR[currentChamber] |= 0x10000;
1184  fCHAMB_ERR[0].insert(currentChamber);
1185  bCHAMB_ERR[currentChamber] |= 0x1;
1186  }
1187 
1188  ++CFEB_SampleCount;
1189 
1190  if ((CFEB_SampleCount % 8) == 0) {
1191 #ifdef LOCAL_UNPACK
1192  COUT << ">";
1193 #endif
1194  CFEB_BSampleCount = 0;
1195  // Count CFEBs
1196  DAV_CFEB--;
1197  }
1198 
1199  // Check calculated CRC sum against reported
1200  if (checkCrcCFEB && CFEB_CRC != buf0[0]) {
1201  fERROR[18] = true;
1202  bERROR |= 0x40000;
1203  fCHAMB_ERR[18].insert(currentChamber);
1204  bCHAMB_ERR[currentChamber] |= 0x40000;
1205  fCHAMB_ERR[0].insert(currentChamber);
1206  bCHAMB_ERR[currentChamber] |= 0x1;
1207  }
1208 
1209  CFEB_CRC = 0;
1211  }
1212 
1213  // == CFEB B-word found
1214  if (!fTMB_Header && (buf0[0] & 0xF000) == 0xB000 && (buf0[1] & 0xF000) == 0xB000 && (buf0[2] & 0xF000) == 0xB000 &&
1215  (buf0[3] & 0xF000) == 0xB000) {
1216  bCHAMB_STATUS[currentChamber] |= 0x400000;
1217 
1218 #ifdef LOCAL_UNPACK
1219  if ((CFEB_SampleCount % 8) == 0) {
1220  COUT << " <";
1221  }
1222  COUT << "B";
1223 #endif
1224 
1225  ++CFEB_SampleCount;
1227 
1228  if ((CFEB_SampleCount % 8) == 0) {
1229 #ifdef LOCAL_UNPACK
1230  COUT << ">";
1231 #endif
1232  CFEB_BSampleCount = 0;
1233  DAV_CFEB--;
1234  }
1235 
1237  }
1238 
1239  // == If it is neither ALCT record nor TMB - probably it is CFEB record and we try to count CRC sum.
1240  // It very few words of CFEB occasionaly will be misinterpreted as ALCT or TMB header the result
1241  // for the CRC sum will be wrong, but other errors of Trailers counting will appear as well
1243  for (int pos = 0; pos < 4; ++pos)
1244  CFEB_CRC = (buf0[pos] & 0x1fff) ^ ((buf0[pos] & 0x1fff) << 1) ^
1245  (((CFEB_CRC & 0x7ffc) >> 2) | ((0x0003 & CFEB_CRC) << 13)) ^ ((CFEB_CRC & 0x7ffc) >> 1);
1246 
1247  // == DMB F-Trailer found
1248  if ((buf0[0] & 0xF000) == 0xF000 && (buf0[1] & 0xF000) == 0xF000 && (buf0[2] & 0xF000) == 0xF000 &&
1249  (buf0[3] & 0xF000) == 0xF000) {
1250  if (!fDMB_Header) {
1251  currentChamber = buf0[3] & 0x0FFF;
1252  fERROR[6] = true;
1253  bERROR |= 0x40;
1254  fCHAMB_ERR[6].insert(currentChamber);
1255  bCHAMB_ERR[currentChamber] |= 0x40;
1256  nDMBs++;
1257  // Set variables if we are waiting ALCT, TMB and CFEB records to be present in event
1258  if (buf0[0] & 0x0400)
1259  bCHAMB_PAYLOAD[currentChamber] |= 0x20;
1260  if (buf0[0] & 0x0800)
1261  bCHAMB_PAYLOAD[currentChamber] |= 0x40;
1262  bCHAMB_PAYLOAD[currentChamber] |= (buf0[0] & 0x001f) << 7;
1263  bCHAMB_PAYLOAD[currentChamber] |= ((buf0[0] >> 5) & 0x1f);
1264 
1265  } // DMB Header is missing
1266  fDMB_Header = false;
1267  fDMB_Trailer = true;
1268  uniqueALCT = true;
1269  uniqueTMB = true;
1270 
1272 
1273  // Finally check if DAVs were correct
1274  checkDAVs();
1275 
1276  // If F-Trailer is lost then do necessary work here
1277  if ((buf1[0] & 0xF000) != 0xE000 || (buf1[1] & 0xF000) != 0xE000 || (buf1[2] & 0xF000) != 0xE000 ||
1278  (buf1[3] & 0xF000) != 0xE000) {
1279  for (int err = 1; err < nERRORS; ++err)
1281  fCHAMB_ERR[0].insert(currentChamber);
1282  bCHAMB_ERR[currentChamber] |= 0x1;
1283  }
1284  // Reset chamber id
1285  currentChamber = -1;
1286  /*
1287  for(int err=0; err<nERRORS; err++)
1288  if( fCHAMB_ERR[err].find(-1) != fCHAMB_ERR[err].end() )
1289  fCHAMB_ERR[err].erase(-1);
1290  bCHAMB_ERR[-1] = 0;
1291  bCHAMB_WRN[-1] = 0;
1292  */
1293  }
1294 #ifdef LOCAL_UNPACK
1295  // Print DMB F-Trailer marker
1296  COUT << " }";
1297 #endif
1298  }
1299 
1300  // == DMB E-Trailer found
1301  if ((buf0[0] & 0xF000) == 0xE000 && (buf0[1] & 0xF000) == 0xE000 && (buf0[2] & 0xF000) == 0xE000 &&
1302  (buf0[3] & 0xF000) == 0xE000) {
1303  if (!fDMB_Header && !fDMB_Trailer)
1304  nDMBs++; // both DMB Header and DMB F-Trailer were missing
1305 
1306  if (fFormat2013)
1307  {
1309  bCHAMB_STATUS[currentChamber] |= (buf0[0] & 0x0800) >> 11;
1310  bCHAMB_STATUS[currentChamber] |= (buf0[0] & 0x0400) >> 9;
1311  bCHAMB_STATUS[currentChamber] |= (buf0[0] & 0x0080) << 8;
1312 
1313  if (fDMB_Trailer) // F-Trailer exists
1314  {
1315  bCHAMB_STATUS[currentChamber] |= (buf_1[2] & 0x0E00) >> 7;
1316  bCHAMB_STATUS[currentChamber] |= (buf_1[3] & 0x0003) << 3;
1317  bCHAMB_STATUS[currentChamber] |= (buf_1[3] & 0x000C) << 21;
1318  bCHAMB_STATUS[currentChamber] |= (buf_1[3] & 0x0800) >> 4;
1319  bCHAMB_STATUS[currentChamber] |= (buf_1[2] & 0x0100);
1320  bCHAMB_STATUS[currentChamber] |= (buf_1[3] & 0x01f0) << 5;
1321  bCHAMB_STATUS[currentChamber] |= (buf_1[3] & 0x0600) << 16;
1322  bCHAMB_STATUS[currentChamber] |= (buf_1[0] & 0x0800) << 3;
1323  bCHAMB_STATUS[currentChamber] |= (buf_1[1] & 0x001f) << 16;
1324  bCHAMB_STATUS[currentChamber] |= (buf_1[1] & 0x0060) << 21;
1325  }
1326 
1327  } else {
1328  bCHAMB_STATUS[currentChamber] |= (buf0[0] & 0x0800) >> 11;
1329  bCHAMB_STATUS[currentChamber] |= (buf0[0] & 0x0400) >> 9;
1330  bCHAMB_STATUS[currentChamber] |= (buf0[0] & 0x03E0) >> 3;
1331 
1332  if (fDMB_Trailer) // F-Trailer exists
1333  {
1334  bCHAMB_STATUS[currentChamber] |= (buf_1[2] & 0x0002) << 6;
1335  bCHAMB_STATUS[currentChamber] |= (buf_1[2] & 0x0001) << 8;
1336  bCHAMB_STATUS[currentChamber] |= (buf_1[3] & 0x001f) << 9;
1337  bCHAMB_STATUS[currentChamber] |= (buf_1[3] & 0x0040) << 8;
1338  bCHAMB_STATUS[currentChamber] |= (buf_1[3] & 0x0020) << 10;
1339  bCHAMB_STATUS[currentChamber] |= (buf_1[3] & 0x0f80) << 9;
1340  }
1341  }
1342  fDMB_Header = false;
1343 
1344  // If chamber id is unknown it is time to find it out
1345  if (currentChamber == -1) {
1346  currentChamber = buf0[1] & 0x0FFF;
1347  for (int err = 0; err < nERRORS; ++err)
1348  if (fCHAMB_ERR[err].find(-1) != fCHAMB_ERR[err].end()) {
1349  fCHAMB_ERR[err].insert(currentChamber);
1350  fCHAMB_ERR[err].erase(-1);
1351  }
1353  bCHAMB_STATUS[-1] = 0;
1355  bCHAMB_ERR[-1] = 0;
1357  bCHAMB_WRN[-1] = 0;
1358  }
1359  ++cntCHAMB_Trailers[buf0[1] & 0x0FFF];
1360 
1361  dmbSize[sourceID][currentChamber] = buf0 - dmbBuffers[sourceID][currentChamber];
1362 
1363  // Lost DMB F-Trailer before
1364  if (!fDMB_Trailer) {
1365  fERROR[6] = true;
1366  bERROR |= 0x40;
1367  fCHAMB_ERR[6].insert(currentChamber);
1368  bCHAMB_ERR[currentChamber] |= 0x40;
1369  fCHAMB_ERR[0].insert(currentChamber);
1370  bCHAMB_ERR[currentChamber] |= 0x1;
1371  // Check if DAVs were correct here
1372  checkDAVs();
1373  }
1374  fDMB_Trailer = false;
1375 
1376 #ifdef LOCAL_UNPACK
1377  // Print DMB E-Trailer marker
1378  COUT << " DMB=" << (buf0[1] & 0x000F);
1379  COUT << "; " << ALCT_WordsSinceLastHeader << "-" << ALCT_WordCount << "-" << ALCT_WordsExpected << " "
1380  << TMB_WordsSinceLastHeader << "-" << TMB_WordCount << "-" << TMB_WordsExpected << endl;
1381 #endif
1382 
1384 
1385  //
1386  for (int err = 0; err < nERRORS; ++err)
1387  if (fCHAMB_ERR[err].find(-1) != fCHAMB_ERR[err].end()) {
1388  fCHAMB_ERR[err].erase(-1);
1389  fCHAMB_ERR[err].insert(-2);
1390  }
1391  bCHAMB_STATUS[-2] |= bCHAMB_STATUS[-1];
1392  bCHAMB_STATUS[-1] = 0;
1393  bCHAMB_ERR[-2] |= bCHAMB_ERR[-1];
1394  bCHAMB_ERR[-1] = 0;
1395  bCHAMB_WRN[-2] |= bCHAMB_WRN[-1];
1396  bCHAMB_WRN[-1] = 0;
1397 
1398  if (currentChamber != -1)
1399  for (int err = 1; err < nERRORS; ++err)
1401  fCHAMB_ERR[0].insert(currentChamber);
1402  bCHAMB_ERR[currentChamber] |= 0x1;
1403  }
1404 
1405  currentChamber = -1;
1406 #ifdef LOCAL_UNPACK
1407  /*
1408  // Print DMB E-Trailer marker
1409  COUT<<" DMB="<<(buf0[1]&0x000F);
1410  COUT << "; "
1411  << ALCT_WordsSinceLastHeader << "-"
1412  << ALCT_WordCount << "-"
1413  << ALCT_WordsExpected
1414  << " "
1415  << TMB_WordsSinceLastHeader << "-"
1416  << TMB_WordCount << "-"
1417  << TMB_WordsExpected
1418  << endl;
1419  */
1420 #endif
1421  }
1422 
1423  // == DDU Trailer found
1424  if (buf0[0] == 0x8000 && buf0[1] == 0x8000 && buf0[2] == 0xFFFF && buf0[3] == 0x8000) {
1426  checkDAVs();
1427 
1429 
1431 
1432  if (DDU_WordsSinceLastHeader > 3 && !nDMBs) {
1433  fERROR[28] = true;
1434  bERROR |= 0x10000000;
1435  ;
1436  }
1437 
1438  if (fDDU_Trailer) {
1439  fERROR[2] = true;
1440  bERROR |= 0x4;
1441  } // DDU Header is missing
1442  fDDU_Trailer = true;
1443  fDDU_Header = false;
1444 
1445  if (fDMB_Header || fDMB_Trailer) {
1446 #ifdef LOCAL_UNPACK
1447  COUT << " Ex-Err: DMB (Header, Trailer) " << std::endl;
1448 #endif
1449  fERROR[5] = true;
1450  bERROR |= 0x20;
1451  fCHAMB_ERR[5].insert(currentChamber);
1452  bCHAMB_ERR[currentChamber] |= 0x20;
1453  fCHAMB_ERR[0].insert(currentChamber);
1454  bCHAMB_ERR[currentChamber] |= 0x20;
1455  } // DMB Trailer is missing
1456  fDMB_Header = false;
1457  fDMB_Trailer = false;
1458 
1459  currentChamber = -1;
1460 
1461  for (int err = 0; err < nERRORS; ++err)
1462  if (fCHAMB_ERR[err].find(-1) != fCHAMB_ERR[err].end()) {
1463  fCHAMB_ERR[err].erase(-1);
1464  fCHAMB_ERR[err].insert(-2);
1465  }
1466  bCHAMB_STATUS[-2] |= bCHAMB_STATUS[-1];
1467  bCHAMB_STATUS[-1] = 0;
1468  bCHAMB_ERR[-2] |= bCHAMB_ERR[-1];
1469  bCHAMB_ERR[-1] = 0;
1470  bCHAMB_WRN[-2] |= bCHAMB_WRN[-1];
1471  bCHAMB_WRN[-1] = 0;
1472 
1473  for (int err = 1; err < nERRORS; ++err)
1474  if (fCHAMB_ERR[err].find(-2) != fCHAMB_ERR[err].end()) {
1475  fCHAMB_ERR[0].insert(-2);
1476  bCHAMB_ERR[-2] |= 0x1;
1477  }
1478 
1479  dduSize[sourceID] = buf0 - dduBuffers[sourceID];
1480 
1481  ++cntDDU_Trailers; // Increment DDUTrailer counter
1482 
1483  // == Combining 2 words into 24bit value
1484  DDU_WordCount = buf2[2] | ((buf2[3] & 0xFF) << 16);
1485 
1486  if ((DDU_WordsSinceLastHeader + 4) != DDU_WordCount) {
1487  fERROR[4] = true;
1488  bERROR |= 0x10;
1489  }
1490 
1491  if (DMB_Active != nDMBs) {
1492  fERROR[24] = true;
1493  bERROR |= 0x1000000;
1494  }
1495 
1496 #ifdef LOCAL_UNPACK
1497  COUT << "DDU Trailer Occurrence " << cntDDU_Trailers << endl;
1498  COUT << "----------------------------------------------------------" << endl;
1499  COUT << "DDU 64-bit words = Actual - DDUcounted =" << DDU_WordsSinceLastHeader + 4 << "-" << DDU_WordCount
1500  << endl;
1501 #endif
1502 
1503  // increment statistics Errors and Warnings (i=0 case is handled in DDU Header)
1504  for (int err = 1; err < nERRORS; ++err) {
1505  if (fERROR[err]) {
1506  fERROR[0] = true;
1507  bERROR |= 0x1;
1508 #ifdef LOCAL_UNPACK
1509  CERR << "\nDDU Header Occurrence = " << cntDDU_Headers;
1510  CERR << " ERROR " << err << " " << sERROR[err] << endl;
1511 #endif
1512  }
1513  }
1514 
1515 #ifdef LOCAL_UNPACK
1516  for (int wrn = 1; wrn < nWARNINGS; ++wrn) {
1517  if (fWARNING[wrn]) {
1518  COUT << "\nDDU Header Occurrence = " << cntDDU_Headers;
1519  COUT << " WARNING " << wrn << " " << sWARNING[wrn] << endl;
1520  }
1521  }
1522 #endif
1523 
1524  bDDU_ERR[sourceID] |= bERROR;
1526  sync_stats();
1527 
1530  if (modeDDUonly) {
1531  buffer += 4;
1532  buf_1 = &(tmpbuf[0]); // Just for safety
1533  buf0 = &(tmpbuf[4]); // Just for safety
1534  buf1 = &(tmpbuf[8]); // Just for safety
1535  buf2 = &(tmpbuf[12]); // Just for safety
1536  bzero(tmpbuf, sizeof(uint16_t) * 16);
1537  return length - 4;
1538  }
1539  }
1540 
1541  if (!modeDDUonly) {
1542  // DCC Trailer 1 && DCC Trailer 2
1543  // =VB= Added support for Sep. 2008 CMS DAQ DCC format
1544  // =VB= 04.18.09 Removed (buf2[0]&0x0003) == 0x3 check for old DCC format to satisfy older format of simulated data
1545  if ((buf1[3] & 0xFF00) == 0xEF00 &&
1546  (((buf2[3] & 0xFF00) == 0xAF00) || ((buf2[3] & 0xFF00) == 0xA000 && (buf2[0] & 0x0003) == 0x0))) {
1547  // =VB= Added check that there is no DCCHeader detected to set missing DCC Header error
1548  if (!fDCC_Header || fDCC_Trailer) {
1549  fERROR[26] = true;
1550  bERROR |= 0x4000000;
1551  fERROR[0] = true;
1552  bERROR |= 0x1;
1553  } // DCC Header is missing
1554  fDCC_Trailer = true;
1555  fDCC_Header = false;
1556 
1557  if (fDDU_Header) {
1558  // == DDU Trailer is missing
1559  fERROR[1] = true;
1560  bERROR |= 0x2;
1561  fERROR[0] = true;
1562  bERROR |= 0x1;
1563  }
1564 
1565  buffer += 4;
1566  buf_1 = &(tmpbuf[0]); // Just for safety
1567  buf0 = &(tmpbuf[4]); // Just for safety
1568  buf1 = &(tmpbuf[8]); // Just for safety
1569  buf2 = &(tmpbuf[12]); // Just for safety
1570  bzero(tmpbuf, sizeof(uint16_t) * 16);
1571  sync_stats();
1572  return length - 4;
1573  }
1574  }
1575 
1576  length -= 4;
1577  buffer += 4;
1578  }
1579  //Store the tail of the buffer
1580  buf_1 = &(tmpbuf[0]);
1581  buf0 = &(tmpbuf[4]);
1582  buf1 = &(tmpbuf[8]);
1583  buf2 = &(tmpbuf[12]);
1584  memcpy((void*)tmpbuf, (void*)(buffer - 16), sizeof(short) * 16);
1585 
1586  if (!modeDDUonly && !fDCC_Trailer && !fDCC_Header) {
1587  fERROR[26] = true;
1588  bERROR |= 0x4000000;
1589  fERROR[25] = true;
1590  bERROR |= 0x2000000;
1591  fERROR[0] = true;
1592  bERROR |= 0x1;
1593  sync_stats();
1594  return length;
1595  }
1596 
1597  return -2;
1598 }
uint32_t DDU_WordsSinceLastHeader
uint32_t TMB_WordCount
const uint16_t * buf0
const uint16_t * buffer_start
std::map< CSCIdType, ExaminerStatusType > bCHAMB_ERR
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
const double w
Definition: UKUtility.cc:23
std::map< DDUIdType, uint32_t > dduSize
const uint16_t * buf2
int scanbuf(const uint16_t *&buf, int32_t length, uint16_t sig, uint16_t mask=0xFFFF)
uint32_t ALCT_WordsSinceLastHeader
const uint16_t * buf1
uint32_t ALCT_WordCount
const uint16_t nERRORS
uint32_t TMB_WordsGEM
uint32_t DDU_WordsSinceLastTrailer
std::map< CSCIdType, ExaminerStatusType > bCHAMB_PAYLOAD
uint32_t cntDDU_Headers
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
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
Definition: Activities.doc:4
std::map< DDUIdType, const uint16_t * > dduBuffers
uint32_t TMB_Firmware_Revision
CSCIdType currentChamber
uint32_t nWG_round_up
check zero suppression mode
std::map< CSCIdType, uint32_t > cntCHAMB_Trailers
const uint16_t nWARNINGS
std::map< DDUIdType, std::map< CSCIdType, uint32_t > > dmbSize
uint32_t CFEB_SampleCount
std::map< CSCIdType, ExaminerStatusType > bCHAMB_WRN
uint32_t TMB_WordsRPC
uint32_t TMB_Tbins
uint32_t TMB_WordsExpected
#define COUT
const uint16_t * buf_2
const uint16_t * buf_1
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
uint16_t tmpbuf[16]
uint32_t DDU_Firmware_Revision
void checkTriggerHeadersAndTrailers()
std::vector< const char * > sWARNING
DDUIdType sourceID
uint32_t ALCT_WordsSinceLastHeaderZeroSuppressed
uint32_t DDU_WordCount
std::map< CSCIdType, ExaminerStatusType > bCHAMB_STATUS
string end
Definition: dataset.py:937
void checkDAVs()
checks DAV_ALCT, DAV_TMB, and DAV_CFEB
ExaminerStatusType bWARNING
std::map< DDUIdType, std::map< CSCIdType, const uint16_t * > > dmbBuffers
std::map< CSCIdType, uint32_t > cntCHAMB_Headers
uint32_t cntDDU_Trailers
void CSCDCCExaminer::checkDAVs ( )
private

checks DAV_ALCT, DAV_TMB, and DAV_CFEB

Definition at line 1642 of file CSCDCCExaminer.cc.

References bCHAMB_ERR, bERROR, currentChamber, DAV_ALCT, DAV_CFEB, DAV_TMB, fCHAMB_ERR, and fERROR.

Referenced by check().

1642  {
1643  if (DAV_ALCT) {
1644  fERROR[21] = true;
1645  bERROR |= 0x200000;
1646  fCHAMB_ERR[21].insert(currentChamber);
1647  bCHAMB_ERR[currentChamber] |= 0x200000;
1648  DAV_ALCT = false;
1649  }
1650  if (DAV_TMB) {
1651  fERROR[22] = true;
1652  bERROR |= 0x400000;
1653  fCHAMB_ERR[22].insert(currentChamber);
1654  bCHAMB_ERR[currentChamber] |= 0x400000;
1655  DAV_TMB = false;
1656  }
1657  if (DAV_CFEB && DAV_CFEB != -16) {
1658  fERROR[23] = true;
1659  bERROR |= 0x800000;
1660  fCHAMB_ERR[23].insert(currentChamber);
1661  bCHAMB_ERR[currentChamber] |= 0x800000;
1662  DAV_CFEB = 0;
1663  }
1664 }
std::map< CSCIdType, ExaminerStatusType > bCHAMB_ERR
std::set< CSCIdType > fCHAMB_ERR[29]
CSCIdType currentChamber
ExaminerStatusType bERROR
void CSCDCCExaminer::checkTriggerHeadersAndTrailers ( )
private

Definition at line 1666 of file CSCDCCExaminer.cc.

References ALCT_WordCount, ALCT_WordsExpected, ALCT_WordsSinceLastHeader, ALCT_WordsSinceLastHeaderZeroSuppressed, ALCT_ZSE, bCHAMB_ERR, bERROR, CFEB_SampleCount, currentChamber, fALCT_Header, fCHAMB_ERR, fERROR, fTMB_Header, TMB_WordCount, TMB_WordsExpected, and TMB_WordsSinceLastHeader.

Referenced by check().

1666  {
1667 #ifdef LOCAL_UNPACK
1668  /*
1669  COUT << " Ex-ALCT-Word-count " << std::endl;
1670  COUT << " ALCT Words Since Last Header: " << ALCT_WordsSinceLastHeader << std::endl;
1671  COUT << " ALCT Word Count: " << ALCT_WordCount << std::endl;
1672  COUT << " ALCT Words Expected: " << ALCT_WordsExpected << std::endl;
1673  */
1674 #endif
1675  if (!fALCT_Header &&
1677  ALCT_ZSE == 0) {
1678  fERROR[9] = true;
1679  bERROR |= 0x200;
1680  fCHAMB_ERR[9].insert(currentChamber);
1681  bCHAMB_ERR[currentChamber] |= 0x200;
1683  ALCT_WordCount = 0;
1685  ALCT_WordsExpected = 0;
1686  } // ALCT Word Count Error
1687 
1688  if (!fALCT_Header &&
1690  ALCT_ZSE != 0) {
1691  fERROR[9] = true;
1692  bERROR |= 0x200;
1693  fCHAMB_ERR[9].insert(currentChamber);
1694  bCHAMB_ERR[currentChamber] |= 0x200;
1697  ALCT_WordCount = 0;
1699  ALCT_WordsExpected = 0;
1700  } // ALCT Word Count Error With zero suppression
1701 
1703  fERROR[14] = true;
1704  bERROR |= 0x4000;
1705  fCHAMB_ERR[14].insert(currentChamber);
1706  bCHAMB_ERR[currentChamber] |= 0x4000;
1708  TMB_WordCount = 0;
1710  TMB_WordsExpected = 0;
1711  } // TMB Word Count Error
1712 
1713  if ((CFEB_SampleCount % 8) != 0) {
1714  fERROR[17] = true;
1715  bERROR |= 0x20000;
1716  fCHAMB_ERR[17].insert(currentChamber);
1717  bCHAMB_ERR[currentChamber] |= 0x20000;
1718  CFEB_SampleCount = 0;
1719  } // Number of CFEB samples != 8*n
1720 
1721  if (fALCT_Header) {
1722  fERROR[7] = true; // ALCT Trailer is missing
1723  bERROR |= 0x80;
1724  fCHAMB_ERR[7].insert(currentChamber);
1725  bCHAMB_ERR[currentChamber] |= 0x80;
1728  ALCT_WordsExpected = 0;
1729  fALCT_Header = false;
1730  }
1731 
1732  if (fTMB_Header) {
1733  fERROR[12] = true; // TMB Trailer is missing
1734  bERROR |= 0x1000;
1735  fCHAMB_ERR[12].insert(currentChamber);
1736  bCHAMB_ERR[currentChamber] |= 0x1000;
1738  TMB_WordsExpected = 0;
1739  fTMB_Header = false;
1740  }
1741 }
uint32_t TMB_WordCount
std::map< CSCIdType, ExaminerStatusType > bCHAMB_ERR
std::set< CSCIdType > fCHAMB_ERR[29]
uint32_t ALCT_WordsSinceLastHeader
uint32_t ALCT_WordCount
uint32_t ALCT_WordsExpected
CSCIdType currentChamber
uint32_t CFEB_SampleCount
uint32_t TMB_WordsExpected
uint32_t TMB_WordsSinceLastHeader
to decode if zero suppression enabled
ExaminerStatusType bERROR
uint32_t ALCT_WordsSinceLastHeaderZeroSuppressed
void CSCDCCExaminer::clear ( void  )
private

Definition at line 1600 of file CSCDCCExaminer.cc.

References bCHAMB_ERR, bCHAMB_PAYLOAD, bCHAMB_STATUS, bCHAMB_WRN, bDDU_ERR, bDDU_WRN, bERROR, bSUM_ERROR, bSUM_WARNING, bWARNING, dduBuffers, dduOffsets, dduSize, dmbBuffers, dmbOffsets, dmbSize, submitPVValidationJobs::err, fCHAMB_ERR, fCHAMB_WRN, fERROR, fSUM_ERROR, fSUM_WARNING, fWARNING, nERRORS, and nWARNINGS.

Referenced by check(), and CSCDCCExaminer().

1600  {
1601  bzero(fERROR, sizeof(bool) * nERRORS);
1602  bzero(fWARNING, sizeof(bool) * nWARNINGS);
1603  bzero(fSUM_ERROR, sizeof(bool) * nERRORS);
1604  bzero(fSUM_WARNING, sizeof(bool) * nWARNINGS);
1605  bERROR = 0;
1606  bWARNING = 0;
1607  bSUM_ERROR = 0;
1608  bSUM_WARNING = 0;
1609  for (int err = 0; err < nERRORS; ++err)
1610  fCHAMB_ERR[err].clear();
1611  for (int wrn = 0; wrn < nWARNINGS; ++wrn)
1612  fCHAMB_WRN[wrn].clear();
1613  bCHAMB_ERR.clear();
1614  bCHAMB_WRN.clear();
1615  bCHAMB_PAYLOAD.clear();
1616  bCHAMB_STATUS.clear();
1617  bDDU_ERR.clear();
1618  bDDU_WRN.clear();
1619  dduBuffers.clear();
1620  dduOffsets.clear();
1621  dmbBuffers.clear();
1622  dmbOffsets.clear();
1623  dduSize.clear();
1624  dmbSize.clear();
1625 }
std::map< CSCIdType, ExaminerStatusType > bCHAMB_ERR
std::map< DDUIdType, ExaminerStatusType > bDDU_ERR
std::map< DDUIdType, ExaminerStatusType > bDDU_WRN
std::set< CSCIdType > fCHAMB_ERR[29]
std::map< DDUIdType, uint32_t > dduOffsets
std::map< DDUIdType, uint32_t > dduSize
ExaminerStatusType bSUM_WARNING
const uint16_t nERRORS
std::map< CSCIdType, ExaminerStatusType > bCHAMB_PAYLOAD
std::map< DDUIdType, const uint16_t * > dduBuffers
const uint16_t nWARNINGS
std::map< DDUIdType, std::map< CSCIdType, uint32_t > > dmbSize
std::set< CSCIdType > fCHAMB_WRN[5]
bool fSUM_ERROR[29]
ExaminerStatusType bSUM_ERROR
std::map< CSCIdType, ExaminerStatusType > bCHAMB_WRN
std::map< DDUIdType, std::map< CSCIdType, uint32_t > > dmbOffsets
ExaminerStatusType bERROR
bool fSUM_WARNING[5]
std::map< CSCIdType, ExaminerStatusType > bCHAMB_STATUS
ExaminerStatusType bWARNING
std::map< DDUIdType, std::map< CSCIdType, const uint16_t * > > dmbBuffers
void CSCDCCExaminer::crcALCT ( bool  enable)

Definition at line 29 of file CSCDCCExaminer.cc.

References CreateSqliteForCondDB_cfg::enable.

Referenced by CSCOfflineMonitor::doBXMonitor(), CSCValidation::doTimeMonitoring(), and CSCDCCUnpacker::produce().

29  {
31  if (checkCrcALCT)
32  sERROR[10] = "ALCT CRC Error ";
33  else
34  sERROR[10] = "ALCT CRC Error ( disabled ) ";
35 }
std::vector< const char * > sERROR
void CSCDCCExaminer::crcCFEB ( bool  enable)

Definition at line 45 of file CSCDCCExaminer.cc.

References CreateSqliteForCondDB_cfg::enable.

Referenced by CSCOfflineMonitor::doBXMonitor(), CSCValidation::doTimeMonitoring(), and CSCDCCUnpacker::produce().

45  {
47  if (checkCrcCFEB)
48  sERROR[18] = "CFEB CRC Error ";
49  else
50  sERROR[18] = "CFEB CRC Error ( disabled ) ";
51 }
std::vector< const char * > sERROR
void CSCDCCExaminer::crcTMB ( bool  enable)

Definition at line 37 of file CSCDCCExaminer.cc.

References CreateSqliteForCondDB_cfg::enable.

Referenced by CSCOfflineMonitor::doBXMonitor(), CSCValidation::doTimeMonitoring(), and CSCDCCUnpacker::produce().

37  {
39  if (checkCrcTMB)
40  sERROR[15] = "TMB CRC Error ";
41  else
42  sERROR[15] = "TMB CRC Error ( disabled ) ";
43 }
std::vector< const char * > sERROR
std::map<DDUIdType, const uint16_t*> CSCDCCExaminer::DDU_block ( void  ) const
inline

Definition at line 317 of file CSCDCCExaminer.h.

References dduBuffers.

Referenced by CSCDDUEventData::unpack_data().

317 { return dduBuffers; }
std::map< DDUIdType, const uint16_t * > dduBuffers
std::map<DDUIdType, uint32_t> CSCDCCExaminer::DDU_ptrOffsets ( void  ) const
inline

Definition at line 320 of file CSCDCCExaminer.h.

References dduOffsets.

320 { return dduOffsets; }
std::map< DDUIdType, uint32_t > dduOffsets
std::map<DDUIdType, uint32_t> CSCDCCExaminer::DDU_size ( void  ) const
inline

Definition at line 323 of file CSCDCCExaminer.h.

References dduSize.

Referenced by CSCDDUEventData::unpack_data().

323 { return dduSize; }
std::map< DDUIdType, uint32_t > dduSize
DDUIdType CSCDCCExaminer::dduSourceID ( void  )
inline

Definition at line 315 of file CSCDCCExaminer.h.

References sourceID.

315 { return sourceID; }
DDUIdType sourceID
std::map<DDUIdType, std::map<CSCIdType, const uint16_t*> > CSCDCCExaminer::DMB_block ( void  ) const
inline

Definition at line 318 of file CSCDCCExaminer.h.

References dmbBuffers.

Referenced by CSCDDUEventData::unpack_data().

318 { return dmbBuffers; }
std::map< DDUIdType, std::map< CSCIdType, const uint16_t * > > dmbBuffers
std::map<DDUIdType, std::map<CSCIdType, uint32_t> > CSCDCCExaminer::DMB_ptrOffsets ( void  ) const
inline

Definition at line 321 of file CSCDCCExaminer.h.

References dmbOffsets.

321 { return dmbOffsets; }
std::map< DDUIdType, std::map< CSCIdType, uint32_t > > dmbOffsets
std::map<DDUIdType, std::map<CSCIdType, uint32_t> > CSCDCCExaminer::DMB_size ( void  ) const
inline

Definition at line 324 of file CSCDCCExaminer.h.

References dmbSize.

324 { return dmbSize; }
std::map< DDUIdType, std::map< CSCIdType, uint32_t > > dmbSize
const char* CSCDCCExaminer::errName ( int  num) const
inline

Definition at line 173 of file CSCDCCExaminer.h.

References nERRORS, pileupDistInMC::num, and sERROR.

Referenced by CSCDCCUnpacker::produce().

173  {
174  if (num >= 0 && num < nERRORS)
175  return sERROR[num];
176  else
177  return "";
178  }
const uint16_t nERRORS
std::vector< const char * > sERROR
bool CSCDCCExaminer::error ( int  num) const
inline

Definition at line 212 of file CSCDCCExaminer.h.

References fSUM_ERROR, nERRORS, and pileupDistInMC::num.

212  {
213  if (num >= 0 && num < nERRORS)
214  return fSUM_ERROR[num];
215  else
216  return false;
217  }
const uint16_t nERRORS
bool fSUM_ERROR[29]
const char* CSCDCCExaminer::errorName ( int  num) const
inline

Definition at line 186 of file CSCDCCExaminer.h.

References nERRORS, pileupDistInMC::num, and sERROR_.

186  {
187  if (num >= 0 && num < nERRORS)
188  return sERROR_[num];
189  else
190  return "";
191  }
const uint16_t nERRORS
std::vector< const char * > sERROR_
ExaminerStatusType CSCDCCExaminer::errors ( void  ) const
inline

Definition at line 170 of file CSCDCCExaminer.h.

References bSUM_ERROR.

Referenced by CSCOfflineMonitor::doBXMonitor(), CSCValidation::doTimeMonitoring(), and CSCDCCUnpacker::produce().

170 { return bSUM_ERROR; }
ExaminerStatusType bSUM_ERROR
std::map<CSCIdType, ExaminerStatusType> CSCDCCExaminer::errorsDetailed ( void  ) const
inline

Definition at line 302 of file CSCDCCExaminer.h.

References bCHAMB_ERR.

Referenced by CSCDCCUnpacker::produce().

302 { return bCHAMB_ERR; }
std::map< CSCIdType, ExaminerStatusType > bCHAMB_ERR
std::map<DDUIdType, ExaminerStatusType> CSCDCCExaminer::errorsDetailedDDU ( void  ) const
inline

Definition at line 300 of file CSCDCCExaminer.h.

References bDDU_ERR.

Referenced by CSCDCCUnpacker::produce().

300 { return bDDU_ERR; }
std::map< DDUIdType, ExaminerStatusType > bDDU_ERR
ExaminerStatusType CSCDCCExaminer::errorsForChamber ( CSCIdType  chamber) const
inline

Print (for debugging, to be removed)

Definition at line 254 of file CSCDCCExaminer.h.

References bCHAMB_ERR, and B2GTnPMonitor_cfi::item.

Referenced by cscdqm::EventProcessor::processCSC(), and CSCDDUEventData::unpack_data().

254  {
255  std::map<CSCIdType, ExaminerStatusType>::const_iterator item = bCHAMB_ERR.find(chamber);
257 
258  // for(item =bCHAMB_ERR.begin() ; item !=bCHAMB_ERR.end() ; item++)
259  //std::cout << " Ex-errors: " << std::hex << (*item).second << std::dec << std::endl;
260 
261  item = bCHAMB_ERR.find(chamber);
262  if (item != bCHAMB_ERR.end())
263  return item->second;
264  else
265  return 0;
266  }
std::map< CSCIdType, ExaminerStatusType > bCHAMB_ERR
ExaminerStatusType CSCDCCExaminer::errorsForDDU ( DDUIdType  dduSourceID) const
inline

Definition at line 276 of file CSCDCCExaminer.h.

References bDDU_ERR, and B2GTnPMonitor_cfi::item.

276  {
277  std::map<DDUIdType, ExaminerStatusType>::const_iterator item = bDDU_ERR.find(dduSourceID);
278  if (item != bDDU_ERR.end())
279  return item->second;
280  else
281  return 0;
282  }
std::map< DDUIdType, ExaminerStatusType > bDDU_ERR
DDUIdType dduSourceID(void)
ExaminerMaskType CSCDCCExaminer::getMask ( ) const
inline

Definition at line 168 of file CSCDCCExaminer.h.

References examinerMask.

Referenced by CSCDCCUnpacker::produce(), and CSCDDUEventData::unpack_data().

168 { return examinerMask; }
ExaminerMaskType examinerMask
bool CSCDCCExaminer::isDDUmode ( )
inline

Definition at line 313 of file CSCDCCExaminer.h.

References modeDDUonly.

313 { return modeDDUonly; };
std::vector<DDUIdType> CSCDCCExaminer::listOfDDUs ( void  ) const
inline

Definition at line 290 of file CSCDCCExaminer.h.

References bDDU_ERR, and B2GTnPMonitor_cfi::item.

290  {
291  std::vector<DDUIdType> DDUs;
292  std::map<DDUIdType, ExaminerStatusType>::const_iterator item = bDDU_ERR.begin();
293  while (item != bDDU_ERR.end()) {
294  DDUs.push_back(item->first);
295  item++;
296  }
297  return DDUs;
298  }
std::map< DDUIdType, ExaminerStatusType > bDDU_ERR
void CSCDCCExaminer::modeDDU ( bool  enable)

Definition at line 53 of file CSCDCCExaminer.cc.

References CreateSqliteForCondDB_cfg::enable.

Referenced by CSCDCCUnpacker::produce().

53  {
55  if (modeDDUonly) {
56  sERROR[25] = "DCC Trailer Missing ";
57  sERROR[26] = "DCC Header Missing ";
58  } else {
59  sERROR[25] = "DCC Trailer Missing (disabled) ";
60  sERROR[26] = "DCC Header Missing (disabled) ";
61  }
62 }
std::vector< const char * > sERROR
std::map<CSCIdType, ExaminerStatusType> CSCDCCExaminer::payloadDetailed ( void  ) const
inline

Definition at line 304 of file CSCDCCExaminer.h.

References bCHAMB_PAYLOAD.

Referenced by CSCDCCUnpacker::produce().

304 { return bCHAMB_PAYLOAD; }
std::map< CSCIdType, ExaminerStatusType > bCHAMB_PAYLOAD
ExaminerStatusType CSCDCCExaminer::payloadForChamber ( CSCIdType  chamber) const
inline

Definition at line 238 of file CSCDCCExaminer.h.

References bCHAMB_PAYLOAD, and B2GTnPMonitor_cfi::item.

238  {
239  std::map<CSCIdType, ExaminerStatusType>::const_iterator item = bCHAMB_PAYLOAD.find(chamber);
240  if (item != bCHAMB_PAYLOAD.end())
241  return item->second;
242  else
243  return 0;
244  }
std::map< CSCIdType, ExaminerStatusType > bCHAMB_PAYLOAD
const char* CSCDCCExaminer::payloadName ( int  num) const
inline

Definition at line 199 of file CSCDCCExaminer.h.

References nPAYLOADS, pileupDistInMC::num, and sDMBExpectedPayload.

199  {
200  if (num >= 0 && num < nPAYLOADS)
201  return sDMBExpectedPayload[num];
202  else
203  return "";
204  }
std::vector< const char * > sDMBExpectedPayload
const uint16_t nPAYLOADS
int CSCDCCExaminer::scanbuf ( const uint16_t *&  buf,
int32_t  length,
uint16_t  sig,
uint16_t  mask = 0xFFFF 
)
inlineprivate

Definition at line 1752 of file CSCDCCExaminer.cc.

References mps_fire::i.

Referenced by check().

1752  {
1753  for (int i = 0; i < length; i++) {
1754  if ((buffer[i] & mask) == sig) {
1755  return i;
1756  }
1757  }
1758  return -1;
1759 }
void CSCDCCExaminer::setMask ( ExaminerMaskType  mask)
inline

Definition at line 167 of file CSCDCCExaminer.h.

References examinerMask.

Referenced by CSCOfflineMonitor::doBXMonitor(), CSCValidation::doTimeMonitoring(), and CSCDCCUnpacker::produce().

167 { examinerMask = mask; }
ExaminerMaskType examinerMask
std::map<CSCIdType, ExaminerStatusType> CSCDCCExaminer::statusDetailed ( void  ) const
inline

Definition at line 305 of file CSCDCCExaminer.h.

References bCHAMB_STATUS.

Referenced by CSCDCCUnpacker::produce().

305 { return bCHAMB_STATUS; }
std::map< CSCIdType, ExaminerStatusType > bCHAMB_STATUS
ExaminerStatusType CSCDCCExaminer::statusForChamber ( CSCIdType  chamber) const
inline

Definition at line 246 of file CSCDCCExaminer.h.

References bCHAMB_STATUS, and B2GTnPMonitor_cfi::item.

246  {
247  std::map<CSCIdType, ExaminerStatusType>::const_iterator item = bCHAMB_STATUS.find(chamber);
248  if (item != bCHAMB_STATUS.end())
249  return item->second;
250  else
251  return 0;
252  }
std::map< CSCIdType, ExaminerStatusType > bCHAMB_STATUS
const char* CSCDCCExaminer::statusName ( int  num) const
inline

Definition at line 205 of file CSCDCCExaminer.h.

References nSTATUSES, pileupDistInMC::num, and sDMBEventStaus.

205  {
206  if (num >= 0 && num < nSTATUSES)
207  return sDMBEventStaus[num];
208  else
209  return "";
210  }
const uint16_t nSTATUSES
std::vector< const char * > sDMBEventStaus
void CSCDCCExaminer::sync_stats ( )
inlineprivate

Definition at line 1743 of file CSCDCCExaminer.cc.

References bERROR, bSUM_ERROR, bSUM_WARNING, bWARNING, submitPVValidationJobs::err, fERROR, fSUM_ERROR, fSUM_WARNING, fWARNING, nERRORS, and nWARNINGS.

Referenced by check().

1743  {
1744  for (int err = 0; err < nERRORS; ++err)
1745  fSUM_ERROR[err] |= fERROR[err];
1746  for (int wrn = 0; wrn < nWARNINGS; ++wrn)
1747  fSUM_WARNING[wrn] |= fWARNING[wrn];
1748  bSUM_ERROR |= bERROR;
1750 }
ExaminerStatusType bSUM_WARNING
const uint16_t nERRORS
const uint16_t nWARNINGS
bool fSUM_ERROR[29]
ExaminerStatusType bSUM_ERROR
ExaminerStatusType bERROR
bool fSUM_WARNING[5]
ExaminerStatusType bWARNING
bool CSCDCCExaminer::warning ( int  num) const
inline

Definition at line 218 of file CSCDCCExaminer.h.

References fSUM_WARNING, pileupDistInMC::num, and nWARNINGS.

218  {
219  if (num >= 0 && num < nWARNINGS)
220  return fSUM_WARNING[num];
221  else
222  return false;
223  }
const uint16_t nWARNINGS
bool fSUM_WARNING[5]
const char* CSCDCCExaminer::warningName ( int  num) const
inline

Definition at line 192 of file CSCDCCExaminer.h.

References pileupDistInMC::num, nWARNINGS, and sWARNING_.

192  {
193  if (num >= 0 && num < nWARNINGS)
194  return sWARNING_[num];
195  else
196  return "";
197  }
const uint16_t nWARNINGS
std::vector< const char * > sWARNING_
ExaminerStatusType CSCDCCExaminer::warnings ( void  ) const
inline

Definition at line 171 of file CSCDCCExaminer.h.

References bSUM_WARNING.

171 { return bSUM_WARNING; }
ExaminerStatusType bSUM_WARNING
std::map<CSCIdType, ExaminerStatusType> CSCDCCExaminer::warningsDetailed ( void  ) const
inline

Definition at line 303 of file CSCDCCExaminer.h.

References bCHAMB_WRN.

303 { return bCHAMB_WRN; }
std::map< CSCIdType, ExaminerStatusType > bCHAMB_WRN
ExaminerStatusType CSCDCCExaminer::warningsForChamber ( CSCIdType  chamber) const
inline

Definition at line 268 of file CSCDCCExaminer.h.

References bCHAMB_WRN, and B2GTnPMonitor_cfi::item.

268  {
269  std::map<CSCIdType, ExaminerStatusType>::const_iterator item = bCHAMB_WRN.find(chamber);
270  if (item != bCHAMB_WRN.end())
271  return item->second;
272  else
273  return 0;
274  }
std::map< CSCIdType, ExaminerStatusType > bCHAMB_WRN
ExaminerStatusType CSCDCCExaminer::warningsForDDU ( DDUIdType  dduSourceID) const
inline

Definition at line 283 of file CSCDCCExaminer.h.

References bDDU_WRN, and B2GTnPMonitor_cfi::item.

283  {
284  std::map<DDUIdType, ExaminerStatusType>::const_iterator item = bDDU_WRN.find(dduSourceID);
285  if (item != bDDU_WRN.end())
286  return item->second;
287  else
288  return 0;
289  }
std::map< DDUIdType, ExaminerStatusType > bDDU_WRN
DDUIdType dduSourceID(void)
const char* CSCDCCExaminer::wrnName ( int  num) const
inline

Definition at line 179 of file CSCDCCExaminer.h.

References pileupDistInMC::num, nWARNINGS, and sWARNING.

179  {
180  if (num >= 0 && num < nWARNINGS)
181  return sWARNING[num];
182  else
183  return "";
184  }
const uint16_t nWARNINGS
std::vector< const char * > sWARNING
void CSCDCCExaminer::zeroCounts ( )
private

Definition at line 1627 of file CSCDCCExaminer.cc.

References ALCT_WordCount, ALCT_WordsExpected, ALCT_WordsSinceLastHeader, ALCT_WordsSinceLastHeaderZeroSuppressed, ALCT_ZSE, CFEB_BSampleCount, CFEB_SampleCount, CFEB_SampleWordCount, TMB_Tbins, TMB_WordCount, TMB_WordsExpected, and TMB_WordsSinceLastHeader.

Referenced by check(), and CSCDCCExaminer().

1627  {
1630  ALCT_WordCount = 0;
1631  ALCT_WordsExpected = 0;
1632  ALCT_ZSE = 0;
1634  TMB_WordCount = 0;
1635  TMB_WordsExpected = 0;
1636  TMB_Tbins = 0;
1638  CFEB_SampleCount = 0;
1639  CFEB_BSampleCount = 0;
1640 }
uint32_t TMB_WordCount
uint32_t CFEB_SampleWordCount
uint32_t ALCT_WordsSinceLastHeader
uint32_t ALCT_WordCount
uint32_t ALCT_WordsExpected
uint32_t CFEB_SampleCount
uint32_t TMB_Tbins
uint32_t TMB_WordsExpected
uint32_t CFEB_BSampleCount
uint32_t TMB_WordsSinceLastHeader
to decode if zero suppression enabled
uint32_t ALCT_WordsSinceLastHeaderZeroSuppressed

Member Data Documentation

uint32_t CSCDCCExaminer::ALCT_CRC
private

Definition at line 138 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

uint32_t CSCDCCExaminer::ALCT_WordCount
private

Definition at line 119 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and zeroCounts().

uint32_t CSCDCCExaminer::ALCT_WordsExpected
private

Definition at line 120 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and zeroCounts().

uint32_t CSCDCCExaminer::ALCT_WordsSinceLastHeader
private

Definition at line 117 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and zeroCounts().

uint32_t CSCDCCExaminer::ALCT_WordsSinceLastHeaderZeroSuppressed
private

Definition at line 118 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and zeroCounts().

uint32_t CSCDCCExaminer::ALCT_ZSE
private
std::map<CSCIdType, ExaminerStatusType> CSCDCCExaminer::bCHAMB_ERR
private
std::map<CSCIdType, ExaminerStatusType> CSCDCCExaminer::bCHAMB_PAYLOAD
private

Definition at line 32 of file CSCDCCExaminer.h.

Referenced by check(), clear(), payloadDetailed(), and payloadForChamber().

std::map<CSCIdType, ExaminerStatusType> CSCDCCExaminer::bCHAMB_STATUS
private

Definition at line 33 of file CSCDCCExaminer.h.

Referenced by check(), clear(), statusDetailed(), and statusForChamber().

std::map<CSCIdType, ExaminerStatusType> CSCDCCExaminer::bCHAMB_WRN
private

Definition at line 31 of file CSCDCCExaminer.h.

Referenced by check(), clear(), warningsDetailed(), and warningsForChamber().

std::map<DDUIdType, ExaminerStatusType> CSCDCCExaminer::bDDU_ERR
private

Definition at line 34 of file CSCDCCExaminer.h.

Referenced by check(), clear(), errorsDetailedDDU(), errorsForDDU(), and listOfDDUs().

std::map<DDUIdType, ExaminerStatusType> CSCDCCExaminer::bDDU_WRN
private

Definition at line 35 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and warningsForDDU().

ExaminerStatusType CSCDCCExaminer::bERROR
private

Definition at line 21 of file CSCDCCExaminer.h.

Referenced by check(), checkDAVs(), checkTriggerHeadersAndTrailers(), clear(), and sync_stats().

ExaminerStatusType CSCDCCExaminer::bSUM_ERROR
private

Definition at line 22 of file CSCDCCExaminer.h.

Referenced by clear(), errors(), and sync_stats().

ExaminerStatusType CSCDCCExaminer::bSUM_WARNING
private

Definition at line 22 of file CSCDCCExaminer.h.

Referenced by clear(), sync_stats(), and warnings().

const uint16_t * CSCDCCExaminer::buf0
private

Definition at line 73 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

const uint16_t * CSCDCCExaminer::buf1
private

Definition at line 73 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

const uint16_t * CSCDCCExaminer::buf2
private

Definition at line 73 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

const uint16_t * CSCDCCExaminer::buf_1
private

Definition at line 73 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

const uint16_t* CSCDCCExaminer::buf_2
private

Definition at line 73 of file CSCDCCExaminer.h.

Referenced by check().

const uint16_t* CSCDCCExaminer::buffer_start
private

Definition at line 157 of file CSCDCCExaminer.h.

Referenced by check().

ExaminerStatusType CSCDCCExaminer::bWARNING
private

Definition at line 21 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and sync_stats().

uint32_t CSCDCCExaminer::CFEB_BSampleCount
private

Definition at line 135 of file CSCDCCExaminer.h.

Referenced by check(), and zeroCounts().

uint32_t CSCDCCExaminer::CFEB_CRC
private

Definition at line 142 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

uint32_t CSCDCCExaminer::CFEB_SampleCount
private

Definition at line 134 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and zeroCounts().

uint32_t CSCDCCExaminer::CFEB_SampleWordCount
private

Definition at line 133 of file CSCDCCExaminer.h.

Referenced by check(), and zeroCounts().

bool CSCDCCExaminer::checkCrcALCT
private

Definition at line 137 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

bool CSCDCCExaminer::checkCrcCFEB
private

Definition at line 141 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

bool CSCDCCExaminer::checkCrcTMB
private

Definition at line 139 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

std::map<CSCIdType, uint32_t> CSCDCCExaminer::cntCHAMB_Headers

Definition at line 99 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

std::map<CSCIdType, uint32_t> CSCDCCExaminer::cntCHAMB_Trailers

Definition at line 100 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

uint32_t CSCDCCExaminer::cntDDU_Headers

Definition at line 97 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

uint32_t CSCDCCExaminer::cntDDU_Trailers

Definition at line 98 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

CSCIdType CSCDCCExaminer::currentChamber
private

Definition at line 71 of file CSCDCCExaminer.h.

Referenced by check(), checkDAVs(), checkTriggerHeadersAndTrailers(), and CSCDCCExaminer().

bool CSCDCCExaminer::DAV_ALCT
private

Definition at line 90 of file CSCDCCExaminer.h.

Referenced by check(), checkDAVs(), and CSCDCCExaminer().

int CSCDCCExaminer::DAV_CFEB
private

Definition at line 92 of file CSCDCCExaminer.h.

Referenced by check(), checkDAVs(), and CSCDCCExaminer().

int CSCDCCExaminer::DAV_DMB
private

Definition at line 93 of file CSCDCCExaminer.h.

Referenced by check().

bool CSCDCCExaminer::DAV_TMB
private

Definition at line 91 of file CSCDCCExaminer.h.

Referenced by check(), checkDAVs(), and CSCDCCExaminer().

uint32_t CSCDCCExaminer::DDU_Firmware_Revision
private

Definition at line 131 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

uint32_t CSCDCCExaminer::DDU_WordCount
private

Definition at line 113 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

uint32_t CSCDCCExaminer::DDU_WordMismatch_Occurrences
private

Definition at line 114 of file CSCDCCExaminer.h.

Referenced by CSCDCCExaminer().

uint32_t CSCDCCExaminer::DDU_WordsSinceLastHeader
private

Definition at line 112 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

uint32_t CSCDCCExaminer::DDU_WordsSinceLastTrailer
private

Definition at line 115 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

std::map<DDUIdType, const uint16_t*> CSCDCCExaminer::dduBuffers
private

Definition at line 151 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and DDU_block().

std::map<DDUIdType, uint32_t> CSCDCCExaminer::dduOffsets
private

Definition at line 153 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and DDU_ptrOffsets().

std::map<DDUIdType, uint32_t> CSCDCCExaminer::dduSize
private

Definition at line 155 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and DDU_size().

int CSCDCCExaminer::DMB_Active
private

Definition at line 94 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

std::map<DDUIdType, std::map<CSCIdType, const uint16_t*> > CSCDCCExaminer::dmbBuffers
private

Definition at line 152 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and DMB_block().

std::map<DDUIdType, std::map<CSCIdType, uint32_t> > CSCDCCExaminer::dmbOffsets
private

Definition at line 154 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and DMB_ptrOffsets().

std::map<DDUIdType, std::map<CSCIdType, uint32_t> > CSCDCCExaminer::dmbSize
private

Definition at line 156 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and DMB_size().

ExaminerMaskType CSCDCCExaminer::examinerMask
private

Definition at line 146 of file CSCDCCExaminer.h.

Referenced by getMask(), and setMask().

bool CSCDCCExaminer::fALCT_Format2007
private

Definition at line 85 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

bool CSCDCCExaminer::fALCT_Header
private

Definition at line 82 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and CSCDCCExaminer().

std::set<CSCIdType> CSCDCCExaminer::fCHAMB_ERR[29]
private
std::set<CSCIdType> CSCDCCExaminer::fCHAMB_WRN[5]
private

Definition at line 29 of file CSCDCCExaminer.h.

Referenced by chambersWithWarning(), and clear().

bool CSCDCCExaminer::fDCC_Header
private

Definition at line 76 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

bool CSCDCCExaminer::fDCC_Trailer
private

Definition at line 77 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

bool CSCDCCExaminer::fDDU_Header
private

Definition at line 78 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

bool CSCDCCExaminer::fDDU_Trailer
private

Definition at line 79 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

bool CSCDCCExaminer::fDMB_Header
private

Definition at line 80 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

bool CSCDCCExaminer::fDMB_Trailer
private

Definition at line 81 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

bool CSCDCCExaminer::fERROR[29]
private

Definition at line 23 of file CSCDCCExaminer.h.

Referenced by check(), checkDAVs(), checkTriggerHeadersAndTrailers(), clear(), and sync_stats().

bool CSCDCCExaminer::fFormat2013
private

Definition at line 86 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

bool CSCDCCExaminer::fSUM_ERROR[29]
private

Definition at line 25 of file CSCDCCExaminer.h.

Referenced by clear(), error(), and sync_stats().

bool CSCDCCExaminer::fSUM_WARNING[5]
private

Definition at line 26 of file CSCDCCExaminer.h.

Referenced by clear(), sync_stats(), and warning().

bool CSCDCCExaminer::fTMB_Format2007
private

Definition at line 84 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

bool CSCDCCExaminer::fTMB_Header
private

Definition at line 83 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and CSCDCCExaminer().

bool CSCDCCExaminer::fWARNING[5]
private

Definition at line 24 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and sync_stats().

bool CSCDCCExaminer::modeDDUonly
private

Definition at line 144 of file CSCDCCExaminer.h.

Referenced by check(), CSCDCCExaminer(), and isDDUmode().

int CSCDCCExaminer::nDMBs
private

Definition at line 94 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

const uint16_t CSCDCCExaminer::nERRORS
const uint16_t CSCDCCExaminer::nPAYLOADS

Definition at line 17 of file CSCDCCExaminer.h.

Referenced by payloadName().

const uint16_t CSCDCCExaminer::nSTATUSES

Definition at line 17 of file CSCDCCExaminer.h.

Referenced by cscdqm::EventProcessor::processExaminer(), and statusName().

const uint16_t CSCDCCExaminer::nWARNINGS
uint32_t CSCDCCExaminer::nWG_round_up
private

check zero suppression mode

Definition at line 122 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

std::vector<const char*> CSCDCCExaminer::sDMBEventStaus
private

Definition at line 20 of file CSCDCCExaminer.h.

Referenced by CSCDCCExaminer(), and statusName().

std::vector<const char*> CSCDCCExaminer::sDMBExpectedPayload
private

Definition at line 20 of file CSCDCCExaminer.h.

Referenced by CSCDCCExaminer(), and payloadName().

std::vector<const char*> CSCDCCExaminer::sERROR
private

Definition at line 20 of file CSCDCCExaminer.h.

Referenced by check(), CSCDCCExaminer(), and errName().

std::vector<const char*> CSCDCCExaminer::sERROR_
private

Definition at line 20 of file CSCDCCExaminer.h.

Referenced by CSCDCCExaminer(), and errorName().

DDUIdType CSCDCCExaminer::sourceID
private

Definition at line 145 of file CSCDCCExaminer.h.

Referenced by check(), CSCDCCExaminer(), and dduSourceID().

std::vector<const char*> CSCDCCExaminer::sWARNING
private

Definition at line 20 of file CSCDCCExaminer.h.

Referenced by check(), CSCDCCExaminer(), and wrnName().

std::vector<const char*> CSCDCCExaminer::sWARNING_
private

Definition at line 20 of file CSCDCCExaminer.h.

Referenced by CSCDCCExaminer(), and warningName().

uint32_t CSCDCCExaminer::TMB_CRC
private

Definition at line 140 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

uint32_t CSCDCCExaminer::TMB_Firmware_Revision
private

Definition at line 130 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

uint32_t CSCDCCExaminer::TMB_Tbins
private

Definition at line 127 of file CSCDCCExaminer.h.

Referenced by check(), and zeroCounts().

uint32_t CSCDCCExaminer::TMB_WordCount
private

Definition at line 125 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and zeroCounts().

uint32_t CSCDCCExaminer::TMB_WordsExpected
private

Definition at line 126 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and zeroCounts().

uint32_t CSCDCCExaminer::TMB_WordsGEM
private

Definition at line 129 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

uint32_t CSCDCCExaminer::TMB_WordsRPC
private

Definition at line 128 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

uint32_t CSCDCCExaminer::TMB_WordsSinceLastHeader
private

to decode if zero suppression enabled

Definition at line 124 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and zeroCounts().

uint16_t CSCDCCExaminer::tmpbuf[16]
private

Definition at line 74 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

bool CSCDCCExaminer::uniqueALCT
private

Definition at line 88 of file CSCDCCExaminer.h.

Referenced by check().

bool CSCDCCExaminer::uniqueTMB
private

Definition at line 88 of file CSCDCCExaminer.h.

Referenced by check().