CMS 3D CMS Logo

RPCDcsInfoClient.cc
Go to the documentation of this file.
3 
5  : dcsinfofolder_(ps.getUntrackedParameter<std::string>("dcsInfoFolder", "RPC/DCSInfo")),
6  eventinfofolder_(ps.getUntrackedParameter<std::string>("eventInfoFolder", "RPC/EventInfo")),
7  dqmprovinfofolder_(ps.getUntrackedParameter<std::string>("dqmProvInfoFolder", "Info/EventInfo")) {}
8 
10  // book
11  ibooker.cd();
13 
14  MonitorElement* reportSummaryMap = igetter.get(dqmprovinfofolder_ + "/reportSummaryMap");
15  MonitorElement* eventInfoLumi = igetter.get(eventinfofolder_ + "/iLumiSection");
16 
17  if (!reportSummaryMap)
18  return;
19 
20  TH2F* h2 = reportSummaryMap->getTH2F();
21  if (!h2)
22  return;
23  const int maxLS = reportSummaryMap->getNbinsX();
24 
25  int nLS = eventInfoLumi->getIntValue();
26  if (nLS <= 0 or nLS > maxLS) {
27  // If the nLS from the event info is not valid, we take the value from the
28  // reportSummaryMap. The histogram is initialized with -1 value then filled
29  // with non-negative value for valid LSs.
30  // Note that we start from the first bin, since many runs have small nLS.
31  for (nLS = 1; nLS <= maxLS; ++nLS) {
32  const double dcsBit = h2->GetBinContent(nLS, 1);
33  if (dcsBit == -1)
34  break;
35  }
36  }
37 
38  MonitorElement* rpcHVStatus = ibooker.book2D("rpcHVStatus", "RPC HV Status", nLS, 1., nLS + 1, 1, 0.5, 1.5);
39  rpcHVStatus->setAxisTitle("Luminosity Section", 1);
40  rpcHVStatus->setBinLabel(1, "", 2);
41 
42  // Find bin number of RPC from the EventInfo's reportSummaryMap
43  int binRPC = 0;
44  for (int i = 1, nbinsY = reportSummaryMap->getNbinsY(); i <= nbinsY; ++i) {
45  const std::string binLabel = h2->GetYaxis()->GetBinLabel(i);
46  if (binLabel == "RPC") {
47  binRPC = i;
48  break;
49  }
50  }
51  if (binRPC == 0)
52  return;
53 
54  // Take bin contents from the reportSummaryMap and fill into the RPC DCSInfo
55  int nLSRPC = 0;
56  for (int i = 1; i <= nLS; ++i) {
57  const double dcsBit = h2->GetBinContent(i, binRPC);
58  const int hvStatus = (dcsBit != -1) ? 1 : 0;
59  if (hvStatus != 0) {
60  ++nLSRPC;
61  rpcHVStatus->setBinContent(i, 1, hvStatus);
62  }
63  }
64 
65  MonitorElement* rpcHV = ibooker.bookInt("rpcHV");
66  rpcHV->Fill(nLSRPC);
67 }
mps_fire.i
i
Definition: mps_fire.py:428
LuminosityBlock.h
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
RPCDcsInfoClient.h
RPCDcsInfoClient::dqmprovinfofolder_
const std::string dqmprovinfofolder_
Definition: RPCDcsInfoClient.h:19
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
RPCDcsInfoClient::RPCDcsInfoClient
RPCDcsInfoClient(const edm::ParameterSet &ps)
Definition: RPCDcsInfoClient.cc:4
RPCDcsInfoClient::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: RPCDcsInfoClient.cc:9
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
hlt_dqm_clientPB-live_cfg.nbinsY
nbinsY
Definition: hlt_dqm_clientPB-live_cfg.py:69
edm::ParameterSet
Definition: ParameterSet.h:47
dqm::impl::MonitorElement::getNbinsY
virtual int getNbinsY() const
get # of bins in Y-axis
Definition: MonitorElement.cc:580
dqm::implementation::IBooker::bookInt
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
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
RPCDcsInfoClient::eventinfofolder_
const std::string eventinfofolder_
Definition: RPCDcsInfoClient.h:18
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
std
Definition: JetResolutionObject.h:76
dqm::implementation::IGetter
Definition: DQMStore.h:484
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
dqm::impl::MonitorElement::getNbinsX
virtual int getNbinsX() const
get # of bins in X-axis
Definition: MonitorElement.cc:574
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
dqm::implementation::IBooker
Definition: DQMStore.h:43
RPCDcsInfoClient::dcsinfofolder_
const std::string dcsinfofolder_
Definition: RPCDcsInfoClient.h:17
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800
dqm::impl::MonitorElement::getIntValue
virtual int64_t getIntValue() const
Definition: MonitorElement.cc:924
dqm::legacy::MonitorElement::getTH2F
virtual TH2F * getTH2F() const
Definition: MonitorElement.h:491