CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 
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 */
int ib
Definition: cuy.py:661
std::map< std::string, MonitorElement * > * msm_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
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
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 * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:322
T min(T a, T b)
Definition: MathUtil.h:58
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)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
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
int weight
Definition: histoStyle.py:51
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
HistLim(int nbin, double mini, double maxi)
void book2D(DQMStore::IBooker &ib, std::string name, const HistLim &limX, const HistLim &limY)