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