CMS 3D CMS Logo

GEMDQMStatusDigi.cc
Go to the documentation of this file.
9 
10 
14 
18 
19 #include <string>
20 
21 //----------------------------------------------------------------------------------------------------
22 
24 {
25 public:
27  ~GEMDQMStatusDigi() override {};
28  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
29 
30 protected:
31  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
32  void analyze(edm::Event const& e, edm::EventSetup const& eSetup) override;
33  void endRun(edm::Run const& run, edm::EventSetup const& eSetup) override {};
34 
35 private:
36  int nVfat_ = 24;
37  int cBit_ = 9;
38  int eBit_ = 13;
42 
47 
53 
59 
60 };
61 
62 using namespace std;
63 using namespace edm;
64 
66 {
67 
68  tagVFAT_ = consumes<GEMVfatStatusDigiCollection>(cfg.getParameter<edm::InputTag>("VFATInputLabel"));
69  tagGEB_ = consumes<GEMGEBdataCollection>(cfg.getParameter<edm::InputTag>("GEBInputLabel"));
70  tagAMC_ = consumes<GEMAMCdataCollection>(cfg.getParameter<edm::InputTag>("AMCInputLabel"));
71 
72 }
73 
75 {
77  desc.add<edm::InputTag>("VFATInputLabel", edm::InputTag("muonGEMDigis", "vfatStatus"));
78  desc.add<edm::InputTag>("GEBInputLabel", edm::InputTag("muonGEMDigis", "gebStatus"));
79  desc.add<edm::InputTag>("AMCInputLabel", edm::InputTag("muonGEMDigis", "AMCStatus"));
80  descriptions.add("GEMDQMStatusDigi", desc);
81 }
82 
84 {
85 
86  ibooker.cd();
87  ibooker.setCurrentFolder("GEM/StatusDigi");
88 
89  h1_vfat_quality_ = ibooker.book1D("vfat quality", "quality", 6, 0, 6);
90  h1_vfat_flag_ = ibooker.book1D("vfat flag", "flag", 5, 0, 5);
91 
92  h2_vfat_quality_ = ibooker.book2D("vfat quality per geb", "quality", 6, 0 , 6, 36, 0, 36);
93  h2_vfat_flag_ = ibooker.book2D("vfat flag per geb", "flag", 5, 0, 5, 36, 0, 36);
94 
95  h1_geb_inputStatus_ = ibooker.book1D("geb input status", "inputStatus", 10, 0, 10);
96  h1_geb_vfatWordCnt_ = ibooker.book1D("geb no vfats", "nvfats", 25, 0, 25);
97  h1_geb_zeroSupWordsCnt_ = ibooker.book1D("geb zeroSupWordsCnt", "zeroSupWordsCnt", 10, 0, 10);
98  h1_geb_stuckData_ = ibooker.book1D("geb stuckData", "stuckData", 10, 0, 10);
99  h1_geb_inFIFOund_ = ibooker.book1D("geb inFIFOund", "inFIFOund", 10, 0, 10);
100 
101  h1_amc_ttsState_ = ibooker.book1D("amc ttsState", "ttsState", 10, 0, 10);
102  h1_amc_davCnt_ = ibooker.book1D("amc davCnt", "davCnt", 10, 0, 10);
103  h1_amc_buffState_ = ibooker.book1D("amc buffState", "buffState", 10, 0, 10);
104  h1_amc_oosGlib_ = ibooker.book1D("amc oosGlib", "oosGlib", 10, 0, 10);
105  h1_amc_chTimeOut_ = ibooker.book1D("amc chTimeOut", "chTimeOut", 10, 0, 10);
106 }
107 
109 {
113  event.getByToken( tagVFAT_, gemVFAT);
114  event.getByToken( tagGEB_, gemGEB);
115  event.getByToken( tagAMC_, gemAMC);
116 
117  for (GEMVfatStatusDigiCollection::DigiRangeIterator vfatIt = gemVFAT->begin(); vfatIt != gemVFAT->end(); ++vfatIt){
118  GEMDetId gemid = (*vfatIt).first;
119  float nIdx = gemid.chamber() + (gemid.layer()-1)/2.0;
120  const GEMVfatStatusDigiCollection::Range& range = (*vfatIt).second;
121  for ( auto vfatStat = range.first; vfatStat != range.second; ++vfatStat ) {
122 
123  h1_vfat_quality_->Fill(vfatStat->quality());
124  h1_vfat_flag_->Fill(vfatStat->flag());
125  h2_vfat_quality_->Fill(vfatStat->quality(), nIdx);
126  h2_vfat_flag_->Fill(vfatStat->flag(), nIdx);
127  }
128  }
129 
130  for (GEMGEBdataCollection::DigiRangeIterator gebIt = gemGEB->begin(); gebIt != gemGEB->end(); ++gebIt){
131  const GEMGEBdataCollection::Range& range = (*gebIt).second;
132  for ( auto GEBStatus = range.first; GEBStatus != range.second; ++GEBStatus ) {
133 
134  h1_geb_inputStatus_->Fill(GEBStatus->inputStatus());
135  h1_geb_vfatWordCnt_->Fill(GEBStatus->vfatWordCnt()/3);
136  h1_geb_zeroSupWordsCnt_->Fill(GEBStatus->zeroSupWordsCnt());
137  h1_geb_stuckData_->Fill(GEBStatus->stuckData());
138  h1_geb_inFIFOund_->Fill(GEBStatus->inFIFOund());
139 
140  }
141  }
142 
143  for (GEMAMCdataCollection::DigiRangeIterator amcIt = gemAMC->begin(); amcIt != gemAMC->end(); ++amcIt){
144  const GEMAMCdataCollection::Range& range = (*amcIt).second;
145  for ( auto amc = range.first; amc != range.second; ++amc ) {
146 
147  h1_amc_ttsState_->Fill(amc->ttsState());
148  h1_amc_davCnt_->Fill(amc->davCnt());
149  h1_amc_buffState_->Fill(amc->buffState());
150  h1_amc_oosGlib_->Fill(amc->oosGlib());
151  h1_amc_chTimeOut_->Fill(amc->chTimeOut());
152  }
153  }
154 
155 }
156 
T getParameter(std::string const &) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MonitorElement * h1_amc_buffState_
MonitorElement * h1_vfat_flag_
edm::EDGetToken tagVFAT_
GEMDQMStatusDigi(const edm::ParameterSet &cfg)
int chamber() const
Chamber id: it identifies a chamber in a ring it goes from 1 to 36.
Definition: GEMDetId.h:74
MonitorElement * h1_amc_chTimeOut_
void Fill(long long x)
MonitorElement * h1_geb_zeroSupWordsCnt_
MonitorElement * h2_vfat_quality_
MonitorElement * h1_amc_oosGlib_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * h1_geb_inputStatus_
int layer() const
Layer id: each station have two layers of chambers: layer 1 is the inner chamber and layer 2 is the o...
Definition: GEMDetId.h:69
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * h2_vfat_flag_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void endRun(edm::Run const &run, edm::EventSetup const &eSetup) override
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * h1_geb_stuckData_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HLT enums.
~GEMDQMStatusDigi() override
MonitorElement * h1_amc_ttsState_
std::pair< const_iterator, const_iterator > Range
edm::EDGetToken tagGEB_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * h1_geb_vfatWordCnt_
Definition: AMCSpec.h:8
DigiRangeIterator end() const
MonitorElement * h1_geb_inFIFOund_
edm::EDGetToken tagAMC_
MonitorElement * h1_amc_davCnt_
MonitorElement * h1_vfat_quality_
Definition: event.py:1
Definition: Run.h:45
DigiRangeIterator begin() const