CMS 3D CMS Logo

GEMDAQStatusSource.cc
Go to the documentation of this file.
2 
3 using namespace std;
4 using namespace edm;
5 
8  tagVFAT_ = consumes<GEMVFATStatusCollection>(cfg.getParameter<edm::InputTag>("VFATInputLabel"));
9  tagOH_ = consumes<GEMOHStatusCollection>(cfg.getParameter<edm::InputTag>("OHInputLabel"));
10  tagAMC_ = consumes<GEMAMCStatusCollection>(cfg.getParameter<edm::InputTag>("AMCInputLabel"));
11  tagAMC13_ = consumes<GEMAMC13StatusCollection>(cfg.getParameter<edm::InputTag>("AMC13InputLabel"));
12 
13  nAMCSlots_ = cfg.getParameter<Int_t>("AMCSlots");
14 
15  bWarnedNotFound_ = false;
16 }
17 
20  desc.add<edm::InputTag>("VFATInputLabel", edm::InputTag("muonGEMDigis", "VFATStatus"));
21  desc.add<edm::InputTag>("OHInputLabel", edm::InputTag("muonGEMDigis", "OHStatus"));
22  desc.add<edm::InputTag>("AMCInputLabel", edm::InputTag("muonGEMDigis", "AMCStatus"));
23  desc.add<edm::InputTag>("AMC13InputLabel", edm::InputTag("muonGEMDigis", "AMC13Status"));
24 
25  desc.add<Int_t>("AMCSlots", 13);
26  desc.addUntracked<std::string>("runType", "relval");
27  desc.addUntracked<std::string>("logCategory", "GEMDAQStatusSource");
28 
29  descriptions.add("GEMDAQStatusSource", desc);
30 }
31 
33  //if (useDBEMap_)
34  if (true) {
35  const auto &chMap = iSetup.getData(gemChMapToken_);
36  auto gemChMap = std::make_unique<GEMChMap>(chMap);
37 
38  std::vector<unsigned int> listFEDId;
39  for (auto const &[ec, dc] : gemChMap->chamberMap()) {
40  unsigned int fedId = ec.fedId;
41  uint8_t amcNum = ec.amcNum;
42  GEMDetId gemChId(dc.detId);
43 
44  if (mapFEDIdToRe_.find(fedId) == mapFEDIdToRe_.end()) {
45  listFEDId.push_back(fedId);
46  }
47  mapFEDIdToRe_[fedId] = gemChId.region();
48  mapFEDIdToSt_[fedId] = gemChId.station();
49  mapAMC13ToListChamber_[fedId].push_back(gemChId);
50  mapAMCToListChamber_[{fedId, amcNum}].push_back(gemChId);
51  }
52 
53  Int_t nIdx = 1;
54  for (auto fedId : listFEDId) {
55  mapFEDIdToPosition_[fedId] = nIdx++;
56  }
57 
58  } else {
59  // no EMap in DB, using dummy
60  auto gemChMap = std::make_unique<GEMChMap>();
61  gemChMap->setDummy();
62 
63  for (auto const &[ec, dc] : gemChMap->chamberMap()) {
64  unsigned int fedId = ec.fedId;
65  uint8_t amcNum = ec.amcNum;
66  GEMDetId gemChId(dc.detId);
67 
68  mapFEDIdToRe_[fedId] = gemChId.region();
69  mapAMC13ToListChamber_[fedId].push_back(gemChId);
70  mapAMCToListChamber_[{fedId, amcNum}].push_back(gemChId);
71  }
72  }
73 }
74 
76  if (h2Status == nullptr) {
77  return;
78  }
79 
80  unsigned int unBinPos = 1;
81  h2Status->setBinLabel(unBinPos++, "Good", 2);
82  h2Status->setBinLabel(unBinPos++, "Invalid AMC", 2);
83  h2Status->setBinLabel(unBinPos++, "Invalid size", 2);
84  h2Status->setBinLabel(unBinPos++, "Fail trailer check", 2);
85  h2Status->setBinLabel(unBinPos++, "Fail fragment length", 2);
86  h2Status->setBinLabel(unBinPos++, "Fail trailer match", 2);
87  h2Status->setBinLabel(unBinPos++, "More trailer", 2);
88  h2Status->setBinLabel(unBinPos++, "CRC modified", 2);
89  h2Status->setBinLabel(unBinPos++, "S-link error", 2);
90  h2Status->setBinLabel(unBinPos++, "Wrong FED ID", 2);
91 
92  for (auto const &[fedId, nPos] : mapFEDIdToPosition_) {
93  auto st = mapFEDIdToSt_[fedId];
94  auto re = (mapFEDIdToRe_[fedId] > 0 ? 'P' : 'M');
95  h2Status->setBinLabel(nPos, Form("GE%i1-%c", st, re), 1);
96  }
97 }
98 
100  if (h2Status == nullptr) {
101  return;
102  }
103 
104  unsigned int unBinPos = 1;
105  h2Status->setBinLabel(unBinPos++, "Good", 2);
106  h2Status->setBinLabel(unBinPos++, "Invalid OH", 2);
107  h2Status->setBinLabel(unBinPos++, "Back pressure", 2);
108  h2Status->setBinLabel(unBinPos++, "Bad EC", 2);
109  h2Status->setBinLabel(unBinPos++, "Bad BC", 2);
110  h2Status->setBinLabel(unBinPos++, "Bad OC", 2);
111  h2Status->setBinLabel(unBinPos++, "Bad run type", 2);
112  h2Status->setBinLabel(unBinPos++, "Bad CRC", 2);
113  h2Status->setBinLabel(unBinPos++, "MMCM locked", 2);
114  h2Status->setBinLabel(unBinPos++, "DAQ clock locked", 2);
115  h2Status->setBinLabel(unBinPos++, "DAQ not ready", 2);
116  h2Status->setBinLabel(unBinPos++, "BC0 not locked", 2);
117 }
118 
120  if (h2Status == nullptr) {
121  return;
122  }
123 
124  unsigned int unBinPos = 1;
125  h2Status->setBinLabel(unBinPos++, "Good", 2);
126  h2Status->setBinLabel(unBinPos++, "Event FIFO near full", 2);
127  h2Status->setBinLabel(unBinPos++, "Input FIFO near full", 2);
128  h2Status->setBinLabel(unBinPos++, "L1A FIFO near full", 2);
129  h2Status->setBinLabel(unBinPos++, "Event size warn", 2);
130  h2Status->setBinLabel(unBinPos++, "Invalid VFAT", 2);
131  h2Status->setBinLabel(unBinPos++, "Event FIFO full", 2);
132  h2Status->setBinLabel(unBinPos++, "Input FIFO full", 2);
133  h2Status->setBinLabel(unBinPos++, "L1A FIFO full", 2);
134  h2Status->setBinLabel(unBinPos++, "Event size overflow", 2);
135  h2Status->setBinLabel(unBinPos++, "Invalid event", 2);
136  h2Status->setBinLabel(unBinPos++, "Out of Sync AMC vs VFAT", 2);
137  h2Status->setBinLabel(unBinPos++, "Out of Sync VFAT vs VFAT", 2);
138  h2Status->setBinLabel(unBinPos++, "BX mismatch AMC vs VFAT", 2);
139  h2Status->setBinLabel(unBinPos++, "BX mismatch VFAT vs VFAT", 2);
140  h2Status->setBinLabel(unBinPos++, "Input FIFO underflow", 2);
141  h2Status->setBinLabel(unBinPos++, "Bad VFAT count", 2);
142 }
143 
145  if (h2Status == nullptr) {
146  return;
147  }
148 
149  unsigned int unBinPos = 1;
150  h2Status->setBinLabel(unBinPos++, "Good", 2);
151  h2Status->setBinLabel(unBinPos++, "Basic overflow", 2);
152  h2Status->setBinLabel(unBinPos++, "Zero-sup overflow", 2);
153  h2Status->setBinLabel(unBinPos++, "VFAT CRC error", 2);
154  h2Status->setBinLabel(unBinPos++, "Invalid header", 2);
155  h2Status->setBinLabel(unBinPos++, "AMC EC mismatch", 2);
156  h2Status->setBinLabel(unBinPos++, "AMC BC mismatch", 2);
157 }
158 
160  LoadROMap(iSetup);
161  if (mapAMC13ToListChamber_.empty() || mapAMCToListChamber_.empty())
162  return;
163  initGeometry(iSetup);
164  if (GEMGeometry_ == nullptr)
165  return;
166  loadChambers();
167 
168  strFolderMain_ = "GEM/DAQStatus";
169 
170  nBXMin_ = -10;
171  nBXMax_ = 10;
172 
173  ibooker.cd();
175 
176  h2AMC13Status_ = nullptr;
177 
178  bFillAMC_ = false;
179 
180  //if (nRunType_ != GEMDQM_RUNTYPE_RELVAL)
182  Int_t nNumAMC13 = (Int_t)mapFEDIdToRe_.size();
183  h2AMC13Status_ = ibooker.book2D(
184  "amc13_status", "AMC13 Status;AMC13;", nNumAMC13, 0.5, nNumAMC13 + 0.5, nBitAMC13_, 0.5, nBitAMC13_ + 0.5);
186 
187  for (auto &[fedId, nIdx] : mapFEDIdToPosition_) {
188  auto st = mapFEDIdToSt_[fedId];
189  auto re = (mapFEDIdToRe_[fedId] > 0 ? 'P' : 'M');
190  auto strName = Form("amc_status_GE%i1-%c", st, re);
191  auto strTitle = Form("AMC Status GE%i1-%c;AMC slot;", st, re);
193  ibooker.book2D(strName, strTitle, nAMCSlots_, -0.5, nAMCSlots_ - 0.5, nBitAMC_, 0.5, nBitAMC_ + 0.5);
195  }
196 
197  bFillAMC_ = true;
198  }
199 
200  mapStatusOH_ =
201  MEMap3Inf(this, "oh_status", "OptoHybrid Status", 36, 0.5, 36.5, nBitOH_, 0.5, nBitOH_ + 0.5, "Chamber");
202 
204  this, "vfat_statusWarnSum", "VFAT reporting warnings", 36, 0.5, 36.5, 24, -0.5, 24 - 0.5, "Chamber", "VFAT");
206  this, "vfat_statusErrSum", "VFAT reporting errors", 36, 0.5, 36.5, 24, -0.5, 24 - 0.5, "Chamber", "VFAT");
208  MEMap4Inf(this, "vfat_status", "VFAT Status", 24, -0.5, 24 - 0.5, nBitVFAT_, 0.5, nBitVFAT_ + 0.5, "VFAT");
209 
215  }
216 
217  GenerateMEPerChamber(ibooker);
218 
220  h2SummaryStatusAll = CreateSummaryHist(ibooker, "chamberAllStatus");
221  h2SummaryStatusWarning = CreateSummaryHist(ibooker, "chamberWarnings");
222  h2SummaryStatusError = CreateSummaryHist(ibooker, "chamberErrors");
223  }
224 
226  h2SummaryStatusVFATWarning = CreateSummaryHist(ibooker, "chamberVFATWarnings");
227  h2SummaryStatusVFATError = CreateSummaryHist(ibooker, "chamberVFATErrors");
228  h2SummaryStatusOHWarning = CreateSummaryHist(ibooker, "chamberOHWarnings");
229  h2SummaryStatusOHError = CreateSummaryHist(ibooker, "chamberOHErrors");
230  h2SummaryStatusAMCWarning = CreateSummaryHist(ibooker, "chamberAMCWarnings");
231  h2SummaryStatusAMCError = CreateSummaryHist(ibooker, "chamberAMCErrors");
232  h2SummaryStatusAMC13Error = CreateSummaryHist(ibooker, "chamberAMC13Errors");
233 
234  h2SummaryStatusAll->setTitle("Summary of all number of OH or VFAT status of each chambers");
235  h2SummaryStatusWarning->setTitle("Summary of all warnings of each chambers");
236  h2SummaryStatusError->setTitle("Summary of all errors of each chambers");
237  h2SummaryStatusVFATWarning->setTitle("Summary of VFAT warnings of each chambers");
238  h2SummaryStatusVFATError->setTitle("Summary of VFAT errors of each chambers");
239  h2SummaryStatusOHWarning->setTitle("Summary of OH warnings of each chambers");
240  h2SummaryStatusOHError->setTitle("Summary of OH errors of each chambers");
241  h2SummaryStatusAMCWarning->setTitle("Summary of AMC warnings of each chambers");
242  h2SummaryStatusAMCError->setTitle("Summary of AMC errors of each chambers");
243  h2SummaryStatusAMC13Error->setTitle("Summary of AMC13 errors of each chambers");
244  }
245 }
246 
248  MEStationInfo &stationInfo = mapStationInfo_[key];
249 
250  Int_t nNewNumCh = stationInfo.nMaxIdxChamber_ - stationInfo.nMinIdxChamber_ + 1;
251 
252  mapStatusOH_.SetBinConfX(nNewNumCh, stationInfo.nMinIdxChamber_ - 0.5, stationInfo.nMaxIdxChamber_ + 0.5);
253  mapStatusOH_.bookND(bh, key);
255 
256  if (mapStatusOH_.isOperating()) {
258  }
259 
261  nNewNumCh, stationInfo.nMinIdxChamber_ - 0.5, stationInfo.nMaxIdxChamber_ + 0.5);
266 
268  nNewNumCh, stationInfo.nMinIdxChamber_ - 0.5, stationInfo.nMaxIdxChamber_ + 0.5);
273 
274  return 0;
275 }
276 
278  ME3IdsKey key3 = key4Tokey3(key);
279  MEStationInfo &stationInfo = mapStationInfo_[key3];
280 
281  bh.getBooker()->setCurrentFolder(strFolderMain_ + "/VFATStatus_" + getNameDirLayer(key3));
282 
283  mapStatusVFATPerCh_.SetBinConfX(stationInfo.nMaxVFAT_, -0.5);
288  }
289 
291 
292  return 0;
293 }
294 
300 
301  event.getByToken(tagVFAT_, gemVFAT);
302  event.getByToken(tagOH_, gemOH);
303  event.getByToken(tagAMC_, gemAMC);
304  event.getByToken(tagAMC13_, gemAMC13);
305 
306  if (!(gemVFAT.isValid() && gemOH.isValid() && gemAMC.isValid() && gemAMC13.isValid())) {
307  if (!bWarnedNotFound_) {
308  edm::LogWarning(log_category_) << "DAQ sources from muonGEMDigis are not found";
309  bWarnedNotFound_ = true;
310  }
311  return;
312  }
313 
314  std::map<ME4IdsKey, bool> mapChamberAll;
315  std::map<ME4IdsKey, bool> mapChamberWarning;
316  std::map<ME4IdsKey, bool> mapChamberError;
317  std::map<ME4IdsKey, bool> mapChamberVFATWarning;
318  std::map<ME4IdsKey, bool> mapChamberVFATError;
319  std::map<ME4IdsKey, bool> mapChamberOHWarning;
320  std::map<ME4IdsKey, bool> mapChamberOHError;
321  std::map<ME4IdsKey, bool> mapChamberAMCWarning;
322  std::map<ME4IdsKey, bool> mapChamberAMCError;
323  std::map<ME4IdsKey, bool> mapChamberAMC13Error;
324 
325  for (auto amc13It = gemAMC13->begin(); amc13It != gemAMC13->end(); ++amc13It) {
326  int fedId = (*amc13It).first;
327  if (mapFEDIdToPosition_.find(fedId) == mapFEDIdToPosition_.end()) {
328  continue;
329  }
330  int nXBin = mapFEDIdToPosition_[fedId];
331 
332  const auto &range = (*amc13It).second;
333  for (auto amc13 = range.first; amc13 != range.second; ++amc13) {
334  Bool_t bWarn = false;
335  Bool_t bErr = false;
336 
339 
340  if (bFillAMC_) {
342  if (warnings.InValidAMC)
343  FillWithRiseErr(h2AMC13Status_, nXBin, 2, bWarn);
344  }
345 
347  if (errors.InValidSize)
348  FillWithRiseErr(h2AMC13Status_, nXBin, 3, bErr);
349  if (errors.failTrailerCheck)
350  FillWithRiseErr(h2AMC13Status_, nXBin, 4, bErr);
351  if (errors.failFragmentLength)
352  FillWithRiseErr(h2AMC13Status_, nXBin, 5, bErr);
353  if (errors.failTrailerMatch)
354  FillWithRiseErr(h2AMC13Status_, nXBin, 6, bErr);
355  if (errors.moreTrailers)
356  FillWithRiseErr(h2AMC13Status_, nXBin, 7, bErr);
357  if (errors.crcModified)
358  FillWithRiseErr(h2AMC13Status_, nXBin, 8, bErr);
359  if (errors.slinkError)
360  FillWithRiseErr(h2AMC13Status_, nXBin, 9, bErr);
361  if (errors.wrongFedId)
362  FillWithRiseErr(h2AMC13Status_, nXBin, 10, bErr);
363  }
364  }
365 
366  if (!bWarn && !bErr) {
368  h2AMC13Status_->Fill(nXBin, 1);
369  }
370  } else {
371  auto &listChamber = mapAMC13ToListChamber_[fedId];
372  for (auto gid : listChamber) {
373  ME4IdsKey key4Ch{gid.region(), gid.station(), gid.layer(), gid.chamber()};
374  if (bErr)
375  mapChamberAMC13Error[key4Ch] = false;
376  }
377  }
378  }
379  }
380 
381  MonitorElement *h2AMCStatus = nullptr;
382 
383  for (auto amcIt = gemAMC->begin(); amcIt != gemAMC->end(); ++amcIt) {
384  int fedId = (*amcIt).first;
385  if (mapFEDIdToAMCStatus_.find(fedId) == mapFEDIdToAMCStatus_.end()) {
386  continue;
387  }
388  h2AMCStatus = mapFEDIdToAMCStatus_[fedId];
389 
390  const GEMAMCStatusCollection::Range &range = (*amcIt).second;
391  for (auto amc = range.first; amc != range.second; ++amc) {
392  Bool_t bWarn = false;
393  Bool_t bErr = false;
394 
395  Int_t nAMCNum = amc->amcNumber();
396 
397  GEMAMCStatus::Warnings warnings{amc->warnings()};
398  GEMAMCStatus::Errors errors{amc->errors()};
399 
400  if (bFillAMC_) {
402  if (warnings.InValidOH)
403  FillWithRiseErr(h2AMCStatus, nAMCNum, 2, bWarn);
404  if (warnings.backPressure)
405  FillWithRiseErr(h2AMCStatus, nAMCNum, 3, bWarn);
406  }
407 
409  if (errors.badEC)
410  FillWithRiseErr(h2AMCStatus, nAMCNum, 4, bErr);
411  if (errors.badBC)
412  FillWithRiseErr(h2AMCStatus, nAMCNum, 5, bErr);
413  if (errors.badOC)
414  FillWithRiseErr(h2AMCStatus, nAMCNum, 6, bErr);
415  if (errors.badRunType)
416  FillWithRiseErr(h2AMCStatus, nAMCNum, 7, bErr);
417  if (errors.badCRC)
418  FillWithRiseErr(h2AMCStatus, nAMCNum, 8, bErr);
419  if (errors.MMCMlocked)
420  FillWithRiseErr(h2AMCStatus, nAMCNum, 9, bErr);
421  if (errors.DAQclocklocked)
422  FillWithRiseErr(h2AMCStatus, nAMCNum, 10, bErr);
423  if (errors.DAQnotReday)
424  FillWithRiseErr(h2AMCStatus, nAMCNum, 11, bErr);
425  if (errors.BC0locked)
426  FillWithRiseErr(h2AMCStatus, nAMCNum, 12, bErr);
427  }
428  }
429 
430  if (!bWarn && !bErr) {
432  h2AMCStatus->Fill(nAMCNum, 1);
433  }
434  } else {
435  auto &listChamber = mapAMCToListChamber_[{fedId, nAMCNum}];
436  for (auto gid : listChamber) {
437  ME4IdsKey key4Ch{gid.region(), gid.station(), gid.layer(), gid.chamber()};
438  if (bErr)
439  mapChamberAMCError[key4Ch] = false;
440  if (bWarn)
441  mapChamberAMCWarning[key4Ch] = false;
442  }
443  }
444  }
445  }
446 
447  for (auto ohIt = gemOH->begin(); ohIt != gemOH->end(); ++ohIt) {
448  GEMDetId gid = (*ohIt).first;
449  ME3IdsKey key3{gid.region(), gid.station(), gid.layer()};
450  ME4IdsKey key4{gid.region(), gid.station(), gid.layer(), gid.chamber()}; // WARNING: Chamber, not iEta
451 
452  const GEMOHStatusCollection::Range &range = (*ohIt).second;
453  for (auto OHStatus = range.first; OHStatus != range.second; ++OHStatus) {
454  GEMOHStatus::Warnings warnings{OHStatus->warnings()};
455  if (warnings.EvtNF)
456  mapStatusOH_.Fill(key3, gid.chamber(), 2);
457  if (warnings.InNF)
458  mapStatusOH_.Fill(key3, gid.chamber(), 3);
459  if (warnings.L1aNF)
460  mapStatusOH_.Fill(key3, gid.chamber(), 4);
461  if (warnings.EvtSzW)
462  mapStatusOH_.Fill(key3, gid.chamber(), 5);
463  if (warnings.InValidVFAT)
464  mapStatusOH_.Fill(key3, gid.chamber(), 6);
465 
466  GEMOHStatus::Errors errors{OHStatus->errors()};
467  if (errors.EvtF)
468  mapStatusOH_.Fill(key3, gid.chamber(), 7);
469  if (errors.InF)
470  mapStatusOH_.Fill(key3, gid.chamber(), 8);
471  if (errors.L1aF)
472  mapStatusOH_.Fill(key3, gid.chamber(), 9);
473  if (errors.EvtSzOFW)
474  mapStatusOH_.Fill(key3, gid.chamber(), 10);
475  if (errors.Inv)
476  mapStatusOH_.Fill(key3, gid.chamber(), 11);
477  if (errors.OOScAvV)
478  mapStatusOH_.Fill(key3, gid.chamber(), 12);
479  if (errors.OOScVvV)
480  mapStatusOH_.Fill(key3, gid.chamber(), 13);
481  if (errors.BxmAvV)
482  mapStatusOH_.Fill(key3, gid.chamber(), 14);
483  if (errors.BxmVvV)
484  mapStatusOH_.Fill(key3, gid.chamber(), 15);
485  if (errors.InUfw)
486  mapStatusOH_.Fill(key3, gid.chamber(), 16);
487  if (errors.badVFatCount)
488  mapStatusOH_.Fill(key3, gid.chamber(), 17);
489 
490  Bool_t bWarn = warnings.wcodes != 0;
491  Bool_t bErr = errors.codes != 0;
492  if (!bWarn && !bErr)
493  mapStatusOH_.Fill(key3, gid.chamber(), 1);
494  if (bWarn)
495  mapChamberOHWarning[key4] = false;
496  if (bErr)
497  mapChamberOHError[key4] = false;
498  mapChamberAll[key4] = true;
499  }
500  }
501 
502  for (auto vfatIt = gemVFAT->begin(); vfatIt != gemVFAT->end(); ++vfatIt) {
503  GEMDetId gid = (*vfatIt).first;
504  ME3IdsKey key3{gid.region(), gid.station(), gid.layer()};
505  ME4IdsKey key4Ch{gid.region(), gid.station(), gid.layer(), gid.chamber()}; // WARNING: Chamber, not iEta
506  const GEMVFATStatusCollection::Range &range = (*vfatIt).second;
507 
508  for (auto vfatStat = range.first; vfatStat != range.second; ++vfatStat) {
509  Int_t nIdxVFAT = getVFATNumber(gid.station(), gid.ieta(), vfatStat->vfatPosition());
510 
511  GEMVFATStatus::Warnings warnings{vfatStat->warnings()};
512  if (warnings.basicOFW)
513  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFAT, 2);
514  if (warnings.zeroSupOFW)
515  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFAT, 3);
516 
517  GEMVFATStatus::Errors errors{(uint8_t)vfatStat->errors()};
518  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFAT, 4);
519  if (errors.InValidHeader)
520  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFAT, 5);
521  if (errors.EC)
522  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFAT, 6);
523  if (errors.BC)
524  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFAT, 7);
525 
526  Bool_t bWarn = warnings.wcodes != 0;
527  Bool_t bErr = errors.codes != 0;
528  if (!bWarn && !bErr)
529  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFAT, 1);
530  if (bWarn)
531  mapChamberVFATWarning[key4Ch] = false;
532  if (bErr)
533  mapChamberVFATError[key4Ch] = false;
534  if (bWarn)
535  mapStatusWarnVFATPerLayer_.Fill(key3, gid.chamber(), nIdxVFAT);
536  if (bErr)
537  mapStatusErrVFATPerLayer_.Fill(key3, gid.chamber(), nIdxVFAT);
538  mapChamberAll[key4Ch] = true;
539  }
540  }
541 
543  // Summarizing all presence of status of each chamber
544  for (auto const &[key4, bErr] : mapChamberAll) {
545  ME3IdsKey key3 = key4Tokey3(key4);
546  Int_t nChamber = keyToChamber(key4);
547  h2SummaryStatusAll->Fill(nChamber, mapStationToIdx_[key3]);
548  }
549 
550  // Summarizing all presence of status of each chamber
552  // Summarizing all the error and warning occupancy
553  FillStatusSummaryPlot(mapChamberVFATWarning, h2SummaryStatusVFATWarning, &mapChamberWarning);
554  FillStatusSummaryPlot(mapChamberVFATError, h2SummaryStatusVFATError, &mapChamberError);
555  FillStatusSummaryPlot(mapChamberOHWarning, h2SummaryStatusOHWarning, &mapChamberWarning);
556  FillStatusSummaryPlot(mapChamberOHError, h2SummaryStatusOHError, &mapChamberError);
557  FillStatusSummaryPlot(mapChamberAMCWarning, h2SummaryStatusAMCWarning, &mapChamberWarning);
558  FillStatusSummaryPlot(mapChamberAMCError, h2SummaryStatusAMCError, &mapChamberError);
559  FillStatusSummaryPlot(mapChamberAMC13Error, h2SummaryStatusAMC13Error, &mapChamberError);
560 
561  FillStatusSummaryPlot(mapChamberWarning, h2SummaryStatusWarning);
563  }
564 }
565 
virtual void setTitle(const std::string &title)
set (ie. change) histogram/profile title
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
constexpr int station() const
Definition: GEMDetId.h:179
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
MEMapInfT< MEMap4Ids, ME4IdsKey > MEMap4Inf
Definition: GEMDQMBase.h:460
dqm::impl::MonitorElement * CreateSummaryHist(DQMStore::IBooker &ibooker, TString strName)
Definition: GEMDQMBase.cc:139
int ProcessWithMEMap3WithChamber(BookingHelper &bh, ME4IdsKey key) override
GEMDAQStatusSource(const edm::ParameterSet &cfg)
constexpr int region() const
Definition: GEMDetId.h:171
Int_t nRunType_
Definition: GEMDQMBase.h:518
void FillWithRiseErr(MonitorElement *h, Int_t nX, Int_t nY, Bool_t &bErr)
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edm::EDGetToken tagAMC13_
int getVFATNumber(const int, const int, const int)
Definition: GEMDQMBase.h:615
int SetLabelForChambers(K key, Int_t nAxis, Int_t nNumBin=-1, Int_t nIdxStart=1)
Definition: GEMDQMBase.h:337
MonitorElement * h2SummaryStatusAMCWarning
MEMapInfT< MEMap3Ids, ME3IdsKey > MEMap3Inf
Definition: GEMDQMBase.h:459
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
MonitorElement * h2AMC13Status_
MonitorElement * h2SummaryStatusAMCError
int initGeometry(edm::EventSetup const &iSetup)
Definition: GEMDQMBase.cc:27
std::tuple< Int_t, Int_t, Int_t, Int_t > ME4IdsKey
std::map< UInt_t, int > mapFEDIdToRe_
int SetLabelForVFATs(K key, Int_t nNumEtaPartitions, Int_t nAxis, Int_t nNumBin=-1)
Definition: GEMDQMBase.h:359
std::map< ME3IdsKey, MEStationInfo > mapStationInfo_
Definition: GEMDQMBase.h:590
std::map< UInt_t, int > mapFEDIdToSt_
std::map< std::tuple< int, int >, std::vector< GEMDetId > > mapAMCToListChamber_
int loadChambers()
Definition: GEMDQMBase.cc:56
std::map< ME3IdsKey, int > mapStationToIdx_
Definition: GEMDQMBase.h:589
constexpr int layer() const
Definition: GEMDetId.h:190
int Fill(K key, Double_t x)
Definition: GEMDQMBase.h:380
std::string log_category_
Definition: GEMDQMBase.h:520
constexpr int chamber() const
Definition: GEMDetId.h:183
edm::EDGetToken tagVFAT_
MonitorElement * h2SummaryStatusVFATError
const edm::ESGetToken< GEMChMap, GEMChMapRcd > gemChMapToken_
void Fill(long long x)
MEMap3Inf mapStatusWarnVFATPerLayer_
std::map< UInt_t, MonitorElement * > mapFEDIdToAMCStatus_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
edm::EDGetToken tagOH_
MonitorElement * h2SummaryStatusError
MEMap3Inf mapStatusErrVFATPerLayer_
int GenerateMEPerChamber(DQMStore::IBooker &ibooker)
Definition: GEMDQMBase.cc:171
void SetLabelAMCStatus(MonitorElement *h2Status)
void LoadROMap(edm::EventSetup const &iSetup)
std::map< UInt_t, int > mapFEDIdToPosition_
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
Transition
Definition: Transition.h:12
bool getData(T &iHolder) const
Definition: EventSetup.h:122
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
DigiRangeIterator begin() const
void SetLabelAMC13Status(MonitorElement *h2Status)
std::map< int, std::vector< GEMDetId > > mapAMC13ToListChamber_
MonitorElement * h2SummaryStatusVFATWarning
MonitorElement * h2SummaryStatusAll
constexpr int ieta() const
Definition: GEMDetId.h:199
const GEMGeometry * GEMGeometry_
Definition: GEMDQMBase.h:575
void SetLabelVFATStatus(MonitorElement *h2Status)
std::pair< const_iterator, const_iterator > Range
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
void add(std::string const &label, ParameterSetDescription const &psetDescription)
DQMStore::IBooker * getBooker()
Definition: GEMDQMBase.h:94
int keyToChamber(ME4IdsKey key)
Definition: GEMDQMBase.h:542
void SetLabelOHStatus(MonitorElement *h2Status)
bool isValid() const
Definition: HandleBase.h:70
std::string getNameDirLayer(ME3IdsKey key3)
Definition: GEMDQMBase.h:662
int bookND(BookingHelper &bh, K key)
Definition: GEMDQMBase.h:307
MonitorElement * h2SummaryStatusOHWarning
ME3IdsKey key4Tokey3(ME4IdsKey key)
Definition: GEMDQMBase.h:551
MonitorElement * h2SummaryStatusAMC13Error
HLT enums.
int ProcessWithMEMap3(BookingHelper &bh, ME3IdsKey key) override
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
void SetBinConfX(Int_t nBins, Double_t dL=0.5, Double_t dH=-1048576.0)
Definition: GEMDQMBase.h:281
Definition: errors.py:1
MonitorElement * h2SummaryStatusWarning
Log< level::Warning, false > LogWarning
Definition: AMCSpec.h:8
void FillStatusSummaryPlot(std::map< ME4IdsKey, bool > &mapChamber, MonitorElement *h2Plot, std::map< ME4IdsKey, bool > *pmapSummary=nullptr)
MonitorElement * h2SummaryStatusOHError
void SetBinConfY(Int_t nBins, Double_t dL=0.5, Double_t dH=-1048576.0)
Definition: GEMDQMBase.h:289
dqm::impl::MonitorElement * FindHist(K key)
Definition: GEMDQMBase.h:328
DigiRangeIterator end() const
Definition: event.py:1
Definition: Run.h:45
edm::EDGetToken tagAMC_