CMS 3D CMS Logo

ElectronMcFakePostValidator.cc
Go to the documentation of this file.
1 
5 
8  // histos bining and limits
9 
10  edm::ParameterSet histosSet = conf.getParameter<edm::ParameterSet>("histosCfg");
11 
12  set_EfficiencyFlag = histosSet.getParameter<bool>("EfficiencyFlag");
13  set_StatOverflowFlag = histosSet.getParameter<bool>("StatOverflowFlag");
14 }
15 
17 
19  setBookIndex(-1);
20  setBookPrefix("h_ele");
23 
24  edm::LogInfo("ElectronMcFakePostValidator::finalize") << "efficiency calculation ";
25  bookH1andDivide(iBooker,
26  iGetter,
27  "etaEff_Extended",
28  "matchingObjectEta_Extended_matched",
29  "matchingObject_eta_Extended",
30  "#eta",
31  "Efficiency",
32  "");
33  bookH1andDivide(iBooker,
34  iGetter,
35  "absetaEff_Extended",
36  "matchingObjectAbsEta_Extended_matched",
37  "matchingObject_abseta_Extended",
38  "|#eta|",
39  "Efficiency",
40  "");
41  bookH1andDivide(iBooker, iGetter, "zEff", "matchingObjectZ_matched", "matchingObject_z", "z (cm)", "Efficiency", "");
43  iBooker, iGetter, "ptEff", "matchingObjectPt_matched", "matchingObject_Pt", "p_{T} (GeV/c)", "Efficiency", "");
45  iBooker, iGetter, "phiEff", "matchingObjectPhi_matched", "matchingObject_phi", "#phi (rad)", "Efficiency", "");
46  // bookH2andDivide(iBooker,iGetter, "ptEtaEff","matchingObjectPtEta_matched","matchingObjectPtEta","#eta","p_{T} (GeV/c)","");
47  //
48  // bookH1andDivide(iBooker,iGetter, "etaQmisid","matchingObjectEta_matched_qmisid","h_simEta","#eta","q misId","");
49  // bookH1andDivide(iBooker,iGetter, "zQmisid","matchingObjectZ_matched_qmisid","h_simZ","z (cm)","q misId","");
50  // bookH1andDivide(iBooker,iGetter, "absetaQmisid","matchingObjectAbsEta_matched_qmisid","h_simAbsEta","|#eta|","q misId","");
51  // bookH1andDivide(iBooker,iGetter, "ptQmisid","matchingObjectPt_matched_qmisid","h_simPt","p_{T} (GeV/c)","q misId","");
52 
53  edm::LogInfo("ElectronMcFakePostValidator::finalize") << "all reco electrons ";
54  bookH1andDivide(iBooker, iGetter, "etaEff_all", "vertexEta_all", "matchingObject_eta", "#eta", "N_{rec}/N_{gen}", "");
56  iBooker, iGetter, "ptEff_all", "vertexPt_all", "matchingObject_Pt", "p_{T} (GeV/c)", "N_{rec}/N_{gen}", "");
57 
58  edm::LogInfo("ElectronMcFakePostValidator::finalize") << "classes";
59  bookH1andDivide(iBooker,
60  iGetter,
61  "eta_goldenFrac",
62  "eta_golden",
63  "h_ele_eta",
64  "|#eta|",
65  "Fraction of electrons",
66  "fraction of golden electrons vs eta");
67  bookH1andDivide(iBooker,
68  iGetter,
69  "eta_bbremFrac",
70  "eta_bbrem",
71  "h_ele_eta",
72  "|#eta|",
73  "Fraction of electrons",
74  "fraction of big brem electrons vs eta");
75  // bookH1andDivide(iBooker,iGetter, "eta_narrowFrac","eta_narrow","h_ele_eta","|#eta|","Fraction of electrons","fraction of narrow electrons vs eta");
76  bookH1andDivide(iBooker,
77  iGetter,
78  "eta_showerFrac",
79  "eta_shower",
80  "h_ele_eta",
81  "|#eta|",
82  "Fraction of electrons",
83  "fraction of showering electrons vs eta");
84 
85  // fbrem
86  MonitorElement* p1_ele_fbremVsEta_mean = get(iGetter, "fbremvsEtamean");
87  TAxis* etaAxis = p1_ele_fbremVsEta_mean->getTProfile()->GetXaxis();
89  iBooker, "xOverx0VsEta", "mean X/X_0 vs eta", etaAxis->GetNbins(), etaAxis->GetXmin(), etaAxis->GetXmax());
90  for (int ibin = 1; ibin < etaAxis->GetNbins() + 1; ibin++) {
91  double xOverX0 = 0.;
92  if (p1_ele_fbremVsEta_mean->getBinContent(ibin) > 0.) {
93  xOverX0 = -log(p1_ele_fbremVsEta_mean->getBinContent(ibin));
94  }
95  h1_ele_xOverX0VsEta->setBinContent(ibin, xOverX0);
96  }
97 
98 
99  MonitorElement* h1_ele_provenance = get(iGetter, "provenance");
100  if (h1_ele_provenance->getBinContent(3) > 0) {
101  h1_ele_provenance->getTH1F()->Scale(1. / h1_ele_provenance->getBinContent(3));
102  }
103  MonitorElement* h1_ele_provenance_barrel = get(iGetter, "provenance_barrel");
104  if (h1_ele_provenance_barrel->getBinContent(3) > 0) {
105  h1_ele_provenance_barrel->getTH1F()->Scale(1. / h1_ele_provenance_barrel->getBinContent(3));
106  }
107  MonitorElement* h1_ele_provenance_endcaps = get(iGetter, "provenance_endcaps");
108  if (h1_ele_provenance_endcaps->getBinContent(3) > 0) {
109  h1_ele_provenance_endcaps->getTH1F()->Scale(1. / h1_ele_provenance_endcaps->getBinContent(3));
110  }
111  MonitorElement* h1_ele_provenance_Extended = get(iGetter, "provenance_Extended");
112  if (h1_ele_provenance_Extended->getBinContent(3) > 0) {
113  h1_ele_provenance_Extended->getTH1F()->Scale(1. / h1_ele_provenance_Extended->getBinContent(3));
114  }
115 
116  // profiles from 2D histos
117  profileX(iBooker, iGetter, "PoPmatchingObjectVsEta", "", "#eta", "<P/P_{gen}>");
118  profileX(iBooker, iGetter, "PoPmatchingObjectVsPhi", "", "#phi (rad)", "<P/P_{gen}>");
119  profileX(iBooker, iGetter, "EtaMnEtamatchingObjectVsEta", "", "#eta", "<#eta_{rec} - #eta_{gen}>");
120  profileX(iBooker, iGetter, "EtaMnEtamatchingObjectVsPhi", "", "#phi (rad)", "<#eta_{rec} - #eta_{gen}>");
121  profileX(iBooker, iGetter, "PhiMnPhimatchingObjectVsEta", "", "#eta", "<#phi_{rec} - #phi_{gen}> (rad)");
122  profileX(iBooker, iGetter, "PhiMnPhimatchingObjectVsPhi", "", "#phi (rad)", "");
123  profileX(iBooker, iGetter, "vertexPtVsEta", "mean ele transverse momentum vs eta", "#eta", "<p_{T}> (GeV/c)");
124  profileX(iBooker, iGetter, "vertexPtVsPhi", "mean ele transverse momentum vs phi", "#phi (rad)", "<p_{T}> (GeV/c)");
125  profileX(iBooker, iGetter, "EoPVsEta_Extended", "mean ele E/p vs eta", "#eta", "<E/P_{vertex}>");
126  profileX(iBooker, iGetter, "EoPVsPhi", "mean ele E/p vs phi", "#phi (rad)", "<E/P_{vertex}>");
127  profileX(iBooker, iGetter, "EoPoutVsEta", "mean ele E/pout vs eta", "#eta", "<E_{seed}/P_{out}>");
128  profileX(iBooker, iGetter, "EoPoutVsPhi", "mean ele E/pout vs phi", "#phi (rad)", "<E_{seed}/P_{out}>");
129  profileX(iBooker, iGetter, "EeleOPoutVsEta", "mean ele Eele/pout vs eta", "#eta", "<E_{ele}/P_{out}>");
130  profileX(iBooker, iGetter, "EeleOPoutVsPhi", "mean ele Eele/pout vs phi", "#phi (rad)", "<E_{ele}/P_{out}>");
131  profileX(iBooker, iGetter, "HoEVsEta", "mean ele H/E vs eta", "#eta", "<H/E>");
132  profileX(iBooker, iGetter, "HoEVsPhi", "mean ele H/E vs phi", "#phi (rad)", "<H/E>");
133  profileX(iBooker, iGetter, "chi2VsEta", "mean ele track chi2 vs eta", "#eta", "<#Chi^{2}>");
134  profileX(iBooker, iGetter, "chi2VsPhi", "mean ele track chi2 vs phi", "#phi (rad)", "<#Chi^{2}>");
135  profileX(iBooker, iGetter, "foundHitsVsEta_Extended", "mean ele track # found hits vs eta", "#eta", "<N_{hits}>");
136  profileX(iBooker, iGetter, "foundHitsVsPhi", "mean ele track # found hits vs phi", "#phi (rad)", "<N_{hits}>");
137  profileX(iBooker, iGetter, "lostHitsVsEta", "mean ele track # lost hits vs eta", "#eta", "<N_{hits}>");
138  profileX(iBooker, iGetter, "lostHitsVsPhi", "mean ele track # lost hits vs phi", "#phi (rad)", "<N_{hits}>");
139  profileX(iBooker, iGetter, "vertexTIPVsEta", "mean tip (wrt gen vtx) vs eta", "#eta", "<TIP> (cm)");
140  profileX(iBooker, iGetter, "vertexTIPVsPhi", "mean tip (wrt gen vtx) vs phi", "#phi", "<TIP> (cm)");
141  profileX(iBooker, iGetter, "vertexTIPVsPt", "mean tip (wrt gen vtx) vs phi", "p_{T} (GeV/c)", "<TIP> (cm)");
142  profileX(iBooker,
143  iGetter,
144  "seedDphi2_VsEta",
145  "mean ele seed dphi 2nd layer vs eta",
146  "#eta",
147  "<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)",
148  -0.004,
149  0.004);
150  profileX(iBooker,
151  iGetter,
152  "seedDphi2_VsPt",
153  "mean ele seed dphi 2nd layer vs pt",
154  "p_{T} (GeV/c)",
155  "<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)",
156  -0.004,
157  0.004);
158  profileX(iBooker,
159  iGetter,
160  "seedDrz2_VsEta",
161  "mean ele seed dr(dz) 2nd layer vs eta",
162  "#eta",
163  "<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)",
164  -0.15,
165  0.15);
166  profileX(iBooker,
167  iGetter,
168  "seedDrz2_VsPt",
169  "mean ele seed dr(dz) 2nd layer vs pt",
170  "p_{T} (GeV/c)",
171  "<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)",
172  -0.15,
173  0.15);
174  profileX(iBooker,
175  iGetter,
176  "seedDphi2Pos_VsEta",
177  "mean ele seed dphi 2nd layer positron vs eta",
178  "#eta",
179  "<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)",
180  -0.004,
181  0.004);
182  profileX(iBooker,
183  iGetter,
184  "seedDphi2Pos_VsPt",
185  "mean ele seed dphi 2nd layer positron vs pt",
186  "p_{T} (GeV/c)",
187  "<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)",
188  -0.004,
189  0.004);
190  profileX(iBooker,
191  iGetter,
192  "seedDrz2Pos_VsEta",
193  "mean ele seed dr(dz) 2nd layer positron vs eta",
194  "#eta",
195  "<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)",
196  -0.15,
197  0.15);
198  profileX(iBooker,
199  iGetter,
200  "seedDrz2Pos_VsPt",
201  "mean ele seed dr(dz) 2nd layer positron vs pt",
202  "p_{T} (GeV/c)",
203  "<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)",
204  -0.15,
205  0.15);
206 
207 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
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)
virtual TProfile * getTProfile() const
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")
ElectronMcFakePostValidator(const edm::ParameterSet &conf)
void setBookPrefix(const std::string &)
void finalize(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) override
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="")
void setBookStatOverflowFlag(const bool &)
void setBookEfficiencyFlag(const bool &)
Log< level::Info, false > LogInfo
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
virtual TH1F * getTH1F() const
virtual double getBinContent(int binx) const
get content of bin (1-D)