CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Attributes
MatchMETBenchmark Class Reference

#include <MatchMETBenchmark.h>

Inheritance diagram for MatchMETBenchmark:
Benchmark MatchMETBenchmarkAnalyzer

Public Member Functions

void fillOne (const reco::MET &candidate, const reco::MET &matchedCandidate)
 fill histograms with a given particle More...
 
 MatchMETBenchmark (Mode mode)
 
void setup (DQMStore::IBooker &b)
 book histograms More...
 
 ~MatchMETBenchmark () override
 
- Public Member Functions inherited from Benchmark
 Benchmark (Mode mode=DEFAULT)
 
bool isInRange (float pt, float eta, float phi) const
 
virtual void setDirectory (TDirectory *dir)
 
void setParameters (Mode mode)
 
void setRange (float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax)
 
void write ()
 write to the TFile, in plain ROOT mode. No need to call this function in DQM mode More...
 
virtual ~Benchmark () noexcept(false)
 

Protected Attributes

TH2F * delta_et_Over_et_VS_et_
 
TH2F * delta_et_VS_et_
 
TH1F * delta_ex_
 
TH2F * delta_ex_VS_set_
 
TH2F * delta_phi_VS_et_
 
TH2F * delta_set_Over_set_VS_set_
 
TH2F * delta_set_VS_set_
 
TH2F * RecEt_VS_TrueEt_
 
TH2F * RecSet_Over_TrueSet_VS_TrueSet_
 
- Protected Attributes inherited from Benchmark
TDirectory * dir_
 
float etaMax_
 
float etaMin_
 
Mode mode_
 
float phiMax_
 
float phiMin_
 
float ptMax_
 
float ptMin_
 

Additional Inherited Members

- Public Types inherited from Benchmark
typedef dqm::legacy::DQMStore DQMStore
 
enum  Mode { DEFAULT, DQMOFFLINE, VALIDATION }
 
- Protected Member Functions inherited from Benchmark
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 analyzer or not. More...
 
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 analyzer or not. More...
 
TH2F * book2D (DQMStore::IBooker &b, const char *histname, const char *title, int nbinsx, float *xbins, 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 analyzer or not. More...
 
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 child analyzer or not. More...
 
TProfile * bookProfile (DQMStore::IBooker &b, const char *histname, const char *title, int nbinsx, float *xbins, float ymin, float ymax, const char *option)
 book a TProfile, either through IBooker or plain root More...
 

Detailed Description

Definition at line 13 of file MatchMETBenchmark.h.

Constructor & Destructor Documentation

MatchMETBenchmark::MatchMETBenchmark ( Mode  mode)
inline

Definition at line 15 of file MatchMETBenchmark.h.

15 : Benchmark(mode) {}
Benchmark(Mode mode=DEFAULT)
Definition: Benchmark.h:34
MatchMETBenchmark::~MatchMETBenchmark ( )
override

Definition at line 13 of file MatchMETBenchmark.cc.

13 {}

Member Function Documentation

void MatchMETBenchmark::fillOne ( const reco::MET candidate,
const reco::MET matchedCandidate 
)

fill histograms with a given particle

Definition at line 106 of file MatchMETBenchmark.cc.

References reco::LeafCandidate::eta(), reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), and reco::MET::sumEt().

Referenced by MatchMETBenchmarkAnalyzer::analyze().

106  {
107  if (!isInRange(cand.pt(), cand.eta(), cand.phi()))
108  return;
109 
110  if (matchedCand.pt() > 0.001)
111  delta_et_Over_et_VS_et_->Fill(matchedCand.pt(), (cand.pt() - matchedCand.pt()) / matchedCand.pt());
112  else
113  edm::LogWarning("MatchMETBenchmark") << " matchedCand.pt()<0.001";
114  delta_et_VS_et_->Fill(matchedCand.pt(), cand.pt() - matchedCand.pt());
115  delta_phi_VS_et_->Fill(matchedCand.pt(), cand.phi() - matchedCand.phi());
116  delta_ex_->Fill(cand.px() - matchedCand.px());
117  delta_ex_->Fill(cand.py() - matchedCand.py());
118  RecEt_VS_TrueEt_->Fill(matchedCand.pt(), cand.pt());
119  delta_set_VS_set_->Fill(matchedCand.sumEt(), cand.sumEt() - matchedCand.sumEt());
120  if (matchedCand.sumEt() > 0.001)
121  delta_set_Over_set_VS_set_->Fill(matchedCand.sumEt(), (cand.sumEt() - matchedCand.sumEt()) / matchedCand.sumEt());
122  else
123  edm::LogWarning("MatchMETBenchmark") << " matchedCand.sumEt()<0.001";
124  delta_ex_VS_set_->Fill(matchedCand.sumEt(), cand.px() - matchedCand.px());
125  delta_ex_VS_set_->Fill(matchedCand.sumEt(), cand.py() - matchedCand.py());
126  if (matchedCand.sumEt() > 0.001)
127  RecSet_Over_TrueSet_VS_TrueSet_->Fill(matchedCand.sumEt(), cand.sumEt() / matchedCand.sumEt());
128 }
TH2F * delta_set_Over_set_VS_set_
TH2F * RecSet_Over_TrueSet_VS_TrueSet_
Log< level::Warning, false > LogWarning
bool isInRange(float pt, float eta, float phi) const
Definition: Benchmark.h:50
void MatchMETBenchmark::setup ( DQMStore::IBooker b)

book histograms

Definition at line 15 of file MatchMETBenchmark.cc.

