CMS 3D CMS Logo

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...
 
 ~METBenchmark () 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 ()
 
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 through IBooker or plain root 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 through IBooker or plain root 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 through IBooker or plain root 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, either through IBooker or plain root 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, either through IBooker or plain root More...
 

Detailed Description

To plot MET quantities.

Definition at line 11 of file METBenchmark.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file METBenchmark.cc.

Referenced by METBenchmark().

15 {}

Member Function Documentation

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

fill a collection

Definition at line 39 of file METBenchmark.h.

References fillOne(), and mps_fire::i.

Referenced by METBenchmarkAnalyzer::analyze(), and METBenchmark().

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

fill histograms with a given particle

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

56  {
57  if (!isInRange(cand.pt(), cand.eta(), cand.phi()))
58  return;
59 
60  pt_->Fill(cand.pt());
61  pt2_->Fill(cand.pt());
62  px_->Fill(cand.px());
63  py_->Fill(cand.py());
64  phi_->Fill(cand.phi());
65  sumEt_->Fill(cand.sumEt());
66  sumEt2_->Fill(cand.sumEt());
67  if (cand.sumEt() > 3.0)
68  etOverSumEt_->Fill(cand.pt() / cand.sumEt());
69  mex_VS_sumEt_->Fill(cand.sumEt(), cand.px());
70  mex_VS_sumEt_->Fill(cand.sumEt(), cand.py());
71 }
TH1F * sumEt_
Definition: METBenchmark.h:32
TH1F * etOverSumEt_
Definition: METBenchmark.h:34
TH1F * sumEt2_
Definition: METBenchmark.h:33
TH2F * mex_VS_sumEt_
Definition: METBenchmark.h:35
bool isInRange(float pt, float eta, float phi) const
Definition: Benchmark.h:50
void METBenchmark::setup ( DQMStore::IBooker b)

book histograms

Definition at line 17 of file METBenchmark.cc.

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

Referenced by METBenchmarkAnalyzer::bookHistograms(), and METBenchmark().

17  {
18  // std::cout << "FL: METBenchmark.cc: start setup()" << std::endl;
19 
20  PhaseSpace ptPS(100, 0, 200);
21  PhaseSpace pt2PS(100, 0, 7000);
22  PhaseSpace pxPS(100, -100., 100);
23  PhaseSpace phiPS(50, -3.1416, 3.1416);
24  PhaseSpace sumEtPS(100, 0, 3000);
25  PhaseSpace sumEt2PS(100, 0, 7000);
26  PhaseSpace sumEt3PS(50, 0, 200);
27  PhaseSpace etOverSumEtPS(100, 0.0, 1.0);
28 
29  switch (mode_) {
30  case DQMOFFLINE:
31  ptPS = PhaseSpace(200, 0, 200);
32  pxPS = PhaseSpace(200, -100., 100);
33  sumEtPS = PhaseSpace(200, 0, 200);
34  break;
35  default:
36  break;
37  }
38 
39  pt_ = book1D(b, "pt_", "pt_;p_{T} [GeV]", ptPS.n, ptPS.m, ptPS.M);
40  pt2_ = book1D(b, "pt2_", "pt2_;p_{T} [GeV]", pt2PS.n, pt2PS.m, pt2PS.M);
41  px_ = book1D(b, "px_", "px_;p_{X} [GeV]", pxPS.n, pxPS.m, pxPS.M);
42  py_ = book1D(b, "py_", "py_;p_{Y} [GeV]", pxPS.n, pxPS.m, pxPS.M);
43 
44  // might want to increase the number of bins, to match the size of the ECAL
45  // crystals
46  phi_ = book1D(b, "phi_", "phi_;#phi", phiPS.n, phiPS.m, phiPS.M);
47  sumEt_ = book1D(b, "sumEt_", "sumEt_;#SigmaE_{T} [GeV]", sumEtPS.n, sumEtPS.m, sumEtPS.M);
48  sumEt2_ = book1D(b, "sumEt2_", "sumEt2_;#SigmaE_{T} [GeV]", sumEt2PS.n, sumEt2PS.m, sumEt2PS.M);
49  etOverSumEt_ =
50  book1D(b, "etOverSumEt_", "etOverSumEt_;p_{T}/#SigmaE_{T}", etOverSumEtPS.n, etOverSumEtPS.m, etOverSumEtPS.M);
51 
53  b, "mex_VS_sumEt_", ";#SigmaE_{T} [GeV];p_{X} [GeV]", sumEt3PS.n, sumEt3PS.m, sumEt3PS.M, pxPS.n, pxPS.m, pxPS.M);
54 }
TH1F * sumEt_
Definition: METBenchmark.h:32
TH1F * etOverSumEt_
Definition: METBenchmark.h:34
TH1F * book1D(DQMStore::IBooker &b, const char *histname, const char *title, int nbins, float xmin, float xmax)
book a 1D histogram, either through IBooker or plain root
Definition: Benchmark.cc:16
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 through IBooker or plain root
Definition: Benchmark.cc:23
TH1F * sumEt2_
Definition: METBenchmark.h:33
TH2F * mex_VS_sumEt_
Definition: METBenchmark.h:35
Mode mode_
Definition: Benchmark.h:124

Member Data Documentation

TH1F* METBenchmark::etOverSumEt_
protected

Definition at line 34 of file METBenchmark.h.

TH2F* METBenchmark::mex_VS_sumEt_
protected

Definition at line 35 of file METBenchmark.h.

TH1F* METBenchmark::phi_
protected

Definition at line 31 of file METBenchmark.h.

TH1F* METBenchmark::pt2_
protected

Definition at line 28 of file METBenchmark.h.

TH1F* METBenchmark::pt_
protected

Definition at line 27 of file METBenchmark.h.

TH1F* METBenchmark::px_
protected

Definition at line 29 of file METBenchmark.h.

TH1F* METBenchmark::py_
protected

Definition at line 30 of file METBenchmark.h.

TH1F* METBenchmark::sumEt2_
protected

Definition at line 33 of file METBenchmark.h.

TH1F* METBenchmark::sumEt_
protected

Definition at line 32 of file METBenchmark.h.