CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 ()
 book histograms More...
 
virtual ~MatchMETBenchmark ()
 
- 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 ()
 

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 }
 
- Static Public Attributes inherited from Benchmark
static DQMStoreDQM_ = 0
 
- Protected Member Functions inherited from Benchmark
TH1F * book1D (const char *histname, const char *title, int nbins, float xmin, float xmax)
 book a 1D histogram, either with DQM or plain root. More...
 
TH2F * book2D (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. More...
 
TH2F * book2D (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. More...
 

Detailed Description

Definition at line 11 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:41
int mode
Definition: AMPTWrapper.h:139
MatchMETBenchmark::~MatchMETBenchmark ( )
virtual

Definition at line 15 of file MatchMETBenchmark.cc.

15 {}

Member Function Documentation

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

fill histograms with a given particle

Definition at line 99 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().

100  {
101 
102  if( !isInRange(cand.pt(), cand.eta(), cand.phi() ) ) return;
103 
104  if ( matchedCand.pt()>0.001 ) delta_et_Over_et_VS_et_->Fill( matchedCand.pt(), (cand.pt() - matchedCand.pt())/matchedCand.pt() );
105  else edm::LogWarning("MatchMETBenchmark") << " matchedCand.pt()<0.001";
106  delta_et_VS_et_->Fill( matchedCand.pt(), cand.pt() - matchedCand.pt() );
107  delta_phi_VS_et_->Fill( matchedCand.pt(), cand.phi() - matchedCand.phi() );
108  delta_ex_->Fill(cand.px()-matchedCand.px());
109  delta_ex_->Fill(cand.py()-matchedCand.py());
110  RecEt_VS_TrueEt_->Fill(matchedCand.pt(),cand.pt());
111  delta_set_VS_set_->Fill(matchedCand.sumEt(),cand.sumEt()-matchedCand.sumEt());
112  if ( matchedCand.sumEt()>0.001 ) delta_set_Over_set_VS_set_->Fill(matchedCand.sumEt(),(cand.sumEt()-matchedCand.sumEt())/matchedCand.sumEt());
113  else edm::LogWarning("MatchMETBenchmark") << " matchedCand.sumEt()<0.001";
114  delta_ex_VS_set_->Fill(matchedCand.sumEt(),cand.px()-matchedCand.px());
115  delta_ex_VS_set_->Fill(matchedCand.sumEt(),cand.py()-matchedCand.py());
116  if ( matchedCand.sumEt()>0.001 ) RecSet_Over_TrueSet_VS_TrueSet_->Fill(matchedCand.sumEt(),cand.sumEt()/matchedCand.sumEt());
117 
118 }
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 ( void  )

book histograms

Definition at line 17 of file MatchMETBenchmark.cc.

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

Referenced by MatchMETBenchmarkAnalyzer::beginJob().

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

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.