CMS 3D CMS Logo

PFMETBenchmark.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_Benchmark_PFMETBenchmark_h
2 #define RecoParticleFlow_Benchmark_PFMETBenchmark_h
3 
5 
21 
22 //#include "FWCore/ServiceRegistry/interface/Service.h"
23 
24 #include "TH1F.h"
25 #include "TH2F.h"
27 #include <string>
28 #include <TFile.h>
29 
31 public:
34 
36  virtual ~PFMETBenchmark();
37 
38  void setup(std::string Filename,
39  bool debug,
40  bool plotAgainstReco = false,
41  std::string benchmarkLabel_ = "ParticleFlow",
42  DQMStore* dbe_store = nullptr);
43  void process(const reco::PFMETCollection&,
46  const reco::METCollection&);
50  const reco::METCollection&);
54  const reco::METCollection&,
55  const std::vector<reco::CaloJet>&,
56  const std::vector<reco::CaloJet>&);
57  float getTrueMET() { return true_met; }
58  float getTruePhi() { return true_phi; }
59  float getTrueSET() { return true_set; }
60  float getPFMET() { return rec_met; }
61  float getPFMEX() { return rec_mex - true_mex; }
62  float getPFMEY() { return rec_mey - true_mey; }
63  float getPFPhi() { return rec_phi; }
64  float getPFSET() { return rec_set; }
65  float getCaloMET() { return calo_met; }
66  float getCaloMEX() { return calo_mex - true_mex; }
67  float getCaloMEY() { return calo_mey - true_mey; }
68  float getCaloPhi() { return calo_phi; }
69  float getCaloSET() { return calo_set; }
70  float getTCMET() { return tc_met; }
71  float getTCMEX() { return tc_mex - true_mex; }
72  float getTCMEY() { return tc_mey - true_mey; }
73  float getTCPhi() { return tc_phi; }
74  float getTCSET() { return tc_set; }
75  float getDeltaPFMET() { return rec_met - true_met; }
76  float getDeltaPFPhi() { return mpi_pi(rec_phi - true_phi); }
77  float getDeltaPFSET() { return rec_set - true_set; }
78  float getDeltaCaloMET() { return calo_met - true_met; }
79  float getDeltaCaloPhi() { return mpi_pi(calo_phi - true_phi); }
80  float getDeltaCaloSET() { return calo_set - true_set; }
81  float getDeltaTCMET() { return tc_met - true_met; }
82  float getDeltaTCPhi() { return mpi_pi(tc_phi - true_phi); }
83  float getDeltaTCSET() { return tc_set - true_set; }
84  double mpi_pi(double angle);
85  void analyse();
86  //void FitSlicesInY(TH2F*, TH1F*, TH1F*, bool, int);
87  void write();
88 
89 private:
90  TFile* file_;
91 
92  // histograms
93  // delta Pt or E quantities for Barrel
98  TH1F* hMEX;
99  TH1F* hDeltaMEX;
100  TH1F* hDeltaMET;
101  TH1F* hDeltaPhi;
102  TH1F* hDeltaSET;
103 
112  TH1F* hTrueMET;
113  TH1F* hCaloMET;
114  TH1F* hPFMET;
115  TH1F* hTCMET;
118 
123  TH1F* hCaloMEX;
128 
133  TH1F* hTCMEX;
134  TH1F* hDeltaTCMEX;
135  TH1F* hDeltaTCMET;
136  TH1F* hDeltaTCPhi;
137  TH1F* hDeltaTCSET;
138 
141 
142  //TH1F *hmeanPF;
143  //TH1F *hmeanCalo;
144  //TH1F *hsigmaPF;
145  //TH1F *hsigmaCalo;
146  //TH1F *hrmsPF;
147  //TH1F *hrmsCalo;
148 
150 
151  double true_set;
152  double true_met;
153  double true_mex;
154  double true_mey;
155  double true_phi;
156  double rec_met;
157  double rec_mex;
158  double rec_mey;
159  double rec_phi;
160  double rec_set;
161  double calo_met;
162  double calo_mex;
163  double calo_mey;
164  double calo_phi;
165  double calo_set;
166  double tc_met;
167  double tc_mex;
168  double tc_mey;
169  double tc_phi;
170  double tc_set;
171 
172 protected:
174  bool debug_;
176  DQMStore* dbe_;
177 };
178 
179 #endif // RecoParticleFlow_Benchmark_PFMETBenchmark_h
TProfile * profileTCSETvsTCSETresp
float getTrueMET()
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
TProfile * profileTCMETvsTCMETresp
TH2F * hCaloSETvsDeltaCaloSET
TH2F * hDeltaPFPhivstrueMET
float getDeltaCaloPhi()
TH2F * hDeltaTCPhivstrueMET
TH2F * hDeltaTCMETvstrueMET
float getDeltaTCMET()
TProfile * profileMETvsMETresp
TH2F * hDeltaCaloMETvstrueMET
virtual ~PFMETBenchmark()
TH2F * hCaloMETvstrueMET
void calculateQuantities(const reco::PFMETCollection &, const reco::GenParticleCollection &, const reco::CaloMETCollection &, const reco::METCollection &)
TH2F * hDeltaCaloPhivstrueMET
float getDeltaTCPhi()
TProfile * profileSETvsSETresp
void setup(std::string Filename, bool debug, bool plotAgainstReco=false, std::string benchmarkLabel_="ParticleFlow", DQMStore *dbe_store=0)
TH2F * hCaloSETvsDeltaCaloMET
TH2F * hSETvsDeltaMET
std::string outputFile_
std::vector< reco::MET > METCollection
collection of MET objects
Definition: METCollection.h:22
PFBenchmarkAlgo * algo_
double mpi_pi(double angle)
void process(const reco::PFMETCollection &, const reco::GenParticleCollection &, const reco::CaloMETCollection &, const reco::METCollection &)
TH2F * hSETvsDeltaSET
float getDeltaCaloSET()
TH2F * hDeltaPFMETvstrueMET
dqm::legacy::DQMStore DQMStore
float getCaloMEX()
float getTruePhi()
float getCaloPhi()
TH2F * hDeltaTCMEXvstrueSET
float getDeltaPFSET()
string benchmarkLabel_
float getDeltaPFMET()
TH2F * hDeltaCaloMEXvstrueSET
float getDeltaTCSET()
TH2F * hDeltaPFMEXvstrueSET
TProfile * profileCaloSETvsCaloSETresp
bool plotAgainstReco
float getDeltaCaloMET()
#define debug
Definition: HDRShower.cc:19
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
float getDeltaPFPhi()
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
TH2F * hTCSETvsDeltaTCSET
TH2F * hTCMETvstrueMET
float getCaloSET()
DQMStore * dbe_
TProfile * profileCaloMETvsCaloMETresp
float getCaloMET()
TH2F * hTCSETvsDeltaTCMET
dqm::legacy::MonitorElement MonitorElement
TH2F * hPFMETvstrueMET
float getCaloMEY()
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
float getTrueSET()