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 
13 class TH2F;
14 class TDirectory;
15 
16 class DQMStore;
17 
18 
20 class Benchmark{
21 
22  public:
23 
24  class PhaseSpace {
25  public:
26  int n;
27  float m;
28  float M;
29  PhaseSpace() : n(1), m(0), M(1) {}
30  PhaseSpace( int n, float m, float M):n(n), m(m), M(M) {}
31  };
32 
33  enum Mode {
37  };
38 
39  static DQMStore *DQM_;
40 
42  dir_(0), mode_(mode),
43  ptMin_(0), ptMax_(10e10),
44  etaMin_(-10), etaMax_(10),
45  phiMin_(-10), phiMax_(10) {}
46 
47  virtual ~Benchmark();
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,
71  int nbins, float xmin, float xmax);
72 
74  TH2F* book2D(const char* histname, const char* title,
75  int nbinsx, float xmin, float xmax,
76  int nbinsy, float ymin, float ymax );
77 
79  TH2F* book2D(const char* histname, const char* title,
80  int nbinsx, float* xbins,
81  int nbinsy, float ymin, float ymax );
82 
83 
84  TDirectory* dir_;
85 
87 
88  float ptMin_;
89  float ptMax_;
90  float etaMin_;
91  float etaMax_;
92  float phiMin_;
93  float phiMax_;
94 
95 
96 };
97 
98 #endif
float etaMax_
Definition: Benchmark.h:91
const double xbins[]
float ptMax_
Definition: Benchmark.h:89
PhaseSpace(int n, float m, float M)
Definition: Benchmark.h:30
abstract base class
Definition: Benchmark.h:20
float phiMin_
Definition: Benchmark.h:92
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:99
static DQMStore * DQM_
Definition: Benchmark.h:39
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:93
void setParameters(Mode mode)
Definition: Benchmark.h:49
Benchmark(Mode mode=DEFAULT)
Definition: Benchmark.h:41
float ptMin_
Definition: Benchmark.h:88
TDirectory * dir_
Definition: Benchmark.h:84
void setRange(float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax)
Definition: Benchmark.h:51
float etaMin_
Definition: Benchmark.h:90
Mode mode_
Definition: Benchmark.h:86
dbl *** dir
Definition: mlp_gen.cc:35
bool isInRange(float pt, float eta, float phi) const
Definition: Benchmark.h:58
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