test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  if (nlsmax > 900 ) nlsmax = 900;
53 
54  std::string meName = dcsinfofolder_ + "/rpcHVStatus";
55  MonitorElement* rpcHVStatus = ibooker.book2D("rpcHVStatus","RPC HV Status", nlsmax, 1., nlsmax+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 }
LuminosityBlockID id() const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
RPCDcsInfoClient(const edm::ParameterSet &ps)
void cd(void)
Definition: DQMStore.cc:268
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:304
MonitorElement * bookInt(Args &&...args)
Definition: DQMStore.h:103
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)
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
std::string dcsinfofolder_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
TH1F * getTH1F(void) const
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)