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 ()
 write to the TFile, in plain ROOT mode. No need to call this function in DQM mode More...
 
virtual ~Benchmark () noexcept(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
typedef dqm::legacy::DQMStore DQMStore
 
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 *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...
 
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...
 
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...
 
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...
 

Detailed Description

To plot MET quantities.

Definition at line 11 of file METBenchmark.h.

Constructor & Destructor Documentation

◆ METBenchmark()

METBenchmark::METBenchmark ( Mode  mode)
inline

Definition at line 13 of file METBenchmark.h.

13 : Benchmark(mode) {}

◆ ~METBenchmark()

METBenchmark::~METBenchmark ( )
override

Definition at line 14 of file METBenchmark.cc.

14 {}

Member Function Documentation

◆ fill()

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

fill a collection

Definition at line 39 of file METBenchmark.h.

39  {
40  for (unsigned int i = 0; i < candCollection.size(); ++i) {
41  const reco::MET &cand = candCollection[i];
42  fillOne(cand);
43  }
44 }

References fillOne(), and mps_fire::i.

Referenced by METBenchmarkAnalyzer::analyze().

◆ fillOne()

void METBenchmark::fillOne ( const reco::MET candidate)

fill histograms with a given particle

Definition at line 55 of file METBenchmark.cc.

55  {
56  if (!isInRange(cand.pt(), cand.eta(), cand.phi()))
57  return;
58 
59  pt_->Fill(cand.pt());
60  pt2_->Fill(cand.pt());
61  px_->Fill(cand.px());
62  py_->Fill(cand.py());
63  phi_->Fill(cand.phi());
64  sumEt_->Fill(cand.sumEt());
65  sumEt2_->Fill(cand.sumEt());
66  if (cand.sumEt() > 3.0)
67  etOverSumEt_->Fill(cand.pt() / cand.sumEt());
68  mex_VS_sumEt_->Fill(cand.sumEt(), cand.px());
69  mex_VS_sumEt_->Fill(cand.sumEt(), cand.py());
70 }

Referenced by fill().

◆ setup()

void METBenchmark::setup ( DQMStore::IBooker b)

book histograms

Definition at line 16 of file METBenchmark.cc.

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

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

Referenced by METBenchmarkAnalyzer::bookHistograms().

Member Data Documentation

◆ etOverSumEt_

TH1F* METBenchmark::etOverSumEt_
protected

Definition at line 34 of file METBenchmark.h.

◆ mex_VS_sumEt_

TH2F* METBenchmark::mex_VS_sumEt_
protected

Definition at line 35 of file METBenchmark.h.

◆ phi_

TH1F* METBenchmark::phi_
protected

Definition at line 31 of file METBenchmark.h.

◆ pt2_

TH1F* METBenchmark::pt2_
protected

Definition at line 28 of file METBenchmark.h.

◆ pt_

TH1F* METBenchmark::pt_
protected

Definition at line 27 of file METBenchmark.h.

◆ px_

TH1F* METBenchmark::px_
protected

Definition at line 29 of file METBenchmark.h.

◆ py_

TH1F* METBenchmark::py_
protected

Definition at line 30 of file METBenchmark.h.

◆ sumEt2_

TH1F* METBenchmark::sumEt2_
protected

Definition at line 33 of file METBenchmark.h.

◆ sumEt_

TH1F* METBenchmark::sumEt_
protected

Definition at line 32 of file METBenchmark.h.

mps_fire.i
i
Definition: mps_fire.py:355
Benchmark::book2D
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:22
METBenchmark::fillOne
void fillOne(const reco::MET &candidate)
fill histograms with a given particle
Definition: METBenchmark.cc:55
Benchmark::isInRange
bool isInRange(float pt, float eta, float phi) const
Definition: Benchmark.h:50
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
METBenchmark::mex_VS_sumEt_
TH2F * mex_VS_sumEt_
Definition: METBenchmark.h:35
Benchmark::DQMOFFLINE
Definition: Benchmark.h:32
METBenchmark::phi_
TH1F * phi_
Definition: METBenchmark.h:31
METBenchmark::sumEt2_
TH1F * sumEt2_
Definition: METBenchmark.h:33
reco::MET
Definition: MET.h:41
METBenchmark::etOverSumEt_
TH1F * etOverSumEt_
Definition: METBenchmark.h:34
Benchmark::mode_
Mode mode_
Definition: Benchmark.h:118
b
double b
Definition: hdecay.h:118
Benchmark::Benchmark
Benchmark(Mode mode=DEFAULT)
Definition: Benchmark.h:34
METBenchmark::py_
TH1F * py_
Definition: METBenchmark.h:30
METBenchmark::sumEt_
TH1F * sumEt_
Definition: METBenchmark.h:32
cand
Definition: decayParser.h:34
METBenchmark::pt_
TH1F * pt_
Definition: METBenchmark.h:27
Benchmark::book1D
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:15
METBenchmark::pt2_
TH1F * pt2_
Definition: METBenchmark.h:28
METBenchmark::px_
TH1F * px_
Definition: METBenchmark.h:29