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 
20 
22 class Benchmark{
23 
24  public:
25 
26  class PhaseSpace {
27  public:
28  int n;
29  float m;
30  float M;
31  PhaseSpace() : n(1), m(0), M(1) {}
32  PhaseSpace( int n, float m, float M):n(n), m(m), M(M) {}
33  };
34 
35  enum Mode {
39  };
40 
42  dir_(nullptr), mode_(mode),
43  ptMin_(0), ptMax_(10e10),
44  etaMin_(-10), etaMax_(10),
45  phiMin_(-10), phiMax_(10) {}
46 
47  virtual ~Benchmark() noexcept(false);
48 
50 
51  void setRange( float ptMin, float ptMax,
52  float etaMin, float etaMax,
53  float phiMin, float phiMax ) {
56  }
57 
58  bool isInRange(float pt, float eta, float phi) const {
59  return pt>ptMin_ && pt<ptMax_ && eta>etaMin_ && eta<etaMax_ && phi>phiMin_ && phi<phiMax_ ? true : false;
60  }
61 
62  virtual void setDirectory(TDirectory* dir);
63 
65  void write();
66 
67  protected:
68 
70  //TH1F* book1D(const char* histname, const char* title,
72  TH1F* book1D(DQMStore::IBooker& b, const char* histname, const char* title,
73  int nbins, float xmin, float xmax);
74 
76  //TH2F* book2D(const char* histname, const char* title,
78  TH2F* book2D(DQMStore::IBooker& b, const char* histname, const char* title,
79  int nbinsx, float xmin, float xmax,
80  int nbinsy, float ymin, float ymax );
81 
83  //TH2F* book2D(const char* histname, const char* title,
85  TH2F* book2D(DQMStore::IBooker& b, const char* histname, const char* title,
86  int nbinsx, float* xbins,
87  int nbinsy, float ymin, float ymax );
88 
90  //TProfile* bookProfile(const char* histname, const char* title,
92  TProfile* bookProfile(DQMStore::IBooker& b, const char* histname, const char* title,
93  int nbinsx, float xmin, float xmax,
94  float ymin, float ymax, const char* option );
95 
97  //TProfile* bookProfile(const char* histname, const char* title,
99  TProfile* bookProfile(DQMStore::IBooker& b, const char* histname, const char* title,
100  int nbinsx, float* xbins,
101  float ymin, float ymax, const char* option );
102 
103  TDirectory* dir_;
104 
106 
107  float ptMin_;
108  float ptMax_;
109  float etaMin_;
110  float etaMax_;
111  float phiMin_;
112  float phiMax_;
113 
114 
115 };
116 
117 #endif
TH1F * book1D(DQMStore::IBooker &b, const char *histname, const char *title, int nbins, float xmin, float xmax)
book a 1D histogram, either with DQM or plain root depending if DQM_ has been initialized in a child ...
Definition: Benchmark.cc:23
float etaMax_
Definition: Benchmark.h:110
const double xbins[]
float ptMax_
Definition: Benchmark.h:108
PhaseSpace(int n, float m, float M)
Definition: Benchmark.h:32
abstract base class
Definition: Benchmark.h:22
float phiMin_
Definition: Benchmark.h:111
#define noexcept
virtual void setDirectory(TDirectory *dir)
Definition: Benchmark.cc:18
#define nullptr
void write()
write to the TFile, in plain ROOT mode. No need to call this function in DQM mode ...
Definition: Benchmark.cc:73
virtual ~Benchmark()(false)
Definition: Benchmark.cc:13
float phiMax_
Definition: Benchmark.h:112
void setParameters(Mode mode)
Definition: Benchmark.h:49
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 with DQM or plain root depending if DQM_ has been initialized in a child ...
Definition: Benchmark.cc:29
Benchmark(Mode mode=DEFAULT)
Definition: Benchmark.h:41
float ptMin_
Definition: Benchmark.h:107
TDirectory * dir_
Definition: Benchmark.h:103
void setRange(float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax)
Definition: Benchmark.h:51
double b
Definition: hdecay.h:120
float etaMin_
Definition: Benchmark.h:109
Mode mode_
Definition: Benchmark.h:105
dbl *** dir
Definition: mlp_gen.cc:35
bool isInRange(float pt, float eta, float phi) const
Definition: Benchmark.h:58
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 histogram, either with DQM or plain root depending if DQM_ has been initialized in a ...
Definition: Benchmark.cc:51