CMS 3D CMS Logo

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