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