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 
7 
8  dcsinfofolder_ = ps.getUntrackedParameter<std::string>("dcsInfoFolder", "RPC/DCSInfo") ;
9 }
10 
11 
13 
15  DCS.clear();
16  DCS.resize(10); // start with 10 LS, resize later
17 }
18 
20 
22  if (!dbe_) return;
23 
24  unsigned int nlumi = l.id().luminosityBlock() ;
25 
26  if (nlumi+1 > DCS.size()) DCS.resize(nlumi+1);
27 
28 
29  MonitorElement* DCSbyLS_ = dbe_->get(dcsinfofolder_ + "/DCSbyLS" );
30 
31  if ( !DCSbyLS_ ) return;
32 
33  if ( TH1F * h1 = DCSbyLS_->getTH1F()) {
34  int hvStatus = 0;
35 
36  if ( h1->GetBinContent(1) != 0 ) {
37  hvStatus = 0; // set to 0 because HV was off (!)
38  } else {
39  hvStatus = 1; // set to 1 because HV was on (!)
40  }
41 
42  DCS[nlumi] = hvStatus;
43  }
44 
45  return;
46 }
47 
49 
50  // book
51  dbe_->cd();
53 
54  unsigned int nlsmax = DCS.size();
55  if (nlsmax > 900 ) nlsmax = 900;
56 
57  std::string meName = dcsinfofolder_ + "/rpcHVStatus";
58  MonitorElement* rpcHVStatus = dbe_->get(meName);
59  if (rpcHVStatus) dbe_->removeElement(rpcHVStatus->getName());
60 
61  rpcHVStatus = dbe_->book2D("rpcHVStatus","RPC HV Status", nlsmax, 1., nlsmax+1, 1, 0.5, 1.5);
62  rpcHVStatus->setAxisTitle("Luminosity Section", 1);
63  rpcHVStatus->setBinLabel(1,"",2);
64 
65  int lsCounter = 0;
66  // fill
67  for (unsigned int i = 0 ; i < nlsmax ; i++ ) {
68  rpcHVStatus->setBinContent(i+1,1,DCS[i]);
69  lsCounter +=DCS[i];
70  }
71 
72  meName = dcsinfofolder_ + "/rpcHV";
73  MonitorElement* rpcHV = dbe_->get(meName);
74  if (rpcHV) dbe_->removeElement(rpcHVStatus->getName());
75  rpcHV = dbe_->bookInt("rpcHV");
76 
77  rpcHV ->Fill(lsCounter);
78 
79  return;
80 }
LuminosityBlockID id() const
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
void analyze(const edm::Event &e, const edm::EventSetup &c)
RPCDcsInfoClient(const edm::ParameterSet &ps)
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:561
void beginRun(const edm::Run &r, const edm::EventSetup &c)
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 endLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &c)
void removeElement(const std::string &name)
Definition: DQMStore.cc:2772
std::string dcsinfofolder_
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
TH1F * getTH1F(void) const
LuminosityBlockNumber_t luminosityBlock() const
void endRun(const edm::Run &r, const edm::EventSetup &c)
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:779
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1000
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
Definition: Run.h:41