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 
26 
28 public:
29  explicit HcalDigisClient(const edm::ParameterSet&);
30 
31  ~HcalDigisClient() override;
32 
33 private:
34 
35  void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter & igetter ) override {
36  igetter.setCurrentFolder(dirName_); // This sets the DQMStore (should apply to ibooker as well
37  runClient(ibooker, igetter);
38  }
39 
40  struct HistLim {
41 
42  HistLim(int nbin, double mini, double maxi)
43  : n(nbin), min(mini), max(maxi) {
44  }
45  int n;
46  double min;
47  double max;
48  };
49 
50  virtual void runClient(DQMStore::IBooker &ib, DQMStore::IGetter &ig);
51  int HcalDigisEndjob(const std::vector<MonitorElement*> &hcalMEs, std::string subdet_, DQMStore::IBooker &ib);
52 
54 
55  void book1D(DQMStore::IBooker &ib, std::string name, int n, double min, double max) {
56  if (!msm_->count(name)) (*msm_)[name] = ib.book1D(name.c_str(), name.c_str(), n, min, max);
57  }
58 
60  if (!msm_->count(name)) (*msm_)[name] = ib.book1D(name.c_str(), name.c_str(), limX.n, limX.min, limX.max);
61  }
62 
63  void fill1D(std::string name, double X, double weight = 1) {
64  msm_->find(name)->second->Fill(X, weight);
65  }
66 
67  void book2D(DQMStore::IBooker &ib, std::string name, const HistLim& limX, const HistLim& limY) {
68  if (!msm_->count(name)) (*msm_)[name] = ib.book2D(name.c_str(), name.c_str(), limX.n, limX.min, limX.max, limY.n, limY.min, limY.max);
69  }
70 
71  void fill2D(std::string name, double X, double Y, double weight = 1) {
72  msm_->find(name)->second->Fill(X, Y, weight);
73  }
74 
75  void bookPf(DQMStore::IBooker &ib, std::string name, const HistLim& limX, const HistLim& limY) {
76  if (!msm_->count(name)) (*msm_)[name] = ib.bookProfile(name.c_str(), name.c_str(), limX.n, limX.min, limX.max, limY.n, limY.min, limY.max);
77  }
78 
79  void bookPf(DQMStore::IBooker &ib, std::string name, const HistLim& limX, const HistLim& limY, const char *option) {
80  if (!msm_->count(name)) (*msm_)[name] = ib.bookProfile(name.c_str(), name.c_str(), limX.n, limX.min, limX.max, limY.n, limY.min, limY.max, option);
81  }
82 
83  void fillPf(std::string name, double X, double Y) {
84  msm_->find(name)->second->Fill(X, Y);
85  }
86 
87  std::string str(int x);
88 
89  double integralMETH2D(MonitorElement* ME, int i0, int i1, int j0, int j1);
90  void scaleMETH2D(MonitorElement* ME, double s);
91  std::map<std::string, MonitorElement*> *msm_;
94 };
95 
96 
97 
98 #endif /* HCALDIGISCLIENT_H */
99 
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:160
std::string dirName_
void scaleMETH2D(MonitorElement *ME, double s)
virtual void runClient(DQMStore::IBooker &ib, DQMStore::IGetter &ig)
#define X(str)
Definition: MuonsGrabber.cc:48
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)
int HcalDigisEndjob(const std::vector< MonitorElement * > &hcalMEs, std::string subdet_, DQMStore::IBooker &ib)
std::string outputFile_
Definition: ME.h:11
void fill1D(std::string name, double X, double weight=1)
~HcalDigisClient() override
MonitorElement * monitor(std::string name)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
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)
std::map< std::string, MonitorElement * > * msm_
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
double integralMETH2D(MonitorElement *ME, int i0, int i1, int j0, int j1)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:349
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:660