CMS 3D CMS Logo

GEMDQMStatusDigi.cc
Go to the documentation of this file.
12 
16 
21 
22 #include <string>
23 #include <fstream>
24 
25 #include <TFile.h>
26 #include <TDirectoryFile.h>
27 
28 //----------------------------------------------------------------------------------------------------
29 
30 using namespace dqm::impl;
31 
32 typedef struct tagTimeStoreItem {
36 
38 
39  Int_t nNbinY;
40  Int_t nNbinMin;
41  Int_t nNbinMax;
43 
45 public:
47  ~GEMDQMStatusDigi() override{};
48  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
49 
50 protected:
51  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
52  void bookHistogramsChamberPart(DQMStore::IBooker &, GEMDetId &);
53  void bookHistogramsStationPart(DQMStore::IBooker &, GEMDetId &);
54  void bookHistogramsAMCPart(DQMStore::IBooker &);
55  void bookHistogramsTimeRecordPart(DQMStore::IBooker &);
56 
57  int SetInfoChambers();
58  int SetConfigTimeRecord();
59  int LoadPrevData();
60 
61  Int_t seekIdx(std::vector<GEMDetId> &listLayers, UInt_t unId);
62  void seekIdxSummary(GEMDetId gid, Int_t &nIdxLayer, Int_t &nIdxChamber);
63 
64  void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override;
65 
66 private:
67  const GEMGeometry *initGeometry(edm::EventSetup const &iSetup);
68 
69  void AddLabel();
70 
71  std::string suffixChamber(GEMDetId &id);
72  std::string suffixLayer(GEMDetId &id);
73 
74  Bool_t FillBits(MonitorElement *monitor, uint64_t unVal, int nNumBits);
75  Bool_t FillBits(MonitorElement *monitor, uint64_t unVal, int nNumBits, int nY);
76 
78  std::shared_ptr<GEMROMapping> GEMROMapping_;
79  std::vector<GEMChamber> gemChambers_;
80 
81  int nNCh_;
82 
83  int cBit_ = 9;
84  int qVFATBit_ = 5;
85  int fVFATBit_ = 4;
86  int eBit_ = 16;
87  int amcStatusBit_ = 6;
88 
93 
95 
96  int nNBxBin_;
98 
102 
104 
109 
110  std::vector<Int_t> listAMCSlots_;
111 
112  std::vector<GEMDetId> m_listLayers;
113  std::vector<GEMDetId> m_listChambers;
114 
117 
118  std::unordered_map<UInt_t, MonitorElement *> listVFATQualityFlag_;
119  std::unordered_map<UInt_t, MonitorElement *> listVFATBC_;
120  std::unordered_map<UInt_t, MonitorElement *> listVFATEC_;
121 
122  std::unordered_map<UInt_t, MonitorElement *> listGEBInputStatus_;
123  std::unordered_map<UInt_t, MonitorElement *> listGEBInputID_;
124  std::unordered_map<UInt_t, MonitorElement *> listGEBVFATWordCnt_;
125  std::unordered_map<UInt_t, MonitorElement *> listGEBVFATWordCntT_;
126  std::unordered_map<UInt_t, MonitorElement *> listGEBZeroSupWordsCnt_;
127  std::unordered_map<UInt_t, MonitorElement *> listGEBbcOH_;
128  std::unordered_map<UInt_t, MonitorElement *> listGEBecOH_;
129  std::unordered_map<UInt_t, MonitorElement *> listGEBOHCRC_;
130 
131  std::unordered_map<UInt_t, Bool_t> m_mapStatusFill;
132  std::unordered_map<UInt_t, Bool_t> m_mapStatusErr;
133 
135  const Int_t m_nIdxSummaryFill = 1, m_nIdxSummaryErr = 2;
136 
143 
145 
146  // For more information, see SetConfigTimeRecord()
147  std::map<UInt_t, TimeStoreItem> listTimeStore_;
150 };
151 
153  const GEMGeometry *GEMGeometry_ = nullptr;
154  try {
156  iSetup.get<MuonGeometryRecord>().get(hGeom);
157  GEMGeometry_ = &*hGeom;
159  edm::LogError("MuonGEMBaseValidation") << "+++ Error : GEM geometry is unavailable on event loop. +++\n";
160  return nullptr;
161  }
162  return GEMGeometry_;
163 }
164 
165 using namespace std;
166 using namespace edm;
167 
169  tagVFAT_ = consumes<GEMVfatStatusDigiCollection>(cfg.getParameter<edm::InputTag>("VFATInputLabel"));
170  tagGEB_ = consumes<GEMGEBdataCollection>(cfg.getParameter<edm::InputTag>("GEBInputLabel"));
171  tagAMC_ = consumes<GEMAMCdataCollection>(cfg.getParameter<edm::InputTag>("AMCInputLabel"));
172  tagDigi_ = consumes<GEMDigiCollection>(cfg.getParameter<edm::InputTag>("digisInputLabel"));
173 
174  listAMCSlots_ = cfg.getParameter<std::vector<int>>("AMCSlots");
175 
176  strFmtSummaryLabel_ = cfg.getParameter<std::string>("summaryLabelFmt");
177  bFlipSummary_ = cfg.getParameter<bool>("flipSummary");
178  bPerSuperchamber_ = cfg.getParameter<bool>("perSuperchamber");
179 
180  strPathPrevDQMRoot_ = cfg.getParameter<std::string>("pathOfPrevDQMRoot");
181  nNEvtPerSec_ = cfg.getParameter<int>("numOfEvtPerSec");
182  nNSecPerBin_ = cfg.getParameter<int>("secOfEvtPerBin");
183  nNTimeBinPrimitive_ = cfg.getParameter<int>("totalTimeInterval");
184 
185  nIdxFirstStrip_ = cfg.getParameter<int>("idxFirstStrip");
186 
187  nNBxRange_ = cfg.getParameter<int>("bxRange");
188  nNBxBin_ = cfg.getParameter<int>("bxBin");
189 }
190 
193  desc.add<edm::InputTag>("VFATInputLabel", edm::InputTag("muonGEMDigis", "vfatStatus"));
194  desc.add<edm::InputTag>("GEBInputLabel", edm::InputTag("muonGEMDigis", "gebStatus"));
195  desc.add<edm::InputTag>("AMCInputLabel", edm::InputTag("muonGEMDigis", "AMCdata"));
196  desc.add<edm::InputTag>("digisInputLabel", edm::InputTag("muonGEMDigis", ""));
197 
198  std::vector<int> listAMCSlotsDef = {0, 1, 2, 3, 4, 5, 6, 7};
199  desc.add<std::vector<int>>("AMCSlots", listAMCSlotsDef); // TODO: Find how to get this from the geometry
200 
201  desc.add<std::string>("summaryLabelFmt", "GE%(station_signed)+i/%(layer)i");
202  desc.add<bool>("flipSummary", false);
203  desc.add<bool>("perSuperchamber", true);
204 
205  desc.add<std::string>("pathOfPrevDQMRoot", "");
206  desc.add<int>("numOfEvtPerSec", 100);
207  desc.add<int>("secOfEvtPerBin", 10);
208  desc.add<int>("totalTimeInterval", 50000);
209 
210  desc.add<int>("idxFirstStrip", 0);
211 
212  desc.add<int>("bxRange", 10);
213  desc.add<int>("bxBin", 20);
214 
215  descriptions.add("GEMDQMStatusDigi", desc);
216 }
217 
219  return "Gemini_" + to_string(id.chamber()) + "_GE" + (id.region() > 0 ? "p" : "m") + to_string(id.station()) + "_" +
220  to_string(id.layer());
221 }
222 
224  return std::string("st_") + (id.region() >= 0 ? "p" : "m") + std::to_string(id.station()) +
225  (bPerSuperchamber_ ? "_la_" + std::to_string(id.layer()) : "");
226 }
227 
229  const std::vector<const GEMSuperChamber *> &superChambers_ = GEMGeometry_->superChambers();
230  for (auto sch : superChambers_) {
231  int nLayer = sch->nChambers();
232  for (int l = 0; l < nLayer; l++) {
233  Bool_t bExist = false;
234  for (auto ch : gemChambers_)
235  if (ch.id() == sch->chamber(l + 1)->id())
236  bExist = true;
237  if (bExist)
238  continue;
239 
240  gemChambers_.push_back(*sch->chamber(l + 1));
241  }
242  }
243 
244  // End: Loading the GEM geometry
245 
246  // Start: Set the configurations
247 
248  m_listLayers.clear();
249 
250  // Summarizing geometry configurations
251  for (auto ch : gemChambers_) {
252  GEMDetId gid = ch.id();
253 
254  GEMDetId layerID(gid.region(), gid.ring(), gid.station(), (bPerSuperchamber_ ? gid.layer() : 0), 0, 0);
255  Bool_t bOcc = false;
256 
257  for (auto lid : m_listLayers) {
258  if (lid == layerID) {
259  bOcc = true;
260  break;
261  }
262  }
263 
264  if (!bOcc)
265  m_listLayers.push_back(layerID);
266 
267  GEMDetId chamberID(0, 1, 1, (bPerSuperchamber_ ? 0 : gid.layer()), gid.chamber(), 0);
268  bOcc = false;
269 
270  for (auto cid : m_listChambers) {
271  if (cid == chamberID) {
272  bOcc = true;
273  break;
274  }
275  }
276 
277  if (!bOcc)
278  m_listChambers.push_back(chamberID);
279  }
280 
281  // Preliminary for sorting the summaries
282  auto lambdaLayer = [this](GEMDetId a, GEMDetId b) -> Bool_t {
283  Int_t nFlipSign = (this->bFlipSummary_ ? -1 : 1);
284  Int_t nA = nFlipSign * a.region() * (20 * a.station() + a.layer());
285  Int_t nB = nFlipSign * b.region() * (20 * b.station() + b.layer());
286  return nA > nB;
287  };
288 
289  auto lambdaChamber = [](GEMDetId a, GEMDetId b) -> Bool_t {
290  Int_t nA = 20 * a.chamber() + a.layer();
291  Int_t nB = 20 * b.chamber() + b.layer();
292  return nA < nB;
293  };
294 
295  // Sorting the summaries
296  std::sort(m_listLayers.begin(), m_listLayers.end(), lambdaLayer);
297  std::sort(m_listChambers.begin(), m_listChambers.end(), lambdaChamber);
298 
299  nNCh_ = (int)m_listChambers.size();
300 
301  return 0;
302 }
303 
304 // 0: General; for whole AMC slots
306  TimeStoreItem newTimeStore;
307 
308  newTimeStore.nNbinMin = 0;
309  newTimeStore.nNbinMax = 0;
310 
311  std::string strCommonName = "per_time_";
312 
313  // Very general GEMDetId
314  newTimeStore.strName = strCommonName + "status_AMCslots";
315  newTimeStore.strTitle = "Status of AMC slots per time";
316  newTimeStore.strAxisX = "AMC slot";
317  newTimeStore.nNbinY = listAMCSlots_.size();
318  listTimeStore_[0] = newTimeStore;
319 
320  for (auto layerId : m_listLayers) {
321  std::string strSuffix =
322  (layerId.region() > 0 ? "p" : "m") + std::to_string(layerId.station()) + "_" + std::to_string(layerId.layer());
323 
324  newTimeStore.strName = strCommonName + "status_GEB_" + suffixLayer(layerId);
325  newTimeStore.strTitle = "";
326  newTimeStore.strAxisX = "Chamber";
327 
328  newTimeStore.nNbinY = nNCh_;
329  listTimeStore_[layerId] = newTimeStore;
330  }
331 
332  for (auto ch : gemChambers_) {
333  auto chId = ch.id();
334  GEMDetId chIdStatus(chId.region(), chId.ring(), chId.station(), chId.layer(), chId.chamber(), 1);
335  GEMDetId chIdDigi(chId.region(), chId.ring(), chId.station(), chId.layer(), chId.chamber(), 2);
336  GEMDetId chIdBx(chId.region(), chId.ring(), chId.station(), chId.layer(), chId.chamber(), 3);
337 
338  std::string strSuffix = suffixChamber(chId);
339 
340  Int_t nVFAT = 0;
341  if (chId.station() == 1)
343  if (chId.station() == 2)
345 
346  newTimeStore.strName = strCommonName + "status_chamber_" + strSuffix;
347  newTimeStore.strTitle = "";
348  newTimeStore.strAxisX = "VFAT";
349 
350  newTimeStore.nNbinY = nVFAT;
351  listTimeStore_[chIdStatus] = newTimeStore;
352 
353  newTimeStore.strName = strCommonName + "digi_chamber_" + strSuffix;
354  newTimeStore.strTitle = "";
355  newTimeStore.strAxisX = "VFAT";
356 
357  newTimeStore.nNbinY = nVFAT;
358  listTimeStore_[chIdDigi] = newTimeStore;
359 
360  newTimeStore.strName = strCommonName + "bx_chamber_" + strSuffix;
361  newTimeStore.strTitle = "";
362  newTimeStore.strAxisX = "Bunch crossing";
363 
364  newTimeStore.nNbinY = nNBxBin_;
365  newTimeStore.nNbinMin = -nNBxRange_;
366  newTimeStore.nNbinMax = nNBxRange_;
367 
368  listTimeStore_[chIdBx] = newTimeStore;
369 
370  newTimeStore.nNbinMin = newTimeStore.nNbinMax = 0;
371  }
372 
373  return 0;
374 }
375 
377  TFile *fPrev;
378  Bool_t bSync = true;
379 
380  nStackedBin_ = 0;
381  nStackedEvt_ = 0;
382 
383  if (strPathPrevDQMRoot_.empty())
384  return 0;
385 
386  std::ifstream fExist(strPathPrevDQMRoot_.c_str());
387  if (!fExist.good())
388  return 0;
389  fExist.close();
390 
391  fPrev = new TFile(strPathPrevDQMRoot_.c_str());
392  if (fPrev == nullptr)
393  return 1;
394 
395  std::cout << strPathPrevDQMRoot_ << " is being loaded" << std::endl;
396  std::string strRunnum = ((TDirectoryFile *)fPrev->Get("DQMData"))->GetListOfKeys()->At(0)->GetName();
397 
398  // In this stage, we need to use them to check the consistence of time-histograms
399  nStackedBin_ = -1;
400  nStackedEvt_ = -1;
401 
402  for (auto &itStore : listTimeStore_) {
403  std::string strNameStore = "DQMData/" + strRunnum + "/GEM/Run summary/StatusDigi/" + itStore.second.strName;
404  TH2F *h2Prev = (TH2F *)fPrev->Get(strNameStore.c_str());
405 
406  Int_t nNBinX = h2Prev->GetNbinsX();
407  Int_t nNBinY = h2Prev->GetNbinsY();
408 
409  // Including all under/overflow bins (they contain important infos)
410  nStackedEvt_ = 0;
411  for (Int_t i = 0; i <= nNBinX + 1; i++) {
412  if (i > 0)
413  nStackedEvt_ += h2Prev->GetBinContent(i, 0);
414  for (Int_t j = 0; j <= nNBinY + 1; j++) {
415  itStore.second.h2Histo->setBinContent(i, j, h2Prev->GetBinContent(i, j));
416  }
417  }
418 
419  Int_t nStackedBinCurr = nStackedEvt_ / (nNSecPerBin_ * nNEvtPerSec_);
420  Int_t nStackedEvtCurr = nStackedEvt_ % (nNSecPerBin_ * nNEvtPerSec_);
421 
422  if (nStackedBin_ < 0) {
423  nStackedBin_ = nStackedBinCurr;
424  nStackedEvt_ = nStackedEvtCurr;
425  } else {
426  bSync = (nStackedBin_ == nStackedBinCurr && nStackedEvt_ == nStackedEvtCurr);
427  }
428  }
429 
430  if (!bSync) { // No sync...!
431  std::cerr << "WARNING: No sync on time histograms" << std::endl;
432  }
433 
434  fPrev->Close();
435 
436  return 0;
437 }
438 
439 void GEMDQMStatusDigi::bookHistogramsChamberPart(DQMStore::IBooker &ibooker, GEMDetId &gid) {
440  std::string hName, hTitle;
441 
442  UInt_t unBinPos;
443 
444  std::string strIdxName = suffixChamber(gid);
445  std::string strIdxTitle = "GEMINIm" + to_string(gid.chamber()) + " in GE" + (gid.region() > 0 ? "+" : "-") +
446  to_string(gid.station()) + "/" + to_string(gid.layer());
447 
448  Int_t nVFAT = 0;
449  if (gid.station() == 1)
451  if (gid.station() == 2)
453 
454  hName = "vfatStatus_QualityFlag_" + strIdxName;
455  hTitle = "VFAT quality " + strIdxTitle;
456  hTitle += ";VFAT;";
457  listVFATQualityFlag_[gid] = ibooker.book2D(hName, hTitle, nVFAT, 0, nVFAT, 9, 0, 9);
458 
459  hName = "vfatStatus_BC_" + strIdxName;
460  hTitle = "VFAT bunch crossing " + strIdxTitle;
461  hTitle += ";Bunch crossing;VFAT";
462  listVFATBC_[gid] = ibooker.book2D(hName, hTitle, nNBxBin_, -nNBxRange_, nNBxRange_, nVFAT, 0, nVFAT);
463 
464  hName = "vfatStatus_EC_" + strIdxName;
465  hTitle = "VFAT event counter " + strIdxTitle;
466  hTitle += ";Event counter;VFAT";
467  listVFATEC_[gid] = ibooker.book2D(hName, hTitle, 256, 0, 256, nVFAT, 0, nVFAT);
468 
469  unBinPos = 1;
470  listVFATQualityFlag_[gid]->setBinLabel(unBinPos++, "Good", 2);
471  listVFATQualityFlag_[gid]->setBinLabel(unBinPos++, "CRC fail", 2);
472  listVFATQualityFlag_[gid]->setBinLabel(unBinPos++, "b1010 fail", 2);
473  listVFATQualityFlag_[gid]->setBinLabel(unBinPos++, "b1100 fail", 2);
474  listVFATQualityFlag_[gid]->setBinLabel(unBinPos++, "b1110 fail", 2);
475  listVFATQualityFlag_[gid]->setBinLabel(unBinPos++, "Hamming error", 2);
476  listVFATQualityFlag_[gid]->setBinLabel(unBinPos++, "AFULL", 2);
477  listVFATQualityFlag_[gid]->setBinLabel(unBinPos++, "SEUlogic", 2);
478  listVFATQualityFlag_[gid]->setBinLabel(unBinPos++, "SUEI2C", 2);
479 
480  m_mapStatusFill[gid] = false;
481  m_mapStatusErr[gid] = false;
482 }
483 
484 void GEMDQMStatusDigi::bookHistogramsStationPart(DQMStore::IBooker &ibooker, GEMDetId &lid) {
485  UInt_t unBinPos;
486 
487  Int_t re = lid.region();
488  UInt_t st = lid.station();
489  UInt_t la = lid.layer();
490 
491  auto newbookGEB = [this](DQMStore::IBooker &ibooker,
492  std::string strName,
493  std::string strTitle,
494  std::string strAxis,
495  GEMDetId &lid,
496  int nLayer,
497  int nStation,
498  int re,
499  int nBin,
500  float fMin,
501  float fMax) -> MonitorElement * {
502  strName = strName + "_" + suffixLayer(lid);
503  strTitle = strTitle + ", station: " + (re >= 0 ? "+" : "-") + std::to_string(nStation);
504 
505  if (bPerSuperchamber_) {
506  strTitle += ", layer: " + std::to_string(nLayer);
507  }
508 
509  strTitle += ";Chamber;" + strAxis;
510 
511  auto hNew = ibooker.book2D(strName, strTitle, this->nNCh_, 0, this->nNCh_, nBin, fMin, fMax);
512 
513  for (Int_t i = 0; i < this->nNCh_; i++) {
514  auto &gid = this->m_listChambers[i];
515  Int_t nCh = gid.chamber() + (this->bPerSuperchamber_ ? 0 : gid.layer() - 1);
516  hNew->setBinLabel(i + 1, std::to_string(nCh), 1);
517  }
518 
519  return hNew;
520  };
521 
522  listGEBInputStatus_[lid] =
523  newbookGEB(ibooker, "geb_input_status", "inputStatus", "", lid, la, st, re, eBit_, 0, eBit_);
524  listGEBInputID_[lid] = newbookGEB(ibooker, "geb_input_ID", "inputID", "Input ID", lid, la, st, re, 32, 0, 32);
525  listGEBVFATWordCnt_[lid] =
526  newbookGEB(ibooker, "geb_no_vfats", "nvfats in header", "Number of VFATs in header", lid, la, st, re, 25, 0, 25);
527  listGEBVFATWordCntT_[lid] = newbookGEB(
528  ibooker, "geb_no_vfatsT", "nvfats in trailer", "Number of VFATs in trailer", lid, la, st, re, 25, 0, 25);
529  listGEBZeroSupWordsCnt_[lid] = newbookGEB(
530  ibooker, "geb_zeroSupWordsCnt", "zeroSupWordsCnt", "Zero sup. words count", lid, la, st, re, 10, 0, 10);
531 
532  listGEBbcOH_[lid] =
533  newbookGEB(ibooker, "geb_bcOH", "OH bunch crossing", "OH bunch crossing", lid, la, st, re, 3600, 0, 3600);
534  listGEBecOH_[lid] =
535  newbookGEB(ibooker, "geb_ecOH", "OH event coounter", "OH event counter", lid, la, st, re, 256, 0, 256);
536  listGEBOHCRC_[lid] =
537  newbookGEB(ibooker, "geb_OHCRC", "CRC of OH data", "CRC of OH data", lid, la, st, re, 65536, 0, 65536);
538 
539  unBinPos = 1;
540  listGEBInputStatus_[lid]->setBinLabel(unBinPos++, "BX mismatch GLIB OH", 2);
541  listGEBInputStatus_[lid]->setBinLabel(unBinPos++, "BX mismatch GLIB VFAT", 2);
542  listGEBInputStatus_[lid]->setBinLabel(unBinPos++, "OOS GLIB OH", 2);
543  listGEBInputStatus_[lid]->setBinLabel(unBinPos++, "OOS GLIB VFAT", 2);
544  listGEBInputStatus_[lid]->setBinLabel(unBinPos++, "No VFAT marker", 2);
545  listGEBInputStatus_[lid]->setBinLabel(unBinPos++, "Event size warn", 2);
546  listGEBInputStatus_[lid]->setBinLabel(unBinPos++, "L1AFIFO near full", 2);
547  listGEBInputStatus_[lid]->setBinLabel(unBinPos++, "InFIFO near full", 2);
548  listGEBInputStatus_[lid]->setBinLabel(unBinPos++, "EvtFIFO near full", 2);
549  listGEBInputStatus_[lid]->setBinLabel(unBinPos++, "Event size overflow", 2);
550  listGEBInputStatus_[lid]->setBinLabel(unBinPos++, "L1AFIFO full", 2);
551  listGEBInputStatus_[lid]->setBinLabel(unBinPos++, "InFIFO full", 2);
552  listGEBInputStatus_[lid]->setBinLabel(unBinPos++, "EvtFIFO full", 2);
553  listGEBInputStatus_[lid]->setBinLabel(unBinPos++, "Input FIFO underflow", 2);
554  listGEBInputStatus_[lid]->setBinLabel(unBinPos++, "Stuck data", 2);
555  listGEBInputStatus_[lid]->setBinLabel(unBinPos++, "Event FIFO underflow", 2);
556 }
557 
558 void GEMDQMStatusDigi::bookHistogramsAMCPart(DQMStore::IBooker &ibooker) {
559  h2AMCStatus_ = ibooker.book2D("amc_statusflag",
560  "Status of AMC slots;AMC slot;",
561  listAMCSlots_.size(),
562  0,
563  listAMCSlots_.size(),
564  amcStatusBit_,
565  0,
566  amcStatusBit_);
567 
568  uint32_t unBinPos = 1;
569  h2AMCStatus_->setBinLabel(unBinPos++, "BC0 not locked", 2);
570  h2AMCStatus_->setBinLabel(unBinPos++, "DAQ not ready", 2);
571  h2AMCStatus_->setBinLabel(unBinPos++, "DAQ clock not locked", 2);
572  h2AMCStatus_->setBinLabel(unBinPos++, "MMCM not locked", 2);
573  h2AMCStatus_->setBinLabel(unBinPos++, "Back pressure", 2);
574  h2AMCStatus_->setBinLabel(unBinPos++, "GLIB out-of-sync", 2);
575 }
576 
577 void GEMDQMStatusDigi::bookHistogramsTimeRecordPart(DQMStore::IBooker &ibooker) {
578  for (auto &itStore : listTimeStore_) {
579  auto &infoCurr = itStore.second;
580 
581  Float_t fMin = -0.5, fMax = infoCurr.nNbinY - 0.5;
582 
583  if (infoCurr.nNbinMin < infoCurr.nNbinMax) {
584  fMin = infoCurr.nNbinMin;
585  fMax = infoCurr.nNbinMax;
586  }
587 
588  infoCurr.h2Histo = ibooker.book2D(
589  infoCurr.strName,
590  infoCurr.strTitle + ";Per " + std::to_string(nNSecPerBin_ * nNEvtPerSec_) + " events;" + infoCurr.strAxisX,
591  nNTimeBinPrimitive_,
592  0,
593  nNTimeBinPrimitive_,
594  infoCurr.nNbinY,
595  fMin,
596  fMax);
597 
598  if (seekIdx(m_listLayers, itStore.first) >= 0) {
599  for (Int_t i = 0; i < nNCh_; i++) {
600  auto &gid = m_listChambers[i];
601  Int_t nCh = gid.chamber() + (bPerSuperchamber_ ? 0 : gid.layer() - 1);
602  infoCurr.h2Histo->setBinLabel(i + 1, std::to_string(nCh), 2);
603  }
604  }
605  }
606 }
607 
608 // To make labels like python, with std::(unordered_)map
609 std::string printfWithMap(std::string strFmt, std::unordered_map<std::string, Int_t> mapArg) {
610  std::string strRes = strFmt;
611  char szOutFmt[64];
612  size_t unPos, unPosEnd;
613 
614  for (unPos = strRes.find('%'); unPos != std::string::npos; unPos = strRes.find('%', unPos + 1)) {
615  unPosEnd = strRes.find(')', unPos);
616  if (strRes[unPos + 1] != '(' || unPosEnd == std::string::npos)
617  break; // Syntax error
618 
619  // Extracting the key
620  std::string strKey = strRes.substr(unPos + 2, unPosEnd - (unPos + 2));
621 
622  // To treat formats like '%5i' or '%02i', extracting '5' or '02'
623  // After do this,
624  std::string strOptNum = "%";
625  unPosEnd++;
626 
627  for (;; unPosEnd++) {
628  if (!('0' <= strRes[unPosEnd] && strRes[unPosEnd] <= '9') && strRes[unPosEnd] != '+')
629  break;
630  strOptNum += strRes[unPosEnd];
631  }
632 
633  if (strRes[unPosEnd] != 'i' && strRes[unPosEnd] != 'd')
634  break; // Syntax error
635  strOptNum += strRes[unPosEnd];
636  unPosEnd++;
637 
638  sprintf(szOutFmt, strOptNum.c_str(), mapArg[strKey]);
639  strRes = strRes.substr(0, unPos) + szOutFmt + strRes.substr(unPosEnd);
640  }
641 
642  if (unPos != std::string::npos) { // It means... an syntax error occurs!
643  std::cerr << "ERROR: Syntax error on printfWithMap(); " << std::endl;
644  return "";
645  }
646 
647  return strRes;
648 }
649 
650 void GEMDQMStatusDigi::bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &iSetup) {
651  // Start: Loading the GEM geometry
652 
653  GEMGeometry_ = initGeometry(iSetup);
654  if (GEMGeometry_ == nullptr)
655  return;
656 
657  SetInfoChambers();
658 
659  // End: Set the configurations
660 
661  // Start: Setting books
662 
663  ibooker.cd();
664  ibooker.setCurrentFolder("GEM/StatusDigi");
665 
666  for (auto ch : gemChambers_) {
667  GEMDetId gid = ch.id();
668  bookHistogramsChamberPart(ibooker, gid);
669  }
670 
671  for (auto lid : m_listLayers) {
672  bookHistogramsStationPart(ibooker, lid);
673  }
674 
675  bookHistogramsAMCPart(ibooker);
676 
677  // Setting the informations for time histograms
678  SetConfigTimeRecord();
679  bookHistogramsTimeRecordPart(ibooker);
680  LoadPrevData();
681 
682  h1_vfat_qualityflag_ = ibooker.book1D("vfat_quality_flag", "quality and flag", 9, 0, 9);
683  h2_vfat_qualityflag_ = ibooker.book2D("vfat_quality_flag_per_geb", "quality and flag", nNCh_, 0, nNCh_, 9, 0, 9);
684 
685  h1_amc_ttsState_ = ibooker.book1D("amc_ttsState", "ttsState", 10, 0, 10);
686  h1_amc_davCnt_ = ibooker.book1D("amc_davCnt", "davCnt", 10, 0, 10);
687  h1_amc_buffState_ = ibooker.book1D("amc_buffState", "buffState", 10, 0, 10);
688  h1_amc_oosGlib_ = ibooker.book1D("amc_oosGlib", "oosGlib", 10, 0, 10);
689  h1_amc_chTimeOut_ = ibooker.book1D("amc_chTimeOut", "chTimeOut", 10, 0, 10);
690 
691  ibooker.cd();
692  ibooker.setCurrentFolder("GEM/EventInfo");
693 
694  h3SummaryStatusPre_ = ibooker.book3D(
695  "reportSummaryMapPreliminary", ";Chamber;", nNCh_, 0, nNCh_, m_listLayers.size(), 0, m_listLayers.size(), 2, 0, 1);
696 
697  for (Int_t i = 0; i < nNCh_; i++) {
698  auto &gid = this->m_listChambers[i];
699  Int_t nCh = gid.chamber() + (bPerSuperchamber_ ? 0 : gid.layer() - 1);
700  h3SummaryStatusPre_->setBinLabel(i + 1, std::to_string(nCh), 1);
701  }
702 
703  Int_t nIdxLayer = 0;
704  std::unordered_map<std::string, Int_t> mapArg;
705 
706  // Start: Labeling section
707 
708  for (auto lid : m_listLayers) {
709  mapArg["station_signed"] = lid.region() * lid.station();
710  mapArg["region"] = lid.region();
711  mapArg["station"] = lid.station();
712  mapArg["layer"] = lid.layer();
713  mapArg["chamber"] = lid.chamber();
714 
715  h3SummaryStatusPre_->setBinLabel(nIdxLayer + 1, printfWithMap(strFmtSummaryLabel_, mapArg), 2);
716  nIdxLayer++;
717  }
718 }
719 
721  int i = 0;
722  uint64_t unFlag = 1;
723 
724  if (monitor == nullptr)
725  return false;
726 
727  for (; i < nNumBits; i++, unFlag <<= 1) {
728  if ((unVal & unFlag) != 0) {
729  monitor->Fill(i);
730  }
731  }
732 
733  return true;
734 }
735 
736 Bool_t GEMDQMStatusDigi::FillBits(MonitorElement *monitor, uint64_t unVal, int nNumBits, int nX) {
737  int i = 0;
738  uint64_t unFlag = 1;
739 
740  if (monitor == nullptr)
741  return false;
742 
743  for (; i < nNumBits; i++, unFlag <<= 1) {
744  if ((unVal & unFlag) != 0) {
745  monitor->Fill(nX, i);
746  }
747  }
748 
749  return true;
750 }
751 
752 Int_t GEMDQMStatusDigi::seekIdx(std::vector<GEMDetId> &listLayers, UInt_t unId) {
753  if (unId < 256)
754  return -1;
755 
756  GEMDetId id(unId);
757  for (Int_t nIdx = 0; nIdx < (Int_t)listLayers.size(); nIdx++)
758  if (id == listLayers[nIdx])
759  return nIdx;
760  return -1;
761 }
762 
763 void GEMDQMStatusDigi::seekIdxSummary(GEMDetId gid, Int_t &nIdxLayer, Int_t &nIdxChamber) {
764  Int_t nLayer = (bPerSuperchamber_ ? gid.layer() : 0);
765  GEMDetId layerId(gid.region(), gid.ring(), gid.station(), nLayer, 0, 0);
766  GEMDetId chamberId(0, 1, 1, gid.layer() - nLayer, gid.chamber(), 0);
767 
768  nIdxLayer = seekIdx(m_listLayers, layerId) + 1;
769  nIdxChamber = seekIdx(m_listChambers, chamberId) + 1;
770 }
771 
773  Bool_t bIsNotEmpty = true;
774 
779 
780  event.getByToken(tagVFAT_, gemVFAT);
781  event.getByToken(tagGEB_, gemGEB);
782  event.getByToken(tagAMC_, gemAMC);
783  event.getByToken(tagDigi_, gemDigis);
784 
785  auto fillTimeHisto = [](TimeStoreItem &listCurr, int nStackedBin, int nIdx, bool bFill) -> void {
786  Int_t nX = nStackedBin + 1;
787  Int_t nY = nIdx + 1;
788 
789  listCurr.h2Histo->setBinContent(nX, 0, listCurr.h2Histo->getBinContent(nX, 0) + 1);
790  if (bFill)
791  listCurr.h2Histo->setBinContent(nX, nY, listCurr.h2Histo->getBinContent(nX, nY) + 1);
792  };
793 
794  for (GEMVfatStatusDigiCollection::DigiRangeIterator vfatIt = gemVFAT->begin(); vfatIt != gemVFAT->end(); ++vfatIt) {
795  GEMDetId gemid = (*vfatIt).first;
796  GEMDetId gemchId = gemid.chamberId();
797  GEMDetId gemOnlychId(0, 1, 1, (bPerSuperchamber_ ? 0 : gemid.layer()), gemid.chamber(), 0);
798 
799  int nIdx = seekIdx(m_listChambers, gemOnlychId);
800  int nRoll = gemid.roll();
801  const GEMVfatStatusDigiCollection::Range &range = (*vfatIt).second;
802 
803  GEMDetId chIdStatus(gemid.region(), gemid.ring(), gemid.station(), gemid.layer(), gemid.chamber(), 1);
804  if (listTimeStore_.find((UInt_t)chIdStatus) == listTimeStore_.end()) {
805  edm::LogError("BadGeometry") << "Wrong detId which is not in the current geometry (VFAT status): " << gemchId
806  << std::endl;
807  continue;
808  }
809 
810  auto &listCurr = listTimeStore_[chIdStatus];
811 
812  for (auto vfatStat = range.first; vfatStat != range.second; ++vfatStat) {
813  bIsNotEmpty = true;
814 
815  uint64_t unQFVFAT = vfatStat->quality() /* | (vfatStat->flag() << qVFATBit_)*/;
816  if ((unQFVFAT & ~0x1) == 0) {
817  unQFVFAT |= 0x1; // If no error, then it should be 'Good'
818  } else { // Error!!
819  Int_t nIdxLayer, nIdxChamber;
820  seekIdxSummary(gemchId, nIdxLayer, nIdxChamber);
821  h3SummaryStatusPre_->setBinContent(nIdxChamber, nIdxLayer, m_nIdxSummaryErr, 1.0);
822  }
823 
824  FillBits(h1_vfat_qualityflag_, unQFVFAT, qVFATBit_ + fVFATBit_);
825  FillBits(h2_vfat_qualityflag_, unQFVFAT, qVFATBit_ + fVFATBit_, nIdx); // They could be there
826 
827  int nVFAT = (GEMeMap::maxEtaPartition_ - nRoll) + GEMeMap::maxEtaPartition_ * vfatStat->phi();
828  bIsNotEmpty = FillBits(listVFATQualityFlag_[gemchId], unQFVFAT, qVFATBit_ + fVFATBit_, nVFAT);
829 
830  if (!bIsNotEmpty) {
831  edm::LogError("BadGeometry") << "Wrong detId which is not in the current geometry (VFAT status): " << gemchId
832  << std::endl;
833  continue;
834  }
835 
836  listVFATEC_[gemchId]->Fill(vfatStat->ec(), nVFAT);
837 
838  fillTimeHisto(listCurr, nStackedBin_, nVFAT, (unQFVFAT & ~0x1) != 0);
839  }
840  }
841 
842  for (GEMGEBdataCollection::DigiRangeIterator gebIt = gemGEB->begin(); gebIt != gemGEB->end(); ++gebIt) {
843  GEMDetId gemid = (*gebIt).first;
844  GEMDetId lid(gemid.region(), gemid.ring(), gemid.station(), (bPerSuperchamber_ ? gemid.layer() : 0), 0, 0);
845  GEMDetId chid(0, 1, 1, (bPerSuperchamber_ ? 0 : gemid.layer()), gemid.chamber(), 0);
846 
847  Int_t nCh = seekIdx(m_listChambers, chid);
848 
849  if (listTimeStore_.find((UInt_t)lid) == listTimeStore_.end()) {
850  edm::LogError("BadGeometry") << "Wrong detId which is not in the current geometry (GEB status): " << lid
851  << std::endl;
852  continue;
853  }
854 
855  auto &listCurr = listTimeStore_[lid];
856 
857  const GEMGEBdataCollection::Range &range = (*gebIt).second;
858  for (auto GEBStatus = range.first; GEBStatus != range.second; ++GEBStatus) {
859  bIsNotEmpty = true;
860 
861  uint64_t unBit = 0;
862  uint64_t unStatus = 0;
863 
864  unStatus |= (GEBStatus->bxmVvV() << unBit++);
865  unStatus |= (GEBStatus->bxmAvV() << unBit++);
866  unStatus |= (GEBStatus->oOScVvV() << unBit++);
867  unStatus |= (GEBStatus->oOScAvV() << unBit++);
868  unStatus |= (GEBStatus->noVFAT() << unBit++);
869  unStatus |= (GEBStatus->evtSzW() << unBit++);
870  unStatus |= (GEBStatus->l1aNF() << unBit++);
871  unStatus |= (GEBStatus->inNF() << unBit++);
872  unStatus |= (GEBStatus->evtNF() << unBit++);
873  unStatus |= (GEBStatus->evtSzOFW() << unBit++);
874  unStatus |= (GEBStatus->l1aF() << unBit++);
875  unStatus |= (GEBStatus->inF() << unBit++);
876  unStatus |= (GEBStatus->evtF() << unBit++);
877  unStatus |= (GEBStatus->inUfw() << unBit++);
878  unStatus |= (GEBStatus->stuckData() << unBit++);
879  unStatus |= (GEBStatus->evUfw() << unBit++);
880 
881  if (unStatus != 0) { // Error!
882  Int_t nIdxLayer, nIdxChamber;
883  seekIdxSummary(gemid, nIdxLayer, nIdxChamber);
884  h3SummaryStatusPre_->setBinContent(nIdxChamber, nIdxLayer, m_nIdxSummaryErr, 1.0);
885  }
886 
887  bIsNotEmpty = FillBits(listGEBInputStatus_[lid], unStatus, eBit_, nCh);
888 
889  if (!bIsNotEmpty) {
890  edm::LogError("BadGeometry") << "Wrong detId which is not in the current geometry (GEB status): " << lid
891  << std::endl;
892  continue;
893  }
894 
895  listGEBInputID_[lid]->Fill(nCh, GEBStatus->inputID());
896  listGEBVFATWordCnt_[lid]->Fill(nCh, GEBStatus->vfatWordCnt() / 3);
897  listGEBVFATWordCntT_[lid]->Fill(nCh, GEBStatus->vfatWordCntT() / 3);
898  listGEBZeroSupWordsCnt_[lid]->Fill(nCh, GEBStatus->zeroSupWordsCnt());
899 
900  listGEBbcOH_[lid]->Fill(nCh, GEBStatus->bcOH());
901  listGEBecOH_[lid]->Fill(nCh, GEBStatus->ecOH());
902  listGEBOHCRC_[lid]->Fill(nCh, GEBStatus->crc());
903 
904  fillTimeHisto(listCurr, nStackedBin_, nCh, unStatus != 0);
905  }
906  }
907 
908  auto findAMCIdx = [this](Int_t nAMCnum) -> Int_t {
909  for (Int_t i = 0; i < (Int_t)listAMCSlots_.size(); i++)
910  if (listAMCSlots_[i] == nAMCnum)
911  return i;
912  return -1;
913  };
914 
915  for (GEMAMCdataCollection::DigiRangeIterator amcIt = gemAMC->begin(); amcIt != gemAMC->end(); ++amcIt) {
916  const GEMAMCdataCollection::Range &range = (*amcIt).second;
917  auto &listCurr = listTimeStore_[0];
918  for (auto amc = range.first; amc != range.second; ++amc) {
919  Int_t nIdAMC = findAMCIdx(amc->amcNum());
920  uint64_t unBit = 0;
921  uint64_t unStatus = 0;
922 
923  unStatus |= (!amc->bc0locked() << unBit++);
924  unStatus |= (!amc->daqReady() << unBit++);
925  unStatus |= (!amc->daqClockLocked() << unBit++);
926  unStatus |= (!amc->mmcmLocked() << unBit++);
927  unStatus |= (amc->backPressure() << unBit++);
928  unStatus |= (amc->oosGlib() << unBit++);
929 
930  FillBits(h2AMCStatus_, unStatus, amcStatusBit_, nIdAMC);
931 
932  h1_amc_ttsState_->Fill(amc->ttsState());
933  h1_amc_davCnt_->Fill(amc->davCnt());
934  h1_amc_buffState_->Fill(amc->buffState());
935  h1_amc_oosGlib_->Fill(amc->oosGlib());
936  h1_amc_chTimeOut_->Fill(amc->linkTo());
937 
938  fillTimeHisto(listCurr, nStackedBin_, nIdAMC, unStatus != 0);
939  }
940  }
941 
942  auto findVFATByStrip = [](GEMDetId gid, Int_t nIdxStrip, Int_t nNumStrips) -> Int_t {
943  Int_t nNumEtaPart = GEMeMap::maxEtaPartition_;
944 
945  // Strip: Start at 0
946  if (gid.station() == 1) { // GE1/1
947  Int_t nNumVFAT = GEMeMap::maxVFatGE11_;
948  return nNumEtaPart * ((Int_t)(nIdxStrip / (nNumStrips / nNumVFAT)) + 1) - gid.roll();
949  } else if (gid.station() == 2) { // GE2/1
950  Int_t nNumVFAT = GEMeMap::maxVFatGE21_;
951  return nNumEtaPart * ((Int_t)(nIdxStrip / (nNumStrips / nNumVFAT)) + 1) - gid.roll();
952  }
953 
954  return -1;
955  };
956 
957  // Checking if there is a fire (data)
958  for (auto ch : gemChambers_) {
959  GEMDetId cId = ch.id();
960  Bool_t bIsHit = false;
961 
962  // Because every fired strip in a same VFAT shares a same bx, we keep bx from only one strip
963  std::unordered_map<Int_t, Int_t> mapBXVFAT;
964 
965  GEMDetId chIdDigi(cId.region(), cId.ring(), cId.station(), cId.layer(), cId.chamber(), 2);
966  GEMDetId chIdBx(cId.region(), cId.ring(), cId.station(), cId.layer(), cId.chamber(), 3);
967 
968  auto &listCurrDigi = listTimeStore_[chIdDigi];
969  auto &listCurrBx = listTimeStore_[chIdBx];
970 
971  for (auto roll : ch.etaPartitions()) {
972  GEMDetId rId = roll->id();
973  const auto &digis_in_det = gemDigis->get(rId);
974 
975  for (auto d = digis_in_det.first; d != digis_in_det.second; ++d) {
976  Int_t nIdxStrip = d->strip() - nIdxFirstStrip_;
977  Int_t nVFAT = findVFATByStrip(rId, nIdxStrip, roll->nstrips());
978 
979  bIsHit = true;
980  mapBXVFAT[nVFAT] = d->bx();
981  fillTimeHisto(listCurrDigi, nStackedBin_, nVFAT, true);
982 
983  Int_t nIdxBx;
984 
985  if (d->bx() < listCurrBx.nNbinMin)
986  nIdxBx = 0;
987  else if (d->bx() >= listCurrBx.nNbinMax)
988  nIdxBx = listCurrBx.nNbinY - 1;
989  else
990  nIdxBx = (Int_t)(listCurrBx.nNbinY * 1.0 * (d->bx() - listCurrBx.nNbinMin) /
991  (listCurrBx.nNbinMax - listCurrBx.nNbinMin));
992 
993  fillTimeHisto(listCurrBx, nStackedBin_, nIdxBx, true);
994  }
995  }
996 
997  for (auto bx : mapBXVFAT)
998  listVFATBC_[cId]->Fill(bx.second, bx.first);
999 
1000  if (bIsHit) { // Data occur!
1001  Int_t nIdxLayer, nIdxChamber;
1002  seekIdxSummary(cId, nIdxLayer, nIdxChamber);
1003  h3SummaryStatusPre_->setBinContent(nIdxChamber, nIdxLayer, m_nIdxSummaryFill, 1.0);
1004  }
1005  }
1006 
1007  // Counting the time tables
1008  nStackedEvt_++;
1009  if (nStackedEvt_ >= nNSecPerBin_ * nNEvtPerSec_) { // Time to jump!
1010  nStackedBin_++;
1011  nStackedEvt_ = 0;
1012  }
1013 }
1014 
GEMDQMStatusDigi::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: GEMDQMStatusDigi.cc:650
dqm::impl
Definition: MonitorElement.h:74
GEMDQMStatusDigi::listGEBVFATWordCnt_
std::unordered_map< UInt_t, MonitorElement * > listGEBVFATWordCnt_
Definition: GEMDQMStatusDigi.cc:124
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
GEMDQMStatusDigi::h1_vfat_qualityflag_
MonitorElement * h1_vfat_qualityflag_
Definition: GEMDQMStatusDigi.cc:115
GEMDQMStatusDigi::nStackedBin_
Int_t nStackedBin_
Definition: GEMDQMStatusDigi.cc:148
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
tagTimeStoreItem::nNbinMin
Int_t nNbinMin
Definition: GEMDQMStatusDigi.cc:40
MessageLogger.h
GEMGEBdataCollection.h
GEMDetId::ring
constexpr int ring() const
Definition: GEMDetId.h:170
GEMDQMStatusDigi::bFlipSummary_
bool bFlipSummary_
Definition: GEMDQMStatusDigi.cc:100
bookHistograms
example_stream void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
GEMDQMStatusDigi::bPerSuperchamber_
bool bPerSuperchamber_
Definition: GEMDQMStatusDigi.cc:101
GEMDQMStatusDigi::suffixLayer
std::string suffixLayer(GEMDetId &id)
Definition: GEMDQMStatusDigi.cc:223
ESHandle.h
GEMDetId::layer
constexpr int layer() const
Definition: GEMDetId.h:184
tagTimeStoreItem::strTitle
std::string strTitle
Definition: GEMDQMStatusDigi.cc:34
GEMDQMStatusDigi::nStackedEvt_
Int_t nStackedEvt_
Definition: GEMDQMStatusDigi.cc:149
edm::Run
Definition: Run.h:45
GEMVfatStatusDigiCollection.h
GEMDetId::region
constexpr int region() const
Definition: GEMDetId.h:165
GEMDQMStatusDigi::strFmtSummaryLabel_
std::string strFmtSummaryLabel_
Definition: GEMDQMStatusDigi.cc:99
relativeConstraints.station
station
Definition: relativeConstraints.py:67
edm
HLT enums.
Definition: AlignableModifier.h:19
TimeStoreItem
struct tagTimeStoreItem TimeStoreItem
gather_cfg.cout
cout
Definition: gather_cfg.py:144
GEMDQMStatusDigi::h1_amc_oosGlib_
MonitorElement * h1_amc_oosGlib_
Definition: GEMDQMStatusDigi.cc:140
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
GEMDQMStatusDigi::h1_amc_chTimeOut_
MonitorElement * h1_amc_chTimeOut_
Definition: GEMDQMStatusDigi.cc:141
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
GEMDQMStatusDigi::listVFATBC_
std::unordered_map< UInt_t, MonitorElement * > listVFATBC_
Definition: GEMDQMStatusDigi.cc:119
GEMDQMStatusDigi
Definition: GEMDQMStatusDigi.cc:44
GEMDQMStatusDigi::bookHistogramsStationPart
void bookHistogramsStationPart(DQMStore::IBooker &, GEMDetId &)
Definition: GEMDQMStatusDigi.cc:484
DQMStore.h
GEMDQMStatusDigi::SetConfigTimeRecord
int SetConfigTimeRecord()
Definition: GEMDQMStatusDigi.cc:305
GEMAMCdataCollection.h
GEMDQMStatusDigi::gemChambers_
std::vector< GEMChamber > gemChambers_
Definition: GEMDQMStatusDigi.cc:79
edm::Handle
Definition: AssociativeIterator.h:50
PFElectronDQMAnalyzer_cfi.nBin
nBin
Definition: PFElectronDQMAnalyzer_cfi.py:25
GEMDQMStatusDigi::SetInfoChambers
int SetInfoChambers()
Definition: GEMDQMStatusDigi.cc:228
tagTimeStoreItem
Definition: GEMDQMStatusDigi.cc:32
GEMDQMStatusDigi::listGEBInputID_
std::unordered_map< UInt_t, MonitorElement * > listGEBInputID_
Definition: GEMDQMStatusDigi.cc:123
GEMeMap::maxVFatGE21_
static const int maxVFatGE21_
Definition: GEMeMap.h:68
MakerMacros.h
GEMDQMStatusDigi::strPathPrevDQMRoot_
std::string strPathPrevDQMRoot_
Definition: GEMDQMStatusDigi.cc:103
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
GEMDQMStatusDigi::bookHistogramsAMCPart
void bookHistogramsAMCPart(DQMStore::IBooker &)
Definition: GEMDQMStatusDigi.cc:558
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
GEMDQMStatusDigi::analyze
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
Definition: GEMDQMStatusDigi.cc:772
GEMDQMStatusDigi::nNBxBin_
int nNBxBin_
Definition: GEMDQMStatusDigi.cc:96
GEMDQMStatusDigi::listGEBVFATWordCntT_
std::unordered_map< UInt_t, MonitorElement * > listGEBVFATWordCntT_
Definition: GEMDQMStatusDigi.cc:125
GEMeMap.h
GEMDQMStatusDigi::listGEBOHCRC_
std::unordered_map< UInt_t, MonitorElement * > listGEBOHCRC_
Definition: GEMDQMStatusDigi.cc:129
GEMDQMStatusDigi::seekIdx
Int_t seekIdx(std::vector< GEMDetId > &listLayers, UInt_t unId)
Definition: GEMDQMStatusDigi.cc:752
GEMDQMStatusDigi::listVFATEC_
std::unordered_map< UInt_t, MonitorElement * > listVFATEC_
Definition: GEMDQMStatusDigi.cc:120
fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
GEMDQMStatusDigi::suffixChamber
std::string suffixChamber(GEMDetId &id)
Definition: GEMDQMStatusDigi.cc:218
edm::ESHandle< GEMGeometry >
tagTimeStoreItem::strAxisX
std::string strAxisX
Definition: GEMDQMStatusDigi.cc:35
MuonDigiCollection::end
DigiRangeIterator end() const
Definition: MuonDigiCollection.h:136
GEMDQMStatusDigi::nNTimeBinTotal_
int nNTimeBinTotal_
Definition: GEMDQMStatusDigi.cc:91
GEMDQMStatusDigi::nNCh_
int nNCh_
Definition: GEMDQMStatusDigi.cc:81
tagTimeStoreItem::nNbinMax
Int_t nNbinMax
Definition: GEMDQMStatusDigi.cc:41
GEMDQMStatusDigi::GEMGeometry_
const GEMGeometry * GEMGeometry_
Definition: GEMDQMStatusDigi.cc:77
b
double b
Definition: hdecay.h:118
MuonDigiCollection::begin
DigiRangeIterator begin() const
Definition: MuonDigiCollection.h:134
tagTimeStoreItem::nNbinY
Int_t nNbinY
Definition: GEMDQMStatusDigi.cc:39
GEMeMap::maxVFatGE11_
static const int maxVFatGE11_
Definition: GEMeMap.h:67
GEMDQMStatusDigi::tagAMC_
edm::EDGetToken tagAMC_
Definition: GEMDQMStatusDigi.cc:107
DQMEDAnalyzer.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
GEMDQMStatusDigi::LoadPrevData
int LoadPrevData()
Definition: GEMDQMStatusDigi.cc:376
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GEMDQMStatusDigi::listGEBInputStatus_
std::unordered_map< UInt_t, MonitorElement * > listGEBInputStatus_
Definition: GEMDQMStatusDigi.cc:122
GEMDQMStatusDigi::nIdxFirstStrip_
int nIdxFirstStrip_
Definition: GEMDQMStatusDigi.cc:94
DQMEDAnalyzer
Definition: DQMEDAnalyzer.py:1
GEMDQMStatusDigi::h2_vfat_qualityflag_
MonitorElement * h2_vfat_qualityflag_
Definition: GEMDQMStatusDigi.cc:116
GEMDetId::chamber
constexpr int chamber() const
Definition: GEMDetId.h:177
MonitorElement.h
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
printfWithMap
std::string printfWithMap(std::string strFmt, std::unordered_map< std::string, Int_t > mapArg)
Definition: GEMDQMStatusDigi.cc:609
edm::LogError
Definition: MessageLogger.h:183
a
double a
Definition: hdecay.h:119
GEMDQMStatusDigi::listAMCSlots_
std::vector< Int_t > listAMCSlots_
Definition: GEMDQMStatusDigi.cc:110
Event.h
GEMDQMStatusDigi::bookHistogramsTimeRecordPart
void bookHistogramsTimeRecordPart(DQMStore::IBooker &)
Definition: GEMDQMStatusDigi.cc:577
GEMDQMStatusDigi::tagDigi_
edm::EDGetToken tagDigi_
Definition: GEMDQMStatusDigi.cc:108
GEMDQMStatusDigi::~GEMDQMStatusDigi
~GEMDQMStatusDigi() override
Definition: GEMDQMStatusDigi.cc:47
beam_dqm_sourceclient-live_cfg.monitor
monitor
Definition: beam_dqm_sourceclient-live_cfg.py:234
GEMDQMStatusDigi::h1_amc_davCnt_
MonitorElement * h1_amc_davCnt_
Definition: GEMDQMStatusDigi.cc:138
beam_dqm_sourceclient-live_cfg.cerr
cerr
Definition: beam_dqm_sourceclient-live_cfg.py:17
GEMDetId::roll
constexpr int roll() const
Definition: GEMDetId.h:188
GEMDQMStatusDigi::FillBits
Bool_t FillBits(MonitorElement *monitor, uint64_t unVal, int nNumBits)
Definition: GEMDQMStatusDigi.cc:720
GEMDetId
Definition: GEMDetId.h:17
GEMDQMStatusDigi::tagGEB_
edm::EDGetToken tagGEB_
Definition: GEMDQMStatusDigi.cc:106
GEMDQMStatusDigi::listGEBZeroSupWordsCnt_
std::unordered_map< UInt_t, MonitorElement * > listGEBZeroSupWordsCnt_
Definition: GEMDQMStatusDigi.cc:126
ModuleDef.h
createfilelist.int
int
Definition: createfilelist.py:10
GEMDQMStatusDigi::nNTimeBinPrimitive_
int nNTimeBinPrimitive_
Definition: GEMDQMStatusDigi.cc:92
GEMDQMStatusDigi::nNEvtPerSec_
int nNEvtPerSec_
Definition: GEMDQMStatusDigi.cc:89
analyze
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EventSetup
Definition: EventSetup.h:57
GEMDQMStatusDigi::m_mapStatusErr
std::unordered_map< UInt_t, Bool_t > m_mapStatusErr
Definition: GEMDQMStatusDigi.cc:132
edm::EDGetToken
Definition: EDGetToken.h:35
get
#define get
InputTag.h
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
looper.cfg
cfg
Definition: looper.py:297
GEMDQMStatusDigi::h1_amc_buffState_
MonitorElement * h1_amc_buffState_
Definition: GEMDQMStatusDigi.cc:139
GEMDQMStatusDigi::h1_amc_ttsState_
MonitorElement * h1_amc_ttsState_
Definition: GEMDQMStatusDigi.cc:137
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
GEMDQMStatusDigi::seekIdxSummary
void seekIdxSummary(GEMDetId gid, Int_t &nIdxLayer, Int_t &nIdxChamber)
Definition: GEMDQMStatusDigi.cc:763
GEMGeometry.h
std
Definition: JetResolutionObject.h:76
GEMDQMStatusDigi::GEMROMapping_
std::shared_ptr< GEMROMapping > GEMROMapping_
Definition: GEMDQMStatusDigi.cc:78
GEMDQMStatusDigi::listVFATQualityFlag_
std::unordered_map< UInt_t, MonitorElement * > listVFATQualityFlag_
Definition: GEMDQMStatusDigi.cc:118
GEMDQMStatusDigi::nNBxRange_
int nNBxRange_
Definition: GEMDQMStatusDigi.cc:97
GEMDQMStatusDigi::listTimeStore_
std::map< UInt_t, TimeStoreItem > listTimeStore_
Definition: GEMDQMStatusDigi.cc:147
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
GEMDQMStatusDigi::m_mapStatusFill
std::unordered_map< UInt_t, Bool_t > m_mapStatusFill
Definition: GEMDQMStatusDigi.cc:131
GEMDQMStatusDigi::listGEBecOH_
std::unordered_map< UInt_t, MonitorElement * > listGEBecOH_
Definition: GEMDQMStatusDigi.cc:128
GEMDetId::chamberId
constexpr GEMDetId chamberId() const
Definition: GEMDetId.h:193
GEMeMap::maxEtaPartition_
static const int maxEtaPartition_
Definition: GEMeMap.h:71
GEMDQMStatusDigi::bookHistogramsChamberPart
void bookHistogramsChamberPart(DQMStore::IBooker &, GEMDetId &)
Definition: GEMDQMStatusDigi.cc:439
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
GEMDQMStatusDigi::initGeometry
const GEMGeometry * initGeometry(edm::EventSetup const &iSetup)
Definition: GEMDQMStatusDigi.cc:152
EventSetup.h
MuonDigiCollection::Range
std::pair< const_iterator, const_iterator > Range
Definition: MuonDigiCollection.h:95
amc
Definition: AMCSpec.h:8
GEMDQMStatusDigi::nNSecPerBin_
int nNSecPerBin_
Definition: GEMDQMStatusDigi.cc:90
GEMDigiCollection.h
GEMDQMStatusDigi::m_summaryReport_
MonitorElement * m_summaryReport_
Definition: GEMDQMStatusDigi.cc:144
GEMDQMStatusDigi::h3SummaryStatusPre_
MonitorElement * h3SummaryStatusPre_
Definition: GEMDQMStatusDigi.cc:134
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
GEMDQMStatusDigi::m_listChambers
std::vector< GEMDetId > m_listChambers
Definition: GEMDQMStatusDigi.cc:113
edm::eventsetup::NoProxyException
Definition: NoProxyException.h:31
GEMDetId::station
constexpr int station() const
Definition: GEMDetId.h:173
GEMGeometry
Definition: GEMGeometry.h:24
ztail.d
d
Definition: ztail.py:151
tagTimeStoreItem::strName
std::string strName
Definition: GEMDQMStatusDigi.cc:33
ParameterSet.h
MuonGeometryRecord.h
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
GEMDQMStatusDigi::tagVFAT_
edm::EDGetToken tagVFAT_
Definition: GEMDQMStatusDigi.cc:105
event
Definition: event.py:1
GEMDQMStatusDigi::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: GEMDQMStatusDigi.cc:191
cscd2r::chamberID
CSCDetId chamberID(const CSCDetId &cscDetId)
takes layer ID, converts to chamber ID, switching ME1A to ME11
Definition: CSCDigiToRaw.cc:29
DigiContainerIterator
Definition: MuonDigiCollection.h:30
edm::Event
Definition: Event.h:73
GEMDQMStatusDigi::m_listLayers
std::vector< GEMDetId > m_listLayers
Definition: GEMDQMStatusDigi.cc:112
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:592
GEMDQMStatusDigi::h2AMCStatus_
MonitorElement * h2AMCStatus_
Definition: GEMDQMStatusDigi.cc:142
tagTimeStoreItem::h2Histo
MonitorElement * h2Histo
Definition: GEMDQMStatusDigi.cc:37
edm::InputTag
Definition: InputTag.h:15
GEMDQMStatusDigi::GEMDQMStatusDigi
GEMDQMStatusDigi(const edm::ParameterSet &cfg)
Definition: GEMDQMStatusDigi.cc:168
GEMDQMStatusDigi::listGEBbcOH_
std::unordered_map< UInt_t, MonitorElement * > listGEBbcOH_
Definition: GEMDQMStatusDigi.cc:127
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37