CMS 3D CMS Logo

RPCFEDIntegrity.cc
Go to the documentation of this file.
1 /* \author Anna Cimmino*/
3 
6 
8  edm::LogVerbatim("rpcfedintegrity") << "[RPCFEDIntegrity]: Constructor";
9 
10  rawCountsLabel_ = consumes<RPCRawDataCounts>(ps.getUntrackedParameter<edm::InputTag>("RPCRawCountsInputTag"));
11  prefixDir_ = ps.getUntrackedParameter<std::string>("RPCPrefixDir", "RPC/FEDIntegrity");
12  merge_ = ps.getUntrackedParameter<bool>("MergeRuns", false);
13  minFEDNum_ = ps.getUntrackedParameter<int>("MinimumFEDID", 790);
14  maxFEDNum_ = ps.getUntrackedParameter<int>("MaximumFEDID", 792);
15 
16  init_ = false;
18  FATAL_LIMIT = 5;
19 }
20 
22  edm::LogVerbatim("rpcfedintegrity") << "[RPCFEDIntegrity]: Destructor ";
23  // dbe_=0;
24 }
25 
26 void RPCFEDIntegrity::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) {
27  edm::LogVerbatim("rpcfedintegrity") << "[RPCFEDIntegrity]: Begin booking histograms ";
28 
29  this->bookFEDMe(ibooker);
30 }
31 
33  //get hold of raw data counts
35  iEvent.getByToken(rawCountsLabel_, rawCounts);
36  if (!rawCounts.isValid())
37  return;
38 
39  const RPCRawDataCounts& counts = *rawCounts.product();
40 
41  for (int fed = minFEDNum_; fed <= maxFEDNum_; ++fed) {
42  if (counts.fedBxRecords(fed))
43  fedMe_[Entries]->Fill(fed);
44  if (counts.fedFormatErrors(fed))
45  fedMe_[Fatal]->Fill(fed);
46  if (counts.fedErrorRecords(fed))
47  fedMe_[NonFatal]->Fill(fed);
48  }
49 }
50 
51 //Fill report summary
53  ibooker.cd();
55 
56  fedMe_[Entries] = ibooker.book1D("FEDEntries", "FED Entries", numOfFED_, minFEDNum_, maxFEDNum_ + 1);
57  this->labelBins(fedMe_[Entries]);
58  fedMe_[Fatal] = ibooker.book1D("FEDFatal", "FED Fatal Errors", numOfFED_, minFEDNum_, maxFEDNum_ + 1);
59  this->labelBins(fedMe_[Fatal]);
60  fedMe_[NonFatal] = ibooker.book1D("FEDNonFatal", "FED NON Fatal Errors", numOfFED_, minFEDNum_, maxFEDNum_ + 1);
61  this->labelBins(fedMe_[NonFatal]);
62 
63  init_ = true;
64 }
65 
67  int xbins = myMe->getNbinsX();
68 
69  if (xbins != numOfFED_)
70  return;
71 
72  for (int i = 0; i < xbins; i++) {
73  const std::string xLabel = fmt::format("{}", minFEDNum_ + i);
74  myMe->setBinLabel(i + 1, xLabel, 1);
75  }
76 }
Log< level::Info, true > LogVerbatim
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Begin Lumi block.
const double xbins[]
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
T const * product() const
Definition: Handle.h:70
void analyze(const edm::Event &iEvent, const edm::EventSetup &c) override
Analyze.
T getUntrackedParameter(std::string const &, T const &) const
int iEvent
Definition: GenABIO.cc:224
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
void bookFEDMe(DQMStore::IBooker &)
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)
MonitorElement * fedMe_[3]
void labelBins(MonitorElement *myMe)
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< RPCRawDataCounts > rawCountsLabel_
virtual int getNbinsX() const
get # of bins in X-axis
~RPCFEDIntegrity() override
Destructor.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
RPCFEDIntegrity(const edm::ParameterSet &ps)
Constructor.
Definition: Run.h:45
std::string prefixDir_