CMS 3D CMS Logo

RPCFEDIntegrity.cc
Go to the documentation of this file.
1 /* \author Anna Cimmino*/
2 #include <algorithm>
5 // Framework
10 //DQM Services
12 
13 //EventFilter
16 
17 typedef std::map<std::pair<int, int>, int>::const_iterator IT;
18 
20  edm::LogVerbatim("rpcfedintegrity") << "[RPCFEDIntegrity]: Constructor";
21 
22  rawCountsLabel_ = consumes<RPCRawDataCounts>(ps.getUntrackedParameter<edm::InputTag>("RPCRawCountsInputTag"));
23  prefixDir_ = ps.getUntrackedParameter<std::string>("RPCPrefixDir", "RPC/FEDIntegrity");
24  merge_ = ps.getUntrackedParameter<bool>("MergeRuns", false);
25  minFEDNum_ = ps.getUntrackedParameter<int>("MinimumFEDID", 790);
26  maxFEDNum_ = ps.getUntrackedParameter<int>("MaximumFEDID", 792);
27 
28  init_ = false;
30  FATAL_LIMIT = 5;
31 }
32 
34  edm::LogVerbatim("rpcfedintegrity") << "[RPCFEDIntegrity]: Destructor ";
35  // dbe_=0;
36 }
37 
38 void RPCFEDIntegrity::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) {
39  edm::LogVerbatim("rpcfedintegrity") << "[RPCFEDIntegrity]: Begin booking histograms ";
40 
41  this->bookFEDMe(ibooker);
42 }
43 
45  //get hold of raw data counts
47  iEvent.getByToken(rawCountsLabel_, rawCounts);
48  if (!rawCounts.isValid())
49  return;
50 
51  const RPCRawDataCounts& counts = *rawCounts.product();
52 
53  for (int fed = minFEDNum_; fed <= maxFEDNum_; ++fed) {
54  if (counts.fedBxRecords(fed))
55  fedMe_[Entries]->Fill(fed);
56  if (counts.fedFormatErrors(fed))
57  fedMe_[Fatal]->Fill(fed);
58  if (counts.fedErrorRecords(fed))
59  fedMe_[NonFatal]->Fill(fed);
60  }
61 }
62 
63 //Fill report summary
65  ibooker.cd();
67 
68  fedMe_[Entries] = ibooker.book1D("FEDEntries", "FED Entries", numOfFED_, minFEDNum_, maxFEDNum_ + 1);
69  this->labelBins(fedMe_[Entries]);
70  fedMe_[Fatal] = ibooker.book1D("FEDFatal", "FED Fatal Errors", numOfFED_, minFEDNum_, maxFEDNum_ + 1);
71  this->labelBins(fedMe_[Fatal]);
72  fedMe_[NonFatal] = ibooker.book1D("FEDNonFatal", "FED NON Fatal Errors", numOfFED_, minFEDNum_, maxFEDNum_ + 1);
73  this->labelBins(fedMe_[NonFatal]);
74 
75  init_ = true;
76 }
77 
79  int xbins = myMe->getNbinsX();
80 
81  if (xbins != numOfFED_)
82  return;
83  std::stringstream xLabel;
84 
85  for (int i = 0; i < xbins; i++) {
86  xLabel.str("");
87  int fedNum = minFEDNum_ + i;
88  xLabel << fedNum;
89  myMe->setBinLabel(i + 1, xLabel.str(), 1);
90  }
91 }
RPCFEDIntegrity::~RPCFEDIntegrity
~RPCFEDIntegrity() override
Destructor.
Definition: RPCFEDIntegrity.cc:33
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:44
RPCFEDIntegrity::fedMe_
MonitorElement * fedMe_[3]
Definition: RPCFEDIntegrity.h:46
edm::Run
Definition: Run.h:45
RPCFEDIntegrity::labelBins
void labelBins(MonitorElement *myMe)
Definition: RPCFEDIntegrity.cc:78
LuminosityBlock.h
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
DQMStore.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle
Definition: AssociativeIterator.h:50
DataRecord.h
RPCFEDIntegrity::Entries
Definition: RPCFEDIntegrity.h:44
RPCFEDIntegrity::Fatal
Definition: RPCFEDIntegrity.h:44
RPCFEDIntegrity::minFEDNum_
int minFEDNum_
Definition: RPCFEDIntegrity.h:48
RPCRawDataCountsHistoMaker.h
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
ReadoutError.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RPCFEDIntegrity::bookFEDMe
void bookFEDMe(DQMStore::IBooker &)
Definition: RPCFEDIntegrity.cc:64
RPCFEDIntegrity::maxFEDNum_
int maxFEDNum_
Definition: RPCFEDIntegrity.h:48
RPCFEDIntegrity::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Begin Lumi block.
Definition: RPCFEDIntegrity.cc:38
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
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:35
RPCFEDIntegrity::init_
bool init_
Definition: RPCFEDIntegrity.h:40
edm::EventSetup
Definition: EventSetup.h:58
RPCFEDIntegrity::FATAL_LIMIT
int FATAL_LIMIT
Definition: RPCFEDIntegrity.h:42
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
RPCFEDIntegrity::merge_
bool merge_
Definition: RPCFEDIntegrity.h:40
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
RPCFEDIntegrity::RPCFEDIntegrity
RPCFEDIntegrity(const edm::ParameterSet &ps)
Constructor.
Definition: RPCFEDIntegrity.cc:19
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
IT
std::map< std::pair< int, int >, int >::const_iterator IT
Definition: RPCFEDIntegrity.cc:17
dqm::implementation::IBooker
Definition: DQMStore.h:43
RPCFEDIntegrity.h
ParameterSet.h
RPCFEDIntegrity::numOfFED_
int numOfFED_
Definition: RPCFEDIntegrity.h:48
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
RPCFEDIntegrity::analyze
void analyze(const edm::Event &iEvent, const edm::EventSetup &c) override
Analyze.
Definition: RPCFEDIntegrity.cc:44
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
RPCFEDIntegrity::prefixDir_
std::string prefixDir_
Definition: RPCFEDIntegrity.h:38
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