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 }
RPCFEDIntegrity::~RPCFEDIntegrity
~RPCFEDIntegrity() override
Destructor.
Definition: RPCFEDIntegrity.cc:21
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
fw3dlego::xbins
const double xbins[]
Definition: fw3dlego_xbins.cc:16
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
edm::Handle::product
T const * product() const
Definition: Handle.h:70
RPCRawDataCounts
Definition: RPCRawDataCounts.h:15
RPCFEDIntegrity::NonFatal
Definition: RPCFEDIntegrity.h:40
RPCFEDIntegrity::fedMe_
MonitorElement * fedMe_[3]
Definition: RPCFEDIntegrity.h:42
edm::Run
Definition: Run.h:45
RPCFEDIntegrity::labelBins
void labelBins(MonitorElement *myMe)
Definition: RPCFEDIntegrity.cc:66
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle
Definition: AssociativeIterator.h:50
RPCFEDIntegrity::Entries
Definition: RPCFEDIntegrity.h:40
RPCFEDIntegrity::Fatal
Definition: RPCFEDIntegrity.h:40
RPCFEDIntegrity::minFEDNum_
int minFEDNum_
Definition: RPCFEDIntegrity.h:44
RPCRawDataCountsHistoMaker.h
dqm-mbProfile.format
format
Definition: dqm-mbProfile.py:16
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
RPCFEDIntegrity::bookFEDMe
void bookFEDMe(DQMStore::IBooker &)
Definition: RPCFEDIntegrity.cc:52
RPCFEDIntegrity::maxFEDNum_
int maxFEDNum_
Definition: RPCFEDIntegrity.h:44
RPCFEDIntegrity::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Begin Lumi block.
Definition: RPCFEDIntegrity.cc:26
edm::ParameterSet
Definition: ParameterSet.h:47
iEvent
int iEvent
Definition: GenABIO.cc:224
dqm::impl::MonitorElement::setBinLabel
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)
Definition: MonitorElement.cc:771
RPCFEDIntegrity::rawCountsLabel_
edm::EDGetTokenT< RPCRawDataCounts > rawCountsLabel_
Definition: RPCFEDIntegrity.h:31
RPCFEDIntegrity::init_
bool init_
Definition: RPCFEDIntegrity.h:36
edm::EventSetup
Definition: EventSetup.h:58
RPCFEDIntegrity::FATAL_LIMIT
int FATAL_LIMIT
Definition: RPCFEDIntegrity.h:38
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
RPCFEDIntegrity::merge_
bool merge_
Definition: RPCFEDIntegrity.h:36
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
RPCFEDIntegrity::RPCFEDIntegrity
RPCFEDIntegrity(const edm::ParameterSet &ps)
Constructor.
Definition: RPCFEDIntegrity.cc:7
dqm::impl::MonitorElement::getNbinsX
virtual int getNbinsX() const
get # of bins in X-axis
Definition: MonitorElement.cc:574
dqmiodumpmetadata.counts
counts
Definition: dqmiodumpmetadata.py:25
dqm::implementation::IBooker
Definition: DQMStore.h:43
RPCFEDIntegrity.h
RPCFEDIntegrity::numOfFED_
int numOfFED_
Definition: RPCFEDIntegrity.h:44
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
RPCFEDIntegrity::analyze
void analyze(const edm::Event &iEvent, const edm::EventSetup &c) override
Analyze.
Definition: RPCFEDIntegrity.cc:32
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
RPCFEDIntegrity::prefixDir_
std::string prefixDir_
Definition: RPCFEDIntegrity.h:34
edm::InputTag
Definition: InputTag.h:15
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98