CMS 3D CMS Logo

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