CMS 3D CMS Logo

EfficiencyPlotter.cc
Go to the documentation of this file.
2 
3 // Framework
10 
14 
15 #include <iostream>
16 #include <cstdio>
17 #include <string>
18 #include <cmath>
19 #include "TF1.h"
20 #include "TH1F.h"
21 
22 using namespace edm;
23 using namespace std;
24 
25 //#define DEBUG
26 
28 #ifdef DEBUG
29  cout << "EfficiencyPlotter(): Constructor " << endl;
30 #endif
31  parameters = ps;
32 
33  etaBin = parameters.getParameter<int>("etaBin");
34  etaMin = parameters.getParameter<double>("etaMin");
35  etaMax = parameters.getParameter<double>("etaMax");
36 
37  phiBin = parameters.getParameter<int>("phiBin");
38  phiMin = parameters.getParameter<double>("phiMin");
39  phiMax = parameters.getParameter<double>("phiMax");
40 
41  ptBin = parameters.getParameter<int>("ptBin");
42  ptMin = parameters.getParameter<double>("ptMin");
43  ptMax = parameters.getParameter<double>("ptMax");
44 
45  vtxBin = parameters.getParameter<int>("vtxBin");
46  vtxMin = parameters.getParameter<double>("vtxMin");
47  vtxMax = parameters.getParameter<double>("vtxMax");
48 
49  ID_ = parameters.getParameter<string>("MuonID");
50  theFolder = parameters.getParameter<string>("folder");
51 }
53 
55  ibooker.setCurrentFolder(theFolder);
56 
57  // efficiency plot
58  h_eff_eta_ID = ibooker.book1D("Eff_eta_" + ID_, ID_ + " Eff. vs #eta", etaBin, etaMin, etaMax);
59  h_eff_inner_pt_ID = ibooker.book1D("Eff_inner_pt_" + ID_, ID_ + " Eff. vs pt", ptBin, ptMin, ptMax);
60  h_eff_inner_eta_ID = ibooker.book1D("Eff_inner_eta_" + ID_, ID_ + " Eff. vs #eta", etaBin, etaMin, etaMax);
61  h_eff_inner_phi_ID = ibooker.book1D("Eff_inner_phi_" + ID_, ID_ + " Eff. vs #phi", phiBin, phiMin, phiMax);
62  h_eff_hp_eta_ID = ibooker.book1D("Eff_hp_eta_" + ID_, "High Pt " + ID_ + " Eff. vs #eta", etaBin, etaMin, etaMax);
63  h_eff_phi_ID = ibooker.book1D("Eff_phi_" + ID_, ID_ + " Eff. vs #phi", phiBin, phiMin, phiMax);
64  h_eff_pt_ID = ibooker.book1D("Eff_pt_" + ID_, ID_ + " Eff. vs Pt", ptBin, ptMin, ptMax);
65  h_eff_pt_EB_ID = ibooker.book1D("Eff_pt_EB_" + ID_, "Barrel: " + ID_ + " Eff. vs Pt", ptBin, ptMin, ptMax);
66  h_eff_pt_EE_ID = ibooker.book1D("Eff_pt_EE_" + ID_, "Endcap: " + ID_ + " Eff. vs Pt", ptBin, ptMin, ptMax);
67  h_eff_pt_detIsoID = ibooker.book1D("Eff_pt_detIso" + ID_, "detIso" + ID_ + " Efficiency vs Pt", ptBin, ptMin, ptMax);
68  h_eff_pt_EB_detIsoID =
69  ibooker.book1D("Eff_pt_EB_detIso" + ID_, "Barrel: detIso" + ID_ + " Eff. vs Pt", ptBin, ptMin, ptMax);
70  h_eff_pt_EE_detIsoID =
71  ibooker.book1D("Eff_pt_EE_detIso" + ID_, "Endcap: detIso" + ID_ + " Eff. vs Pt", ptBin, ptMin, ptMax);
72  h_eff_pt_pfIsoID = ibooker.book1D("Eff_pt_pfIso" + ID_, "pfIso" + ID_ + " Eff. vs Pt", ptBin, ptMin, ptMax);
73  h_eff_pt_EB_pfIsoID =
74  ibooker.book1D("Eff_pt_EB_pfIso" + ID_, "Barrel: pfIso" + ID_ + " Eff. vs Pt", ptBin, ptMin, ptMax);
75  h_eff_pt_EE_pfIsoID =
76  ibooker.book1D("Eff_pt_EE_pfIso" + ID_, "Endcap: pfIso" + ID_ + " Eff. vs Pt", ptBin, ptMin, ptMax);
77  h_eff_vtx_detIsoID = ibooker.book1D("Eff_vtx_detIso" + ID_, "detIso" + ID_ + " Eff. vs nVtx", vtxBin, vtxMin, vtxMax);
78  h_eff_vtx_pfIsoID = ibooker.book1D("Eff_vtx_pfIso" + ID_, "pfIso" + ID_ + " Eff. vs nVtx", vtxBin, vtxMin, vtxMax);
79  h_eff_vtx_EB_detIsoID =
80  ibooker.book1D("Eff_vtx_EB_detIso" + ID_, "Barrel: detIso" + ID_ + " Eff. vs nVtx", vtxBin, vtxMin, vtxMax);
81  h_eff_vtx_EB_pfIsoID =
82  ibooker.book1D("Eff_vtx_EB_pfIso" + ID_, "Barrel: pfIso" + ID_ + " Eff. vs nVtx", vtxBin, vtxMin, vtxMax);
83  h_eff_vtx_EE_detIsoID =
84  ibooker.book1D("Eff_vtx_EE_detIso" + ID_, "Endcap: detIso" + ID_ + " Eff. vs nVtx", vtxBin, vtxMin, vtxMax);
85  h_eff_vtx_EE_pfIsoID =
86  ibooker.book1D("Eff_vtx_EE_pfIso" + ID_, "Endcap: pfIso" + ID_ + " Eff. vs nVtx", vtxBin, vtxMin, vtxMax);
87 
88  h_eff_pt_pfIsodBID =
89  ibooker.book1D("Eff_pt_pfIsodB" + ID_, "pfIso" + ID_ + " (deltaBeta) Eff. vs Pt", ptBin, ptMin, ptMax);
90  h_eff_pt_EB_pfIsodBID =
91  ibooker.book1D("Eff_pt_EB_pfIsodB" + ID_, "Barrel: pfIso" + ID_ + " (deltaBeta) Eff. vs Pt", ptBin, ptMin, ptMax);
92  h_eff_pt_EE_pfIsodBID =
93  ibooker.book1D("Eff_pt_EE_pfIsodB" + ID_, "Endcap: pfIso" + ID_ + " (deltaBeta) Eff. vs Pt", ptBin, ptMin, ptMax);
94  h_eff_vtx_pfIsodBID =
95  ibooker.book1D("Eff_vtx_pfIsodB" + ID_, "pfIso" + ID_ + " (deltaBeta) Eff. vs nVtx", vtxBin, vtxMin, vtxMax);
96  h_eff_vtx_EB_pfIsodBID = ibooker.book1D(
97  "Eff_vtx_EB_pfIsodB" + ID_, "Barrel: pfIso" + ID_ + " (deltaBeta) Eff. vs nVtx", vtxBin, vtxMin, vtxMax);
98  h_eff_vtx_EE_pfIsodBID = ibooker.book1D(
99  "Eff_vtx_EE_pfIsodB" + ID_, "Endcap: pfIso" + ID_ + " (deltaBeta) Eff. vs nVtx", vtxBin, vtxMin, vtxMax);
100 
101  // This prevents this ME to be normalized when drawn into the GUI
102  h_eff_eta_ID->setEfficiencyFlag();
103  h_eff_inner_eta_ID->setEfficiencyFlag();
104  h_eff_inner_pt_ID->setEfficiencyFlag();
105  h_eff_inner_phi_ID->setEfficiencyFlag();
106  h_eff_hp_eta_ID->setEfficiencyFlag();
107  h_eff_phi_ID->setEfficiencyFlag();
108  h_eff_pt_ID->setEfficiencyFlag();
109  h_eff_pt_EB_ID->setEfficiencyFlag();
110  h_eff_pt_EE_ID->setEfficiencyFlag();
111  h_eff_pt_detIsoID->setEfficiencyFlag();
112  h_eff_pt_EB_detIsoID->setEfficiencyFlag();
113  h_eff_pt_EE_detIsoID->setEfficiencyFlag();
114  h_eff_pt_pfIsoID->setEfficiencyFlag();
115  h_eff_pt_EB_pfIsoID->setEfficiencyFlag();
116  h_eff_pt_EE_pfIsoID->setEfficiencyFlag();
117  h_eff_vtx_detIsoID->setEfficiencyFlag();
118  h_eff_vtx_pfIsoID->setEfficiencyFlag();
119  h_eff_vtx_EB_detIsoID->setEfficiencyFlag();
120  h_eff_vtx_EB_pfIsoID->setEfficiencyFlag();
121  h_eff_vtx_EE_detIsoID->setEfficiencyFlag();
122  h_eff_vtx_EE_pfIsoID->setEfficiencyFlag();
123 
124  h_eff_pt_pfIsodBID->setEfficiencyFlag();
125  h_eff_pt_EB_pfIsodBID->setEfficiencyFlag();
126  h_eff_pt_EE_pfIsodBID->setEfficiencyFlag();
127  h_eff_vtx_pfIsodBID->setEfficiencyFlag();
128  h_eff_vtx_EB_pfIsodBID->setEfficiencyFlag();
129  h_eff_vtx_EE_pfIsodBID->setEfficiencyFlag();
130 
131  // AXIS TITLES....
132  h_eff_hp_eta_ID->setAxisTitle("#eta", 1);
133  h_eff_inner_eta_ID->setAxisTitle("#eta", 1);
134  h_eff_inner_pt_ID->setAxisTitle("#eta", 1);
135  h_eff_inner_phi_ID->setAxisTitle("#eta", 1);
136  h_eff_eta_ID->setAxisTitle("#eta", 1);
137  h_eff_phi_ID->setAxisTitle("#phi", 1);
138  h_eff_pt_ID->setAxisTitle("p_{T} (GeV)", 1);
139  h_eff_pt_EB_ID->setAxisTitle("p_{T} (GeV)", 1);
140  h_eff_pt_EE_ID->setAxisTitle("p_{T} (GeV)", 1);
141  h_eff_pt_detIsoID->setAxisTitle("p_{T} (GeV)", 1);
142  h_eff_pt_EB_detIsoID->setAxisTitle("p_{T} (GeV)", 1);
143  h_eff_pt_EE_detIsoID->setAxisTitle("p_{T} (GeV)", 1);
144  h_eff_pt_pfIsoID->setAxisTitle("p_{T} (GeV)", 1);
145  h_eff_pt_EB_pfIsoID->setAxisTitle("p_{T} (GeV)", 1);
146  h_eff_pt_EE_pfIsoID->setAxisTitle("p_{T} (GeV)", 1);
147  h_eff_vtx_detIsoID->setAxisTitle("Number of PV", 1);
148  h_eff_vtx_pfIsoID->setAxisTitle("Number of PV", 1);
149  h_eff_vtx_EB_detIsoID->setAxisTitle("Number of PV", 1);
150  h_eff_vtx_EB_pfIsoID->setAxisTitle("Number of PV", 1);
151  h_eff_vtx_EE_detIsoID->setAxisTitle("Number of PV", 1);
152  h_eff_vtx_EE_pfIsoID->setAxisTitle("Number of PV", 1);
153 
154  h_eff_pt_pfIsodBID->setAxisTitle("p_{T} (GeV)", 1);
155  h_eff_pt_EB_pfIsodBID->setAxisTitle("p_{T} (GeV)", 1);
156  h_eff_pt_EE_pfIsodBID->setAxisTitle("p_{T} (GeV)", 1);
157  h_eff_vtx_pfIsodBID->setAxisTitle("Number of PV", 1);
158  h_eff_vtx_EB_pfIsodBID->setAxisTitle("Number of PV", 1);
159  h_eff_vtx_EE_pfIsodBID->setAxisTitle("Number of PV", 1);
160 
162  string inputdir = "Muons/EfficiencyAnalyzer/" + ID_;
163  string numpath_pt = inputdir + "/passProbes_ID_pt";
164  string denpath_pt = inputdir + "/allProbes_pt";
165 
166  MonitorElement *Numerator_pt = igetter.get(numpath_pt);
167  MonitorElement *Denominator_pt = igetter.get(denpath_pt);
168 
169  if (Numerator_pt && Denominator_pt) {
170  TH1F *h_numerator_pt = Numerator_pt->getTH1F();
171  TH1F *h_denominator_pt = Denominator_pt->getTH1F();
172  TH1F *h_eff_pt = h_eff_pt_ID->getTH1F();
173 
174  if (h_eff_pt->GetSumw2N() == 0)
175  h_eff_pt->Sumw2();
176  h_eff_pt->Divide(h_numerator_pt, h_denominator_pt, 1., 1., "B");
177  }
178 
180  string numpath_inner_pt = inputdir + "/passProbes_ID_inner_pt";
181  string denpath_inner_pt = inputdir + "/allProbes_inner_pt";
182 
183  MonitorElement *Numerator_inner_pt = igetter.get(numpath_inner_pt);
184  MonitorElement *Denominator_inner_pt = igetter.get(denpath_inner_pt);
185 
186  if (Numerator_inner_pt && Denominator_inner_pt) {
187  TH1F *h_numerator_inner_pt = Numerator_inner_pt->getTH1F();
188  TH1F *h_denominator_inner_pt = Denominator_inner_pt->getTH1F();
189  TH1F *h_eff_inner_pt = h_eff_inner_pt_ID->getTH1F();
190 
191  if (h_eff_inner_pt->GetSumw2N() == 0)
192  h_eff_inner_pt->Sumw2();
193  h_eff_inner_pt->Divide(h_numerator_inner_pt, h_denominator_inner_pt, 1., 1., "B");
194  }
195 
197  string numpath_inner_eta = inputdir + "/passProbes_ID_inner_eta";
198  string denpath_inner_eta = inputdir + "/allProbes_inner_eta";
199 
200  MonitorElement *Numerator_inner_eta = igetter.get(numpath_inner_eta);
201  MonitorElement *Denominator_inner_eta = igetter.get(denpath_inner_eta);
202 
203  if (Numerator_inner_eta && Denominator_inner_eta) {
204  TH1F *h_numerator_inner_eta = Numerator_inner_eta->getTH1F();
205  TH1F *h_denominator_inner_eta = Denominator_inner_eta->getTH1F();
206  TH1F *h_eff_inner_eta = h_eff_inner_eta_ID->getTH1F();
207 
208  if (h_eff_inner_eta->GetSumw2N() == 0)
209  h_eff_inner_eta->Sumw2();
210  h_eff_inner_eta->Divide(h_numerator_inner_eta, h_denominator_inner_eta, 1., 1., "B");
211  }
212 
214  string numpath_inner_phi = inputdir + "/passProbes_ID_inner_phi";
215  string denpath_inner_phi = inputdir + "/allProbes_inner_phi";
216 
217  MonitorElement *Numerator_inner_phi = igetter.get(numpath_inner_phi);
218  MonitorElement *Denominator_inner_phi = igetter.get(denpath_inner_phi);
219 
220  if (Numerator_inner_phi && Denominator_inner_phi) {
221  TH1F *h_numerator_inner_phi = Numerator_inner_phi->getTH1F();
222  TH1F *h_denominator_inner_phi = Denominator_inner_phi->getTH1F();
223  TH1F *h_eff_inner_phi = h_eff_inner_phi_ID->getTH1F();
224 
225  if (h_eff_inner_phi->GetSumw2N() == 0)
226  h_eff_inner_phi->Sumw2();
227  h_eff_inner_phi->Divide(h_numerator_inner_phi, h_denominator_inner_phi, 1., 1., "B");
228  }
229 
231  string numpath_EB_pt = inputdir + "/passProbes_ID_EB_pt";
232  string denpath_EB_pt = inputdir + "/allProbes_EB_pt";
233 
234  MonitorElement *Numerator_EB_pt = igetter.get(numpath_EB_pt);
235  MonitorElement *Denominator_EB_pt = igetter.get(denpath_EB_pt);
236 
237  if (Numerator_EB_pt && Denominator_EB_pt) {
238  TH1F *h_numerator_EB_pt = Numerator_EB_pt->getTH1F();
239  TH1F *h_denominator_EB_pt = Denominator_EB_pt->getTH1F();
240  TH1F *h_eff_EB_pt = h_eff_pt_EB_ID->getTH1F();
241 
242  if (h_eff_EB_pt->GetSumw2N() == 0)
243  h_eff_EB_pt->Sumw2();
244  h_eff_EB_pt->Divide(h_numerator_EB_pt, h_denominator_EB_pt, 1., 1., "B");
245  }
246 
248  string numpath_EE_pt = inputdir + "/passProbes_ID_EE_pt";
249  string denpath_EE_pt = inputdir + "/allProbes_EE_pt";
250 
251  MonitorElement *Numerator_EE_pt = igetter.get(numpath_EE_pt);
252  MonitorElement *Denominator_EE_pt = igetter.get(denpath_EE_pt);
253 
254  if (Numerator_EE_pt && Denominator_EE_pt) {
255  TH1F *h_numerator_EE_pt = Numerator_EE_pt->getTH1F();
256  TH1F *h_denominator_EE_pt = Denominator_EE_pt->getTH1F();
257  TH1F *h_eff_EE_pt = h_eff_pt_EE_ID->getTH1F();
258 
259  if (h_eff_EE_pt->GetSumw2N() == 0)
260  h_eff_EE_pt->Sumw2();
261  h_eff_EE_pt->Divide(h_numerator_EE_pt, h_denominator_EE_pt, 1., 1., "B");
262  }
263 
265  string numpath_eta = inputdir + "/passProbes_ID_eta";
266  string denpath_eta = inputdir + "/allProbes_eta";
267 
268  MonitorElement *Numerator_eta = igetter.get(numpath_eta);
269  MonitorElement *Denominator_eta = igetter.get(denpath_eta);
270 
271  if (Numerator_eta && Denominator_eta) {
272  TH1F *h_numerator_eta = Numerator_eta->getTH1F();
273  TH1F *h_denominator_eta = Denominator_eta->getTH1F();
274 
275  TH1F *h_eff_eta = h_eff_eta_ID->getTH1F();
276 
277  if (h_eff_eta->GetSumw2N() == 0)
278  h_eff_eta->Sumw2();
279 
280  h_eff_eta->Divide(h_numerator_eta, h_denominator_eta, 1., 1., "B");
281  }
282 
284 
285  string numpath_hp_eta = inputdir + "/passProbes_ID_hp_eta";
286  string denpath_hp_eta = inputdir + "/allProbes_hp_eta";
287 
288  MonitorElement *Numerator_hp_eta = igetter.get(numpath_hp_eta);
289  MonitorElement *Denominator_hp_eta = igetter.get(denpath_hp_eta);
290 
291  if (Numerator_hp_eta && Denominator_hp_eta) {
292  TH1F *h_numerator_hp_eta = Numerator_hp_eta->getTH1F();
293  TH1F *h_denominator_hp_eta = Denominator_hp_eta->getTH1F();
294 
295  TH1F *h_eff_hp_eta = h_eff_hp_eta_ID->getTH1F();
296 
297  if (h_eff_hp_eta->GetSumw2N() == 0)
298  h_eff_hp_eta->Sumw2();
299 
300  h_eff_hp_eta->Divide(h_numerator_hp_eta, h_denominator_hp_eta, 1., 1., "B");
301  }
302 
304 
305  string numpath_phi = inputdir + "/passProbes_ID_phi";
306  string denpath_phi = inputdir + "/allProbes_phi";
307 
308  MonitorElement *Numerator_phi = igetter.get(numpath_phi);
309  MonitorElement *Denominator_phi = igetter.get(denpath_phi);
310 
311  if (Numerator_phi && Denominator_phi) {
312  TH1F *h_numerator_phi = Numerator_phi->getTH1F();
313  TH1F *h_denominator_phi = Denominator_phi->getTH1F();
314 
315  TH1F *h_eff_phi = h_eff_phi_ID->getTH1F();
316 
317  if (h_eff_phi->GetSumw2N() == 0)
318  h_eff_phi->Sumw2();
319 
320  h_eff_phi->Divide(h_numerator_phi, h_denominator_phi, 1., 1., "B");
321  }
322 
324  string numpath_detIso_pt = inputdir + "/passProbes_detIsoID_pt";
325  string denpath_detIso_pt = inputdir + "/allProbes_ID_pt";
326 
327  MonitorElement *Numerator_detIso_pt = igetter.get(numpath_detIso_pt);
328  MonitorElement *Denominator_detIso_pt = igetter.get(denpath_detIso_pt);
329 
330  if (Numerator_detIso_pt && Denominator_detIso_pt) {
331  TH1F *h_numerator_detIso_pt = Numerator_detIso_pt->getTH1F();
332  TH1F *h_denominator_detIso_pt = Denominator_detIso_pt->getTH1F();
333 
334  TH1F *h_eff_detIso_pt = h_eff_pt_detIsoID->getTH1F();
335 
336  if (h_eff_detIso_pt->GetSumw2N() == 0)
337  h_eff_detIso_pt->Sumw2();
338  h_eff_detIso_pt->Divide(h_numerator_detIso_pt, h_denominator_detIso_pt, 1., 1., "B");
339  }
340 
342  string numpath_detIso_EB_pt = inputdir + "/passProbes_EB_detIsoID_pt";
343  string denpath_detIso_EB_pt = inputdir + "/allProbes_EB_ID_pt";
344 
345  MonitorElement *Numerator_detIso_EB_pt = igetter.get(numpath_detIso_EB_pt);
346  MonitorElement *Denominator_detIso_EB_pt = igetter.get(denpath_detIso_EB_pt);
347 
348  if (Numerator_detIso_EB_pt && Denominator_detIso_EB_pt) {
349  TH1F *h_numerator_detIso_EB_pt = Numerator_detIso_EB_pt->getTH1F();
350  TH1F *h_denominator_detIso_EB_pt = Denominator_detIso_EB_pt->getTH1F();
351 
352  TH1F *h_eff_detIso_EB_pt = h_eff_pt_EB_detIsoID->getTH1F();
353 
354  if (h_eff_detIso_EB_pt->GetSumw2N() == 0)
355  h_eff_detIso_EB_pt->Sumw2();
356 
357  h_eff_detIso_EB_pt->Divide(h_numerator_detIso_EB_pt, h_denominator_detIso_EB_pt, 1., 1., "B");
358  }
359 
361  string numpath_detIso_EE_pt = inputdir + "/passProbes_EE_detIsoID_pt";
362  string denpath_detIso_EE_pt = inputdir + "/allProbes_EE_ID_pt";
363 
364  MonitorElement *Numerator_detIso_EE_pt = igetter.get(numpath_detIso_EE_pt);
365  MonitorElement *Denominator_detIso_EE_pt = igetter.get(denpath_detIso_EE_pt);
366 
367  if (Numerator_detIso_EE_pt && Denominator_detIso_EE_pt) {
368  TH1F *h_numerator_detIso_EE_pt = Numerator_detIso_EE_pt->getTH1F();
369  TH1F *h_denominator_detIso_EE_pt = Denominator_detIso_EE_pt->getTH1F();
370 
371  TH1F *h_eff_detIso_EE_pt = h_eff_pt_EE_detIsoID->getTH1F();
372 
373  if (h_eff_detIso_EE_pt->GetSumw2N() == 0)
374  h_eff_detIso_EE_pt->Sumw2();
375 
376  h_eff_detIso_EE_pt->Divide(h_numerator_detIso_EE_pt, h_denominator_detIso_EE_pt, 1., 1., "B");
377  }
378 
380  string numpath_pfIso_pt = inputdir + "/passProbes_pfIsoID_pt";
381  string denpath_pfIso_pt = inputdir + "/allProbes_ID_pt";
382 
383  MonitorElement *Numerator_pfIso_pt = igetter.get(numpath_pfIso_pt);
384  MonitorElement *Denominator_pfIso_pt = igetter.get(denpath_pfIso_pt);
385 
386  if (Numerator_pfIso_pt && Denominator_pfIso_pt) {
387  TH1F *h_numerator_pfIso_pt = Numerator_pfIso_pt->getTH1F();
388  TH1F *h_denominator_pfIso_pt = Denominator_pfIso_pt->getTH1F();
389 
390  TH1F *h_eff_pfIso_pt = h_eff_pt_pfIsoID->getTH1F();
391 
392  if (h_eff_pfIso_pt->GetSumw2N() == 0)
393  h_eff_pfIso_pt->Sumw2();
394 
395  h_eff_pfIso_pt->Divide(h_numerator_pfIso_pt, h_denominator_pfIso_pt, 1., 1., "B");
396  }
397 
399 
400  string numpath_pfIso_EB_pt = inputdir + "/passProbes_EB_pfIsoID_pt";
401  string denpath_pfIso_EB_pt = inputdir + "/allProbes_EB_ID_pt";
402 
403  MonitorElement *Numerator_pfIso_EB_pt = igetter.get(numpath_pfIso_EB_pt);
404  MonitorElement *Denominator_pfIso_EB_pt = igetter.get(denpath_pfIso_EB_pt);
405 
406  if (Numerator_pfIso_EB_pt && Denominator_pfIso_EB_pt) {
407  TH1F *h_numerator_pfIso_EB_pt = Numerator_pfIso_EB_pt->getTH1F();
408  TH1F *h_denominator_pfIso_EB_pt = Denominator_pfIso_EB_pt->getTH1F();
409 
410  TH1F *h_eff_pfIso_EB_pt = h_eff_pt_EB_pfIsoID->getTH1F();
411 
412  if (h_eff_pfIso_EB_pt->GetSumw2N() == 0)
413  h_eff_pfIso_EB_pt->Sumw2();
414  h_eff_pfIso_EB_pt->Divide(h_numerator_pfIso_EB_pt, h_denominator_pfIso_EB_pt, 1., 1., "B");
415  }
416 
418  string numpath_pfIso_EE_pt = inputdir + "/passProbes_EE_pfIsoID_pt";
419  string denpath_pfIso_EE_pt = inputdir + "/allProbes_EE_ID_pt";
420 
421  MonitorElement *Numerator_pfIso_EE_pt = igetter.get(numpath_pfIso_EE_pt);
422  MonitorElement *Denominator_pfIso_EE_pt = igetter.get(denpath_pfIso_EE_pt);
423 
424  if (Numerator_pfIso_EE_pt && Denominator_pfIso_EE_pt) {
425  TH1F *h_numerator_pfIso_EE_pt = Numerator_pfIso_EE_pt->getTH1F();
426  TH1F *h_denominator_pfIso_EE_pt = Denominator_pfIso_EE_pt->getTH1F();
427 
428  TH1F *h_eff_pfIso_EE_pt = h_eff_pt_EE_pfIsoID->getTH1F();
429 
430  if (h_eff_pfIso_EE_pt->GetSumw2N() == 0)
431  h_eff_pfIso_EE_pt->Sumw2();
432 
433  h_eff_pfIso_EE_pt->Divide(h_numerator_pfIso_EE_pt, h_denominator_pfIso_EE_pt, 1., 1., "B");
434  }
435 
437 
438  string numpath_pfIso_nvtx = inputdir + "/passProbes_pfIsoID_nVtx";
439  string denpath_pfIso_nvtx = inputdir + "/allProbes_ID_nVtx";
440 
441  MonitorElement *Numerator_pfIso_nvtx = igetter.get(numpath_pfIso_nvtx);
442  MonitorElement *Denominator_pfIso_nvtx = igetter.get(denpath_pfIso_nvtx);
443 
444  if (Numerator_pfIso_nvtx && Denominator_pfIso_nvtx) {
445  TH1F *h_numerator_pfIso_nvtx = Numerator_pfIso_nvtx->getTH1F();
446  TH1F *h_denominator_pfIso_nvtx = Denominator_pfIso_nvtx->getTH1F();
447 
448  TH1F *h_eff_pfIso_nvtx = h_eff_vtx_pfIsoID->getTH1F();
449 
450  if (h_eff_pfIso_nvtx->GetSumw2N() == 0)
451  h_eff_pfIso_nvtx->Sumw2();
452 
453  h_eff_pfIso_nvtx->Divide(h_numerator_pfIso_nvtx, h_denominator_pfIso_nvtx, 1., 1., "B");
454  }
455 
457  string numpath_detIso_nvtx = inputdir + "/passProbes_detIsoID_nVtx";
458  string denpath_detIso_nvtx = inputdir + "/allProbes_ID_nVtx";
459 
460  MonitorElement *Numerator_detIso_nvtx = igetter.get(numpath_detIso_nvtx);
461  MonitorElement *Denominator_detIso_nvtx = igetter.get(denpath_detIso_nvtx);
462 
463  if (Numerator_detIso_nvtx && Denominator_detIso_nvtx) {
464  TH1F *h_numerator_detIso_nvtx = Numerator_detIso_nvtx->getTH1F();
465  TH1F *h_denominator_detIso_nvtx = Denominator_detIso_nvtx->getTH1F();
466 
467  TH1F *h_eff_detIso_nvtx = h_eff_vtx_detIsoID->getTH1F();
468 
469  if (h_eff_detIso_nvtx->GetSumw2N() == 0)
470  h_eff_detIso_nvtx->Sumw2();
471 
472  h_eff_detIso_nvtx->Divide(h_numerator_detIso_nvtx, h_denominator_detIso_nvtx, 1., 1., "B");
473  }
474 
476  numpath_detIso_nvtx = inputdir + "/passProbes_EB_detIsoID_nVtx";
477  denpath_detIso_nvtx = inputdir + "/allProbes_EB_ID_nVtx";
478 
479  Numerator_detIso_nvtx = igetter.get(numpath_detIso_nvtx);
480  Denominator_detIso_nvtx = igetter.get(denpath_detIso_nvtx);
481 
482  if (Numerator_detIso_nvtx && Denominator_detIso_nvtx) {
483  TH1F *h_numerator_detIso_nvtx = Numerator_detIso_nvtx->getTH1F();
484  TH1F *h_denominator_detIso_nvtx = Denominator_detIso_nvtx->getTH1F();
485 
486  TH1F *h_eff_detIso_nvtx = h_eff_vtx_EB_detIsoID->getTH1F();
487 
488  if (h_eff_detIso_nvtx->GetSumw2N() == 0)
489  h_eff_detIso_nvtx->Sumw2();
490  h_eff_detIso_nvtx->Divide(h_numerator_detIso_nvtx, h_denominator_detIso_nvtx, 1., 1., "B");
491  }
492 
494  numpath_detIso_nvtx = inputdir + "/passProbes_EE_detIsoID_nVtx";
495  denpath_detIso_nvtx = inputdir + "/allProbes_EE_ID_nVtx";
496 
497  Numerator_detIso_nvtx = igetter.get(numpath_detIso_nvtx);
498  Denominator_detIso_nvtx = igetter.get(denpath_detIso_nvtx);
499 
500  if (Numerator_detIso_nvtx && Denominator_detIso_nvtx) {
501  TH1F *h_numerator_detIso_nvtx = Numerator_detIso_nvtx->getTH1F();
502  TH1F *h_denominator_detIso_nvtx = Denominator_detIso_nvtx->getTH1F();
503 
504  TH1F *h_eff_detIso_nvtx = h_eff_vtx_EE_detIsoID->getTH1F();
505 
506  if (h_eff_detIso_nvtx->GetSumw2N() == 0)
507  h_eff_detIso_nvtx->Sumw2();
508 
509  h_eff_detIso_nvtx->Divide(h_numerator_detIso_nvtx, h_denominator_detIso_nvtx, 1., 1., "B");
510  }
511 
513  numpath_pfIso_nvtx = inputdir + "/passProbes_EB_pfIsoID_nVtx";
514  denpath_pfIso_nvtx = inputdir + "/allProbes_EB_ID_nVtx";
515 
516  Numerator_pfIso_nvtx = igetter.get(numpath_pfIso_nvtx);
517  Denominator_pfIso_nvtx = igetter.get(denpath_pfIso_nvtx);
518 
519  if (Numerator_pfIso_nvtx && Denominator_pfIso_nvtx) {
520  TH1F *h_numerator_pfIso_nvtx = Numerator_pfIso_nvtx->getTH1F();
521  TH1F *h_denominator_pfIso_nvtx = Denominator_pfIso_nvtx->getTH1F();
522 
523  TH1F *h_eff_pfIso_nvtx = h_eff_vtx_EB_pfIsoID->getTH1F();
524 
525  if (h_eff_pfIso_nvtx->GetSumw2N() == 0)
526  h_eff_pfIso_nvtx->Sumw2();
527 
528  h_eff_pfIso_nvtx->Divide(h_numerator_pfIso_nvtx, h_denominator_pfIso_nvtx, 1., 1., "B");
529  }
530 
532  numpath_pfIso_nvtx = inputdir + "/passProbes_EE_pfIsoID_nVtx";
533  denpath_pfIso_nvtx = inputdir + "/allProbes_EE_ID_nVtx";
534 
535  Numerator_pfIso_nvtx = igetter.get(numpath_pfIso_nvtx);
536  Denominator_pfIso_nvtx = igetter.get(denpath_pfIso_nvtx);
537 
538  if (Numerator_pfIso_nvtx && Denominator_pfIso_nvtx) {
539  TH1F *h_numerator_pfIso_nvtx = Numerator_pfIso_nvtx->getTH1F();
540  TH1F *h_denominator_pfIso_nvtx = Denominator_pfIso_nvtx->getTH1F();
541 
542  TH1F *h_eff_pfIso_nvtx = h_eff_vtx_EE_pfIsoID->getTH1F();
543 
544  if (h_eff_pfIso_nvtx->GetSumw2N() == 0)
545  h_eff_pfIso_nvtx->Sumw2();
546 
547  h_eff_pfIso_nvtx->Divide(h_numerator_pfIso_nvtx, h_denominator_pfIso_nvtx, 1., 1., "B");
548  }
549 
551  string numpath_pfIsodB_pt = inputdir + "/passProbes_pfIsodBID_pt";
552  string denpath_pfIsodB_pt = inputdir + "/allProbes_ID_pt";
553 
554  MonitorElement *Numerator_pfIsodB_pt = igetter.get(numpath_pfIsodB_pt);
555  MonitorElement *Denominator_pfIsodB_pt = igetter.get(denpath_pfIsodB_pt);
556 
557  if (Numerator_pfIsodB_pt && Denominator_pfIsodB_pt) {
558  TH1F *h_numerator_pfIsodB_pt = Numerator_pfIsodB_pt->getTH1F();
559  TH1F *h_denominator_pfIsodB_pt = Denominator_pfIsodB_pt->getTH1F();
560 
561  TH1F *h_eff_pfIsodB_pt = h_eff_pt_pfIsodBID->getTH1F();
562 
563  if (h_eff_pfIsodB_pt->GetSumw2N() == 0)
564  h_eff_pfIsodB_pt->Sumw2();
565 
566  h_eff_pfIsodB_pt->Divide(h_numerator_pfIsodB_pt, h_denominator_pfIsodB_pt, 1., 1., "B");
567  }
568 
570 
571  string numpath_pfIsodB_EB_pt = inputdir + "/passProbes_EB_pfIsodBID_pt";
572  string denpath_pfIsodB_EB_pt = inputdir + "/allProbes_EB_ID_pt";
573 
574  MonitorElement *Numerator_pfIsodB_EB_pt = igetter.get(numpath_pfIsodB_EB_pt);
575  MonitorElement *Denominator_pfIsodB_EB_pt = igetter.get(denpath_pfIsodB_EB_pt);
576 
577  if (Numerator_pfIsodB_EB_pt && Denominator_pfIsodB_EB_pt) {
578  TH1F *h_numerator_pfIsodB_EB_pt = Numerator_pfIsodB_EB_pt->getTH1F();
579  TH1F *h_denominator_pfIsodB_EB_pt = Denominator_pfIsodB_EB_pt->getTH1F();
580 
581  TH1F *h_eff_pfIsodB_EB_pt = h_eff_pt_EB_pfIsodBID->getTH1F();
582 
583  if (h_eff_pfIsodB_EB_pt->GetSumw2N() == 0)
584  h_eff_pfIsodB_EB_pt->Sumw2();
585  h_eff_pfIsodB_EB_pt->Divide(h_numerator_pfIsodB_EB_pt, h_denominator_pfIsodB_EB_pt, 1., 1., "B");
586  }
587 
589  string numpath_pfIsodB_EE_pt = inputdir + "/passProbes_EE_pfIsodBID_pt";
590  string denpath_pfIsodB_EE_pt = inputdir + "/allProbes_EE_ID_pt";
591 
592  MonitorElement *Numerator_pfIsodB_EE_pt = igetter.get(numpath_pfIsodB_EE_pt);
593  MonitorElement *Denominator_pfIsodB_EE_pt = igetter.get(denpath_pfIsodB_EE_pt);
594 
595  if (Numerator_pfIsodB_EE_pt && Denominator_pfIsodB_EE_pt) {
596  TH1F *h_numerator_pfIsodB_EE_pt = Numerator_pfIsodB_EE_pt->getTH1F();
597  TH1F *h_denominator_pfIsodB_EE_pt = Denominator_pfIsodB_EE_pt->getTH1F();
598 
599  TH1F *h_eff_pfIsodB_EE_pt = h_eff_pt_EE_pfIsodBID->getTH1F();
600 
601  if (h_eff_pfIsodB_EE_pt->GetSumw2N() == 0)
602  h_eff_pfIsodB_EE_pt->Sumw2();
603 
604  h_eff_pfIsodB_EE_pt->Divide(h_numerator_pfIsodB_EE_pt, h_denominator_pfIsodB_EE_pt, 1., 1., "B");
605  }
606 
608 
609  string numpath_pfIsodB_nvtx = inputdir + "/passProbes_pfIsodBID_nVtx";
610  string denpath_pfIsodB_nvtx = inputdir + "/allProbes_ID_nVtx";
611 
612  MonitorElement *Numerator_pfIsodB_nvtx = igetter.get(numpath_pfIsodB_nvtx);
613  MonitorElement *Denominator_pfIsodB_nvtx = igetter.get(denpath_pfIsodB_nvtx);
614 
615  if (Numerator_pfIsodB_nvtx && Denominator_pfIsodB_nvtx) {
616  TH1F *h_numerator_pfIsodB_nvtx = Numerator_pfIsodB_nvtx->getTH1F();
617  TH1F *h_denominator_pfIsodB_nvtx = Denominator_pfIsodB_nvtx->getTH1F();
618 
619  TH1F *h_eff_pfIsodB_nvtx = h_eff_vtx_pfIsodBID->getTH1F();
620 
621  if (h_eff_pfIsodB_nvtx->GetSumw2N() == 0)
622  h_eff_pfIsodB_nvtx->Sumw2();
623 
624  h_eff_pfIsodB_nvtx->Divide(h_numerator_pfIsodB_nvtx, h_denominator_pfIsodB_nvtx, 1., 1., "B");
625  }
626 
628  numpath_pfIsodB_nvtx = inputdir + "/passProbes_EB_pfIsodBID_nVtx";
629  denpath_pfIsodB_nvtx = inputdir + "/allProbes_EB_ID_nVtx";
630 
631  Numerator_pfIsodB_nvtx = igetter.get(numpath_pfIsodB_nvtx);
632  Denominator_pfIsodB_nvtx = igetter.get(denpath_pfIsodB_nvtx);
633 
634  if (Numerator_pfIsodB_nvtx && Denominator_pfIsodB_nvtx) {
635  TH1F *h_numerator_pfIsodB_nvtx = Numerator_pfIsodB_nvtx->getTH1F();
636  TH1F *h_denominator_pfIsodB_nvtx = Denominator_pfIsodB_nvtx->getTH1F();
637 
638  TH1F *h_eff_pfIsodB_nvtx = h_eff_vtx_EB_pfIsodBID->getTH1F();
639 
640  if (h_eff_pfIsodB_nvtx->GetSumw2N() == 0)
641  h_eff_pfIsodB_nvtx->Sumw2();
642 
643  h_eff_pfIsodB_nvtx->Divide(h_numerator_pfIsodB_nvtx, h_denominator_pfIsodB_nvtx, 1., 1., "B");
644  }
645 
647  numpath_pfIsodB_nvtx = inputdir + "/passProbes_EE_pfIsodBID_nVtx";
648  denpath_pfIsodB_nvtx = inputdir + "/allProbes_EE_ID_nVtx";
649 
650  Numerator_pfIsodB_nvtx = igetter.get(numpath_pfIsodB_nvtx);
651  Denominator_pfIsodB_nvtx = igetter.get(denpath_pfIsodB_nvtx);
652 
653  if (Numerator_pfIsodB_nvtx && Denominator_pfIsodB_nvtx) {
654  TH1F *h_numerator_pfIsodB_nvtx = Numerator_pfIsodB_nvtx->getTH1F();
655  TH1F *h_denominator_pfIsodB_nvtx = Denominator_pfIsodB_nvtx->getTH1F();
656 
657  TH1F *h_eff_pfIsodB_nvtx = h_eff_vtx_EE_pfIsodBID->getTH1F();
658 
659  if (h_eff_pfIsodB_nvtx->GetSumw2N() == 0)
660  h_eff_pfIsodB_nvtx->Sumw2();
661 
662  h_eff_pfIsodB_nvtx->Divide(h_numerator_pfIsodB_nvtx, h_denominator_pfIsodB_nvtx, 1., 1., "B");
663  }
664 }
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:29
Handle.h
ALCARECOTkAlBeamHalo_cff.etaMin
etaMin
GeV.
Definition: ALCARECOTkAlBeamHalo_cff.py:32
MessageLogger.h
ESHandle.h
etaBin
int etaBin(const l1t::HGCalMulticluster *cl)
Definition: L1EGammaEEProducer.cc:19
BeamMonitor_cff.phiBin
phiBin
Definition: BeamMonitor_cff.py:75
edm
HLT enums.
Definition: AlignableModifier.h:19
EfficiencyPlotter::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
DQM Client Diagnostic.
Definition: EfficiencyPlotter.cc:54
EfficencyPlotter_cfi.vtxMax
vtxMax
Definition: EfficencyPlotter_cfi.py:17
gather_cfg.cout
cout
Definition: gather_cfg.py:144
dqm::impl::MonitorElement::setEfficiencyFlag
void setEfficiencyFlag()
Definition: MonitorElement.h:267
EfficiencyPlotter::~EfficiencyPlotter
~EfficiencyPlotter() override
Destructor.
Definition: EfficiencyPlotter.cc:52
ptMin
constexpr float ptMin
Definition: PhotonIDValueMapProducer.cc:155
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
DQMStore.h
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
EfficiencyPlotter::EfficiencyPlotter
EfficiencyPlotter(const edm::ParameterSet &ps)
Constructor.
Definition: EfficiencyPlotter.cc:27
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:478
muonRecoAnalyzer_cfi.ptBin
ptBin
Definition: muonRecoAnalyzer_cfi.py:45
MakerMacros.h
AlignmentTrackSelector_cfi.ptMax
ptMax
Definition: AlignmentTrackSelector_cfi.py:12
AlignmentTrackSelector_cfi.phiMin
phiMin
Definition: AlignmentTrackSelector_cfi.py:18
Run.h
AlignmentTrackSelector_cfi.phiMax
phiMax
Definition: AlignmentTrackSelector_cfi.py:17
EfficencyPlotter_cfi.vtxBin
vtxBin
Definition: EfficencyPlotter_cfi.py:15
EfficencyPlotter_cfi.vtxMin
vtxMin
Definition: EfficencyPlotter_cfi.py:16
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
EfficiencyPlotter.h
std
Definition: JetResolutionObject.h:76
dqm::implementation::IGetter
Definition: DQMStore.h:484
ALCARECOTkAlBeamHalo_cff.etaMax
etaMax
Definition: ALCARECOTkAlBeamHalo_cff.py:33
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
EventSetup.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
ParameterSet.h
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98