CMS 3D CMS Logo

RPCDcsInfoClient.cc
Go to the documentation of this file.
3 
5 
6  dcsinfofolder_ = ps.getUntrackedParameter<std::string>("dcsInfoFolder", "RPC/DCSInfo") ;
7 
8  DCS.clear();
9  DCS.resize(10); // start with 10 LS, resize later
10 
11 }
12 
13 
15 
17 
19 
20  unsigned int nlumi = l.id().luminosityBlock() ;
21 
22  if (nlumi+1 > DCS.size()) DCS.resize(nlumi+1);
23 
24 
25  MonitorElement* DCSbyLS_ = igetter.get(dcsinfofolder_ + "/DCSbyLS" );
26 
27  if ( !DCSbyLS_ ) return;
28 
29  if ( TH1F * h1 = DCSbyLS_->getTH1F()) {
30  int hvStatus = 0;
31 
32  if ( h1->GetBinContent(1) != 0 ) {
33  hvStatus = 0; // set to 0 because HV was off (!)
34  } else {
35  hvStatus = 1; // set to 1 because HV was on (!)
36  }
37 
38  DCS[nlumi] = hvStatus;
39  }
40 
41  return;
42 }
43 
44 
46 
47  // book
48  ibooker.cd();
50 
51  unsigned int nlsmax = DCS.size();
52 
53  std::string meName = dcsinfofolder_ + "/rpcHVStatus";
54  MonitorElement* rpcHVStatus = ibooker.book2D("rpcHVStatus","RPC HV Status", nlsmax, 1., nlsmax+1, 1, 0.5, 1.5);
55  rpcHVStatus->setAxisTitle("Luminosity Section", 1);
56  rpcHVStatus->setBinLabel(1,"",2);
57 
58  int lsCounter = 0;
59  // fill
60  for (unsigned int i = 0 ; i < nlsmax ; i++ ) {
61  rpcHVStatus->setBinContent(i+1,1,DCS[i]);
62  lsCounter +=DCS[i];
63  }
64 
65  meName = dcsinfofolder_ + "/rpcHV";
66  MonitorElement* rpcHV = ibooker.bookInt("rpcHV");
67 
68  rpcHV ->Fill(lsCounter);
69 
70  return;
71 }
LuminosityBlockID id() const
T getUntrackedParameter(std::string const &, T const &) const
void setBinContent(int binx, double content)
set content of bin (1-D)
RPCDcsInfoClient(const edm::ParameterSet &ps)
~RPCDcsInfoClient() override
TH1F * getTH1F() const
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:307
MonitorElement * bookInt(Args &&...args)
Definition: DQMStore.h:106
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)
std::vector< int > DCS
void Fill(long long x)
std::string dcsinfofolder_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
LuminosityBlockNumber_t luminosityBlock() const
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void beginJob() override