CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
METBenchmark.cc
Go to the documentation of this file.
2 
4 
6 
7 #include <TFile.h>
8 #include <TH1.h>
9 #include <TH2.h>
10 #include <TROOT.h>
11 
12 using namespace std;
13 
15 
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 
51  mex_VS_sumEt_ = book2D(
52  b, "mex_VS_sumEt_", ";#SigmaE_{T} [GeV];p_{X} [GeV]", sumEt3PS.n, sumEt3PS.m, sumEt3PS.M, pxPS.n, pxPS.m, pxPS.M);
53 }
54 
55 void METBenchmark::fillOne(const reco::MET &cand) {
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 }
double pt() const final
transverse momentum
double px() const final
x coordinate of momentum vector
double sumEt() const
Definition: MET.h:56
void setup(DQMStore::IBooker &b)
book histograms
Definition: METBenchmark.cc:16
Definition: MET.h:41
double py() const final
y coordinate of momentum vector
void fillOne(const reco::MET &candidate)
fill histograms with a given particle
Definition: METBenchmark.cc:55
double b
Definition: hdecay.h:118
double phi() const final
momentum azimuthal angle
~METBenchmark() override
Definition: METBenchmark.cc:14
double eta() const final
momentum pseudorapidity