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 pxPS(100,-100.,100);
28  PhaseSpace phiPS(50, -3.1416, 3.1416);
29  PhaseSpace sumEtPS(100, 0, 3000);
30 
31  switch(mode_) {
32  case DQMOFFLINE:
33  ptPS = PhaseSpace(100, 0, 3000);
34  break;
35  default:
36  break;
37  }
38 
39  pt_ = book1D("pt_", "pt_;p_{T} (GeV)", ptPS.n, ptPS.m, ptPS.M);
40  px_ = book1D("px_", "px_;p_{X} (GeV)", pxPS.n, pxPS.m, pxPS.M);
41 
42  // might want to increase the number of bins, to match the size of the ECAL crystals
43  phi_ = book1D("phi_", "phi_;#phi", phiPS.n, phiPS.m, phiPS.M);
44  sumEt_ = book1D("sumEt_", "sumEt_;#sumE_{T}", sumEtPS.n, sumEtPS.m, sumEtPS.M);
45 }
46 
47 
48 void METBenchmark::fillOne(const reco::MET& cand) {
49 
50  if( !isInRange(cand.pt(), cand.eta(), cand.phi() ) ) return;
51 
52  pt_->Fill( cand.pt() );
53  px_->Fill( cand.px() );
54  px_->Fill( cand.py() );
55  phi_->Fill( cand.phi() );
56  sumEt_->Fill( cand.sumEt() );
57 }
void setup()
book histograms
Definition: METBenchmark.cc:22
virtual ~METBenchmark()
Definition: METBenchmark.cc:19
virtual double eta() const
momentum pseudorapidity
double sumEt() const
Definition: MET.h:48
Definition: MET.h:32
void fillOne(const reco::MET &candidate)
fill histograms with a given particle
Definition: METBenchmark.cc:48
virtual double px() const
x coordinate of momentum vector
virtual double pt() const
transverse momentum
virtual double phi() const
momentum azimuthal angle
virtual double py() const
y coordinate of momentum vector