CMS 3D CMS Logo

ElectronMcSignalPostValidator.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("ElectronMcSignalPostValidator::finalize") << "efficiency calculation";
25  bookH1andDivide(iBooker,
26  iGetter,
27  "etaEff_Extended",
28  "mc_Eta_Extended_matched",
29  "mc_Eta_Extended",
30  "#eta",
31  "Efficiency",
32  "Efficiency vs gen eta"); //Efficiency vs gen eta --- Eta of matched electrons
33  bookH1andDivide(iBooker, iGetter, "zEff", "mc_Z_matched", "mc_Z", "z (cm)", "Efficiency", "");
34  bookH1andDivide(iBooker,
35  iGetter,
36  "absetaEff_Extended",
37  "mc_AbsEta_Extended_matched",
38  "mc_AbsEta_Extended",
39  "|#eta|",
40  "Efficiency",
41  "");
42  bookH1andDivide(iBooker, iGetter, "ptEff", "mc_Pt_matched", "mc_Pt", "p_{T} (GeV/c)", "Efficiency", "");
43  bookH1andDivide(iBooker, iGetter, "phiEff", "mc_Phi_matched", "mc_Phi", "#phi (rad)", "Efficiency", "");
44 
45  edm::LogInfo("ElectronMcSignalPostValidator::finalize") << "q-misid calculation";
46  bookH1andDivide(iBooker, iGetter, "etaQmisid", "mc_Eta_matched_qmisid", "mc_Eta", "#eta", "q misId", "");
47  bookH1andDivide(iBooker, iGetter, "zQmisid", "mc_Z_matched_qmisid", "mc_Z", "z (cm)", "q misId", "");
48  bookH1andDivide(iBooker, iGetter, "absetaQmisid", "mc_AbsEta_matched_qmisid", "mc_AbsEta", "|#eta|", "q misId", "");
49  bookH1andDivide(iBooker, iGetter, "ptQmisid", "mc_Pt_matched_qmisid", "mc_Pt", "p_{T} (GeV/c)", "q misId", "");
50 
51  edm::LogInfo("ElectronMcSignalPostValidator::finalize") << "all reco electrons";
52  bookH1andDivide(iBooker, iGetter, "etaEff_all", "vertexEta_all", "h_mc_Eta", "#eta", "N_{rec}/N_{gen}", "");
53  bookH1andDivide(iBooker, iGetter, "ptEff_all", "vertexPt_all", "h_mc_Pt", "p_{T} (GeV/c)", "N_{rec}/N_{gen}", "");
54 
55  edm::LogInfo("ElectronMcSignalPostValidator::finalize") << "classes";
56  bookH1andDivide(iBooker,
57  iGetter,
58  "eta_goldenFrac",
59  "eta_golden",
60  "h_ele_eta",
61  "|#eta|",
62  "Fraction of electrons",
63  "fraction of golden electrons vs eta");
64  bookH1andDivide(iBooker,
65  iGetter,
66  "eta_bbremFrac",
67  "eta_bbrem",
68  "h_ele_eta",
69  "|#eta|",
70  "Fraction of electrons",
71  "fraction of big brem electrons vs eta");
72  bookH1andDivide(iBooker,
73  iGetter,
74  "eta_showerFrac",
75  "eta_shower",
76  "h_ele_eta",
77  "|#eta|",
78  "Fraction of electrons",
79  "fraction of showering electrons vs eta");
80 
81  // fbrem
82  MonitorElement* p1_ele_fbremVsEta_mean = get(iGetter, "fbremvsEtamean");
83  TAxis* etaAxis = p1_ele_fbremVsEta_mean->getTProfile()->GetXaxis();
85  iBooker, "xOverx0VsEta", "mean X/X_0 vs eta", etaAxis->GetNbins(), etaAxis->GetXmin(), etaAxis->GetXmax());
86  for (int ibin = 1; ibin < etaAxis->GetNbins() + 1; ibin++) {
87  double xOverX0 = 0.;
88  if (p1_ele_fbremVsEta_mean->getBinContent(ibin) > 0.) {
89  xOverX0 = -log(p1_ele_fbremVsEta_mean->getBinContent(ibin));
90  }
91  h1_ele_xOverX0VsEta->setBinContent(ibin, xOverX0);
92  }
93 
94  MonitorElement* h1_ele_provenance = get(iGetter, "provenance");
95  if (h1_ele_provenance->getBinContent(3) > 0) {
96  h1_ele_provenance->getTH1F()->Scale(1. / h1_ele_provenance->getBinContent(3));
97  }
98  MonitorElement* h1_ele_provenance_barrel = get(iGetter, "provenance_barrel");
99  if (h1_ele_provenance_barrel->getBinContent(3) > 0) {
100  h1_ele_provenance_barrel->getTH1F()->Scale(1. / h1_ele_provenance_barrel->getBinContent(3));
101  }
102  MonitorElement* h1_ele_provenance_endcaps = get(iGetter, "provenance_endcaps");
103  if (h1_ele_provenance_endcaps->getBinContent(3) > 0) {
104  h1_ele_provenance_endcaps->getTH1F()->Scale(1. / h1_ele_provenance_endcaps->getBinContent(3));
105  }
106 
107  MonitorElement* h1_ele_provenance_Extended = get(iGetter, "provenance_Extended");
108  if (h1_ele_provenance_Extended->getBinContent(3) > 0) {
109  h1_ele_provenance_Extended->getTH1F()->Scale(1. / h1_ele_provenance_Extended->getBinContent(3));
110  }
111 
112  // profiles from 2D histos
113  profileX(iBooker,
114  iGetter,
115  "scl_EoEtrueVsrecOfflineVertices",
116  "E/Etrue vs number of primary vertices",
117  "N_{primary vertices}",
118  "E/E_{true}",
119  0.8);
120  profileX(iBooker,
121  iGetter,
122  "scl_EoEtrueVsrecOfflineVertices_Extended",
123  "E/Etrue vs number of primary vertices, 2.5<|eta|<3",
124  "N_{primary vertices}",
125  "E/E_{true}",
126  0.8);
127  profileX(iBooker,
128  iGetter,
129  "scl_EoEtrueVsrecOfflineVertices_barrel",
130  "E/Etrue vs number of primary vertices , barrel",
131  "N_{primary vertices}",
132  "E/E_{true}",
133  0.8);
134  profileX(iBooker,
135  iGetter,
136  "scl_EoEtrueVsrecOfflineVertices_endcaps",
137  "E/Etrue vs number of primary vertices , endcaps",
138  "N_{primary vertices}",
139  "E/E_{true}",
140  0.8);
141 
142  profileX(iBooker, iGetter, "PoPtrueVsEta_Extended", "mean ele momentum / gen momentum vs eta", "#eta", "<P/P_{gen}>");
143  profileX(iBooker, iGetter, "PoPtrueVsPhi", "mean ele momentum / gen momentum vs phi", "#phi (rad)", "<P/P_{gen}>");
144  profileX(iBooker, iGetter, "sigmaIetaIetaVsPt", "SigmaIetaIeta vs pt", "p_{T} (GeV/c)", "SigmaIetaIeta");
145  profileX(iBooker,
146  iGetter,
147  "EoEtruePfVsEg",
148  "mean mustache SC/true energy vs final SC/true energy",
149  "E_{final SC}/E_{gen}",
150  "E_{mustache}/E_{gen}");
151  profileY(iBooker,
152  iGetter,
153  "EoEtruePfVsEg",
154  "mean mustache SC/true energy vs final SC/true energy",
155  "E_{final SC}/E_{gen}",
156  "E_{mustache}/E_{gen}");
157  profileX(iBooker, iGetter, "EtaMnEtaTrueVsEta", "mean ele eta - gen eta vs eta", "#eta", "<#eta_{rec} - #eta_{gen}>");
158  profileX(
159  iBooker, iGetter, "EtaMnEtaTrueVsPhi", "mean ele eta - gen eta vs phi", "#phi (rad)", "<#eta_{rec} - #eta_{gen}>");
160  profileX(
161  iBooker, iGetter, "PhiMnPhiTrueVsEta", "mean ele phi - gen phi vs eta", "#eta", "<#phi_{rec} - #phi_{gen}> (rad)");
162  profileX(iBooker, iGetter, "PhiMnPhiTrueVsPhi", "mean ele phi - gen phi vs phi", "#phi (rad)", "");
163  profileX(iBooker, iGetter, "vertexPtVsEta", "mean ele transverse momentum vs eta", "#eta", "<p_{T}> (GeV/c)");
164  profileX(iBooker, iGetter, "vertexPtVsPhi", "mean ele transverse momentum vs phi", "#phi (rad)", "<p_{T}> (GeV/c)");
165  profileX(iBooker, iGetter, "EoPVsEta_Extended", "mean ele E/p vs eta", "#eta", "<E/P_{vertex}>");
166  profileX(iBooker, iGetter, "EoPVsPhi", "mean ele E/p vs phi", "#phi (rad)", "<E/P_{vertex}>");
167  profileX(iBooker, iGetter, "EoPoutVsEta", "mean ele E/pout vs eta", "#eta", "<E_{seed}/P_{out}>");
168  profileX(iBooker, iGetter, "EoPoutVsPhi", "mean ele E/pout vs phi", "#phi (rad)", "<E_{seed}/P_{out}>");
169  profileX(iBooker, iGetter, "EeleOPoutVsEta", "mean ele Eele/pout vs eta", "#eta", "<E_{ele}/P_{out}>");
170  profileX(iBooker, iGetter, "EeleOPoutVsPhi", "mean ele Eele/pout vs phi", "#phi (rad)", "<E_{ele}/P_{out}>");
171  profileX(iBooker, iGetter, "HoEVsEta", "mean ele H/E vs eta", "#eta", "<H/E>");
172  profileX(iBooker, iGetter, "HoEVsPhi", "mean ele H/E vs phi", "#phi (rad)", "<H/E>");
173  profileX(iBooker, iGetter, "chi2VsEta", "mean ele track chi2 vs eta", "#eta", "<#Chi^{2}>");
174  profileX(iBooker, iGetter, "chi2VsPhi", "mean ele track chi2 vs phi", "#phi (rad)", "<#Chi^{2}>");
175  profileX(iBooker, iGetter, "ambiguousTracksVsEta", "mean ele # ambiguous tracks vs eta", "#eta", "<N_{ambiguous}>");
176  profileX(iBooker, iGetter, "foundHitsVsEta_Extended", "mean ele track # found hits vs eta", "#eta", "<N_{hits}>");
177  profileX(iBooker, iGetter, "foundHitsVsEta_mAOD", "mean ele track # found hits vs eta", "#eta", "<N_{hits}>");
178  profileX(iBooker, iGetter, "foundHitsVsPhi", "mean ele track # found hits vs phi", "#phi (rad)", "<N_{hits}>");
179  profileX(iBooker, iGetter, "lostHitsVsEta", "mean ele track # lost hits vs eta", "#eta", "<N_{hits}>");
180  profileX(iBooker, iGetter, "lostHitsVsPhi", "mean ele track # lost hits vs phi", "#phi (rad)", "<N_{hits}>");
181  profileX(iBooker, iGetter, "vertexTIPVsEta", "mean tip (wrt gen vtx) vs eta", "#eta", "<TIP> (cm)");
182  profileX(iBooker, iGetter, "vertexTIPVsPhi", "mean tip (wrt gen vtx) vs phi", "#phi", "<TIP> (cm)");
183  profileX(iBooker, iGetter, "vertexTIPVsPt", "mean tip (wrt gen vtx) vs phi", "p_{T} (GeV/c)", "<TIP> (cm)");
184  profileX(iBooker,
185  iGetter,
186  "seedDphi2_VsEta",
187  "mean ele seed dphi 2nd layer vs eta",
188  "#eta",
189  "<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)",
190  -0.004,
191  0.004);
192  profileX(iBooker,
193  iGetter,
194  "seedDphi2_VsPt",
195  "mean ele seed dphi 2nd layer vs pt",
196  "p_{T} (GeV/c)",
197  "<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)",
198  -0.004,
199  0.004);
200  profileX(iBooker,
201  iGetter,
202  "seedDrz2_VsEta",
203  "mean ele seed dr(dz) 2nd layer vs eta",
204  "#eta",
205  "<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)",
206  -0.15,
207  0.15);
208  profileX(iBooker,
209  iGetter,
210  "seedDrz2_VsPt",
211  "mean ele seed dr(dz) 2nd layer vs pt",
212  "p_{T} (GeV/c)",
213  "<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)",
214  -0.15,
215  0.15);
216  profileX(iBooker,
217  iGetter,
218  "seedDphi2Pos_VsEta",
219  "mean ele seed dphi 2nd layer positron vs eta",
220  "#eta",
221  "<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)",
222  -0.004,
223  0.004);
224  profileX(iBooker,
225  iGetter,
226  "seedDphi2Pos_VsPt",
227  "mean ele seed dphi 2nd layer positron vs pt",
228  "p_{T} (GeV/c)",
229  "<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)",
230  -0.004,
231  0.004);
232  profileX(iBooker,
233  iGetter,
234  "seedDrz2Pos_VsEta",
235  "mean ele seed dr(dz) 2nd layer positron vs eta",
236  "#eta",
237  "<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)",
238  -0.15,
239  0.15);
240  profileX(iBooker,
241  iGetter,
242  "seedDrz2Pos_VsPt",
243  "mean ele seed dr(dz) 2nd layer positron vs pt",
244  "p_{T} (GeV/c)",
245  "<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)",
246  -0.15,
247  0.15);
248 
249 }
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")
void setBookPrefix(const std::string &)
ElectronMcSignalPostValidator(const edm::ParameterSet &conf)
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 finalize(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) override
MonitorElement * profileY(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 &)
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)