CMS 3D CMS Logo

GEMDAQStatusSource.h
Go to the documentation of this file.
1 #ifndef DQM_GEM_INTERFACE_GEMDAQStatusSource_h
2 #define DQM_GEM_INTERFACE_GEMDAQStatusSource_h
3 
12 
16 
18 
26 
28 
29 #include <string>
30 
31 //----------------------------------------------------------------------------------------------------
32 
34 public:
35  explicit GEMDAQStatusSource(const edm::ParameterSet &cfg);
36  ~GEMDAQStatusSource() override{};
37  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
38 
39 protected:
40  void LoadROMap(edm::EventSetup const &iSetup);
41 
42  void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override{};
43  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
44  void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override;
45 
46  void FillWithRiseErr(MonitorElement *h, Int_t nX, Int_t nY, Bool_t &bErr) {
47  h->Fill(nX, nY);
48  bErr = true;
49  };
50 
51  void FillStatusSummaryPlot(std::map<ME4IdsKey, bool> &mapChamber,
52  MonitorElement *h2Plot,
53  std::map<ME4IdsKey, bool> *pmapSummary = nullptr) {
54  for (auto const &[key4, bFlag] : mapChamber) { // bFlag is not used
55  ME3IdsKey key3 = key4Tokey3(key4);
56  Int_t nChamber = keyToChamber(key4);
57  h2Plot->Fill(nChamber, mapStationToIdx_[key3]);
58  if (pmapSummary != nullptr)
59  (*pmapSummary)[key4] = true;
60  }
61  };
62 
63 private:
64  int ProcessWithMEMap3(BookingHelper &bh, ME3IdsKey key) override;
65  int ProcessWithMEMap3WithChamber(BookingHelper &bh, ME4IdsKey key) override;
66 
67  void SetLabelAMC13Status(MonitorElement *h2Status);
68  void SetLabelAMCStatus(MonitorElement *h2Status);
69  void SetLabelOHStatus(MonitorElement *h2Status);
70  void SetLabelVFATStatus(MonitorElement *h2Status);
71 
73 
78 
80 
82 
85 
89 
100 
102 
103  Bool_t bFillAMC_;
104 
105  Int_t nBXMin_, nBXMax_;
106 
107  std::map<UInt_t, int> mapFEDIdToRe_;
108  std::map<UInt_t, int> mapFEDIdToSt_;
109  std::map<UInt_t, int> mapFEDIdToPosition_;
110  std::map<UInt_t, MonitorElement *> mapFEDIdToAMCStatus_;
111  std::map<int, std::vector<GEMDetId>> mapAMC13ToListChamber_;
112  std::map<std::tuple<int, int>, std::vector<GEMDetId>> mapAMCToListChamber_;
113  Int_t nAMCSlots_;
114 
115  int nBitAMC13_ = 10;
116  int nBitAMC_ = 12;
117  int nBitOH_ = 17;
118  int nBitVFAT_ = 7;
119 };
120 
121 #endif // DQM_GEM_INTERFACE_GEMDAQStatusSource_h
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
int ProcessWithMEMap3WithChamber(BookingHelper &bh, ME4IdsKey key) override
GEMDAQStatusSource(const edm::ParameterSet &cfg)
void FillWithRiseErr(MonitorElement *h, Int_t nX, Int_t nY, Bool_t &bErr)
edm::EDGetToken tagAMC13_
MonitorElement * h2SummaryStatusAMCWarning
MEMapInfT< MEMap3Ids, ME3IdsKey > MEMap3Inf
Definition: GEMDQMBase.h:459
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
MonitorElement * h2AMC13Status_
MonitorElement * h2SummaryStatusAMCError
std::tuple< Int_t, Int_t, Int_t, Int_t > ME4IdsKey
std::map< UInt_t, int > mapFEDIdToRe_
std::map< UInt_t, int > mapFEDIdToSt_
std::map< std::tuple< int, int >, std::vector< GEMDetId > > mapAMCToListChamber_
std::map< ME3IdsKey, int > mapStationToIdx_
Definition: GEMDQMBase.h:593
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_
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
void SetLabelAMC13Status(MonitorElement *h2Status)
std::map< int, std::vector< GEMDetId > > mapAMC13ToListChamber_
MonitorElement * h2SummaryStatusVFATWarning
~GEMDAQStatusSource() override
MonitorElement * h2SummaryStatusAll
void SetLabelVFATStatus(MonitorElement *h2Status)
int keyToChamber(ME4IdsKey key)
Definition: GEMDQMBase.h:546
void SetLabelOHStatus(MonitorElement *h2Status)
MonitorElement * h2SummaryStatusOHWarning
ME3IdsKey key4Tokey3(ME4IdsKey key)
Definition: GEMDQMBase.h:555
MonitorElement * h2SummaryStatusAMC13Error
int ProcessWithMEMap3(BookingHelper &bh, ME3IdsKey key) override
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
MonitorElement * h2SummaryStatusWarning
void FillStatusSummaryPlot(std::map< ME4IdsKey, bool > &mapChamber, MonitorElement *h2Plot, std::map< ME4IdsKey, bool > *pmapSummary=nullptr)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
MonitorElement * h2SummaryStatusOHError
Definition: Run.h:45
edm::EDGetToken tagAMC_