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 {
9 }
10 
12  // book
13  ibooker.cd();
15 
16  MonitorElement* reportSummaryMap = igetter.get(dqmprovinfofolder_ + "/reportSummaryMap");
17  MonitorElement* eventInfoLumi = igetter.get(eventinfofolder_+"/iLumiSection");
18 
19  if (!reportSummaryMap)
20  return;
21 
22  TH2F* h2 = reportSummaryMap->getTH2F();
23  if ( !h2 ) return;
24  const int maxLS = reportSummaryMap->getNbinsX();
25 
26  int nLS = eventInfoLumi->getIntValue();
27  if ( nLS <= 0 or nLS > maxLS ) {
28  // If the nLS from the event info is not valid, we take the value from the
29  // reportSummaryMap. The histogram is initialized with -1 value then filled
30  // with non-negative value for valid LSs.
31  // Note that we start from the first bin, since many runs have small nLS.
32  for ( nLS=1; nLS<=maxLS; ++nLS ) {
33  const double dcsBit = h2->GetBinContent(nLS, 1);
34  if ( dcsBit == -1 ) 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 ) return;
52 
53  // Take bin contents from the reportSummaryMap and fill into the RPC DCSInfo
54  int nLSRPC = 0;
55  for ( int i=1; i<=nLS; ++i ) {
56  const double dcsBit = h2->GetBinContent(i, binRPC);
57  const int hvStatus = (dcsBit != -1) ? 1 : 0;
58  if ( hvStatus != 0 ) {
59  ++nLSRPC;
60  rpcHVStatus->setBinContent(i, 1, hvStatus);
61  }
62  }
63 
64  MonitorElement* rpcHV = ibooker.bookInt("rpcHV");
65  rpcHV->Fill(nLSRPC);
66 
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:461
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:11
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:912
dqm::legacy::MonitorElement::getTH2F
virtual TH2F * getTH2F() const
Definition: MonitorElement.h:490