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  DCS.clear();
10  DCS.resize(10); // start with 10 LS, resize later
11 }
12 
14 
16 
18  // book
19  ibooker.cd();
21 
22  unsigned int nlsmax = DCS.size();
23  MonitorElement* reportSummaryMap_ = igetter.get(dqmprovinfofolder_ + "/reportSummaryMap");
24  MonitorElement* lumiNumber_ = igetter.get(eventinfofolder_ + "/iLumiSection");
25 
26  if (!reportSummaryMap_)
27  return;
28 
29  if (TH2F* h2 = reportSummaryMap_->getTH2F()) {
30  nlsmax = lumiNumber_->getIntValue();
31  int hvStatus = 0;
32  const char* label_name = "RPC";
33  unsigned int rpc_num = 0;
34  if (nlsmax > DCS.size())
35  DCS.resize(nlsmax);
36 
37  for (int ybin = 0; ybin < h2->GetNbinsY(); ++ybin) {
38  if (strcmp(h2->GetYaxis()->GetBinLabel(ybin + 1), label_name) == 0)
39  rpc_num = ybin + 1;
40  }
41 
42  for (unsigned int nlumi = 0; nlumi < nlsmax; ++nlumi) {
43  int rpc_dcsbit = h2->GetBinContent(nlumi + 1, rpc_num);
44  if (rpc_dcsbit != -1) {
45  hvStatus = 1; // set to 1 because HV was on (!)
46  } else {
47  hvStatus = 0; // set to 0 because HV was off (!)
48  }
49  DCS[nlumi] = hvStatus;
50  }
51  }
52 
53  std::string meName = dcsinfofolder_ + "/rpcHVStatus";
54  unsigned int dcssize = DCS.size();
55  MonitorElement* rpcHVStatus = ibooker.book2D("rpcHVStatus", "RPC HV Status", dcssize, 1., dcssize + 1, 1, 0.5, 1.5);
56  rpcHVStatus->setAxisTitle("Luminosity Section", 1);
57  rpcHVStatus->setBinLabel(1, "", 2);
58 
59  int lsCounter = 0;
60  // fill
61  for (unsigned int i = 0; i < nlsmax; i++) {
62  rpcHVStatus->setBinContent(i + 1, 1, DCS[i]);
63  lsCounter += DCS[i];
64  }
65 
66  meName = dcsinfofolder_ + "/rpcHV";
67  MonitorElement* rpcHV = ibooker.bookInt("rpcHV");
68 
69  rpcHV->Fill(lsCounter);
70 
71  return;
72 }
mps_fire.i
i
Definition: mps_fire.py:428
LuminosityBlock.h
RPCDcsInfoClient::~RPCDcsInfoClient
~RPCDcsInfoClient() override
Definition: RPCDcsInfoClient.cc:13
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
RPCDcsInfoClient::DCS
std::vector< int > DCS
Definition: RPCDcsInfoClient.h:22
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
RPCDcsInfoClient.h
RPCDcsInfoClient::dqmprovinfofolder_
std::string dqmprovinfofolder_
Definition: RPCDcsInfoClient.h:20
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:17
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RPCDcsInfoClient::dcsinfofolder_
std::string dcsinfofolder_
Definition: RPCDcsInfoClient.h:18
edm::ParameterSet
Definition: ParameterSet.h:47
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::beginJob
void beginJob() override
Definition: RPCDcsInfoClient.cc:15
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
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::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
dqm::implementation::IBooker
Definition: DQMStore.h:43
RPCDcsInfoClient::eventinfofolder_
std::string eventinfofolder_
Definition: RPCDcsInfoClient.h:19
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