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 * phi_
 
TH1F * pt_
 
TH1F * px_
 
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 36 of file METBenchmark.h.

References fillOne(), and i.

Referenced by METBenchmarkAnalyzer::analyze().

36  {
37 
38  for (unsigned int i = 0; i < candCollection.size(); ++i) {
39  const reco::MET& cand = candCollection[i];
40  fillOne(cand);
41  }
42 }
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:48
void METBenchmark::fillOne ( const reco::MET candidate)

fill histograms with a given particle

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

48  {
49 
50  if( !isInRange(cand.pt(), cand.eta(), cand.phi() ) ) return;
51 
52  pt_->Fill( cand.pt() );
53  px_->Fill( cand.px() );
54  px_->Fill( cand.py() );
55  phi_->Fill( cand.phi() );
56  sumEt_->Fill( cand.sumEt() );
57 }
TH1F * sumEt_
Definition: METBenchmark.h:31
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 pxPS(100,-100.,100);
28  PhaseSpace phiPS(50, -3.1416, 3.1416);
29  PhaseSpace sumEtPS(100, 0, 3000);
30 
31  switch(mode_) {
32  case DQMOFFLINE:
33  ptPS = PhaseSpace(100, 0, 3000);
34  break;
35  default:
36  break;
37  }
38 
39  pt_ = book1D("pt_", "pt_;p_{T} (GeV)", ptPS.n, ptPS.m, ptPS.M);
40  px_ = book1D("px_", "px_;p_{X} (GeV)", pxPS.n, pxPS.m, pxPS.M);
41 
42  // might want to increase the number of bins, to match the size of the ECAL crystals
43  phi_ = book1D("phi_", "phi_;#phi", phiPS.n, phiPS.m, phiPS.M);
44  sumEt_ = book1D("sumEt_", "sumEt_;#sumE_{T}", sumEtPS.n, sumEtPS.m, sumEtPS.M);
45 }
TH1F * sumEt_
Definition: METBenchmark.h:31
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::phi_
protected

Definition at line 30 of file METBenchmark.h.

TH1F* METBenchmark::pt_
protected

Definition at line 28 of file METBenchmark.h.

TH1F* METBenchmark::px_
protected

Definition at line 29 of file METBenchmark.h.

TH1F* METBenchmark::sumEt_
protected

Definition at line 31 of file METBenchmark.h.