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 (DQMStore::IBooker &b)
 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 ()(false)
 

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 }
 
- 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

To plot MET quantities.

Definition at line 11 of file METBenchmark.h.

Constructor & Destructor Documentation

METBenchmark::METBenchmark ( Mode  mode)
inline

Definition at line 15 of file METBenchmark.h.

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

Definition at line 20 of file METBenchmark.cc.

20 {}

Member Function Documentation

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

fill a collection

Definition at line 43 of file METBenchmark.h.

References fillOne(), and i.

Referenced by METBenchmarkAnalyzer::analyze().

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

fill histograms with a given particle

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

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

book histograms

Definition at line 23 of file METBenchmark.cc.

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

Referenced by METBenchmarkAnalyzer::bookHistograms().

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

Member Data Documentation

TH1F* METBenchmark::etOverSumEt_
protected

Definition at line 37 of file METBenchmark.h.

TH2F* METBenchmark::mex_VS_sumEt_
protected

Definition at line 38 of file METBenchmark.h.

TH1F* METBenchmark::phi_
protected

Definition at line 34 of file METBenchmark.h.

TH1F* METBenchmark::pt2_
protected

Definition at line 31 of file METBenchmark.h.

TH1F* METBenchmark::pt_
protected

Definition at line 30 of file METBenchmark.h.

TH1F* METBenchmark::px_
protected

Definition at line 32 of file METBenchmark.h.

TH1F* METBenchmark::py_
protected

Definition at line 33 of file METBenchmark.h.

TH1F* METBenchmark::sumEt2_
protected

Definition at line 36 of file METBenchmark.h.

TH1F* METBenchmark::sumEt_
protected

Definition at line 35 of file METBenchmark.h.