CMS 3D CMS Logo

RPCDcsInfoClient.cc
Go to the documentation of this file.
2 
4  : dcsinfofolder_(ps.getUntrackedParameter<std::string>("dcsInfoFolder", "RPC/DCSInfo")),
5  eventinfofolder_(ps.getUntrackedParameter<std::string>("eventInfoFolder", "RPC/EventInfo")),
6  dqmprovinfofolder_(ps.getUntrackedParameter<std::string>("dqmProvInfoFolder", "Info/EventInfo")) {}
7 
9  // book
10  ibooker.cd();
12 
13  MonitorElement* reportSummaryMap = igetter.get(dqmprovinfofolder_ + "/reportSummaryMap");
14  MonitorElement* eventInfoLumi = igetter.get(eventinfofolder_ + "/iLumiSection");
15 
16  if (!reportSummaryMap)
17  return;
18 
19  TH2F* h2 = reportSummaryMap->getTH2F();
20  if (!h2)
21  return;
22  const int maxLS = reportSummaryMap->getNbinsX();
23 
24  int nLS = eventInfoLumi->getIntValue();
25  if (nLS <= 0 or nLS > maxLS) {
26  // If the nLS from the event info is not valid, we take the value from the
27  // reportSummaryMap. The histogram is initialized with -1 value then filled
28  // with non-negative value for valid LSs.
29  // Note that we start from the first bin, since many runs have small nLS.
30  for (nLS = 1; nLS <= maxLS; ++nLS) {
31  const double dcsBit = h2->GetBinContent(nLS, 1);
32  if (dcsBit == -1)
33  break;
34  }
35  }
36 
37  MonitorElement* rpcHVStatus = ibooker.book2D("rpcHVStatus", "RPC HV Status", nLS, 1., nLS + 1, 1, 0.5, 1.5);
38  rpcHVStatus->setAxisTitle("Luminosity Section", 1);
39  rpcHVStatus->setBinLabel(1, "", 2);
40 
41  // Find bin number of RPC from the EventInfo's reportSummaryMap
42  int binRPC = 0;
43  for (int i = 1, nbinsY = reportSummaryMap->getNbinsY(); i <= nbinsY; ++i) {
44  const std::string binLabel = h2->GetYaxis()->GetBinLabel(i);
45  if (binLabel == "RPC") {
46  binRPC = i;
47  break;
48  }
49  }
50  if (binRPC == 0)
51  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 }
RPCDcsInfoClient(const edm::ParameterSet &ps)
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
void Fill(long long x)
virtual TH2F * getTH2F() const
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)
virtual int getNbinsY() const
get # of bins in Y-axis
const std::string dqmprovinfofolder_
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
const std::string eventinfofolder_
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:212
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:680
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
virtual int getNbinsX() const
get # of bins in X-axis
const std::string dcsinfofolder_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
virtual int64_t getIntValue() const