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
METBenchmark Class Reference

To plot MET quantities. More...

#include <METBenchmark.h>

Inheritance diagram for METBenchmark:
Benchmark METBenchmarkAnalyzer

Public Member Functions

template<class C >
void fill (const C &candidates)
 fill a collection More...
 
void fillOne (const reco::MET &candidate)
 fill histograms with a given particle More...
 
 METBenchmark (Mode mode)
 
void setup ()
 book histograms More...
 
virtual ~METBenchmark ()
 
- 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

TH1F * etOverSumEt_
 
TH2F * mex_VS_sumEt_
 
TH1F * phi_
 
TH1F * pt2_
 
TH1F * pt_
 
TH1F * px_
 
TH1F * py_
 
TH1F * sumEt2_
 
TH1F * sumEt_
 
- 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

To plot MET quantities.

Definition at line 9 of file METBenchmark.h.

Constructor & Destructor Documentation

METBenchmark::METBenchmark ( Mode  mode)
inline

Definition at line 13 of file METBenchmark.h.

13 : Benchmark(mode) {}
Benchmark(Mode mode=DEFAULT)
Definition: Benchmark.h:41
METBenchmark::~METBenchmark ( )
virtual

Definition at line 19 of file METBenchmark.cc.

19 {}

Member Function Documentation

template<class C >
void METBenchmark::fill ( const C &  candidates)

fill a collection

Definition at line 41 of file METBenchmark.h.

References fillOne(), and i.

Referenced by METBenchmarkAnalyzer::analyze().

41  {
42 
43  for (unsigned int i = 0; i < candCollection.size(); ++i) {
44  const reco::MET& cand = candCollection[i];
45  fillOne(cand);
46  }
47 }
int i
Definition: DBlmapReader.cc:9
Definition: MET.h:32
void fillOne(const reco::MET &candidate)
fill histograms with a given particle
Definition: METBenchmark.cc:63
void METBenchmark::fillOne ( const reco::MET candidate)

fill histograms with a given particle

Definition at line 63 of file METBenchmark.cc.

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

Referenced by fill().

63  {
64 
65  if( !isInRange(cand.pt(), cand.eta(), cand.phi() ) ) return;
66 
67  pt_->Fill( cand.pt() );
68  pt2_->Fill( cand.pt() );
69  px_->Fill( cand.px() );
70  py_->Fill( cand.py() );
71  phi_->Fill( cand.phi() );
72  sumEt_->Fill( cand.sumEt() );
73  sumEt2_->Fill( cand.sumEt() );
74  if (cand.sumEt()>3.0) etOverSumEt_->Fill( cand.pt()/cand.sumEt() );
75  mex_VS_sumEt_->Fill( cand.sumEt(), cand.px() );
76  mex_VS_sumEt_->Fill( cand.sumEt(), cand.py() );
77 }
TH1F * sumEt_
Definition: METBenchmark.h:33
TH1F * etOverSumEt_
Definition: METBenchmark.h:35
TH1F * sumEt2_
Definition: METBenchmark.h:34
TH2F * mex_VS_sumEt_
Definition: METBenchmark.h:36
bool isInRange(float pt, float eta, float phi) const
Definition: Benchmark.h:58
void METBenchmark::setup ( void  )

book histograms

Definition at line 22 of file METBenchmark.cc.

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

Referenced by METBenchmarkAnalyzer::beginJob().

22  {
23 
24  //std::cout << "FL: METBenchmark.cc: start setup()" << std::endl;
25 
26  PhaseSpace ptPS(100,0,200);
27  PhaseSpace pt2PS(100,0,7000);
28  PhaseSpace pxPS(100,-100.,100);
29  PhaseSpace phiPS(50, -3.1416, 3.1416);
30  PhaseSpace sumEtPS(100, 0, 3000);
31  PhaseSpace sumEt2PS(100, 0, 7000);
32  PhaseSpace sumEt3PS(50, 0, 200);
33  PhaseSpace etOverSumEtPS(100, 0.0, 1.0);
34 
35  switch(mode_) {
36  case DQMOFFLINE:
37  ptPS = PhaseSpace(200, 0, 200);
38  pxPS = PhaseSpace(200,-100.,100);
39  sumEtPS = PhaseSpace(200, 0, 200);
40  break;
41  default:
42  break;
43  }
44 
45  pt_ = book1D("pt_", "pt_;p_{T} [GeV]", ptPS.n, ptPS.m, ptPS.M);
46  pt2_ = book1D("pt2_", "pt2_;p_{T} [GeV]", pt2PS.n, pt2PS.m, pt2PS.M);
47  px_ = book1D("px_", "px_;p_{X} [GeV]", pxPS.n, pxPS.m, pxPS.M);
48  py_ = book1D("py_", "py_;p_{Y} [GeV]", pxPS.n, pxPS.m, pxPS.M);
49 
50  // might want to increase the number of bins, to match the size of the ECAL crystals
51  phi_ = book1D("phi_", "phi_;#phi", phiPS.n, phiPS.m, phiPS.M);
52  sumEt_ = book1D("sumEt_", "sumEt_;#SigmaE_{T} [GeV]", sumEtPS.n, sumEtPS.m, sumEtPS.M);
53  sumEt2_ = book1D("sumEt2_", "sumEt2_;#SigmaE_{T} [GeV]", sumEt2PS.n, sumEt2PS.m, sumEt2PS.M);
54  etOverSumEt_ = book1D("etOverSumEt_", "etOverSumEt_;p_{T}/#SigmaE_{T}", etOverSumEtPS.n, etOverSumEtPS.m, etOverSumEtPS.M);
55 
56  mex_VS_sumEt_= book2D("mex_VS_sumEt_",
57  ";#SigmaE_{T} [GeV];p_{X} [GeV]",
58  sumEt3PS.n, sumEt3PS.m, sumEt3PS.M,
59  pxPS.n, pxPS.m, pxPS.M );
60 }
TH1F * sumEt_
Definition: METBenchmark.h:33
TH1F * etOverSumEt_
Definition: METBenchmark.h:35
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
TH1F * sumEt2_
Definition: METBenchmark.h:34
TH2F * mex_VS_sumEt_
Definition: METBenchmark.h:36
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

TH1F* METBenchmark::etOverSumEt_
protected

Definition at line 35 of file METBenchmark.h.

TH2F* METBenchmark::mex_VS_sumEt_
protected

Definition at line 36 of file METBenchmark.h.

TH1F* METBenchmark::phi_
protected

Definition at line 32 of file METBenchmark.h.

TH1F* METBenchmark::pt2_
protected

Definition at line 29 of file METBenchmark.h.

TH1F* METBenchmark::pt_
protected

Definition at line 28 of file METBenchmark.h.

TH1F* METBenchmark::px_
protected

Definition at line 30 of file METBenchmark.h.

TH1F* METBenchmark::py_
protected

Definition at line 31 of file METBenchmark.h.

TH1F* METBenchmark::sumEt2_
protected

Definition at line 34 of file METBenchmark.h.

TH1F* METBenchmark::sumEt_
protected

Definition at line 33 of file METBenchmark.h.