CMS 3D CMS Logo

Benchmark.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_Benchmark_Benchmark_h
2 #define RecoParticleFlow_Benchmark_Benchmark_h
3 
5 
7 
8 #include <string>
9 
10 class TH1;
11 class TH1F;
12 class TH2;
13 class TProfile;
14 
15 class TH2F;
16 class TDirectory;
17 
18 class DQMStore;
19 
21 class Benchmark {
22 public:
23  class PhaseSpace {
24  public:
25  int n;
26  float m;
27  float M;
28  PhaseSpace() : n(1), m(0), M(1) {}
29  PhaseSpace(int n, float m, float M) : n(n), m(m), M(M) {}
30  };
31 
33 
35  : dir_(nullptr), mode_(mode), ptMin_(0), ptMax_(10e10), etaMin_(-10), etaMax_(10), phiMin_(-10), phiMax_(10) {}
36 
37  virtual ~Benchmark() noexcept(false);
38 
40 
41  void setRange(float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax) {
42  ptMin_ = ptMin;
43  ptMax_ = ptMax;
44  etaMin_ = etaMin;
45  etaMax_ = etaMax;
46  phiMin_ = phiMin;
47  phiMax_ = phiMax;
48  }
49 
50  bool isInRange(float pt, float eta, float phi) const {
51  return pt > ptMin_ && pt < ptMax_ && eta > etaMin_ && eta < etaMax_ && phi > phiMin_ && phi < phiMax_ ? true
52  : false;
53  }
54 
55  virtual void setDirectory(TDirectory *dir);
56 
59  void write();
60 
61 protected:
64  // TH1F* book1D(const char* histname, const char* title,
66  TH1F *book1D(DQMStore::IBooker &b, const char *histname, const char *title, int nbins, float xmin, float xmax);
67 
70  // TH2F* book2D(const char* histname, const char* title,
72  TH2F *book2D(DQMStore::IBooker &b,
73  const char *histname,
74  const char *title,
75  int nbinsx,
76  float xmin,
77  float xmax,
78  int nbinsy,
79  float ymin,
80  float ymax);
81 
84  // TH2F* book2D(const char* histname, const char* title,
86  TH2F *book2D(DQMStore::IBooker &b,
87  const char *histname,
88  const char *title,
89  int nbinsx,
90  float *xbins,
91  int nbinsy,
92  float ymin,
93  float ymax);
94 
97  // TProfile* bookProfile(const char* histname, const char* title,
99  TProfile *bookProfile(DQMStore::IBooker &b,
100  const char *histname,
101  const char *title,
102  int nbinsx,
103  float xmin,
104  float xmax,
105  float ymin,
106  float ymax,
107  const char *option);
108 
111  // TProfile* bookProfile(const char* histname, const char* title,
113  TProfile *bookProfile(DQMStore::IBooker &b,
114  const char *histname,
115  const char *title,
116  int nbinsx,
117  float *xbins,
118  float ymin,
119  float ymax,
120  const char *option);
121 
122  TDirectory *dir_;
123 
125 
126  float ptMin_;
127  float ptMax_;
128  float etaMin_;
129  float etaMax_;
130  float phiMin_;
131  float phiMax_;
132 };
133 
134 #endif
TH1F * book1D(DQMStore::IBooker &b, const char *histname, const char *title, int nbins, float xmin, float xmax)
book a 1D histogram, either through IBooker or plain root
Definition: Benchmark.cc:16
float etaMax_
Definition: Benchmark.h:129
const double xbins[]
float ptMax_
Definition: Benchmark.h:127
PhaseSpace(int n, float m, float M)
Definition: Benchmark.h:29
#define nullptr
abstract base class
Definition: Benchmark.h:21
float phiMin_
Definition: Benchmark.h:130
virtual void setDirectory(TDirectory *dir)
Definition: Benchmark.cc:14
void write()
Definition: Benchmark.cc:94
virtual ~Benchmark()(false)
Definition: Benchmark.cc:12
float phiMax_
Definition: Benchmark.h:131
void setParameters(Mode mode)
Definition: Benchmark.h:39
TH2F * book2D(DQMStore::IBooker &b, const char *histname, const char *title, int nbinsx, float xmin, float xmax, int nbinsy, float ymin, float ymax)
book a 2D histogram, either through IBooker or plain root
Definition: Benchmark.cc:23
Benchmark(Mode mode=DEFAULT)
Definition: Benchmark.h:34
float ptMin_
Definition: Benchmark.h:126
#define noexcept
TDirectory * dir_
Definition: Benchmark.h:122
void setRange(float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax)
Definition: Benchmark.h:41
double b
Definition: hdecay.h:120
float etaMin_
Definition: Benchmark.h:128
Mode mode_
Definition: Benchmark.h:124
dbl *** dir
Definition: mlp_gen.cc:35
bool isInRange(float pt, float eta, float phi) const
Definition: Benchmark.h:50
TProfile * bookProfile(DQMStore::IBooker &b, const char *histname, const char *title, int nbinsx, float xmin, float xmax, float ymin, float ymax, const char *option)
book a TProfile, either through IBooker or plain root
Definition: Benchmark.cc:59