CMS 3D CMS Logo

ElectronMcFakePostValidator.cc
Go to the documentation of this file.
1 
5 
8  {
9  // histos bining and limits
10 
11  edm::ParameterSet histosSet = conf.getParameter<edm::ParameterSet>("histosCfg") ;
12 
13  set_EfficiencyFlag=histosSet.getParameter<bool>("EfficiencyFlag");
14  set_StatOverflowFlag=histosSet.getParameter<bool>("StatOverflowFlag");
15  }
16 
18  {}
19 
21  {
22 
23  setBookIndex(-1) ;
24  setBookPrefix("h_ele") ;
27 
28  edm::LogInfo("ElectronMcFakePostValidator::finalize") << "efficiency calculation " ;
29  bookH1andDivide(iBooker,iGetter, "etaEff","matchingObjectEta_matched","matchingObject_eta","#eta","Efficiency","");
30  bookH1andDivide(iBooker,iGetter, "zEff","matchingObjectZ_matched","matchingObject_z","z (cm)","Efficiency","");
31  bookH1andDivide(iBooker,iGetter, "absetaEff","matchingObjectAbsEta_matched","matchingObject_abseta","|#eta|","Efficiency","");
32  bookH1andDivide(iBooker,iGetter, "ptEff","matchingObjectPt_matched","matchingObject_Pt","p_{T} (GeV/c)","Efficiency","");
33  bookH1andDivide(iBooker,iGetter, "phiEff","matchingObjectPhi_matched","matchingObject_phi","#phi (rad)","Efficiency","");
34 // bookH2andDivide(iBooker,iGetter, "ptEtaEff","matchingObjectPtEta_matched","matchingObjectPtEta","#eta","p_{T} (GeV/c)","");
35 //
36 // bookH1andDivide(iBooker,iGetter, "etaQmisid","matchingObjectEta_matched_qmisid","h_simEta","#eta","q misId","");
37 // bookH1andDivide(iBooker,iGetter, "zQmisid","matchingObjectZ_matched_qmisid","h_simZ","z (cm)","q misId","");
38 // bookH1andDivide(iBooker,iGetter, "absetaQmisid","matchingObjectAbsEta_matched_qmisid","h_simAbsEta","|#eta|","q misId","");
39 // bookH1andDivide(iBooker,iGetter, "ptQmisid","matchingObjectPt_matched_qmisid","h_simPt","p_{T} (GeV/c)","q misId","");
40 
41  edm::LogInfo("ElectronMcFakePostValidator::finalize") << "all reco electrons " ;
42  bookH1andDivide(iBooker,iGetter, "etaEff_all","vertexEta_all","matchingObject_eta","#eta","N_{rec}/N_{gen}","");
43  bookH1andDivide(iBooker,iGetter, "ptEff_all", "vertexPt_all","matchingObject_Pt","p_{T} (GeV/c)","N_{rec}/N_{gen}","");
44 
45  edm::LogInfo("ElectronMcFakePostValidator::finalize") << "classes" ;
46  bookH1andDivide(iBooker,iGetter, "eta_goldenFrac","eta_golden","h_ele_eta","|#eta|","Fraction of electrons","fraction of golden electrons vs eta");
47  bookH1andDivide(iBooker,iGetter, "eta_bbremFrac" ,"eta_bbrem", "h_ele_eta","|#eta|","Fraction of electrons","fraction of big brem electrons vs eta");
48 // bookH1andDivide(iBooker,iGetter, "eta_narrowFrac","eta_narrow","h_ele_eta","|#eta|","Fraction of electrons","fraction of narrow electrons vs eta");
49  bookH1andDivide(iBooker,iGetter, "eta_showerFrac","eta_shower","h_ele_eta","|#eta|","Fraction of electrons","fraction of showering electrons vs eta");
50 
51  // fbrem
52  MonitorElement * p1_ele_fbremVsEta_mean = get(iGetter, "fbremvsEtamean") ;
53  TAxis * etaAxis = p1_ele_fbremVsEta_mean->getTProfile()->GetXaxis() ;
54  MonitorElement * h1_ele_xOverX0VsEta = bookH1withSumw2(iBooker, "xOverx0VsEta","mean X/X_0 vs eta",etaAxis->GetNbins(),etaAxis->GetXmin(),etaAxis->GetXmax());
55  for (int ibin=1;ibin<etaAxis->GetNbins()+1;ibin++) {
56  double xOverX0 = 0.;
57  if (p1_ele_fbremVsEta_mean->getBinContent(ibin)>0.)
58  { xOverX0 = -log(p1_ele_fbremVsEta_mean->getBinContent(ibin)) ; }
59  h1_ele_xOverX0VsEta->setBinContent(ibin,xOverX0) ;
60  }
61 
62 
63  MonitorElement * h1_ele_provenance = get(iGetter, "provenance") ;
64  if (h1_ele_provenance->getBinContent(3)>0)
65  {h1_ele_provenance->getTH1F()->Scale(1./h1_ele_provenance->getBinContent(3));}
66  MonitorElement * h1_ele_provenance_barrel = get(iGetter, "provenance_barrel") ;
67  if (h1_ele_provenance_barrel->getBinContent(3)>0)
68  {h1_ele_provenance_barrel->getTH1F()->Scale(1./h1_ele_provenance_barrel->getBinContent(3));}
69  MonitorElement * h1_ele_provenance_endcaps = get(iGetter, "provenance_endcaps") ;
70  if (h1_ele_provenance_endcaps->getBinContent(3)>0)
71  {h1_ele_provenance_endcaps->getTH1F()->Scale(1./h1_ele_provenance_endcaps->getBinContent(3));}
72 
73  // profiles from 2D histos
74  profileX(iBooker, iGetter, "PoPmatchingObjectVsEta","","#eta","<P/P_{gen}>");
75  profileX(iBooker, iGetter, "PoPmatchingObjectVsPhi","","#phi (rad)","<P/P_{gen}>");
76  profileX(iBooker, iGetter, "EtaMnEtamatchingObjectVsEta","","#eta","<#eta_{rec} - #eta_{gen}>");
77  profileX(iBooker, iGetter, "EtaMnEtamatchingObjectVsPhi","","#phi (rad)","<#eta_{rec} - #eta_{gen}>");
78  profileX(iBooker, iGetter, "PhiMnPhimatchingObjectVsEta","","#eta","<#phi_{rec} - #phi_{gen}> (rad)");
79  profileX(iBooker, iGetter, "PhiMnPhimatchingObjectVsPhi","","#phi (rad)","");
80  profileX(iBooker, iGetter, "vertexPtVsEta","mean ele transverse momentum vs eta","#eta","<p_{T}> (GeV/c)");
81  profileX(iBooker, iGetter, "vertexPtVsPhi","mean ele transverse momentum vs phi","#phi (rad)","<p_{T}> (GeV/c)");
82  profileX(iBooker, iGetter, "EoPVsEta","mean ele E/p vs eta","#eta","<E/P_{vertex}>");
83  profileX(iBooker, iGetter, "EoPVsPhi","mean ele E/p vs phi","#phi (rad)","<E/P_{vertex}>");
84  profileX(iBooker, iGetter, "EoPoutVsEta","mean ele E/pout vs eta","#eta","<E_{seed}/P_{out}>");
85  profileX(iBooker, iGetter, "EoPoutVsPhi","mean ele E/pout vs phi","#phi (rad)","<E_{seed}/P_{out}>");
86  profileX(iBooker, iGetter, "EeleOPoutVsEta","mean ele Eele/pout vs eta","#eta","<E_{ele}/P_{out}>");
87  profileX(iBooker, iGetter, "EeleOPoutVsPhi","mean ele Eele/pout vs phi","#phi (rad)","<E_{ele}/P_{out}>");
88  profileX(iBooker, iGetter, "HoEVsEta","mean ele H/E vs eta","#eta","<H/E>");
89  profileX(iBooker, iGetter, "HoEVsPhi","mean ele H/E vs phi","#phi (rad)","<H/E>");
90  profileX(iBooker, iGetter, "chi2VsEta","mean ele track chi2 vs eta","#eta","<#Chi^{2}>");
91  profileX(iBooker, iGetter, "chi2VsPhi","mean ele track chi2 vs phi","#phi (rad)","<#Chi^{2}>");
92  profileX(iBooker, iGetter, "foundHitsVsEta","mean ele track # found hits vs eta","#eta","<N_{hits}>");
93  profileX(iBooker, iGetter, "foundHitsVsPhi","mean ele track # found hits vs phi","#phi (rad)","<N_{hits}>");
94  profileX(iBooker, iGetter, "lostHitsVsEta","mean ele track # lost hits vs eta","#eta","<N_{hits}>");
95  profileX(iBooker, iGetter, "lostHitsVsPhi","mean ele track # lost hits vs phi","#phi (rad)","<N_{hits}>");
96  profileX(iBooker, iGetter, "vertexTIPVsEta","mean tip (wrt gen vtx) vs eta","#eta","<TIP> (cm)");
97  profileX(iBooker, iGetter, "vertexTIPVsPhi","mean tip (wrt gen vtx) vs phi","#phi","<TIP> (cm)");
98  profileX(iBooker, iGetter, "vertexTIPVsPt","mean tip (wrt gen vtx) vs phi","p_{T} (GeV/c)","<TIP> (cm)");
99  profileX(iBooker, iGetter, "seedDphi2_VsEta","mean ele seed dphi 2nd layer vs eta","#eta","<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)",-0.004,0.004);
100  profileX(iBooker, iGetter, "seedDphi2_VsPt","mean ele seed dphi 2nd layer vs pt","p_{T} (GeV/c)","<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)",-0.004,0.004);
101  profileX(iBooker, iGetter, "seedDrz2_VsEta","mean ele seed dr(dz) 2nd layer vs eta","#eta","<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)",-0.15,0.15);
102  profileX(iBooker, iGetter, "seedDrz2_VsPt","mean ele seed dr(dz) 2nd layer vs pt","p_{T} (GeV/c)","<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)",-0.15,0.15);
103  profileX(iBooker, iGetter, "seedDphi2Pos_VsEta","mean ele seed dphi 2nd layer positron vs eta","#eta","<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)",-0.004,0.004);
104  profileX(iBooker, iGetter, "seedDphi2Pos_VsPt","mean ele seed dphi 2nd layer positron vs pt","p_{T} (GeV/c)","<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)",-0.004,0.004);
105  profileX(iBooker, iGetter, "seedDrz2Pos_VsEta","mean ele seed dr(dz) 2nd layer positron vs eta","#eta","<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)",-0.15,0.15);
106  profileX(iBooker, iGetter, "seedDrz2Pos_VsPt","mean ele seed dr(dz) 2nd layer positron vs pt","p_{T} (GeV/c)","<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)",-0.15,0.15);
107 
108  }
109 
110 
TProfile * getTProfile() const
T getParameter(std::string const &) const
void setBinContent(int binx, double content)
set content of bin (1-D)
TH1F * getTH1F() const
ElectronMcFakePostValidator(const edm::ParameterSet &conf)
void setBookPrefix(const std::string &)
void finalize(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) override
MonitorElement * profileX(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
void setBookStatOverflowFlag(const bool &)
void setBookEfficiencyFlag(const bool &)
MonitorElement * bookH1withSumw2(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
MonitorElement * bookH1andDivide(DQMStore::IBooker &iBooker, DQMStore::IGetter &, const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
double getBinContent(int binx) const
get content of bin (1-D)