CMS 3D CMS Logo

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 ()(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
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 histogram, either with DQM or plain root depending if DQM_ has been initialized in a child analyzer or not. More...
 

Detailed Description

Definition at line 11 of file MatchMETBenchmark.h.

Constructor & Destructor Documentation

MatchMETBenchmark::MatchMETBenchmark ( Mode  mode)
inline
MatchMETBenchmark::~MatchMETBenchmark ( )
override

Definition at line 16 of file MatchMETBenchmark.cc.

Referenced by MatchMETBenchmark().

16 {}

Member Function Documentation

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

fill histograms with a given particle

Definition at line 101 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(), and MatchMETBenchmark().

102  {
103 
104  if( !isInRange(cand.pt(), cand.eta(), cand.phi() ) ) return;
105 
106  if ( matchedCand.pt()>0.001 ) delta_et_Over_et_VS_et_->Fill( matchedCand.pt(), (cand.pt() - matchedCand.pt())/matchedCand.pt() );
107  else edm::LogWarning("MatchMETBenchmark") << " matchedCand.pt()<0.001";
108  delta_et_VS_et_->Fill( matchedCand.pt(), cand.pt() - matchedCand.pt() );
109  delta_phi_VS_et_->Fill( matchedCand.pt(), cand.phi() - matchedCand.phi() );
110  delta_ex_->Fill(cand.px()-matchedCand.px());
111  delta_ex_->Fill(cand.py()-matchedCand.py());
112  RecEt_VS_TrueEt_->Fill(matchedCand.pt(),cand.pt());
113  delta_set_VS_set_->Fill(matchedCand.sumEt(),cand.sumEt()-matchedCand.sumEt());
114  if ( matchedCand.sumEt()>0.001 ) delta_set_Over_set_VS_set_->Fill(matchedCand.sumEt(),(cand.sumEt()-matchedCand.sumEt())/matchedCand.sumEt());
115  else edm::LogWarning("MatchMETBenchmark") << " matchedCand.sumEt()<0.001";
116  delta_ex_VS_set_->Fill(matchedCand.sumEt(),cand.px()-matchedCand.px());
117  delta_ex_VS_set_->Fill(matchedCand.sumEt(),cand.py()-matchedCand.py());
118  if ( matchedCand.sumEt()>0.001 ) RecSet_Over_TrueSet_VS_TrueSet_->Fill(matchedCand.sumEt(),cand.sumEt()/matchedCand.sumEt());
119 
120 }
TH2F * delta_set_Over_set_VS_set_
TH2F * RecSet_Over_TrueSet_VS_TrueSet_
bool isInRange(float pt, float eta, float phi) const
Definition: Benchmark.h:58
void MatchMETBenchmark::setup ( DQMStore::IBooker b)

book histograms

Definition at line 19 of file MatchMETBenchmark.cc.

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

Referenced by MatchMETBenchmarkAnalyzer::bookHistograms(), and MatchMETBenchmark().

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

Member Data Documentation

TH2F* MatchMETBenchmark::delta_et_Over_et_VS_et_
protected

Definition at line 30 of file MatchMETBenchmark.h.

TH2F* MatchMETBenchmark::delta_et_VS_et_
protected

Definition at line 29 of file MatchMETBenchmark.h.

TH1F* MatchMETBenchmark::delta_ex_
protected

Definition at line 34 of file MatchMETBenchmark.h.

TH2F* MatchMETBenchmark::delta_ex_VS_set_
protected

Definition at line 40 of file MatchMETBenchmark.h.

TH2F* MatchMETBenchmark::delta_phi_VS_et_
protected

Definition at line 32 of file MatchMETBenchmark.h.

TH2F* MatchMETBenchmark::delta_set_Over_set_VS_set_
protected

Definition at line 39 of file MatchMETBenchmark.h.

TH2F* MatchMETBenchmark::delta_set_VS_set_
protected

Definition at line 38 of file MatchMETBenchmark.h.

TH2F* MatchMETBenchmark::RecEt_VS_TrueEt_
protected

Definition at line 37 of file MatchMETBenchmark.h.

TH2F* MatchMETBenchmark::RecSet_Over_TrueSet_VS_TrueSet_
protected

Definition at line 43 of file MatchMETBenchmark.h.