CMS 3D CMS Logo

MatchMETBenchmark.cc
Go to the documentation of this file.
5 
6 
7 #include <TROOT.h>
8 #include <TFile.h>
9 #include <TH1.h>
10 #include <TH2.h>
11 
12 
13 using namespace std;
14 
15 
17 
18 
20 
21  //std::cout << "FL: MatchMETBenchmark.cc: start setup()" << std::endl;
22  PhaseSpace ptPS;
23  PhaseSpace dptOvptPS;
24  PhaseSpace dptPS;
25  PhaseSpace dphiPS;
26  PhaseSpace setPS;
27  PhaseSpace dsetPS;
28  PhaseSpace setOvsetPS;
29 
30  switch(mode_) {
31  case VALIDATION:
32  ptPS = PhaseSpace(100,0,1000);
33  dptOvptPS = PhaseSpace( 200, -1, 1);
34  dphiPS = PhaseSpace( 100, -3.2, 3.2);
35  dptPS = PhaseSpace( 200, -500, 500);
36  setPS = PhaseSpace( 300, 0.0, 3000);
37  dsetPS = PhaseSpace( 200, 0.-1000, 1000);
38  setOvsetPS = PhaseSpace( 500,0., 2.);
39  break;
40  case DQMOFFLINE:
41  default:
42  ptPS = PhaseSpace(50,0,200);
43  dptOvptPS = PhaseSpace( 50, -1, 1);
44  dphiPS = PhaseSpace( 50, -3.2, 3.2);
45  dptPS = PhaseSpace( 50, -500, 500);
46  setPS = PhaseSpace( 50, 0.0, 3000);
47  dsetPS = PhaseSpace( 50, -1000.0, 1000);
48  setOvsetPS = PhaseSpace( 100,0., 2.);
49  break;
50  }
51 
52  // variable bins to be done here, as they will save a lot of memory.
53 
54  //float ptBins[11] = {0, 1, 2, 5, 10, 20, 50, 100, 200, 400, 1000};
55 
56  delta_et_Over_et_VS_et_ = book2D(b, "delta_et_Over_et_VS_et_",
57  ";ME_{T, true} (GeV);#DeltaME_{T}/ME_{T}",
58  ptPS.n, ptPS.m, ptPS.M,
59  dptOvptPS.n, dptOvptPS.m, dptOvptPS.M );
60 
61  delta_et_VS_et_ = book2D(b, "delta_et_VS_et_",
62  ";ME_{T, true} (GeV);#DeltaME_{T}",
63  ptPS.n, ptPS.m, ptPS.M,
64  dptPS.n, dptPS.m, dptPS.M );
65 
66  delta_phi_VS_et_ = book2D(b, "delta_phi_VS_et_",
67  ";ME_{T, true} (GeV);#Delta#phi",
68  ptPS.n, ptPS.m, ptPS.M,
69  dphiPS.n, dphiPS.m, dphiPS.M );
70 
71  delta_ex_ = book1D(b, "delta_ex_",
72  "#DeltaME_{X}",
73  dptPS.n, dptPS.m, dptPS.M );
74 
75  RecEt_VS_TrueEt_ = book2D(b, "RecEt_VS_TrueEt_",
76  ";ME_{T, true} (GeV);ME_{T}",
77  ptPS.n, ptPS.m, ptPS.M,
78  ptPS.n, ptPS.m, ptPS.M );
79 
80  delta_set_VS_set_ = book2D(b, "delta_set_VS_set_",
81  ";SE_{T, true} (GeV);#DeltaSE_{T}",
82  setPS.n, setPS.m, setPS.M,
83  dsetPS.n, dsetPS.m, dsetPS.M );
84 
85  delta_set_Over_set_VS_set_ = book2D(b, "delta_set_Over_set_VS_set_",
86  ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}",
87  setPS.n, setPS.m, setPS.M,
88  dptOvptPS.n, dptOvptPS.m, dptOvptPS.M );
89 
90  delta_ex_VS_set_ = book2D(b, "delta_ex_VS_set_",
91  ";SE_{T, true} (GeV);#DeltaE_{X}",
92  setPS.n, setPS.m, setPS.M,
93  ptPS.n, -ptPS.M, ptPS.M );
94 
95  RecSet_Over_TrueSet_VS_TrueSet_ = book2D(b, "RecSet_Over_TrueSet_VS_TrueSet_",
96  ";SE_{T, true} (GeV);SE_{T}/SE_{T}",
97  setPS.n, setPS.m, setPS.M,
98  setOvsetPS.n, setOvsetPS.m, setOvsetPS.M );
99 }
100 
102  const reco::MET& matchedCand) {
103 
104  if( !isInRange(cand.pt(), cand.eta(), cand.phi() ) ) return;
105 
106  if ( matchedCand.pt()>0.001 ) delta_et_Over_et_VS_et_->Fill( matchedCand.pt(), (cand.pt() - matchedCand.pt())/matchedCand.pt() );
107  else edm::LogWarning("MatchMETBenchmark") << " matchedCand.pt()<0.001";
108  delta_et_VS_et_->Fill( matchedCand.pt(), cand.pt() - matchedCand.pt() );
109  delta_phi_VS_et_->Fill( matchedCand.pt(), cand.phi() - matchedCand.phi() );
110  delta_ex_->Fill(cand.px()-matchedCand.px());
111  delta_ex_->Fill(cand.py()-matchedCand.py());
112  RecEt_VS_TrueEt_->Fill(matchedCand.pt(),cand.pt());
113  delta_set_VS_set_->Fill(matchedCand.sumEt(),cand.sumEt()-matchedCand.sumEt());
114  if ( matchedCand.sumEt()>0.001 ) delta_set_Over_set_VS_set_->Fill(matchedCand.sumEt(),(cand.sumEt()-matchedCand.sumEt())/matchedCand.sumEt());
115  else edm::LogWarning("MatchMETBenchmark") << " matchedCand.sumEt()<0.001";
116  delta_ex_VS_set_->Fill(matchedCand.sumEt(),cand.px()-matchedCand.px());
117  delta_ex_VS_set_->Fill(matchedCand.sumEt(),cand.py()-matchedCand.py());
118  if ( matchedCand.sumEt()>0.001 ) RecSet_Over_TrueSet_VS_TrueSet_->Fill(matchedCand.sumEt(),cand.sumEt()/matchedCand.sumEt());
119 
120 }
virtual double pt() const final
transverse momentum
virtual double eta() const final
momentum pseudorapidity
void setup(DQMStore::IBooker &b)
book histograms
virtual ~MatchMETBenchmark()
void fillOne(const reco::MET &candidate, const reco::MET &matchedCandidate)
fill histograms with a given particle
virtual double phi() const final
momentum azimuthal angle
double sumEt() const
Definition: MET.h:56
Definition: MET.h:42
virtual double px() const final
x coordinate of momentum vector
double b
Definition: hdecay.h:120
virtual double py() const final
y coordinate of momentum vector