CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GEMDAQStatusSource.cc
Go to the documentation of this file.
2 
3 using namespace std;
4 using namespace edm;
5 
7  tagVFAT_ = consumes<GEMVFATStatusCollection>(cfg.getParameter<edm::InputTag>("VFATInputLabel"));
8  tagOH_ = consumes<GEMOHStatusCollection>(cfg.getParameter<edm::InputTag>("OHInputLabel"));
9  tagAMC_ = consumes<GEMAMCStatusCollection>(cfg.getParameter<edm::InputTag>("AMCInputLabel"));
10  tagAMC13_ = consumes<GEMAMC13StatusCollection>(cfg.getParameter<edm::InputTag>("AMC13InputLabel"));
11 
12  nAMCSlots_ = cfg.getParameter<Int_t>("AMCSlots");
13  gemEMapToken_ = esConsumes<GEMeMap, GEMeMapRcd, edm::Transition::BeginRun>();
14 }
15 
18  desc.add<edm::InputTag>("VFATInputLabel", edm::InputTag("muonGEMDigis", "VFATStatus"));
19  desc.add<edm::InputTag>("OHInputLabel", edm::InputTag("muonGEMDigis", "OHStatus"));
20  desc.add<edm::InputTag>("AMCInputLabel", edm::InputTag("muonGEMDigis", "AMCStatus"));
21  desc.add<edm::InputTag>("AMC13InputLabel", edm::InputTag("muonGEMDigis", "AMC13Status"));
22 
23  desc.add<Int_t>("AMCSlots", 13);
24  desc.addUntracked<std::string>("logCategory", "GEMDAQStatusSource");
25 
26  descriptions.add("GEMDAQStatusSource", desc);
27 }
28 
30  auto gemROMap = std::make_shared<GEMROMapping>();
31  //if (useDBEMap_)
32  if (true) {
33  const auto &eMap = iSetup.getData(gemEMapToken_);
34  auto gemEMap = std::make_unique<GEMeMap>(eMap);
35  gemEMap->convert(*gemROMap);
36 
37  for (auto imap : gemEMap->theChamberMap_) {
38  int nNumChamber = (int)imap.fedId.size();
39  for (int i = 0; i < nNumChamber; i++) {
40  unsigned int fedId = imap.fedId[i];
41  uint8_t amcNum = imap.amcNum[i];
42  uint8_t gebId = imap.gebId[i];
43  GEMROMapping::chamEC geb_ec{fedId, amcNum, gebId};
44  GEMROMapping::chamDC geb_dc = gemROMap->chamberPos(geb_ec);
45  GEMDetId gemChId = geb_dc.detId;
46 
47  mapFEDIdToRe_[fedId] = gemChId.region();
48  mapAMC13ToListChamber_[fedId].push_back(gemChId);
49  mapAMCToListChamber_[{fedId, amcNum}].push_back(gemChId);
50  }
51  }
52 
53  gemEMap.reset();
54  } else {
55  // no EMap in DB, using dummy
56  // FIXME: How to add mapFEDIdToRe_ and mapDetIdToAMC_??
57  auto gemEMap = std::make_unique<GEMeMap>();
58  gemEMap->convertDummy(*gemROMap);
59  gemEMap.reset();
60  }
61 }
62 
64  unsigned int unBinPos = 1;
65  h2Status->setBinLabel(unBinPos++, "Good", 2);
66  h2Status->setBinLabel(unBinPos++, "Invalid AMC", 2);
67  h2Status->setBinLabel(unBinPos++, "Invalid size", 2);
68  h2Status->setBinLabel(unBinPos++, "Fail trailer check", 2);
69  h2Status->setBinLabel(unBinPos++, "Fail fragment length", 2);
70  h2Status->setBinLabel(unBinPos++, "Fail trailer match", 2);
71  h2Status->setBinLabel(unBinPos++, "More trailer", 2);
72  h2Status->setBinLabel(unBinPos++, "CRC modified", 2);
73  h2Status->setBinLabel(unBinPos++, "S-link error", 2);
74  h2Status->setBinLabel(unBinPos++, "Wrong FED ID", 2);
75 
76  h2Status->setBinLabel(1, "GE11-M", 1);
77  h2Status->setBinLabel(2, "GE11-P", 1);
78 }
79 
81  unsigned int unBinPos = 1;
82  h2Status->setBinLabel(unBinPos++, "Good", 2);
83  h2Status->setBinLabel(unBinPos++, "Invalid OH", 2);
84  h2Status->setBinLabel(unBinPos++, "Back pressure", 2);
85  h2Status->setBinLabel(unBinPos++, "Bad EC", 2);
86  h2Status->setBinLabel(unBinPos++, "Bad BC", 2);
87  h2Status->setBinLabel(unBinPos++, "Bad OC", 2);
88  h2Status->setBinLabel(unBinPos++, "Bad run type", 2);
89  h2Status->setBinLabel(unBinPos++, "Bad CRC", 2);
90  h2Status->setBinLabel(unBinPos++, "MMCM locked", 2);
91  h2Status->setBinLabel(unBinPos++, "DAQ clock locked", 2);
92  h2Status->setBinLabel(unBinPos++, "DAQ not ready", 2);
93  h2Status->setBinLabel(unBinPos++, "BC0 not locked", 2);
94 }
95 
97  unsigned int unBinPos = 1;
98  h2Status->setBinLabel(unBinPos++, "Good", 2);
99  h2Status->setBinLabel(unBinPos++, "Event FIFO near full", 2);
100  h2Status->setBinLabel(unBinPos++, "Input FIFO near full", 2);
101  h2Status->setBinLabel(unBinPos++, "L1A FIFO near full", 2);
102  h2Status->setBinLabel(unBinPos++, "Event size warn", 2);
103  h2Status->setBinLabel(unBinPos++, "Invalid VFAT", 2);
104  h2Status->setBinLabel(unBinPos++, "Event FIFO full", 2);
105  h2Status->setBinLabel(unBinPos++, "Input FIFO full", 2);
106  h2Status->setBinLabel(unBinPos++, "L1A FIFO full", 2);
107  h2Status->setBinLabel(unBinPos++, "Event size overflow", 2);
108  h2Status->setBinLabel(unBinPos++, "Invalid event", 2);
109  h2Status->setBinLabel(unBinPos++, "Out of Sync AMC vs VFAT", 2);
110  h2Status->setBinLabel(unBinPos++, "Out of Sync VFAT vs VFAT", 2);
111  h2Status->setBinLabel(unBinPos++, "BX mismatch AMC vs VFAT", 2);
112  h2Status->setBinLabel(unBinPos++, "BX mismatch VFAT vs VFAT", 2);
113  h2Status->setBinLabel(unBinPos++, "Input FIFO underflow", 2);
114  h2Status->setBinLabel(unBinPos++, "Bad VFAT count", 2);
115 }
116 
118  unsigned int unBinPos = 1;
119  h2Status->setBinLabel(unBinPos++, "Good", 2);
120  h2Status->setBinLabel(unBinPos++, "Basic overflow", 2);
121  h2Status->setBinLabel(unBinPos++, "Zero-sup overflow", 2);
122  h2Status->setBinLabel(unBinPos++, "VFAT CRC error", 2);
123  h2Status->setBinLabel(unBinPos++, "Invalid header", 2);
124  h2Status->setBinLabel(unBinPos++, "AMC EC mismatch", 2);
125  h2Status->setBinLabel(unBinPos++, "AMC BC mismatch", 2);
126 }
127 
129  LoadROMap(iSetup);
130  if (mapAMC13ToListChamber_.empty() || mapAMCToListChamber_.empty())
131  return;
132  initGeometry(iSetup);
133  if (GEMGeometry_ == nullptr)
134  return;
135  loadChambers();
136 
137  nBXMin_ = -10;
138  nBXMax_ = 10;
139 
140  mapFEDIdToRe_[1467] = -1; // FIXME: Need more systematic way
141  mapFEDIdToRe_[1468] = 1;
142 
143  ibooker.cd();
144  ibooker.setCurrentFolder("GEM/DAQStatus");
145 
147  ibooker.book2D("amc13_status", "AMC13 Status;AMC13;", 2, 0.5, 2.5, nBitAMC13_, 0.5, nBitAMC13_ + 0.5);
148  h2AMCStatusNeg_ = ibooker.book2D("amc_status_GE11-M",
149  "AMC Status GE11-M;AMC slot;",
150  nAMCSlots_,
151  -0.5,
152  nAMCSlots_ - 0.5,
153  nBitAMC_,
154  0.5,
155  nBitAMC_ + 0.5);
156  h2AMCStatusPos_ = ibooker.book2D("amc_status_GE11-P",
157  "AMC Status GE11-P;AMC slot;",
158  nAMCSlots_,
159  -0.5,
160  nAMCSlots_ - 0.5,
161  nBitAMC_,
162  0.5,
163  nBitAMC_ + 0.5);
164 
168 
169  mapStatusOH_ =
170  MEMap3Inf(this, "oh_status", "OptoHybrid Status", 36, 0.5, 36.5, nBitOH_, 0.5, nBitOH_ + 0.5, "Chamber");
172  MEMap3Inf(this, "vfat_status", "VFAT Status", 24, -0.5, 24 - 0.5, nBitVFAT_, 0.5, nBitVFAT_ + 0.5, "VFAT");
173 
175  this, "vfat_statusWarnSum", "VFAT reporting warnings", 36, 0.5, 36.5, 24, -0.5, 24 - 0.5, "Chamber", "VFAT");
177  this, "vfat_statusErrSum", "VFAT reporting errors", 36, 0.5, 36.5, 24, -0.5, 24 - 0.5, "Chamber", "VFAT");
179  MEMap4Inf(this, "vfat_status", "VFAT Status", 24, -0.5, 24 - 0.5, nBitVFAT_, 0.5, nBitVFAT_ + 0.5, "VFAT");
180 
181  GenerateMEPerChamber(ibooker);
182 
183  h2SummaryStatusAll = CreateSummaryHist(ibooker, "chamberAllStatus");
184  h2SummaryStatusWarning = CreateSummaryHist(ibooker, "chamberWarnings");
185  h2SummaryStatusError = CreateSummaryHist(ibooker, "chamberErrors");
186  h2SummaryStatusVFATWarning = CreateSummaryHist(ibooker, "chamberVFATWarnings");
187  h2SummaryStatusVFATError = CreateSummaryHist(ibooker, "chamberVFATErrors");
188  h2SummaryStatusOHWarning = CreateSummaryHist(ibooker, "chamberOHWarnings");
189  h2SummaryStatusOHError = CreateSummaryHist(ibooker, "chamberOHErrors");
190  h2SummaryStatusAMCWarning = CreateSummaryHist(ibooker, "chamberAMCWarnings");
191  h2SummaryStatusAMCError = CreateSummaryHist(ibooker, "chamberAMCErrors");
192  h2SummaryStatusAMC13Error = CreateSummaryHist(ibooker, "chamberAMC13Errors");
193 
194  h2SummaryStatusAll->setTitle("Summary of all number of OH or VFAT status of each chambers");
195  h2SummaryStatusWarning->setTitle("Summary of all warnings of each chambers");
196  h2SummaryStatusError->setTitle("Summary of all errors of each chambers");
197  h2SummaryStatusVFATWarning->setTitle("Summary of VFAT warnings of each chambers");
198  h2SummaryStatusVFATError->setTitle("Summary of VFAT errors of each chambers");
199  h2SummaryStatusOHWarning->setTitle("Summary of OH warnings of each chambers");
200  h2SummaryStatusOHError->setTitle("Summary of OH errors of each chambers");
201  h2SummaryStatusAMCWarning->setTitle("Summary of AMC warnings of each chambers");
202  h2SummaryStatusAMCError->setTitle("Summary of AMC errors of each chambers");
203  h2SummaryStatusAMC13Error->setTitle("Summary of AMC13 errors of each chambers");
204 }
205 
207  MEStationInfo &stationInfo = mapStationInfo_[key];
208 
210  mapStatusOH_.bookND(bh, key);
212 
214 
220 
226 
227  mapStatusVFAT_.SetBinConfX(stationInfo.nMaxVFAT_, -0.5);
228  mapStatusVFAT_.bookND(bh, key);
230 
232 
233  return 0;
234 }
235 
237  ME3IdsKey key3 = key4Tokey3(key);
238  MEStationInfo &stationInfo = mapStationInfo_[key3];
239 
240  mapStatusVFATPerCh_.SetBinConfX(stationInfo.nMaxVFAT_, -0.5);
241  mapStatusVFATPerCh_.bookND(bh, key);
244 
245  return 0;
246 }
247 
253 
254  event.getByToken(tagVFAT_, gemVFAT);
255  event.getByToken(tagOH_, gemOH);
256  event.getByToken(tagAMC_, gemAMC);
257  event.getByToken(tagAMC13_, gemAMC13);
258 
259  std::map<ME4IdsKey, bool> mapChamberAll;
260  std::map<ME4IdsKey, bool> mapChamberWarning;
261  std::map<ME4IdsKey, bool> mapChamberError;
262  std::map<ME4IdsKey, bool> mapChamberVFATWarning;
263  std::map<ME4IdsKey, bool> mapChamberVFATError;
264  std::map<ME4IdsKey, bool> mapChamberOHWarning;
265  std::map<ME4IdsKey, bool> mapChamberOHError;
266  std::map<ME4IdsKey, bool> mapChamberAMCWarning;
267  std::map<ME4IdsKey, bool> mapChamberAMCError;
268  std::map<ME4IdsKey, bool> mapChamberAMC13Error;
269 
270  for (auto amc13It = gemAMC13->begin(); amc13It != gemAMC13->end(); ++amc13It) {
271  int fedId = (*amc13It).first;
272  if (mapFEDIdToRe_.find(fedId) == mapFEDIdToRe_.end())
273  continue;
274  int nXBin = 0;
275  if (mapFEDIdToRe_[fedId] < 0) {
276  nXBin = 1;
277  } else if (mapFEDIdToRe_[fedId] > 0) {
278  nXBin = 2;
279  } else {
280  edm::LogError(log_category_) << "+++ Error : Unknown FED Id +++\n" << std::endl;
281  continue;
282  }
283 
284  const auto &range = (*amc13It).second;
285  for (auto amc13 = range.first; amc13 != range.second; ++amc13) {
286  Bool_t bWarn = false;
287  Bool_t bErr = false;
288 
289  GEMAMC13Status::Warnings warnings{amc13->warnings()};
290  if (warnings.InValidAMC)
291  FillWithRiseErr(h2AMC13Status_, nXBin, 2, bWarn);
292 
293  GEMAMC13Status::Errors errors{amc13->errors()};
294  if (errors.InValidSize)
295  FillWithRiseErr(h2AMC13Status_, nXBin, 3, bErr);
296  if (errors.failTrailerCheck)
297  FillWithRiseErr(h2AMC13Status_, nXBin, 4, bErr);
298  if (errors.failFragmentLength)
299  FillWithRiseErr(h2AMC13Status_, nXBin, 5, bErr);
300  if (errors.failTrailerMatch)
301  FillWithRiseErr(h2AMC13Status_, nXBin, 6, bErr);
302  if (errors.moreTrailers)
303  FillWithRiseErr(h2AMC13Status_, nXBin, 7, bErr);
304  if (errors.crcModified)
305  FillWithRiseErr(h2AMC13Status_, nXBin, 8, bErr);
306  if (errors.slinkError)
307  FillWithRiseErr(h2AMC13Status_, nXBin, 9, bErr);
308  if (errors.wrongFedId)
309  FillWithRiseErr(h2AMC13Status_, nXBin, 10, bErr);
310 
311  if (!bWarn && !bErr) {
312  h2AMC13Status_->Fill(nXBin, 1);
313  } else {
314  auto &listChamber = mapAMC13ToListChamber_[fedId];
315  for (auto gid : listChamber) {
316  ME4IdsKey key4Ch{gid.region(), gid.station(), gid.layer(), gid.chamber()};
317  if (bErr)
318  mapChamberAMC13Error[key4Ch] = false;
319  }
320  }
321  }
322  }
323 
324  MonitorElement *h2AMCStatus = nullptr;
325 
326  for (auto amcIt = gemAMC->begin(); amcIt != gemAMC->end(); ++amcIt) {
327  int fedId = (*amcIt).first;
328  if (mapFEDIdToRe_.find(fedId) == mapFEDIdToRe_.end())
329  continue;
330  if (mapFEDIdToRe_[fedId] < 0) {
331  h2AMCStatus = h2AMCStatusNeg_;
332  } else if (mapFEDIdToRe_[fedId] > 0) {
333  h2AMCStatus = h2AMCStatusPos_;
334  } else {
335  edm::LogError(log_category_) << "+++ Error : Unknown FED Id +++\n" << std::endl;
336  continue;
337  }
338 
339  const GEMAMCStatusCollection::Range &range = (*amcIt).second;
340  for (auto amc = range.first; amc != range.second; ++amc) {
341  Bool_t bWarn = false;
342  Bool_t bErr = false;
343 
344  Int_t nAMCNum = amc->amcNumber();
345 
346  GEMAMCStatus::Warnings warnings{amc->warnings()};
347  if (warnings.InValidOH)
348  FillWithRiseErr(h2AMCStatus, nAMCNum, 2, bWarn);
349  if (warnings.backPressure)
350  FillWithRiseErr(h2AMCStatus, nAMCNum, 3, bWarn);
351 
352  GEMAMCStatus::Errors errors{amc->errors()};
353  if (errors.badEC)
354  FillWithRiseErr(h2AMCStatus, nAMCNum, 4, bErr);
355  if (errors.badBC)
356  FillWithRiseErr(h2AMCStatus, nAMCNum, 5, bErr);
357  if (errors.badOC)
358  FillWithRiseErr(h2AMCStatus, nAMCNum, 6, bErr);
359  if (errors.badRunType)
360  FillWithRiseErr(h2AMCStatus, nAMCNum, 7, bErr);
361  if (errors.badCRC)
362  FillWithRiseErr(h2AMCStatus, nAMCNum, 8, bErr);
363  if (errors.MMCMlocked)
364  FillWithRiseErr(h2AMCStatus, nAMCNum, 9, bErr);
365  if (errors.DAQclocklocked)
366  FillWithRiseErr(h2AMCStatus, nAMCNum, 10, bErr);
367  if (errors.DAQnotReday)
368  FillWithRiseErr(h2AMCStatus, nAMCNum, 11, bErr);
369  if (errors.BC0locked)
370  FillWithRiseErr(h2AMCStatus, nAMCNum, 12, bErr);
371 
372  if (!bWarn && !bErr) {
373  h2AMCStatus->Fill(nAMCNum, 1);
374  } else {
375  auto &listChamber = mapAMCToListChamber_[{fedId, nAMCNum}];
376  for (auto gid : listChamber) {
377  ME4IdsKey key4Ch{gid.region(), gid.station(), gid.layer(), gid.chamber()};
378  if (bErr)
379  mapChamberAMCError[key4Ch] = false;
380  if (bWarn)
381  mapChamberAMCWarning[key4Ch] = false;
382  }
383  }
384  }
385  }
386 
387  for (auto ohIt = gemOH->begin(); ohIt != gemOH->end(); ++ohIt) {
388  GEMDetId gid = (*ohIt).first;
389  ME3IdsKey key3{gid.region(), gid.station(), gid.layer()};
390  ME4IdsKey key4{gid.region(), gid.station(), gid.layer(), gid.chamber()}; // WARNING: Chamber, not iEta
391 
392  const GEMOHStatusCollection::Range &range = (*ohIt).second;
393  for (auto OHStatus = range.first; OHStatus != range.second; ++OHStatus) {
394  GEMOHStatus::Warnings warnings{OHStatus->warnings()};
395  if (warnings.EvtNF)
396  mapStatusOH_.Fill(key3, gid.chamber(), 2);
397  if (warnings.InNF)
398  mapStatusOH_.Fill(key3, gid.chamber(), 3);
399  if (warnings.L1aNF)
400  mapStatusOH_.Fill(key3, gid.chamber(), 4);
401  if (warnings.EvtSzW)
402  mapStatusOH_.Fill(key3, gid.chamber(), 5);
403  if (warnings.InValidVFAT)
404  mapStatusOH_.Fill(key3, gid.chamber(), 6);
405 
406  GEMOHStatus::Errors errors{OHStatus->errors()};
407  if (errors.EvtF)
408  mapStatusOH_.Fill(key3, gid.chamber(), 7);
409  if (errors.InF)
410  mapStatusOH_.Fill(key3, gid.chamber(), 8);
411  if (errors.L1aF)
412  mapStatusOH_.Fill(key3, gid.chamber(), 9);
413  if (errors.EvtSzOFW)
414  mapStatusOH_.Fill(key3, gid.chamber(), 10);
415  if (errors.Inv)
416  mapStatusOH_.Fill(key3, gid.chamber(), 11);
417  if (errors.OOScAvV)
418  mapStatusOH_.Fill(key3, gid.chamber(), 12);
419  if (errors.OOScVvV)
420  mapStatusOH_.Fill(key3, gid.chamber(), 13);
421  if (errors.BxmAvV)
422  mapStatusOH_.Fill(key3, gid.chamber(), 14);
423  if (errors.BxmVvV)
424  mapStatusOH_.Fill(key3, gid.chamber(), 15);
425  if (errors.InUfw)
426  mapStatusOH_.Fill(key3, gid.chamber(), 16);
427  if (errors.badVFatCount)
428  mapStatusOH_.Fill(key3, gid.chamber(), 17);
429 
430  Bool_t bWarn = warnings.wcodes != 0;
431  Bool_t bErr = errors.codes != 0;
432  if (!bWarn && !bErr)
433  mapStatusOH_.Fill(key3, gid.chamber(), 1);
434  if (bWarn)
435  mapChamberOHWarning[key4] = false;
436  if (bErr)
437  mapChamberOHError[key4] = false;
438  mapChamberAll[key4] = true;
439  }
440  }
441 
442  for (auto vfatIt = gemVFAT->begin(); vfatIt != gemVFAT->end(); ++vfatIt) {
443  GEMDetId gid = (*vfatIt).first;
444  ME3IdsKey key3{gid.region(), gid.station(), gid.layer()};
445  ME4IdsKey key4Ch{gid.region(), gid.station(), gid.layer(), gid.chamber()}; // WARNING: Chamber, not iEta
446  const GEMVFATStatusCollection::Range &range = (*vfatIt).second;
447 
448  for (auto vfatStat = range.first; vfatStat != range.second; ++vfatStat) {
449  Int_t nIdxVFAT = getVFATNumber(gid.station(), gid.ieta(), vfatStat->vfatPosition());
450 
451  GEMVFATStatus::Warnings warnings{vfatStat->warnings()};
452  if (warnings.basicOFW)
453  mapStatusVFAT_.Fill(key3, nIdxVFAT, 2);
454  if (warnings.zeroSupOFW)
455  mapStatusVFAT_.Fill(key3, nIdxVFAT, 3);
456  if (warnings.basicOFW)
457  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFAT, 2);
458  if (warnings.zeroSupOFW)
459  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFAT, 3);
460 
461  GEMVFATStatus::Errors errors{(uint8_t)vfatStat->errors()};
462  if (errors.vc)
463  mapStatusVFAT_.Fill(key3, nIdxVFAT, 4);
464  if (errors.InValidHeader)
465  mapStatusVFAT_.Fill(key3, nIdxVFAT, 5);
466  if (errors.EC)
467  mapStatusVFAT_.Fill(key3, nIdxVFAT, 6);
468  if (errors.BC)
469  mapStatusVFAT_.Fill(key3, nIdxVFAT, 7);
470  if (errors.vc)
471  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFAT, 4);
472  if (errors.InValidHeader)
473  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFAT, 5);
474  if (errors.EC)
475  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFAT, 6);
476  if (errors.BC)
477  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFAT, 7);
478 
479  Bool_t bWarn = warnings.wcodes != 0;
480  Bool_t bErr = errors.codes != 0;
481  if (!bWarn && !bErr)
482  mapStatusVFAT_.Fill(key3, nIdxVFAT, 1);
483  if (!bWarn && !bErr)
484  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFAT, 1);
485  if (bWarn)
486  mapChamberVFATWarning[key4Ch] = false;
487  if (bErr)
488  mapChamberVFATError[key4Ch] = false;
489  if (bWarn)
490  mapStatusWarnVFATPerLayer_.Fill(key3, gid.chamber(), nIdxVFAT);
491  if (bErr)
492  mapStatusErrVFATPerLayer_.Fill(key3, gid.chamber(), nIdxVFAT);
493  mapChamberAll[key4Ch] = true;
494  }
495  }
496 
497  // Summarizing all presence of status of each chamber
498  for (auto const &[key4, bErr] : mapChamberAll) {
499  ME3IdsKey key3 = key4Tokey3(key4);
500  Int_t nChamber = keyToChamber(key4);
501  h2SummaryStatusAll->Fill(nChamber, mapStationToIdx_[key3]);
502  }
503 
504  // Summarizing all presence of status of each chamber
506  // Summarizing all the error and warning occupancy
507  FillStatusSummaryPlot(mapChamberVFATWarning, h2SummaryStatusVFATWarning, &mapChamberWarning);
508  FillStatusSummaryPlot(mapChamberVFATError, h2SummaryStatusVFATError, &mapChamberError);
509  FillStatusSummaryPlot(mapChamberOHWarning, h2SummaryStatusOHWarning, &mapChamberWarning);
510  FillStatusSummaryPlot(mapChamberOHError, h2SummaryStatusOHError, &mapChamberError);
511  FillStatusSummaryPlot(mapChamberAMCWarning, h2SummaryStatusAMCWarning, &mapChamberWarning);
512  FillStatusSummaryPlot(mapChamberAMCError, h2SummaryStatusAMCError, &mapChamberError);
513  FillStatusSummaryPlot(mapChamberAMC13Error, h2SummaryStatusAMC13Error, &mapChamberError);
514 
515  FillStatusSummaryPlot(mapChamberWarning, h2SummaryStatusWarning);
517 }
518 
virtual void setTitle(const std::string &title)
set (ie. change) histogram/profile title
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MEMapInfT< MEMap4Ids, ME4IdsKey > MEMap4Inf
Definition: GEMDQMBase.h:457
dqm::impl::MonitorElement * CreateSummaryHist(DQMStore::IBooker &ibooker, TString strName)
Definition: GEMDQMBase.cc:125
int ProcessWithMEMap3WithChamber(BookingHelper &bh, ME4IdsKey key) override
GEMDAQStatusSource(const edm::ParameterSet &cfg)
tuple cfg
Definition: looper.py:296
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
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:591
MonitorElement * h2SummaryStatusAMCWarning
MonitorElement * h2AMCStatusNeg_
MEMapInfT< MEMap3Ids, ME3IdsKey > MEMap3Inf
Definition: GEMDQMBase.h:456
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
MonitorElement * h2AMC13Status_
int SetLabelForChambers(K key, Int_t nAxis, Int_t nNumBin=-1)
Definition: GEMDQMBase.h:334
MonitorElement * h2SummaryStatusAMCError
int initGeometry(edm::EventSetup const &iSetup)
Definition: GEMDQMBase.cc:15
std::tuple< Int_t, Int_t, Int_t, Int_t > ME4IdsKey
edm::ESGetToken< GEMeMap, GEMeMapRcd > gemEMapToken_
std::map< UInt_t, int > mapFEDIdToRe_
int SetLabelForVFATs(K key, Int_t nNumEtaPartitions, Int_t nAxis, Int_t nNumBin=-1)
Definition: GEMDQMBase.h:356
std::map< ME3IdsKey, MEStationInfo > mapStationInfo_
Definition: GEMDQMBase.h:564
std::map< std::tuple< int, int >, std::vector< GEMDetId > > mapAMCToListChamber_
int loadChambers()
Definition: GEMDQMBase.cc:46
std::map< ME3IdsKey, int > mapStationToIdx_
Definition: GEMDQMBase.h:563
Log< level::Error, false > LogError
int Fill(K key, Double_t x)
Definition: GEMDQMBase.h:377
std::string log_category_
Definition: GEMDQMBase.h:496
constexpr int ieta() const
Definition: GEMDetId.h:199
edm::EDGetToken tagVFAT_
MonitorElement * h2SummaryStatusVFATError
const uint16_t range(const Frame &aFrame)
void Fill(long long x)
bool getData(T &iHolder) const
Definition: EventSetup.h:128
MEMap3Inf mapStatusWarnVFATPerLayer_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
edm::EDGetToken tagOH_
MonitorElement * h2SummaryStatusError
double amc
Definition: hdecay.h:20
MEMap3Inf mapStatusErrVFATPerLayer_
int GenerateMEPerChamber(DQMStore::IBooker &ibooker)
Definition: GEMDQMBase.cc:161
void SetLabelAMCStatus(MonitorElement *h2Status)
void LoadROMap(edm::EventSetup const &iSetup)
constexpr int region() const
Definition: GEMDetId.h:171
tuple key
prepare the HTCondor submission files and eventually submit them
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
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)
void SetLabelAMC13Status(MonitorElement *h2Status)
std::map< int, std::vector< GEMDetId > > mapAMC13ToListChamber_
MonitorElement * h2SummaryStatusVFATWarning
MonitorElement * h2SummaryStatusAll
const GEMGeometry * GEMGeometry_
Definition: GEMDQMBase.h:550
void SetLabelVFATStatus(MonitorElement *h2Status)
constexpr int chamber() const
Definition: GEMDetId.h:183
constexpr int layer() const
Definition: GEMDetId.h:190
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:177
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
constexpr int station() const
Definition: GEMDetId.h:179
void add(std::string const &label, ParameterSetDescription const &psetDescription)
int keyToChamber(ME4IdsKey key)
Definition: GEMDQMBase.h:520
void SetLabelOHStatus(MonitorElement *h2Status)
int bookND(BookingHelper &bh, K key)
Definition: GEMDQMBase.h:305
MonitorElement * h2SummaryStatusOHWarning
ME3IdsKey key4Tokey3(ME4IdsKey key)
Definition: GEMDQMBase.h:529
MonitorElement * h2SummaryStatusAMC13Error
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:279
MonitorElement * h2SummaryStatusWarning
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:287
dqm::impl::MonitorElement * FindHist(K key)
Definition: GEMDQMBase.h:326
Definition: Run.h:45
MonitorElement * h2AMCStatusPos_
edm::EDGetToken tagAMC_