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  virtual void beginJob() {
37  };
38  virtual void analyze(const edm::Event&, const edm::EventSetup&);
39 
40  virtual void endJob() {
41  if (outputFile_.size() != 0 && dbe_) dbe_->save(outputFile_);
42 
43  };
44 
45  virtual void beginRun(edm::Run const&, edm::EventSetup const&) {
46  };
47 
48  virtual void endRun(edm::Run const&, edm::EventSetup const&) {
49 
51  runClient();
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();
65  int HcalDigisEndjob(const std::vector<MonitorElement*> &hcalMEs, std::string subdet_);
66 
68 
69  void book1D(std::string name, int n, double min, double max) {
70  if (!msm_->count(name)) (*msm_)[name] = dbe_->book1D(name.c_str(), name.c_str(), n, min, max);
71  }
72 
73  void book1D(std::string name, const HistLim& limX) {
74  if (!msm_->count(name)) (*msm_)[name] = dbe_->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(std::string name, const HistLim& limX, const HistLim& limY) {
82  if (!msm_->count(name)) (*msm_)[name] = dbe_->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(std::string name, const HistLim& limX, const HistLim& limY) {
90  if (!msm_->count(name)) (*msm_)[name] = dbe_->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(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_;
107 };
108 
109 
110 
111 #endif /* HCALDIGISCLIENT_H */
112 
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:954
void book2D(std::string name, const HistLim &limX, const HistLim &limY)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::string dirName_
void scaleMETH2D(MonitorElement *ME, double s)
#define X(str)
Definition: MuonsGrabber.cc:48
int HcalDigisEndjob(const std::vector< MonitorElement * > &hcalMEs, std::string subdet_)
HcalDigisClient(const edm::ParameterSet &)
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)
void booking(std::string subdetopt)
void book1D(std::string name, int n, double min, double max)
MonitorElement * monitor(std::string name)
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1268
virtual void endJob()
T min(T a, T b)
Definition: MathUtil.h:58
std::string str(int x)
std::map< std::string, MonitorElement * > * msm_
double integralMETH2D(MonitorElement *ME, int i0, int i1, int j0, int j1)
void fillPf(std::string name, double X, double Y)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2540
virtual void beginJob()
virtual void runClient()
virtual void endRun(edm::Run const &, edm::EventSetup const &)
Definition: DDAxes.h:10
int weight
Definition: histoStyle.py:50
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1082
void book1D(std::string name, const HistLim &limX)
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
HistLim(int nbin, double mini, double maxi)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
void bookPf(std::string name, const HistLim &limX, const HistLim &limY)
Definition: Run.h:41