CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
METBenchmark.cc
Go to the documentation of this file.
2 
4 
5 
8 
9 #include <TROOT.h>
10 #include <TFile.h>
11 #include <TH1.h>
12 #include <TH2.h>
13 
14 
15 using namespace std;
16 
17 
18 
20 
21 
23 
24  //std::cout << "FL: METBenchmark.cc: start setup()" << std::endl;
25 
26  PhaseSpace ptPS(100,0,200);
27  PhaseSpace pt2PS(100,0,7000);
28  PhaseSpace pxPS(100,-100.,100);
29  PhaseSpace phiPS(50, -3.1416, 3.1416);
30  PhaseSpace sumEtPS(100, 0, 3000);
31  PhaseSpace sumEt2PS(100, 0, 7000);
32  PhaseSpace sumEt3PS(50, 0, 200);
33  PhaseSpace etOverSumEtPS(100, 0.0, 1.0);
34 
35  switch(mode_) {
36  case DQMOFFLINE:
37  ptPS = PhaseSpace(200, 0, 200);
38  pxPS = PhaseSpace(200,-100.,100);
39  sumEtPS = PhaseSpace(200, 0, 200);
40  break;
41  default:
42  break;
43  }
44 
45  pt_ = book1D("pt_", "pt_;p_{T} [GeV]", ptPS.n, ptPS.m, ptPS.M);
46  pt2_ = book1D("pt2_", "pt2_;p_{T} [GeV]", pt2PS.n, pt2PS.m, pt2PS.M);
47  px_ = book1D("px_", "px_;p_{X} [GeV]", pxPS.n, pxPS.m, pxPS.M);
48  py_ = book1D("py_", "py_;p_{Y} [GeV]", pxPS.n, pxPS.m, pxPS.M);
49 
50  // might want to increase the number of bins, to match the size of the ECAL crystals
51  phi_ = book1D("phi_", "phi_;#phi", phiPS.n, phiPS.m, phiPS.M);
52  sumEt_ = book1D("sumEt_", "sumEt_;#SigmaE_{T} [GeV]", sumEtPS.n, sumEtPS.m, sumEtPS.M);
53  sumEt2_ = book1D("sumEt2_", "sumEt2_;#SigmaE_{T} [GeV]", sumEt2PS.n, sumEt2PS.m, sumEt2PS.M);
54  etOverSumEt_ = book1D("etOverSumEt_", "etOverSumEt_;p_{T}/#SigmaE_{T}", etOverSumEtPS.n, etOverSumEtPS.m, etOverSumEtPS.M);
55 
56  mex_VS_sumEt_= book2D("mex_VS_sumEt_",
57  ";#SigmaE_{T} [GeV];p_{X} [GeV]",
58  sumEt3PS.n, sumEt3PS.m, sumEt3PS.M,
59  pxPS.n, pxPS.m, pxPS.M );
60 }
61 
62 
63 void METBenchmark::fillOne(const reco::MET& cand) {
64 
65  if( !isInRange(cand.pt(), cand.eta(), cand.phi() ) ) return;
66 
67  pt_->Fill( cand.pt() );
68  pt2_->Fill( cand.pt() );
69  px_->Fill( cand.px() );
70  py_->Fill( cand.py() );
71  phi_->Fill( cand.phi() );
72  sumEt_->Fill( cand.sumEt() );
73  sumEt2_->Fill( cand.sumEt() );
74  if (cand.sumEt()>3.0) etOverSumEt_->Fill( cand.pt()/cand.sumEt() );
75  mex_VS_sumEt_->Fill( cand.sumEt(), cand.px() );
76  mex_VS_sumEt_->Fill( cand.sumEt(), cand.py() );
77 }
void setup()
book histograms
Definition: METBenchmark.cc:22
virtual ~METBenchmark()
Definition: METBenchmark.cc:19
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
double sumEt() const
Definition: MET.h:53
Definition: MET.h:39
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
void fillOne(const reco::MET &candidate)
fill histograms with a given particle
Definition: METBenchmark.cc:63
virtual float pt() const GCC11_FINAL
transverse momentum