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 
19 class Benchmark {
20 public:
22 
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_);
52  }
53 
54  virtual void setDirectory(TDirectory *dir);
55 
57  void write();
58 
59 protected:
61  //TH1F *book1D(const char *histname, const char *title,
63  TH1F *book1D(DQMStore::IBooker &b, const char *histname, const char *title, int nbins, float xmin, float xmax);
64 
66  //TH2F *book2D(const char *histname, const char *title,
68  TH2F *book2D(DQMStore::IBooker &b,
69  const char *histname,
70  const char *title,
71  int nbinsx,
72  float xmin,
73  float xmax,
74  int nbinsy,
75  float ymin,
76  float ymax);
77 
79  //TH2F *book2D(const char *histname, const char *title,
81  TH2F *book2D(DQMStore::IBooker &b,
82  const char *histname,
83  const char *title,
84  int nbinsx,
85  float *xbins,
86  int nbinsy,
87  float ymin,
88  float ymax);
89 
91  //TProfile *bookProfile(const char *histname, const char *title,
93  TProfile *bookProfile(DQMStore::IBooker &b,
94  const char *histname,
95  const char *title,
96  int nbinsx,
97  float xmin,
98  float xmax,
99  float ymin,
100  float ymax,
101  const char *option);
102 
105  // TProfile *bookProfile(const char *histname, const char *title,
107  TProfile *bookProfile(DQMStore::IBooker &b,
108  const char *histname,
109  const char *title,
110  int nbinsx,
111  float *xbins,
112  float ymin,
113  float ymax,
114  const char *option);
115 
116  TDirectory *dir_;
117 
119 
120  float ptMin_;
121  float ptMax_;
122  float etaMin_;
123  float etaMax_;
124  float phiMin_;
125  float phiMax_;
126 };
127 
128 #endif
Benchmark::write
void write()
write to the TFile, in plain ROOT mode. No need to call this function in DQM mode
Definition: Benchmark.cc:93
Benchmark
abstract base class
Definition: Benchmark.h:19
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
fw3dlego::xbins
const double xbins[]
Definition: fw3dlego_xbins.cc:16
ALCARECOTkAlBeamHalo_cff.etaMin
etaMin
GeV.
Definition: ALCARECOTkAlBeamHalo_cff.py:32
funct::false
false
Definition: Factorize.h:29
Benchmark::book2D
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:22
Benchmark::phiMin_
float phiMin_
Definition: Benchmark.h:124
Benchmark::isInRange
bool isInRange(float pt, float eta, float phi) const
Definition: Benchmark.h:50
Benchmark::etaMin_
float etaMin_
Definition: Benchmark.h:122
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
Benchmark::PhaseSpace::n
int n
Definition: Benchmark.h:25
Benchmark::dir_
TDirectory * dir_
Definition: Benchmark.h:116
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
ptMin
constexpr float ptMin
Definition: PhotonIDValueMapProducer.cc:155
Benchmark::phiMax_
float phiMax_
Definition: Benchmark.h:125
DQMStore.h
Benchmark::setParameters
void setParameters(Mode mode)
Definition: Benchmark.h:39
Benchmark::setRange
void setRange(float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax)
Definition: Benchmark.h:41
Benchmark::DQMOFFLINE
Definition: Benchmark.h:32
fileinputsource_cfi.option
option
Definition: fileinputsource_cfi.py:87
Benchmark::PhaseSpace
Definition: Benchmark.h:23
Benchmark::PhaseSpace::PhaseSpace
PhaseSpace(int n, float m, float M)
Definition: Benchmark.h:29
L1TOccupancyClient_cfi.ymax
ymax
Definition: L1TOccupancyClient_cfi.py:43
dqm::legacy::DQMStore
Definition: DQMStore.h:727
AlignmentTrackSelector_cfi.ptMax
ptMax
Definition: AlignmentTrackSelector_cfi.py:12
PVValHelper::eta
Definition: PVValidationHelpers.h:69
Benchmark::~Benchmark
virtual ~Benchmark() noexcept(false)
Definition: Benchmark.cc:11
AlignmentTrackSelector_cfi.phiMin
phiMin
Definition: AlignmentTrackSelector_cfi.py:18
AlignmentTrackSelector_cfi.phiMax
phiMax
Definition: AlignmentTrackSelector_cfi.py:17
Benchmark::PhaseSpace::PhaseSpace
PhaseSpace()
Definition: Benchmark.h:28
LaserClient_cfi.nbins
nbins
Definition: LaserClient_cfi.py:51
Benchmark::mode_
Mode mode_
Definition: Benchmark.h:118
b
double b
Definition: hdecay.h:118
Benchmark::Benchmark
Benchmark(Mode mode=DEFAULT)
Definition: Benchmark.h:34
Benchmark::VALIDATION
Definition: Benchmark.h:32
Benchmark::DQMStore
dqm::legacy::DQMStore DQMStore
Definition: Benchmark.h:21
Benchmark::Mode
Mode
Definition: Benchmark.h:32
Benchmark::etaMax_
float etaMax_
Definition: Benchmark.h:123
Benchmark::ptMax_
float ptMax_
Definition: Benchmark.h:121
Benchmark::PhaseSpace::M
float M
Definition: Benchmark.h:27
Benchmark::PhaseSpace::m
float m
Definition: Benchmark.h:26
Benchmark::bookProfile
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:58
Benchmark::setDirectory
virtual void setDirectory(TDirectory *dir)
Definition: Benchmark.cc:13
DDAxes::phi
Benchmark::book1D
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:15
L1TOccupancyClient_cfi.ymin
ymin
Definition: L1TOccupancyClient_cfi.py:43
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
Benchmark::DEFAULT
Definition: Benchmark.h:32
ALCARECOTkAlBeamHalo_cff.etaMax
etaMax
Definition: ALCARECOTkAlBeamHalo_cff.py:33
dqm::implementation::IBooker
Definition: DQMStore.h:43
Benchmark::ptMin_
float ptMin_
Definition: Benchmark.h:120
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10
PFCandidateFwd.h
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23