CMS 3D CMS Logo

HcalDigisClient.h
Go to the documentation of this file.
1 /*
2  * File: HcalDigisClient.h
3  * Author: fahim
4  *
5  * Created on June 11, 2011, 6:38 PM
6  */
7 
8 #ifndef HCALDIGISCLIENT_H
9 #define HCALDIGISCLIENT_H
10 
11 #include <memory>
12 
13 // user include files
18 
21 
23 
25 
27 public:
28  explicit HcalDigisClient(const edm::ParameterSet &);
29 
30  ~HcalDigisClient() override;
31 
32 private:
33  void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override {
34  igetter.setCurrentFolder(dirName_); // This sets the DQMStore (should apply to ibooker as well
35  runClient(ibooker, igetter);
36  }
37 
38  struct HistLim {
39  HistLim(int nbin, double mini, double maxi) : n(nbin), min(mini), max(maxi) {}
40  int n;
41  double min;
42  double max;
43  };
44 
45  virtual void runClient(DQMStore::IBooker &ib, DQMStore::IGetter &ig);
46  int HcalDigisEndjob(const std::vector<MonitorElement *> &hcalMEs, std::string subdet_, DQMStore::IBooker &ib);
47 
49 
50  void book1D(DQMStore::IBooker &ib, std::string name, int n, double min, double max) {
51  if (!msm_->count(name))
52  (*msm_)[name] = ib.book1D(name.c_str(), name.c_str(), n, min, max);
53  }
54 
56  if (!msm_->count(name))
57  (*msm_)[name] = ib.book1D(name.c_str(), name.c_str(), limX.n, limX.min, limX.max);
58  }
59 
60  void fill1D(std::string name, double X, double weight = 1) { msm_->find(name)->second->Fill(X, weight); }
61 
62  void book2D(DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY) {
63  if (!msm_->count(name))
64  (*msm_)[name] = ib.book2D(name.c_str(), name.c_str(), limX.n, limX.min, limX.max, limY.n, limY.min, limY.max);
65  }
66 
67  void fill2D(std::string name, double X, double Y, double weight = 1) { msm_->find(name)->second->Fill(X, Y, weight); }
68 
69  void bookPf(DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY) {
70  if (!msm_->count(name))
71  (*msm_)[name] =
72  ib.bookProfile(name.c_str(), name.c_str(), limX.n, limX.min, limX.max, limY.n, limY.min, limY.max);
73  }
74 
75  void bookPf(DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY, const char *option) {
76  if (!msm_->count(name))
77  (*msm_)[name] =
78  ib.bookProfile(name.c_str(), name.c_str(), limX.n, limX.min, limX.max, limY.n, limY.min, limY.max, option);
79  }
80 
81  void fillPf(std::string name, double X, double Y) { msm_->find(name)->second->Fill(X, Y); }
82 
83  std::string str(int x);
84 
85  double integralMETH2D(MonitorElement *ME, int i0, int i1, int j0, int j1);
86  void scaleMETH2D(MonitorElement *ME, double s);
87  std::map<std::string, MonitorElement *> *msm_;
90 };
91 
92 #endif /* HCALDIGISCLIENT_H */
std::map< std::string, MonitorElement * > * msm_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::string dirName_
void scaleMETH2D(MonitorElement *ME, double s)
virtual void runClient(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
#define X(str)
Definition: MuonsGrabber.cc:38
Definition: weight.py:1
HcalDigisClient(const edm::ParameterSet &)
void book1D(DQMStore::IBooker &ib, std::string name, const HistLim &limX)
void fill2D(std::string name, double X, double Y, double weight=1)
std::string outputFile_
Definition: ME.h:11
void fill1D(std::string name, double X, double weight=1)
~HcalDigisClient() override
int HcalDigisEndjob(const std::vector< MonitorElement *> &hcalMEs, std::string subdet_, DQMStore::IBooker &ib)
std::string str(int x)
void book1D(DQMStore::IBooker &ib, std::string name, int n, double min, double max)
void bookPf(DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY, const char *option)
MonitorElement * monitor(std::string name)
double integralMETH2D(MonitorElement *ME, int i0, int i1, int j0, int j1)
void bookPf(DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY)
void fillPf(std::string name, double X, double Y)
void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override
HistLim(int nbin, double mini, double maxi)
void book2D(DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY)
ib
Definition: cuy.py:661