CMS 3D CMS Logo

Primary4DVertexHarvester.cc
Go to the documentation of this file.
1 #include <string>
2 
7 
10 
12 
14 public:
15  explicit Primary4DVertexHarvester(const edm::ParameterSet& iConfig);
16  ~Primary4DVertexHarvester() override;
17 
18  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
19 
20 protected:
22 
23 private:
25 
26  void incrementME(MonitorElement* base, MonitorElement* toBeAdded);
27 
29 
30  // --- Histograms
35 
39 
43 
48 
53 
58 
63 
68 
73 
78 
83 
87 
91 };
92 
93 // ------------ constructor and destructor --------------
95  : folder_(iConfig.getParameter<std::string>("folder")) {}
96 
98 
99 // auxiliary method to compute efficiency from the ratio of two 1D MonitorElement
101  for (int ibin = 1; ibin <= den->getNbinsX(); ibin++) {
102  double eff = num->getBinContent(ibin) / den->getBinContent(ibin);
103  double bin_err = sqrt((num->getBinContent(ibin) * (den->getBinContent(ibin) - num->getBinContent(ibin))) /
104  pow(den->getBinContent(ibin), 3));
105  if (den->getBinContent(ibin) == 0) {
106  eff = 0;
107  bin_err = 0;
108  }
109  result->setBinContent(ibin, eff);
110  result->setBinError(ibin, bin_err);
111  }
112 }
113 
114 // auxiliary method to add 1D MonitorElement toBeAdded to a base ME
116  for (int ibin = 1; ibin <= base->getNbinsX(); ibin++) {
117  double newC = base->getBinContent(ibin) + toBeAdded->getBinContent(ibin);
118  double newE = std::sqrt(newC);
119  base->setBinContent(ibin, newC);
120  base->setBinError(ibin, newE);
121  }
122 }
123 
124 // ------------ endjob tasks ----------------------------
126  // --- Get the monitoring histograms
127  MonitorElement* meTrackEffPtTot = igetter.get(folder_ + "EffPtTot");
128  MonitorElement* meTrackMatchedTPEffPtTot = igetter.get(folder_ + "MatchedTPEffPtTot");
129  MonitorElement* meTrackMatchedTPEffPtMtd = igetter.get(folder_ + "MatchedTPEffPtMtd");
130  MonitorElement* meTrackEffEtaTot = igetter.get(folder_ + "EffEtaTot");
131  MonitorElement* meTrackMatchedTPEffEtaTot = igetter.get(folder_ + "MatchedTPEffEtaTot");
132  MonitorElement* meTrackMatchedTPEffEtaMtd = igetter.get(folder_ + "MatchedTPEffEtaMtd");
133  MonitorElement* meRecoVtxVsLineDensity = igetter.get(folder_ + "RecoVtxVsLineDensity");
134  MonitorElement* meRecVerNumber = igetter.get(folder_ + "RecVerNumber");
135 
136  if (!meTrackEffPtTot || !meTrackMatchedTPEffPtTot || !meTrackMatchedTPEffPtMtd || !meTrackEffEtaTot ||
137  !meTrackMatchedTPEffEtaTot || !meTrackMatchedTPEffEtaMtd || !meRecoVtxVsLineDensity || !meRecVerNumber) {
138  edm::LogError("Primary4DVertexHarvester") << "Monitoring histograms not found!" << std::endl;
139  return;
140  }
141 
142  // Normalize line density plot
143  double nEvt = meRecVerNumber->getEntries();
144  if (nEvt > 0.) {
145  nEvt = 1. / nEvt;
146  double nEntries = meRecoVtxVsLineDensity->getEntries();
147  for (int ibin = 1; ibin <= meRecoVtxVsLineDensity->getNbinsX(); ibin++) {
148  double cont = meRecoVtxVsLineDensity->getBinContent(ibin) * nEvt;
149  double bin_err = meRecoVtxVsLineDensity->getBinError(ibin) * nEvt;
150  meRecoVtxVsLineDensity->setBinContent(ibin, cont);
151  meRecoVtxVsLineDensity->setBinError(ibin, bin_err);
152  }
153  meRecoVtxVsLineDensity->setEntries(nEntries);
154  }
155 
156  // --- Book histograms
157  ibook.cd(folder_);
158  meTPPtSelEff_ = ibook.book1D("TPPtSelEff",
159  "Track associated to LV selected efficiency TP VS Pt;Pt [GeV];Efficiency",
160  meTrackEffPtTot->getNbinsX(),
161  meTrackEffPtTot->getTH1()->GetXaxis()->GetXmin(),
162  meTrackEffPtTot->getTH1()->GetXaxis()->GetXmax());
163  meTPPtSelEff_->getTH1()->SetMinimum(0.);
164  computeEfficiency1D(meTrackMatchedTPEffPtTot, meTrackEffPtTot, meTPPtSelEff_);
165 
166  meTPEtaSelEff_ = ibook.book1D("TPEtaSelEff",
167  "Track associated to LV selected efficiency TP VS Eta;Eta;Efficiency",
168  meTrackEffEtaTot->getNbinsX(),
169  meTrackEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
170  meTrackEffEtaTot->getTH1()->GetXaxis()->GetXmax());
171  meTPEtaSelEff_->getTH1()->SetMinimum(0.);
172  computeEfficiency1D(meTrackMatchedTPEffEtaTot, meTrackEffEtaTot, meTPEtaSelEff_);
173 
174  meTPPtMatchEff_ = ibook.book1D("TPPtMatchEff",
175  "Track associated to LV matched to TP efficiency VS Pt;Pt [GeV];Efficiency",
176  meTrackMatchedTPEffPtTot->getNbinsX(),
177  meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmin(),
178  meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmax());
179  meTPPtMatchEff_->getTH1()->SetMinimum(0.);
180  computeEfficiency1D(meTrackMatchedTPEffPtMtd, meTrackMatchedTPEffPtTot, meTPPtMatchEff_);
181 
182  meTPEtaMatchEff_ = ibook.book1D("TPEtaMatchEff",
183  "Track associated to LV matched to TP efficiency VS Eta;Eta;Efficiency",
184  meTrackMatchedTPEffEtaTot->getNbinsX(),
185  meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
186  meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmax());
187  meTPEtaMatchEff_->getTH1()->SetMinimum(0.);
188  computeEfficiency1D(meTrackMatchedTPEffEtaMtd, meTrackMatchedTPEffEtaTot, meTPEtaMatchEff_);
189 
190  MonitorElement* meBarrelPIDp = igetter.get(folder_ + "BarrelPIDp");
191  MonitorElement* meEndcapPIDp = igetter.get(folder_ + "EndcapPIDp");
192 
193  MonitorElement* meBarrelTruePiNoPID = igetter.get(folder_ + "BarrelTruePiNoPID");
194  MonitorElement* meBarrelTrueKNoPID = igetter.get(folder_ + "BarrelTrueKNoPID");
195  MonitorElement* meBarrelTruePNoPID = igetter.get(folder_ + "BarrelTruePNoPID");
196  MonitorElement* meEndcapTruePiNoPID = igetter.get(folder_ + "EndcapTruePiNoPID");
197  MonitorElement* meEndcapTrueKNoPID = igetter.get(folder_ + "EndcapTrueKNoPID");
198  MonitorElement* meEndcapTruePNoPID = igetter.get(folder_ + "EndcapTruePNoPID");
199 
200  MonitorElement* meBarrelTruePiAsPi = igetter.get(folder_ + "BarrelTruePiAsPi");
201  MonitorElement* meBarrelTrueKAsPi = igetter.get(folder_ + "BarrelTrueKAsPi");
202  MonitorElement* meBarrelTruePAsPi = igetter.get(folder_ + "BarrelTruePAsPi");
203  MonitorElement* meEndcapTruePiAsPi = igetter.get(folder_ + "EndcapTruePiAsPi");
204  MonitorElement* meEndcapTrueKAsPi = igetter.get(folder_ + "EndcapTrueKAsPi");
205  MonitorElement* meEndcapTruePAsPi = igetter.get(folder_ + "EndcapTruePAsPi");
206 
207  MonitorElement* meBarrelTruePiAsK = igetter.get(folder_ + "BarrelTruePiAsK");
208  MonitorElement* meBarrelTrueKAsK = igetter.get(folder_ + "BarrelTrueKAsK");
209  MonitorElement* meBarrelTruePAsK = igetter.get(folder_ + "BarrelTruePAsK");
210  MonitorElement* meEndcapTruePiAsK = igetter.get(folder_ + "EndcapTruePiAsK");
211  MonitorElement* meEndcapTrueKAsK = igetter.get(folder_ + "EndcapTrueKAsK");
212  MonitorElement* meEndcapTruePAsK = igetter.get(folder_ + "EndcapTruePAsK");
213 
214  MonitorElement* meBarrelTruePiAsP = igetter.get(folder_ + "BarrelTruePiAsP");
215  MonitorElement* meBarrelTrueKAsP = igetter.get(folder_ + "BarrelTrueKAsP");
216  MonitorElement* meBarrelTruePAsP = igetter.get(folder_ + "BarrelTruePAsP");
217  MonitorElement* meEndcapTruePiAsP = igetter.get(folder_ + "EndcapTruePiAsP");
218  MonitorElement* meEndcapTrueKAsP = igetter.get(folder_ + "EndcapTrueKAsP");
219  MonitorElement* meEndcapTruePAsP = igetter.get(folder_ + "EndcapTruePAsP");
220 
221  if (!meBarrelPIDp || !meEndcapPIDp || !meBarrelTruePiNoPID || !meBarrelTrueKNoPID || !meBarrelTruePNoPID ||
222  !meEndcapTruePiNoPID || !meEndcapTrueKNoPID || !meEndcapTruePNoPID || !meBarrelTruePiAsPi || !meBarrelTrueKAsPi ||
223  !meBarrelTruePAsPi || !meEndcapTruePiAsPi || !meEndcapTrueKAsPi || !meEndcapTruePAsPi || !meBarrelTruePiAsK ||
224  !meBarrelTrueKAsK || !meBarrelTruePAsK || !meEndcapTruePiAsK || !meEndcapTrueKAsK || !meEndcapTruePAsK ||
225  !meBarrelTruePiAsP || !meBarrelTrueKAsP || !meBarrelTruePAsP || !meEndcapTruePiAsP || !meEndcapTrueKAsP ||
226  !meEndcapTruePAsP) {
227  edm::LogWarning("Primary4DVertexHarvester") << "PID Monitoring histograms not found!" << std::endl;
228  return;
229  }
230 
231  meBarrelTruePi_ = ibook.book1D("BarrelTruePi",
232  "Barrel True Pi P;P [GeV]",
233  meBarrelPIDp->getNbinsX(),
234  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
235  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
236  incrementME(meBarrelTruePi_, meBarrelTruePiAsPi);
237  incrementME(meBarrelTruePi_, meBarrelTruePiAsK);
238  incrementME(meBarrelTruePi_, meBarrelTruePiAsP);
239  incrementME(meBarrelTruePi_, meBarrelTruePiNoPID);
240 
241  meEndcapTruePi_ = ibook.book1D("EndcapTruePi",
242  "Endcap True Pi P;P [GeV]",
243  meBarrelPIDp->getNbinsX(),
244  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
245  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
246  incrementME(meEndcapTruePi_, meEndcapTruePiAsPi);
247  incrementME(meEndcapTruePi_, meEndcapTruePiAsK);
248  incrementME(meEndcapTruePi_, meEndcapTruePiAsP);
249  incrementME(meEndcapTruePi_, meEndcapTruePiNoPID);
250 
251  meBarrelTrueK_ = ibook.book1D("BarrelTrueK",
252  "Barrel True K P;P [GeV]",
253  meBarrelPIDp->getNbinsX(),
254  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
255  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
256  incrementME(meBarrelTrueK_, meBarrelTrueKAsPi);
257  incrementME(meBarrelTrueK_, meBarrelTrueKAsK);
258  incrementME(meBarrelTrueK_, meBarrelTrueKAsP);
259  incrementME(meBarrelTrueK_, meBarrelTrueKNoPID);
260 
261  meEndcapTrueK_ = ibook.book1D("EndcapTrueK",
262  "Endcap True K P;P [GeV]",
263  meBarrelPIDp->getNbinsX(),
264  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
265  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
266  incrementME(meEndcapTrueK_, meEndcapTrueKAsPi);
267  incrementME(meEndcapTrueK_, meEndcapTrueKAsK);
268  incrementME(meEndcapTrueK_, meEndcapTrueKAsP);
269  incrementME(meEndcapTrueK_, meEndcapTrueKNoPID);
270 
271  meBarrelTrueP_ = ibook.book1D("BarrelTrueP",
272  "Barrel True P P;P [GeV]",
273  meBarrelPIDp->getNbinsX(),
274  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
275  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
276  incrementME(meBarrelTrueP_, meBarrelTruePAsPi);
277  incrementME(meBarrelTrueP_, meBarrelTruePAsK);
278  incrementME(meBarrelTrueP_, meBarrelTruePAsP);
279  incrementME(meBarrelTrueP_, meBarrelTruePNoPID);
280 
281  meEndcapTrueP_ = ibook.book1D("EndcapTrueP",
282  "Endcap True P P;P [GeV]",
283  meBarrelPIDp->getNbinsX(),
284  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
285  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
286  incrementME(meEndcapTrueP_, meEndcapTruePAsPi);
287  incrementME(meEndcapTrueP_, meEndcapTruePAsK);
288  incrementME(meEndcapTrueP_, meEndcapTruePAsP);
289  incrementME(meEndcapTrueP_, meEndcapTruePNoPID);
290 
291  meBarrelPIDPiAsPiEff_ = ibook.book1D("BarrelPIDPiAsPiEff",
292  "Barrel True pi as pi id. fraction VS P;P [GeV]",
293  meBarrelPIDp->getNbinsX(),
294  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
295  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
296  meBarrelPIDPiAsPiEff_->getTH1()->SetMinimum(0.);
298 
299  meBarrelPIDPiAsKEff_ = ibook.book1D("BarrelPIDPiAsKEff",
300  "Barrel True pi as k id. fraction VS P;P [GeV]",
301  meBarrelPIDp->getNbinsX(),
302  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
303  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
304  meBarrelPIDPiAsKEff_->getTH1()->SetMinimum(0.);
306 
307  meBarrelPIDPiAsPEff_ = ibook.book1D("BarrelPIDPiAsPEff",
308  "Barrel True pi as p id. fraction VS P;P [GeV]",
309  meBarrelPIDp->getNbinsX(),
310  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
311  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
312  meBarrelPIDPiAsPEff_->getTH1()->SetMinimum(0.);
314 
315  meBarrelPIDPiNoPIDEff_ = ibook.book1D("BarrelPIDPiNoPIDEff",
316  "Barrel True pi no PID id. fraction VS P;P [GeV]",
317  meBarrelPIDp->getNbinsX(),
318  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
319  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
320  meBarrelPIDPiNoPIDEff_->getTH1()->SetMinimum(0.);
322 
323  meBarrelPIDKAsPiEff_ = ibook.book1D("BarrelPIDKAsPiEff",
324  "Barrel True k as pi id. fraction VS P;P [GeV]",
325  meBarrelPIDp->getNbinsX(),
326  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
327  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
328  meBarrelPIDKAsPiEff_->getTH1()->SetMinimum(0.);
330 
331  meBarrelPIDKAsKEff_ = ibook.book1D("BarrelPIDKAsKEff",
332  "Barrel True k as k id. fraction VS P;P [GeV]",
333  meBarrelPIDp->getNbinsX(),
334  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
335  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
336  meBarrelPIDKAsKEff_->getTH1()->SetMinimum(0.);
338 
339  meBarrelPIDKAsPEff_ = ibook.book1D("BarrelPIDKAsPEff",
340  "Barrel True k as p id. fraction VS P;P [GeV]",
341  meBarrelPIDp->getNbinsX(),
342  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
343  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
344  meBarrelPIDKAsPEff_->getTH1()->SetMinimum(0.);
346 
347  meBarrelPIDKNoPIDEff_ = ibook.book1D("BarrelPIDKNoPIDEff",
348  "Barrel True k no PID id. fraction VS P;P [GeV]",
349  meBarrelPIDp->getNbinsX(),
350  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
351  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
352  meBarrelPIDKNoPIDEff_->getTH1()->SetMinimum(0.);
354 
355  meBarrelPIDPAsPiEff_ = ibook.book1D("BarrelPIDPAsPiEff",
356  "Barrel True p as pi id. fraction VS P;P [GeV]",
357  meBarrelPIDp->getNbinsX(),
358  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
359  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
360  meBarrelPIDPAsPiEff_->getTH1()->SetMinimum(0.);
362 
363  meBarrelPIDPAsKEff_ = ibook.book1D("BarrelPIDPAsKEff",
364  "Barrel True p as k id. fraction VS P;P [GeV]",
365  meBarrelPIDp->getNbinsX(),
366  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
367  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
368  meBarrelPIDPAsKEff_->getTH1()->SetMinimum(0.);
370 
371  meBarrelPIDPAsPEff_ = ibook.book1D("BarrelPIDPAsPEff",
372  "Barrel True p as p id. fraction VS P;P [GeV]",
373  meBarrelPIDp->getNbinsX(),
374  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
375  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
376  meBarrelPIDPAsPEff_->getTH1()->SetMinimum(0.);
378 
379  meBarrelPIDPNoPIDEff_ = ibook.book1D("BarrelPIDPNoPIDEff",
380  "Barrel True p no PID id. fraction VS P;P [GeV]",
381  meBarrelPIDp->getNbinsX(),
382  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
383  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
384  meBarrelPIDPNoPIDEff_->getTH1()->SetMinimum(0.);
386 
387  meEndcapPIDPiAsPiEff_ = ibook.book1D("EndcapPIDPiAsPiEff",
388  "Endcap True pi as pi id. fraction VS P;P [GeV]",
389  meBarrelPIDp->getNbinsX(),
390  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
391  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
392  meEndcapPIDPiAsPiEff_->getTH1()->SetMinimum(0.);
394 
395  meEndcapPIDPiAsKEff_ = ibook.book1D("EndcapPIDPiAsKEff",
396  "Endcap True pi as k id. fraction VS P;P [GeV]",
397  meBarrelPIDp->getNbinsX(),
398  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
399  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
400  meEndcapPIDPiAsKEff_->getTH1()->SetMinimum(0.);
402 
403  meEndcapPIDPiAsPEff_ = ibook.book1D("EndcapPIDPiAsPEff",
404  "Endcap True pi as p id. fraction VS P;P [GeV]",
405  meBarrelPIDp->getNbinsX(),
406  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
407  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
408  meEndcapPIDPiAsPEff_->getTH1()->SetMinimum(0.);
410 
411  meEndcapPIDPiNoPIDEff_ = ibook.book1D("EndcapPIDPiNoPIDEff",
412  "Endcap True pi no PID id. fraction VS P;P [GeV]",
413  meBarrelPIDp->getNbinsX(),
414  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
415  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
416  meEndcapPIDPiNoPIDEff_->getTH1()->SetMinimum(0.);
418 
419  meEndcapPIDKAsPiEff_ = ibook.book1D("EndcapPIDKAsPiEff",
420  "Endcap True k as pi id. fraction VS P;P [GeV]",
421  meBarrelPIDp->getNbinsX(),
422  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
423  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
424  meEndcapPIDKAsPiEff_->getTH1()->SetMinimum(0.);
426 
427  meEndcapPIDKAsKEff_ = ibook.book1D("EndcapPIDKAsKEff",
428  "Endcap True k as k id. fraction VS P;P [GeV]",
429  meBarrelPIDp->getNbinsX(),
430  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
431  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
432  meEndcapPIDKAsKEff_->getTH1()->SetMinimum(0.);
434 
435  meEndcapPIDKAsPEff_ = ibook.book1D("EndcapPIDKAsPEff",
436  "Endcap True k as p id. fraction VS P;P [GeV]",
437  meBarrelPIDp->getNbinsX(),
438  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
439  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
440  meEndcapPIDKAsPEff_->getTH1()->SetMinimum(0.);
442 
443  meEndcapPIDKNoPIDEff_ = ibook.book1D("EndcapPIDKNoPIDEff",
444  "Endcap True k no PID id. fraction VS P;P [GeV]",
445  meBarrelPIDp->getNbinsX(),
446  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
447  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
448  meEndcapPIDKNoPIDEff_->getTH1()->SetMinimum(0.);
450 
451  meEndcapPIDPAsPiEff_ = ibook.book1D("EndcapPIDPAsPiEff",
452  "Endcap True p as pi id. fraction VS P;P [GeV]",
453  meBarrelPIDp->getNbinsX(),
454  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
455  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
456  meEndcapPIDPAsPiEff_->getTH1()->SetMinimum(0.);
458 
459  meEndcapPIDPAsKEff_ = ibook.book1D("EndcapPIDPAsKEff",
460  "Endcap True p as k id. fraction VS P;P [GeV]",
461  meBarrelPIDp->getNbinsX(),
462  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
463  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
464  meEndcapPIDPAsKEff_->getTH1()->SetMinimum(0.);
466 
467  meEndcapPIDPAsPEff_ = ibook.book1D("EndcapPIDPAsPEff",
468  "Endcap True p as p id. fraction VS P;P [GeV]",
469  meBarrelPIDp->getNbinsX(),
470  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
471  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
472  meEndcapPIDPAsPEff_->getTH1()->SetMinimum(0.);
474 
475  meEndcapPIDPNoPIDEff_ = ibook.book1D("EndcapPIDPNoPIDEff",
476  "Endcap True p no PID id. fraction VS P;P [GeV]",
477  meBarrelPIDp->getNbinsX(),
478  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
479  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
480  meEndcapPIDPNoPIDEff_->getTH1()->SetMinimum(0.);
482 
483  meBarrelAsPi_ = ibook.book1D("BarrelAsPi",
484  "Barrel Identified Pi P;P [GeV]",
485  meBarrelPIDp->getNbinsX(),
486  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
487  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
488  incrementME(meBarrelAsPi_, meBarrelTruePiAsPi);
489  incrementME(meBarrelAsPi_, meBarrelTrueKAsPi);
490  incrementME(meBarrelAsPi_, meBarrelTruePAsPi);
491 
492  meEndcapAsPi_ = ibook.book1D("EndcapAsPi",
493  "Endcap Identified Pi P;P [GeV]",
494  meBarrelPIDp->getNbinsX(),
495  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
496  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
497  incrementME(meEndcapAsPi_, meEndcapTruePiAsPi);
498  incrementME(meEndcapAsPi_, meEndcapTrueKAsPi);
499  incrementME(meEndcapAsPi_, meEndcapTruePAsPi);
500 
501  meBarrelAsK_ = ibook.book1D("BarrelAsK",
502  "Barrel Identified K P;P [GeV]",
503  meBarrelPIDp->getNbinsX(),
504  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
505  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
506  incrementME(meBarrelAsK_, meBarrelTruePiAsK);
507  incrementME(meBarrelAsK_, meBarrelTrueKAsK);
508  incrementME(meBarrelAsK_, meBarrelTruePAsK);
509 
510  meEndcapAsK_ = ibook.book1D("EndcapAsK",
511  "Endcap Identified K P;P [GeV]",
512  meBarrelPIDp->getNbinsX(),
513  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
514  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
515  incrementME(meEndcapAsK_, meEndcapTruePiAsK);
516  incrementME(meEndcapAsK_, meEndcapTrueKAsK);
517  incrementME(meEndcapAsK_, meEndcapTruePAsK);
518 
519  meBarrelAsP_ = ibook.book1D("BarrelAsP",
520  "Barrel Identified P P;P [GeV]",
521  meBarrelPIDp->getNbinsX(),
522  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
523  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
524  incrementME(meBarrelAsP_, meBarrelTruePiAsP);
525  incrementME(meBarrelAsP_, meBarrelTrueKAsP);
526  incrementME(meBarrelAsP_, meBarrelTruePAsP);
527 
528  meEndcapAsP_ = ibook.book1D("EndcapAsP",
529  "Endcap Identified P P;P [GeV]",
530  meBarrelPIDp->getNbinsX(),
531  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
532  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
533  incrementME(meEndcapAsP_, meEndcapTruePiAsP);
534  incrementME(meEndcapAsP_, meEndcapTrueKAsP);
535  incrementME(meEndcapAsP_, meEndcapTruePAsP);
536 
537  meBarrelNoPID_ = ibook.book1D("BarrelNoPID",
538  "Barrel NoPID P;P [GeV]",
539  meBarrelPIDp->getNbinsX(),
540  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
541  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
542  incrementME(meBarrelNoPID_, meBarrelTruePiNoPID);
543  incrementME(meBarrelNoPID_, meBarrelTrueKNoPID);
544  incrementME(meBarrelNoPID_, meBarrelTruePNoPID);
545 
546  meEndcapNoPID_ = ibook.book1D("EndcapNoPID",
547  "Endcap NoPID P;P [GeV]",
548  meBarrelPIDp->getNbinsX(),
549  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
550  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
551  incrementME(meEndcapNoPID_, meEndcapTruePiNoPID);
552  incrementME(meEndcapNoPID_, meEndcapTrueKNoPID);
553  incrementME(meEndcapNoPID_, meEndcapTruePNoPID);
554 
555  meBarrelPiPurity_ = ibook.book1D("BarrelPiPurity",
556  "Barrel pi id. fraction true pi VS P;P [GeV]",
557  meBarrelPIDp->getNbinsX(),
558  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
559  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
560  meBarrelPiPurity_->getTH1()->SetMinimum(0.);
562 
563  meBarrelKPurity_ = ibook.book1D("BarrelKPurity",
564  "Barrel k id. fraction true k VS P;P [GeV]",
565  meBarrelPIDp->getNbinsX(),
566  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
567  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
568  meBarrelKPurity_->getTH1()->SetMinimum(0.);
570 
571  meBarrelPPurity_ = ibook.book1D("BarrelPPurity",
572  "Barrel p id. fraction true p VS P;P [GeV]",
573  meBarrelPIDp->getNbinsX(),
574  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
575  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
576  meBarrelPPurity_->getTH1()->SetMinimum(0.);
578 
579  meEndcapPiPurity_ = ibook.book1D("EndcapPiPurity",
580  "Endcap pi id. fraction true pi VS P;P [GeV]",
581  meEndcapPIDp->getNbinsX(),
582  meEndcapPIDp->getTH1()->GetXaxis()->GetXmin(),
583  meEndcapPIDp->getTH1()->GetXaxis()->GetXmax());
584  meEndcapPiPurity_->getTH1()->SetMinimum(0.);
586 
587  meEndcapKPurity_ = ibook.book1D("EndcapKPurity",
588  "Endcap k id. fraction true k VS P;P [GeV]",
589  meEndcapPIDp->getNbinsX(),
590  meEndcapPIDp->getTH1()->GetXaxis()->GetXmin(),
591  meEndcapPIDp->getTH1()->GetXaxis()->GetXmax());
592  meEndcapKPurity_->getTH1()->SetMinimum(0.);
594 
595  meEndcapPPurity_ = ibook.book1D("EndcapPPurity",
596  "Endcap p id. fraction true p VS P;P [GeV]",
597  meEndcapPIDp->getNbinsX(),
598  meEndcapPIDp->getTH1()->GetXaxis()->GetXmin(),
599  meEndcapPIDp->getTH1()->GetXaxis()->GetXmax());
600  meEndcapPPurity_->getTH1()->SetMinimum(0.);
602 }
603 
604 // ------------ method fills 'descriptions' with the allowed parameters for the module ----------
607 
608  desc.add<std::string>("folder", "MTD/Vertices/");
609 
610  descriptions.add("Primary4DVertexPostProcessor", desc);
611 }
612 
std::string folder_
virtual void setEntries(double nentries)
set # of entries
Primary4DVertexHarvester(const edm::ParameterSet &iConfig)
void computeEfficiency1D(MonitorElement *num, MonitorElement *den, MonitorElement *result)
Log< level::Error, false > LogError
T sqrt(T t)
Definition: SSEVec.h:23
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
virtual double getEntries() const
get # of entries
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
void incrementME(MonitorElement *base, MonitorElement *toBeAdded)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
virtual TH1 * getTH1() const
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
virtual int getNbinsX() const
get # of bins in X-axis
virtual double getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
virtual void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
Log< level::Warning, false > LogWarning
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
cont
load Luminosity info ##
Definition: generateEDF.py:620
virtual double getBinContent(int binx) const
get content of bin (1-D)