CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
32 
33 private:
34 
35  virtual void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter & igetter ) {
36  igetter.setCurrentFolder("HcalDigisV/HcalDigiTask"); // moved this line from constructor
37 
38  // the following booking clas were moved from the constructor
39  booking(ibooker, "HB");
40  booking(ibooker, "HE");
41  booking(ibooker, "HO");
42  booking(ibooker, "HF");
43 
44  igetter.setCurrentFolder(dirName_); // This sets the DQMStore (should apply to ibooker as well
45  runClient(ibooker, igetter);
46  }
47 
48  struct HistLim {
49 
50  HistLim(int nbin, double mini, double maxi)
51  : n(nbin), min(mini), max(maxi) {
52  }
53  int n;
54  double min;
55  double max;
56  };
57 
58  virtual void runClient(DQMStore::IBooker &ib, DQMStore::IGetter &ig);
59  int HcalDigisEndjob(const std::vector<MonitorElement*> &hcalMEs, std::string subdet_);
60 
62 
63  void book1D(DQMStore::IBooker &ib, std::string name, int n, double min, double max) {
64  if (!msm_->count(name)) (*msm_)[name] = ib.book1D(name.c_str(), name.c_str(), n, min, max);
65  }
66 
68  if (!msm_->count(name)) (*msm_)[name] = ib.book1D(name.c_str(), name.c_str(), limX.n, limX.min, limX.max);
69  }
70 
71  void fill1D(std::string name, double X, double weight = 1) {
72  msm_->find(name)->second->Fill(X, weight);
73  }
74 
75  void book2D(DQMStore::IBooker &ib, std::string name, const HistLim& limX, const HistLim& limY) {
76  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);
77  }
78 
79  void fill2D(std::string name, double X, double Y, double weight = 1) {
80  msm_->find(name)->second->Fill(X, Y, weight);
81  }
82 
83  void bookPf(DQMStore::IBooker &ib, std::string name, const HistLim& limX, const HistLim& limY) {
84  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);
85  }
86 
87  void bookPf(DQMStore::IBooker &ib, std::string name, const HistLim& limX, const HistLim& limY, const char *option) {
88  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);
89  }
90 
91  void fillPf(std::string name, double X, double Y) {
92  msm_->find(name)->second->Fill(X, Y);
93  }
94 
95  void booking(DQMStore::IBooker &ib, std::string subdetopt);
96 
97  std::string str(int x);
98 
99  double integralMETH2D(MonitorElement* ME, int i0, int i1, int j0, int j1);
100  void scaleMETH2D(MonitorElement* ME, double s);
101  std::map<std::string, MonitorElement*> *msm_;
104 };
105 
106 
107 
108 #endif /* HCALDIGISCLIENT_H */
109 
int ib
Definition: cuy.py:660
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
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
int HcalDigisEndjob(const std::vector< MonitorElement * > &hcalMEs, std::string subdet_)
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)
MonitorElement * monitor(std::string name)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
T min(T a, T b)
Definition: MathUtil.h:58
std::string str(int x)
virtual void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void booking(DQMStore::IBooker &ib, std::string subdetopt)
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:133
double integralMETH2D(MonitorElement *ME, int i0, int i1, int j0, int j1)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:330
void bookPf(DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY)
void fillPf(std::string name, double X, double Y)
HistLim(int nbin, double mini, double maxi)
void book2D(DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY)