29 bool eventAccepted =
true;
34 if (
getEMUHisto(h::EMU_ALL_DDUS_FORMAT_ERRORS, mo)) {
37 for (std::set<DDUIdType>::const_iterator ddu_itr = DDUs.begin(); ddu_itr != DDUs.end(); ++ddu_itr) {
39 int dduID = (*ddu_itr)&0xFF;
41 for(
int i = 0;
i < 29;
i++) {
42 if ((errs >>
i) & 0x1 ) {
43 mo->
Fill(dduID,
i + 1);
55 unsigned long dccBinCheckMask = 0x06080016;
57 if ((binErrorStatus & dccBinCheckMask) > 0) {
58 eventAccepted =
false;
61 if (binErrorStatus != 0) {
72 int crateID = (chamberID >> 4) & 0xFF;
73 int dmbSlot = chamberID & 0xF;
75 if (crateID == 255) {
continue; }
92 mo->
Fill(crateID, dmbSlot);
95 unsigned int cscType = 0;
96 unsigned int cscPosition = 0;
97 if (!
getCSCFromMap(crateID, dmbSlot, cscType, cscPosition))
continue;
99 if (cscType && cscPosition &&
getEMUHisto(h::EMU_CSC_REPORTING, mo)) {
100 mo->
Fill(cscPosition, cscType);
105 int cfeb_dav = (payload >> 7) & 0x1F;
106 int cfeb_active = payload & 0x1F;
107 int alct_dav = (payload >> 5) & 0x1;
108 int tmb_dav = (payload >> 6) & 0x1;
109 int cfeb_dav_num = 0;
112 if (cscType && cscPosition &&
getEMUHisto(h::EMU_CSC_WO_ALCT, mo)) {
113 mo->
Fill(cscPosition, cscType);
116 mo->
Fill(crateID, dmbSlot);
121 if (cscType && cscPosition &&
getEMUHisto(h::EMU_CSC_WO_CLCT, mo)) {
122 mo->
Fill(cscPosition, cscType);
125 mo->
Fill(crateID, dmbSlot);
130 if (cscType && cscPosition &&
getEMUHisto(h::EMU_CSC_WO_CFEB, mo)) {
131 mo->
Fill(cscPosition, cscType);
134 mo->
Fill(crateID, dmbSlot);
139 for (
int i=0; i<5;i++) {
140 if ((cfeb_dav>>i) & 0x1)
cntCFEBs++;
153 if (
getCSCHisto(h::CSC_ACTUAL_DMB_CFEB_DAV_RATE, crateID, dmbSlot, mo)
154 &&
getCSCHisto(h::CSC_ACTUAL_DMB_CFEB_DAV_FREQUENCY, crateID, dmbSlot, mof)) {
155 if (
getCSCHisto(h::CSC_DMB_CFEB_DAV_UNPACKING_INEFFICIENCY, crateID, dmbSlot, mo1)
156 &&
getCSCHisto(h::CSC_DMB_CFEB_DAV, crateID, dmbSlot, mo2)) {
157 for (
int i=1; i<=5; i++) {
159 double unpacked_dav_num = mo2->GetBinContent(i);
161 mo1->SetBinContent(i,1, 100.*(1-unpacked_dav_num/actual_dav_num));
163 mo1->SetEntries((
int)DMBEvents);
166 for (
int i=0; i<5;i++) {
167 int cfeb_present = (cfeb_dav>>
i) & 0x1;
168 cfeb_dav_num += cfeb_present;
173 mof->
SetBinContent(i+1, ((
float)cfeb_entries/(
float)(DMBEvents)*100.0));
178 if (
getCSCHisto(h::CSC_ACTUAL_DMB_CFEB_DAV_MULTIPLICITY_RATE, crateID, dmbSlot, mo)
179 &&
getCSCHisto(h::CSC_ACTUAL_DMB_CFEB_DAV_MULTIPLICITY_FREQUENCY, crateID, dmbSlot, mof)) {
180 for (
unsigned short i = 1; i < 7; i++) {
182 mof->
SetBinContent(i, ((
float)cfeb_entries / (
float)(DMBEvents) * 100.0));
186 if (
getCSCHisto(h::CSC_DMB_CFEB_DAV_MULTIPLICITY_UNPACKING_INEFFICIENCY, crateID, dmbSlot, mo1)
187 &&
getCSCHisto(h::CSC_DMB_CFEB_DAV_MULTIPLICITY, crateID, dmbSlot, mo2)) {
188 for (
unsigned short i = 1; i < 7; i++) {
190 float unpacked_dav_num = mo2->GetBinContent(i);
192 mo1->SetBinContent(i, 1, 100. * (1-unpacked_dav_num/actual_dav_num));
194 mo1->SetEntries((
int)DMBEvents);
197 mo->
Fill(cfeb_dav_num);
200 if (
getCSCHisto(h::CSC_DMB_CFEB_ACTIVE_VS_DAV, crateID, dmbSlot, mo)) mo->
Fill(cfeb_dav, cfeb_active);
203 if (
getCSCHisto(h::CSC_ACTUAL_DMB_FEB_DAV_RATE, crateID, dmbSlot, mo)) {
204 if (
getCSCHisto(h::CSC_ACTUAL_DMB_FEB_DAV_FREQUENCY, crateID, dmbSlot, mo1)) {
205 for (
int i = 1; i < 4; i++) {
207 mo1->SetBinContent(i, ((
float)dav_num / (
float)(DMBEvents) * 100.0));
209 mo1->SetEntries((
int)DMBEvents);
211 if (
getCSCHisto(h::CSC_DMB_FEB_DAV_UNPACKING_INEFFICIENCY, crateID, dmbSlot, mof)
212 &&
getCSCHisto(h::CSC_DMB_FEB_DAV_RATE, crateID, dmbSlot, mo2)) {
213 for (
int i = 1; i < 4; i++) {
215 float unpacked_dav_num = mo2->GetBinContent(i);
217 mof->
SetBinContent(i,1, 100. * (1 - unpacked_dav_num / actual_dav_num));
237 float feb_combination_dav = -1.0;
239 if (
getCSCHisto(h::CSC_ACTUAL_DMB_FEB_COMBINATIONS_DAV_RATE, crateID, dmbSlot, mo)) {
240 if(alct_dav == 0 && tmb_dav == 0 && cfeb_dav == 0) feb_combination_dav = 0.0;
241 if(alct_dav > 0 && tmb_dav == 0 && cfeb_dav == 0) feb_combination_dav = 1.0;
242 if(alct_dav == 0 && tmb_dav > 0 && cfeb_dav == 0) feb_combination_dav = 2.0;
243 if(alct_dav == 0 && tmb_dav == 0 && cfeb_dav > 0) feb_combination_dav = 3.0;
244 if(alct_dav == 0 && tmb_dav > 0 && cfeb_dav > 0) feb_combination_dav = 4.0;
245 if(alct_dav > 0 && tmb_dav > 0 && cfeb_dav == 0) feb_combination_dav = 5.0;
246 if(alct_dav > 0 && tmb_dav == 0 && cfeb_dav > 0) feb_combination_dav = 6.0;
247 if(alct_dav > 0 && tmb_dav > 0 && cfeb_dav > 0) feb_combination_dav = 7.0;
250 if (
getCSCHisto(h::CSC_ACTUAL_DMB_FEB_COMBINATIONS_DAV_FREQUENCY, crateID, dmbSlot, mo1)) {
251 for (
int i = 1; i < 9; i++) {
253 mo1->SetBinContent(i, ((
float)feb_combination_dav_number / (
float)(DMBEvents) * 100.0));
255 mo1->SetEntries(DMBEvents);
257 if (
getCSCHisto(h::CSC_DMB_FEB_COMBINATIONS_DAV_UNPACKING_INEFFICIENCY, crateID, dmbSlot, mof)
258 &&
getCSCHisto(h::CSC_DMB_FEB_COMBINATIONS_DAV_RATE, crateID, dmbSlot, mo2)) {
259 for (
int i = 1; i < 9; i++) {
261 float unpacked_dav_num = mo2->GetBinContent(i);
263 mof->
SetBinContent(i, 1, 100. * (1 - unpacked_dav_num / actual_dav_num));
271 mo->
Fill(feb_combination_dav);
284 unsigned int crateID = (chamberID >> 4) & 0xFF;
285 unsigned int dmbSlot = chamberID & 0xF;
288 if (crateID == 255) {
continue; }
298 unsigned int cscType = 0;
299 unsigned int cscPosition = 0;
300 if (!
getCSCFromMap(crateID, dmbSlot, cscType, cscPosition))
continue;
302 if (
getCSCHisto(h::CSC_BINCHECK_DATAFLOW_PROBLEMS_TABLE, crateID, dmbSlot, mo)) {
303 for (
int bit = 0; bit < binChecker.
nSTATUSES; bit++) {
304 if (chStatus & (1<<bit) ) {
312 int anyInputFull = chStatus & 0x3F;
314 if (cscType && cscPosition &&
getEMUHisto(h::EMU_CSC_DMB_INPUT_FIFO_FULL, mo)) {
315 mo->
Fill(cscPosition, cscType);
318 mo->
Fill(crateID, dmbSlot);
322 int anyInputTO = (chStatus >> 7) & 0x3FFF;
324 if (cscType && cscPosition &&
getEMUHisto(h::EMU_CSC_DMB_INPUT_TIMEOUT, mo)) {
325 mo->
Fill(cscPosition, cscType);
328 mo->
Fill(crateID, dmbSlot);
334 mo->
Fill(crateID, dmbSlot);
337 if (cscType && cscPosition &&
getEMUHisto(h::EMU_CSC_FORMAT_WARNINGS, mo)) {
338 mo->
Fill(cscPosition, cscType);
353 const unsigned int crateID = (chamberID >> 4) & 0xFF;
354 const unsigned int dmbSlot = chamberID & 0xF;
357 if ((crateID ==255) || (chErr & 0x80)) {
continue; }
359 if (crateID > 60 || dmbSlot > 10) {
continue; }
369 if ((chErr &
config->getBINCHECK_MASK()) != 0) {
373 bool isCSCError =
false;
374 bool fillBC =
getCSCHisto(h::CSC_BINCHECK_ERRORSTAT_TABLE, crateID, dmbSlot, mo);
376 for (
int bit = 5; bit < 24; bit++) {
378 if (chErr & (1 << bit) ) {
381 mo->
Fill(0., bit - 5);
396 mo->
Fill(crateID, dmbSlot);
399 if (eventAccepted &&
getEMUHisto(h::EMU_DMB_UNPACKED_WITH_ERRORS, mo)) {
400 mo->
Fill(crateID, dmbSlot);
403 unsigned int cscType = 0;
404 unsigned int cscPosition = 0;
405 if (!
getCSCFromMap(crateID, dmbSlot, cscType, cscPosition))
continue;
407 if ( cscType && cscPosition &&
getEMUHisto(h::EMU_CSC_FORMAT_ERRORS, mo)) {
408 mo->
Fill(cscPosition, cscType);
411 if (eventAccepted && cscType && cscPosition &&
getEMUHisto(h::EMU_CSC_UNPACKED_WITH_ERRORS, mo)) {
412 mo->
Fill(cscPosition, cscType);
419 return eventAccepted;
const bool getCSCFromMap(const unsigned int &crateId, const unsigned int &dmbId, unsigned int &cscType, unsigned int &cscPosition) const
Get CSC type and position from crate and dmb identifiers.
uint32_t cntCFEBs
Total Number of DMBs per event from DDU Header DAV.
void incChamberCounter(const ChamberCounterType counter, const HwId crateId, const HwId dmbId)
Increment Chamber counter by 1.
virtual void SetEntries(const double value)=0
virtual void Fill(float x)=0
Monitoring Object interface used to cover Root object and provide common interface to EventProcessor ...
const bool getCSCHisto(const HistoId &histo, const HwId &crateID, const HwId &dmbSlot, MonitorObject *&me)
Get CSC (Chamber) Level Monitoring Object.
uint32_t cntTMBs
Total Number of ALCTs per event from DMB DAV.
uint32_t cntALCTs
Total Number of CFEBs per event from DMB DAV.
virtual void SetBinContent(const int binX, const double value)=0
boost::function< bool(const unsigned int, const unsigned int, CSCDetId &) > fnGetCSCDetId
CSCDetId chamberID(const CSCDetId &cscDetId)
takes layer ID, converts to chamber ID, switching ME1A to ME11
bool processExaminer(const CSCDCCExaminer &binChecker)
const uint32_t getChamberCounterValue(const ChamberCounterType counter, const HwId crateId, const HwId dmbId) const
Get Chamber counter value.
void copyChamberCounterValue(const ChamberCounterType counter_from, const ChamberCounterType counter_to, const HwId crateId, const HwId dmbId)
Copy Chamber counter value from one counter to another.
virtual double GetBinContent(const int binX)=0
virtual void SetMaximum(const double d)=0
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.