CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Benchmark.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_Benchmark_Benchmark_h
2 #define RecoParticleFlow_Benchmark_Benchmark_h
3 
5 
6 
7 #include <string>
8 
9 class TH1;
10 class TH1F;
11 class TH2;
12 class TProfile;
13 
14 class TH2F;
15 class TDirectory;
16 
17 class DQMStore;
18 
19 
21 class Benchmark{
22 
23  public:
24 
25  class PhaseSpace {
26  public:
27  int n;
28  float m;
29  float M;
30  PhaseSpace() : n(1), m(0), M(1) {}
31  PhaseSpace( int n, float m, float M):n(n), m(m), M(M) {}
32  };
33 
34  enum Mode {
38  };
39 
40  static DQMStore *DQM_;
41 
43  dir_(0), mode_(mode),
44  ptMin_(0), ptMax_(10e10),
45  etaMin_(-10), etaMax_(10),
46  phiMin_(-10), phiMax_(10) {}
47 
48  virtual ~Benchmark();
49 
51 
52  void setRange( float ptMin, float ptMax,
53  float etaMin, float etaMax,
54  float phiMin, float phiMax ) {
57  }
58 
59  bool isInRange(float pt, float eta, float phi) const {
60  return pt>ptMin_ && pt<ptMax_ && eta>etaMin_ && eta<etaMax_ && phi>phiMin_ && phi<phiMax_ ? true : false;
61  }
62 
63  virtual void setDirectory(TDirectory* dir);
64 
66  void write();
67 
68  protected:
69 
71  TH1F* book1D(const char* histname, const char* title,
72  int nbins, float xmin, float xmax);
73 
75  TH2F* book2D(const char* histname, const char* title,
76  int nbinsx, float xmin, float xmax,
77  int nbinsy, float ymin, float ymax );
78 
80  TH2F* book2D(const char* histname, const char* title,
81  int nbinsx, float* xbins,
82  int nbinsy, float ymin, float ymax );
83 
85  TProfile* bookProfile(const char* histname, const char* title,
86  int nbinsx, float xmin, float xmax,
87  float ymin, float ymax, const char* option );
88 
90  TProfile* bookProfile(const char* histname, const char* title,
91  int nbinsx, float* xbins,
92  float ymin, float ymax, const char* option );
93 
94  TDirectory* dir_;
95 
97 
98  float ptMin_;
99  float ptMax_;
100  float etaMin_;
101  float etaMax_;
102  float phiMin_;
103  float phiMax_;
104 
105 
106 };
107 
108 #endif
float etaMax_
Definition: Benchmark.h:101
const double xbins[]
float ptMax_
Definition: Benchmark.h:99
PhaseSpace(int n, float m, float M)
Definition: Benchmark.h:31
abstract base class
Definition: Benchmark.h:21
float phiMin_
Definition: Benchmark.h:102
virtual void setDirectory(TDirectory *dir)
Definition: Benchmark.cc:19
T eta() const
void write()
write to the TFile, in plain ROOT mode. No need to call this function in DQM mode ...
Definition: Benchmark.cc:141
static DQMStore * DQM_
Definition: Benchmark.h:40
virtual ~Benchmark()
Definition: Benchmark.cc:15
TH2F * book2D(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.
Definition: Benchmark.cc:43
float phiMax_
Definition: Benchmark.h:103
void setParameters(Mode mode)
Definition: Benchmark.h:50
Benchmark(Mode mode=DEFAULT)
Definition: Benchmark.h:42
float ptMin_
Definition: Benchmark.h:98
TDirectory * dir_
Definition: Benchmark.h:94
void setRange(float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax)
Definition: Benchmark.h:52
float etaMin_
Definition: Benchmark.h:100
Mode mode_
Definition: Benchmark.h:96
dbl *** dir
Definition: mlp_gen.cc:35
bool isInRange(float pt, float eta, float phi) const
Definition: Benchmark.h:59
TProfile * bookProfile(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.
Definition: Benchmark.cc:95
TH1F * book1D(const char *histname, const char *title, int nbins, float xmin, float xmax)
book a 1D histogram, either with DQM or plain root.
Definition: Benchmark.cc:25
Definition: DDAxes.h:10