References Benchmark::PhaseSpace::m, Benchmark::PhaseSpace::M, and Benchmark::PhaseSpace::n.

Referenced by MatchMETBenchmarkAnalyzer::bookHistograms().

15  {
16  // std::cout << "FL: MatchMETBenchmark.cc: start setup()" << std::endl;
17  PhaseSpace ptPS;
18  PhaseSpace dptOvptPS;
19  PhaseSpace dptPS;
20  PhaseSpace dphiPS;
21  PhaseSpace setPS;
22  PhaseSpace dsetPS;
23  PhaseSpace setOvsetPS;
24 
25  switch (mode_) {
26  case VALIDATION:
27  ptPS = PhaseSpace(100, 0, 1000);
28  dptOvptPS = PhaseSpace(200, -1, 1);
29  dphiPS = PhaseSpace(100, -3.2, 3.2);
30  dptPS = PhaseSpace(200, -500, 500);
31  setPS = PhaseSpace(300, 0.0, 3000);
32  dsetPS = PhaseSpace(200, 0. - 1000, 1000);
33  setOvsetPS = PhaseSpace(500, 0., 2.);
34  break;
35  case DQMOFFLINE:
36  default:
37  ptPS = PhaseSpace(50, 0, 200);
38  dptOvptPS = PhaseSpace(50, -1, 1);
39  dphiPS = PhaseSpace(50, -3.2, 3.2);
40  dptPS = PhaseSpace(50, -500, 500);
41  setPS = PhaseSpace(50, 0.0, 3000);
42  dsetPS = PhaseSpace(50, -1000.0, 1000);
43  setOvsetPS = PhaseSpace(100, 0., 2.);
44  break;
45  }
46 
47  // variable bins to be done here, as they will save a lot of memory.
48 
49  // float ptBins[11] = {0, 1, 2, 5, 10, 20, 50, 100, 200, 400, 1000};
50 
52  "delta_et_Over_et_VS_et_",
53  ";ME_{T, true} (GeV);#DeltaME_{T}/ME_{T}",
54  ptPS.n,
55  ptPS.m,
56  ptPS.M,
57  dptOvptPS.n,
58  dptOvptPS.m,
59  dptOvptPS.M);
60 
62  b, "delta_et_VS_et_", ";ME_{T, true} (GeV);#DeltaME_{T}", ptPS.n, ptPS.m, ptPS.M, dptPS.n, dptPS.m, dptPS.M);
63 
65  b, "delta_phi_VS_et_", ";ME_{T, true} (GeV);#Delta#phi", ptPS.n, ptPS.m, ptPS.M, dphiPS.n, dphiPS.m, dphiPS.M);
66 
67  delta_ex_ = book1D(b, "delta_ex_", "#DeltaME_{X}", dptPS.n, dptPS.m, dptPS.M);
68 
70  book2D(b, "RecEt_VS_TrueEt_", ";ME_{T, true} (GeV);ME_{T}", ptPS.n, ptPS.m, ptPS.M, ptPS.n, ptPS.m, ptPS.M);
71 
73  "delta_set_VS_set_",
74  ";SE_{T, true} (GeV);#DeltaSE_{T}",
75  setPS.n,
76  setPS.m,
77  setPS.M,
78  dsetPS.n,
79  dsetPS.m,
80  dsetPS.M);
81 
83  "delta_set_Over_set_VS_set_",
84  ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}",
85  setPS.n,
86  setPS.m,
87  setPS.M,
88  dptOvptPS.n,
89  dptOvptPS.m,
90  dptOvptPS.M);
91 
93  b, "delta_ex_VS_set_", ";SE_{T, true} (GeV);#DeltaE_{X}", setPS.n, setPS.m, setPS.M, ptPS.n, -ptPS.M, ptPS.M);
94 
96  "RecSet_Over_TrueSet_VS_TrueSet_",
97  ";SE_{T, true} (GeV);SE_{T}/SE_{T}",
98  setPS.n,
99  setPS.m,
100  setPS.M,
101  setOvsetPS.n,
102  setOvsetPS.m,
103  setOvsetPS.M);
104 }
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
TH2F * delta_set_Over_set_VS_set_
TH2F * RecSet_Over_TrueSet_VS_TrueSet_
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
Mode mode_
Definition: Benchmark.h:118

Member Data Documentation

TH2F* MatchMETBenchmark::delta_et_Over_et_VS_et_
protected

Definition at line 28 of file MatchMETBenchmark.h.

TH2F* MatchMETBenchmark::delta_et_VS_et_
protected

Definition at line 27 of file MatchMETBenchmark.h.

TH1F* MatchMETBenchmark::delta_ex_
protected

Definition at line 32 of file MatchMETBenchmark.h.

TH2F* MatchMETBenchmark::delta_ex_VS_set_
protected

Definition at line 38 of file MatchMETBenchmark.h.

TH2F* MatchMETBenchmark::delta_phi_VS_et_
protected

Definition at line 30 of file MatchMETBenchmark.h.

TH2F* MatchMETBenchmark::delta_set_Over_set_VS_set_
protected

Definition at line 37 of file MatchMETBenchmark.h.

TH2F* MatchMETBenchmark::delta_set_VS_set_
protected

Definition at line 36 of file MatchMETBenchmark.h.

TH2F* MatchMETBenchmark::RecEt_VS_TrueEt_
protected

Definition at line 35 of file MatchMETBenchmark.h.

TH2F* MatchMETBenchmark::RecSet_Over_TrueSet_VS_TrueSet_
protected

Definition at line 41 of file MatchMETBenchmark.h.