File indexing completed on 2023-03-17 10:58:17
0001 #ifndef RecoParticleFlow_Benchmark_Benchmark_h
0002 #define RecoParticleFlow_Benchmark_Benchmark_h
0003
0004 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
0005
0006 #include "DQMServices/Core/interface/DQMStore.h"
0007
0008 #include <string>
0009
0010 class TH1;
0011 class TH1F;
0012 class TH2;
0013 class TProfile;
0014
0015 class TH2F;
0016 class TDirectory;
0017
0018
0019 class Benchmark {
0020 public:
0021 typedef dqm::legacy::DQMStore DQMStore;
0022
0023 class PhaseSpace {
0024 public:
0025 int n;
0026 float m;
0027 float M;
0028 PhaseSpace() : n(1), m(0), M(1) {}
0029 PhaseSpace(int n, float m, float M) : n(n), m(m), M(M) {}
0030 };
0031
0032 enum Mode { DEFAULT, DQMOFFLINE, VALIDATION };
0033
0034 Benchmark(Mode mode = DEFAULT)
0035 : dir_(nullptr), mode_(mode), ptMin_(0), ptMax_(10e10), etaMin_(-10), etaMax_(10), phiMin_(-10), phiMax_(10) {}
0036
0037 virtual ~Benchmark() noexcept(false);
0038
0039 void setParameters(Mode mode) { mode_ = mode; }
0040
0041 void setRange(float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax) {
0042 ptMin_ = ptMin;
0043 ptMax_ = ptMax;
0044 etaMin_ = etaMin;
0045 etaMax_ = etaMax;
0046 phiMin_ = phiMin;
0047 phiMax_ = phiMax;
0048 }
0049
0050 bool isInRange(float pt, float eta, float phi) const {
0051 return (pt > ptMin_ && pt < ptMax_ && eta > etaMin_ && eta < etaMax_ && phi > phiMin_ && phi < phiMax_);
0052 }
0053
0054 virtual void setDirectory(TDirectory *dir);
0055
0056
0057 void write();
0058
0059 protected:
0060
0061
0062
0063 TH1F *book1D(DQMStore::IBooker &b, const char *histname, const char *title, int nbins, float xmin, float xmax);
0064
0065
0066
0067
0068 TH2F *book2D(DQMStore::IBooker &b,
0069 const char *histname,
0070 const char *title,
0071 int nbinsx,
0072 float xmin,
0073 float xmax,
0074 int nbinsy,
0075 float ymin,
0076 float ymax);
0077
0078
0079
0080
0081 TH2F *book2D(DQMStore::IBooker &b,
0082 const char *histname,
0083 const char *title,
0084 int nbinsx,
0085 float *xbins,
0086 int nbinsy,
0087 float ymin,
0088 float ymax);
0089
0090
0091
0092
0093 TProfile *bookProfile(DQMStore::IBooker &b,
0094 const char *histname,
0095 const char *title,
0096 int nbinsx,
0097 float xmin,
0098 float xmax,
0099 float ymin,
0100 float ymax,
0101 const char *option);
0102
0103
0104
0105
0106
0107 TProfile *bookProfile(DQMStore::IBooker &b,
0108 const char *histname,
0109 const char *title,
0110 int nbinsx,
0111 float *xbins,
0112 float ymin,
0113 float ymax,
0114 const char *option);
0115
0116 TDirectory *dir_;
0117
0118 Mode mode_;
0119
0120 float ptMin_;
0121 float ptMax_;
0122 float etaMin_;
0123 float etaMax_;
0124 float phiMin_;
0125 float phiMax_;
0126 };
0127
0128 #endif