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  void scaleby(MonitorElement* h, double scale);
26 
27  void incrementME(MonitorElement* base, MonitorElement* toBeAdded);
28 
30 
31  // --- Histograms
36 
40 
44 
49 
54 
59 
64 
69 
74 
79 
84 
88 
92 };
93 
94 // ------------ constructor and destructor --------------
96  : folder_(iConfig.getParameter<std::string>("folder")) {}
97 
99 
100 // auxiliary method to compute efficiency from the ratio of two 1D MonitorElement
102  for (int ibin = 1; ibin <= den->getNbinsX(); ibin++) {
103  double eff = num->getBinContent(ibin) / den->getBinContent(ibin);
104  double bin_err = sqrt((num->getBinContent(ibin) * (den->getBinContent(ibin) - num->getBinContent(ibin))) /
105  pow(den->getBinContent(ibin), 3));
106  if (den->getBinContent(ibin) == 0) {
107  eff = 0;
108  bin_err = 0;
109  }
110  result->setBinContent(ibin, eff);
111  result->setBinError(ibin, bin_err);
112  }
113 }
114 
116  double ent = h->getEntries();
117  for (int ibin = 1; ibin <= h->getNbinsX(); ibin++) {
118  double eff = h->getBinContent(ibin) * scale;
119  double bin_err = h->getBinError(ibin) * scale;
120  h->setBinContent(ibin, eff);
121  h->setBinError(ibin, bin_err);
122  }
123  h->setEntries(ent);
124 }
125 
126 // auxiliary method to add 1D MonitorElement toBeAdded to a base ME
128  for (int ibin = 1; ibin <= base->getNbinsX(); ibin++) {
129  double newC = base->getBinContent(ibin) + toBeAdded->getBinContent(ibin);
130  double newE = std::sqrt(newC);
131  base->setBinContent(ibin, newC);
132  base->setBinError(ibin, newE);
133  }
134 }
135 
136 // ------------ endjob tasks ----------------------------
138  // --- Get the monitoring histograms
139  MonitorElement* meTrackEffPtTot = igetter.get(folder_ + "EffPtTot");
140  MonitorElement* meTrackMatchedTPEffPtTot = igetter.get(folder_ + "MatchedTPEffPtTot");
141  MonitorElement* meTrackMatchedTPEffPtMtd = igetter.get(folder_ + "MatchedTPEffPtMtd");
142  MonitorElement* meTrackEffEtaTot = igetter.get(folder_ + "EffEtaTot");
143  MonitorElement* meTrackMatchedTPEffEtaTot = igetter.get(folder_ + "MatchedTPEffEtaTot");
144  MonitorElement* meTrackMatchedTPEffEtaMtd = igetter.get(folder_ + "MatchedTPEffEtaMtd");
145  MonitorElement* meRecVerNumber = igetter.get(folder_ + "RecVerNumber");
146  MonitorElement* meRecVerZ = igetter.get(folder_ + "recPVZ");
147  MonitorElement* meRecVerT = igetter.get(folder_ + "recPVT");
148  MonitorElement* meSimVerNumber = igetter.get(folder_ + "SimVerNumber");
149  MonitorElement* meSimVerZ = igetter.get(folder_ + "simPVZ");
150  MonitorElement* meSimVerT = igetter.get(folder_ + "simPVT");
151 
152  if (!meTrackEffPtTot || !meTrackMatchedTPEffPtTot || !meTrackMatchedTPEffPtMtd || !meTrackEffEtaTot ||
153  !meTrackMatchedTPEffEtaTot || !meTrackMatchedTPEffEtaMtd || !meRecVerNumber || !meRecVerZ || !meRecVerT ||
154  !meSimVerNumber || !meSimVerZ || !meSimVerT) {
155  edm::LogError("Primary4DVertexHarvester") << "Monitoring histograms not found!" << std::endl;
156  return;
157  }
158 
159  // Normalize z,time multiplicty plots to get correct line densities
160  double scale = meRecVerNumber->getTH1F()->Integral();
161  scale = (scale > 0.) ? 1. / scale : 0.;
162  if (scale > 0.) {
163  scaleby(meRecVerZ, scale);
164  scaleby(meRecVerT, scale);
165  }
166  scale = meSimVerNumber->getTH1F()->Integral();
167  scale = (scale > 0.) ? 1. / scale : 0.;
168  if (scale > 0.) {
169  scaleby(meSimVerZ, scale);
170  scaleby(meSimVerT, scale);
171  }
172 
173  // --- Book histograms
174  ibook.cd(folder_);
175  meTPPtSelEff_ = ibook.book1D("TPPtSelEff",
176  "Track associated to LV selected efficiency TP VS Pt;Pt [GeV];Efficiency",
177  meTrackEffPtTot->getNbinsX(),
178  meTrackEffPtTot->getTH1()->GetXaxis()->GetXmin(),
179  meTrackEffPtTot->getTH1()->GetXaxis()->GetXmax());
180  meTPPtSelEff_->getTH1()->SetMinimum(0.);
181  computeEfficiency1D(meTrackMatchedTPEffPtTot, meTrackEffPtTot, meTPPtSelEff_);
182 
183  meTPEtaSelEff_ = ibook.book1D("TPEtaSelEff",
184  "Track associated to LV selected efficiency TP VS Eta;Eta;Efficiency",
185  meTrackEffEtaTot->getNbinsX(),
186  meTrackEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
187  meTrackEffEtaTot->getTH1()->GetXaxis()->GetXmax());
188  meTPEtaSelEff_->getTH1()->SetMinimum(0.);
189  computeEfficiency1D(meTrackMatchedTPEffEtaTot, meTrackEffEtaTot, meTPEtaSelEff_);
190 
191  meTPPtMatchEff_ = ibook.book1D("TPPtMatchEff",
192  "Track associated to LV matched to TP efficiency VS Pt;Pt [GeV];Efficiency",
193  meTrackMatchedTPEffPtTot->getNbinsX(),
194  meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmin(),
195  meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmax());
196  meTPPtMatchEff_->getTH1()->SetMinimum(0.);
197  computeEfficiency1D(meTrackMatchedTPEffPtMtd, meTrackMatchedTPEffPtTot, meTPPtMatchEff_);
198 
199  meTPEtaMatchEff_ = ibook.book1D("TPEtaMatchEff",
200  "Track associated to LV matched to TP efficiency VS Eta;Eta;Efficiency",
201  meTrackMatchedTPEffEtaTot->getNbinsX(),
202  meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
203  meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmax());
204  meTPEtaMatchEff_->getTH1()->SetMinimum(0.);
205  computeEfficiency1D(meTrackMatchedTPEffEtaMtd, meTrackMatchedTPEffEtaTot, meTPEtaMatchEff_);
206 
207  MonitorElement* meBarrelPIDp = igetter.get(folder_ + "BarrelPIDp");
208  MonitorElement* meEndcapPIDp = igetter.get(folder_ + "EndcapPIDp");
209 
210  MonitorElement* meBarrelTruePiNoPID = igetter.get(folder_ + "BarrelTruePiNoPID");
211  MonitorElement* meBarrelTrueKNoPID = igetter.get(folder_ + "BarrelTrueKNoPID");
212  MonitorElement* meBarrelTruePNoPID = igetter.get(folder_ + "BarrelTruePNoPID");
213  MonitorElement* meEndcapTruePiNoPID = igetter.get(folder_ + "EndcapTruePiNoPID");
214  MonitorElement* meEndcapTrueKNoPID = igetter.get(folder_ + "EndcapTrueKNoPID");
215  MonitorElement* meEndcapTruePNoPID = igetter.get(folder_ + "EndcapTruePNoPID");
216 
217  MonitorElement* meBarrelTruePiAsPi = igetter.get(folder_ + "BarrelTruePiAsPi");
218  MonitorElement* meBarrelTrueKAsPi = igetter.get(folder_ + "BarrelTrueKAsPi");
219  MonitorElement* meBarrelTruePAsPi = igetter.get(folder_ + "BarrelTruePAsPi");
220  MonitorElement* meEndcapTruePiAsPi = igetter.get(folder_ + "EndcapTruePiAsPi");
221  MonitorElement* meEndcapTrueKAsPi = igetter.get(folder_ + "EndcapTrueKAsPi");
222  MonitorElement* meEndcapTruePAsPi = igetter.get(folder_ + "EndcapTruePAsPi");
223 
224  MonitorElement* meBarrelTruePiAsK = igetter.get(folder_ + "BarrelTruePiAsK");
225  MonitorElement* meBarrelTrueKAsK = igetter.get(folder_ + "BarrelTrueKAsK");
226  MonitorElement* meBarrelTruePAsK = igetter.get(folder_ + "BarrelTruePAsK");
227  MonitorElement* meEndcapTruePiAsK = igetter.get(folder_ + "EndcapTruePiAsK");
228  MonitorElement* meEndcapTrueKAsK = igetter.get(folder_ + "EndcapTrueKAsK");
229  MonitorElement* meEndcapTruePAsK = igetter.get(folder_ + "EndcapTruePAsK");
230 
231  MonitorElement* meBarrelTruePiAsP = igetter.get(folder_ + "BarrelTruePiAsP");
232  MonitorElement* meBarrelTrueKAsP = igetter.get(folder_ + "BarrelTrueKAsP");
233  MonitorElement* meBarrelTruePAsP = igetter.get(folder_ + "BarrelTruePAsP");
234  MonitorElement* meEndcapTruePiAsP = igetter.get(folder_ + "EndcapTruePiAsP");
235  MonitorElement* meEndcapTrueKAsP = igetter.get(folder_ + "EndcapTrueKAsP");
236  MonitorElement* meEndcapTruePAsP = igetter.get(folder_ + "EndcapTruePAsP");
237 
238  if (!meBarrelPIDp || !meEndcapPIDp || !meBarrelTruePiNoPID || !meBarrelTrueKNoPID || !meBarrelTruePNoPID ||
239  !meEndcapTruePiNoPID || !meEndcapTrueKNoPID || !meEndcapTruePNoPID || !meBarrelTruePiAsPi || !meBarrelTrueKAsPi ||
240  !meBarrelTruePAsPi || !meEndcapTruePiAsPi || !meEndcapTrueKAsPi || !meEndcapTruePAsPi || !meBarrelTruePiAsK ||
241  !meBarrelTrueKAsK || !meBarrelTruePAsK || !meEndcapTruePiAsK || !meEndcapTrueKAsK || !meEndcapTruePAsK ||
242  !meBarrelTruePiAsP || !meBarrelTrueKAsP || !meBarrelTruePAsP || !meEndcapTruePiAsP || !meEndcapTrueKAsP ||
243  !meEndcapTruePAsP) {
244  edm::LogWarning("Primary4DVertexHarvester") << "PID Monitoring histograms not found!" << std::endl;
245  return;
246  }
247 
248  meBarrelTruePi_ = ibook.book1D("BarrelTruePi",
249  "Barrel True Pi P;P [GeV]",
250  meBarrelPIDp->getNbinsX(),
251  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
252  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
253  incrementME(meBarrelTruePi_, meBarrelTruePiAsPi);
254  incrementME(meBarrelTruePi_, meBarrelTruePiAsK);
255  incrementME(meBarrelTruePi_, meBarrelTruePiAsP);
256  incrementME(meBarrelTruePi_, meBarrelTruePiNoPID);
257 
258  meEndcapTruePi_ = ibook.book1D("EndcapTruePi",
259  "Endcap True Pi P;P [GeV]",
260  meBarrelPIDp->getNbinsX(),
261  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
262  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
263  incrementME(meEndcapTruePi_, meEndcapTruePiAsPi);
264  incrementME(meEndcapTruePi_, meEndcapTruePiAsK);
265  incrementME(meEndcapTruePi_, meEndcapTruePiAsP);
266  incrementME(meEndcapTruePi_, meEndcapTruePiNoPID);
267 
268  meBarrelTrueK_ = ibook.book1D("BarrelTrueK",
269  "Barrel True K P;P [GeV]",
270  meBarrelPIDp->getNbinsX(),
271  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
272  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
273  incrementME(meBarrelTrueK_, meBarrelTrueKAsPi);
274  incrementME(meBarrelTrueK_, meBarrelTrueKAsK);
275  incrementME(meBarrelTrueK_, meBarrelTrueKAsP);
276  incrementME(meBarrelTrueK_, meBarrelTrueKNoPID);
277 
278  meEndcapTrueK_ = ibook.book1D("EndcapTrueK",
279  "Endcap True K P;P [GeV]",
280  meBarrelPIDp->getNbinsX(),
281  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
282  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
283  incrementME(meEndcapTrueK_, meEndcapTrueKAsPi);
284  incrementME(meEndcapTrueK_, meEndcapTrueKAsK);
285  incrementME(meEndcapTrueK_, meEndcapTrueKAsP);
286  incrementME(meEndcapTrueK_, meEndcapTrueKNoPID);
287 
288  meBarrelTrueP_ = ibook.book1D("BarrelTrueP",
289  "Barrel True P P;P [GeV]",
290  meBarrelPIDp->getNbinsX(),
291  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
292  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
293  incrementME(meBarrelTrueP_, meBarrelTruePAsPi);
294  incrementME(meBarrelTrueP_, meBarrelTruePAsK);
295  incrementME(meBarrelTrueP_, meBarrelTruePAsP);
296  incrementME(meBarrelTrueP_, meBarrelTruePNoPID);
297 
298  meEndcapTrueP_ = ibook.book1D("EndcapTrueP",
299  "Endcap True P P;P [GeV]",
300  meBarrelPIDp->getNbinsX(),
301  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
302  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
303  incrementME(meEndcapTrueP_, meEndcapTruePAsPi);
304  incrementME(meEndcapTrueP_, meEndcapTruePAsK);
305  incrementME(meEndcapTrueP_, meEndcapTruePAsP);
306  incrementME(meEndcapTrueP_, meEndcapTruePNoPID);
307 
308  meBarrelPIDPiAsPiEff_ = ibook.book1D("BarrelPIDPiAsPiEff",
309  "Barrel True pi as pi id. fraction VS P;P [GeV]",
310  meBarrelPIDp->getNbinsX(),
311  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
312  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
313  meBarrelPIDPiAsPiEff_->getTH1()->SetMinimum(0.);
315 
316  meBarrelPIDPiAsKEff_ = ibook.book1D("BarrelPIDPiAsKEff",
317  "Barrel True pi as k id. fraction VS P;P [GeV]",
318  meBarrelPIDp->getNbinsX(),
319  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
320  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
321  meBarrelPIDPiAsKEff_->getTH1()->SetMinimum(0.);
323 
324  meBarrelPIDPiAsPEff_ = ibook.book1D("BarrelPIDPiAsPEff",
325  "Barrel True pi as p id. fraction VS P;P [GeV]",
326  meBarrelPIDp->getNbinsX(),
327  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
328  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
329  meBarrelPIDPiAsPEff_->getTH1()->SetMinimum(0.);
331 
332  meBarrelPIDPiNoPIDEff_ = ibook.book1D("BarrelPIDPiNoPIDEff",
333  "Barrel True pi no PID id. fraction VS P;P [GeV]",
334  meBarrelPIDp->getNbinsX(),
335  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
336  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
337  meBarrelPIDPiNoPIDEff_->getTH1()->SetMinimum(0.);
339 
340  meBarrelPIDKAsPiEff_ = ibook.book1D("BarrelPIDKAsPiEff",
341  "Barrel True k as pi id. fraction VS P;P [GeV]",
342  meBarrelPIDp->getNbinsX(),
343  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
344  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
345  meBarrelPIDKAsPiEff_->getTH1()->SetMinimum(0.);
347 
348  meBarrelPIDKAsKEff_ = ibook.book1D("BarrelPIDKAsKEff",
349  "Barrel True k as k id. fraction VS P;P [GeV]",
350  meBarrelPIDp->getNbinsX(),
351  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
352  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
353  meBarrelPIDKAsKEff_->getTH1()->SetMinimum(0.);
355 
356  meBarrelPIDKAsPEff_ = ibook.book1D("BarrelPIDKAsPEff",
357  "Barrel True k as p id. fraction VS P;P [GeV]",
358  meBarrelPIDp->getNbinsX(),
359  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
360  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
361  meBarrelPIDKAsPEff_->getTH1()->SetMinimum(0.);
363 
364  meBarrelPIDKNoPIDEff_ = ibook.book1D("BarrelPIDKNoPIDEff",
365  "Barrel True k no PID id. fraction VS P;P [GeV]",
366  meBarrelPIDp->getNbinsX(),
367  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
368  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
369  meBarrelPIDKNoPIDEff_->getTH1()->SetMinimum(0.);
371 
372  meBarrelPIDPAsPiEff_ = ibook.book1D("BarrelPIDPAsPiEff",
373  "Barrel True p as pi id. fraction VS P;P [GeV]",
374  meBarrelPIDp->getNbinsX(),
375  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
376  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
377  meBarrelPIDPAsPiEff_->getTH1()->SetMinimum(0.);
379 
380  meBarrelPIDPAsKEff_ = ibook.book1D("BarrelPIDPAsKEff",
381  "Barrel True p as k id. fraction VS P;P [GeV]",
382  meBarrelPIDp->getNbinsX(),
383  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
384  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
385  meBarrelPIDPAsKEff_->getTH1()->SetMinimum(0.);
387 
388  meBarrelPIDPAsPEff_ = ibook.book1D("BarrelPIDPAsPEff",
389  "Barrel True p as p id. fraction VS P;P [GeV]",
390  meBarrelPIDp->getNbinsX(),
391  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
392  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
393  meBarrelPIDPAsPEff_->getTH1()->SetMinimum(0.);
395 
396  meBarrelPIDPNoPIDEff_ = ibook.book1D("BarrelPIDPNoPIDEff",
397  "Barrel True p no PID id. fraction VS P;P [GeV]",
398  meBarrelPIDp->getNbinsX(),
399  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
400  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
401  meBarrelPIDPNoPIDEff_->getTH1()->SetMinimum(0.);
403 
404  meEndcapPIDPiAsPiEff_ = ibook.book1D("EndcapPIDPiAsPiEff",
405  "Endcap True pi as pi id. fraction VS P;P [GeV]",
406  meBarrelPIDp->getNbinsX(),
407  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
408  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
409  meEndcapPIDPiAsPiEff_->getTH1()->SetMinimum(0.);
411 
412  meEndcapPIDPiAsKEff_ = ibook.book1D("EndcapPIDPiAsKEff",
413  "Endcap True pi as k id. fraction VS P;P [GeV]",
414  meBarrelPIDp->getNbinsX(),
415  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
416  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
417  meEndcapPIDPiAsKEff_->getTH1()->SetMinimum(0.);
419 
420  meEndcapPIDPiAsPEff_ = ibook.book1D("EndcapPIDPiAsPEff",
421  "Endcap True pi as p id. fraction VS P;P [GeV]",
422  meBarrelPIDp->getNbinsX(),
423  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
424  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
425  meEndcapPIDPiAsPEff_->getTH1()->SetMinimum(0.);
427 
428  meEndcapPIDPiNoPIDEff_ = ibook.book1D("EndcapPIDPiNoPIDEff",
429  "Endcap True pi no PID id. fraction VS P;P [GeV]",
430  meBarrelPIDp->getNbinsX(),
431  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
432  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
433  meEndcapPIDPiNoPIDEff_->getTH1()->SetMinimum(0.);
435 
436  meEndcapPIDKAsPiEff_ = ibook.book1D("EndcapPIDKAsPiEff",
437  "Endcap True k as pi id. fraction VS P;P [GeV]",
438  meBarrelPIDp->getNbinsX(),
439  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
440  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
441  meEndcapPIDKAsPiEff_->getTH1()->SetMinimum(0.);
443 
444  meEndcapPIDKAsKEff_ = ibook.book1D("EndcapPIDKAsKEff",
445  "Endcap True k as k id. fraction VS P;P [GeV]",
446  meBarrelPIDp->getNbinsX(),
447  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
448  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
449  meEndcapPIDKAsKEff_->getTH1()->SetMinimum(0.);
451 
452  meEndcapPIDKAsPEff_ = ibook.book1D("EndcapPIDKAsPEff",
453  "Endcap True k as p id. fraction VS P;P [GeV]",
454  meBarrelPIDp->getNbinsX(),
455  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
456  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
457  meEndcapPIDKAsPEff_->getTH1()->SetMinimum(0.);
459 
460  meEndcapPIDKNoPIDEff_ = ibook.book1D("EndcapPIDKNoPIDEff",
461  "Endcap True k no PID id. fraction VS P;P [GeV]",
462  meBarrelPIDp->getNbinsX(),
463  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
464  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
465  meEndcapPIDKNoPIDEff_->getTH1()->SetMinimum(0.);
467 
468  meEndcapPIDPAsPiEff_ = ibook.book1D("EndcapPIDPAsPiEff",
469  "Endcap True p as pi id. fraction VS P;P [GeV]",
470  meBarrelPIDp->getNbinsX(),
471  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
472  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
473  meEndcapPIDPAsPiEff_->getTH1()->SetMinimum(0.);
475 
476  meEndcapPIDPAsKEff_ = ibook.book1D("EndcapPIDPAsKEff",
477  "Endcap True p as k id. fraction VS P;P [GeV]",
478  meBarrelPIDp->getNbinsX(),
479  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
480  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
481  meEndcapPIDPAsKEff_->getTH1()->SetMinimum(0.);
483 
484  meEndcapPIDPAsPEff_ = ibook.book1D("EndcapPIDPAsPEff",
485  "Endcap True p as p id. fraction VS P;P [GeV]",
486  meBarrelPIDp->getNbinsX(),
487  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
488  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
489  meEndcapPIDPAsPEff_->getTH1()->SetMinimum(0.);
491 
492  meEndcapPIDPNoPIDEff_ = ibook.book1D("EndcapPIDPNoPIDEff",
493  "Endcap True p no PID id. fraction VS P;P [GeV]",
494  meBarrelPIDp->getNbinsX(),
495  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
496  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
497  meEndcapPIDPNoPIDEff_->getTH1()->SetMinimum(0.);
499 
500  meBarrelAsPi_ = ibook.book1D("BarrelAsPi",
501  "Barrel Identified Pi P;P [GeV]",
502  meBarrelPIDp->getNbinsX(),
503  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
504  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
505  incrementME(meBarrelAsPi_, meBarrelTruePiAsPi);
506  incrementME(meBarrelAsPi_, meBarrelTrueKAsPi);
507  incrementME(meBarrelAsPi_, meBarrelTruePAsPi);
508 
509  meEndcapAsPi_ = ibook.book1D("EndcapAsPi",
510  "Endcap Identified Pi P;P [GeV]",
511  meBarrelPIDp->getNbinsX(),
512  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
513  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
514  incrementME(meEndcapAsPi_, meEndcapTruePiAsPi);
515  incrementME(meEndcapAsPi_, meEndcapTrueKAsPi);
516  incrementME(meEndcapAsPi_, meEndcapTruePAsPi);
517 
518  meBarrelAsK_ = ibook.book1D("BarrelAsK",
519  "Barrel Identified K P;P [GeV]",
520  meBarrelPIDp->getNbinsX(),
521  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
522  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
523  incrementME(meBarrelAsK_, meBarrelTruePiAsK);
524  incrementME(meBarrelAsK_, meBarrelTrueKAsK);
525  incrementME(meBarrelAsK_, meBarrelTruePAsK);
526 
527  meEndcapAsK_ = ibook.book1D("EndcapAsK",
528  "Endcap Identified K P;P [GeV]",
529  meBarrelPIDp->getNbinsX(),
530  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
531  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
532  incrementME(meEndcapAsK_, meEndcapTruePiAsK);
533  incrementME(meEndcapAsK_, meEndcapTrueKAsK);
534  incrementME(meEndcapAsK_, meEndcapTruePAsK);
535 
536  meBarrelAsP_ = ibook.book1D("BarrelAsP",
537  "Barrel Identified P P;P [GeV]",
538  meBarrelPIDp->getNbinsX(),
539  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
540  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
541  incrementME(meBarrelAsP_, meBarrelTruePiAsP);
542  incrementME(meBarrelAsP_, meBarrelTrueKAsP);
543  incrementME(meBarrelAsP_, meBarrelTruePAsP);
544 
545  meEndcapAsP_ = ibook.book1D("EndcapAsP",
546  "Endcap Identified P P;P [GeV]",
547  meBarrelPIDp->getNbinsX(),
548  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
549  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
550  incrementME(meEndcapAsP_, meEndcapTruePiAsP);
551  incrementME(meEndcapAsP_, meEndcapTrueKAsP);
552  incrementME(meEndcapAsP_, meEndcapTruePAsP);
553 
554  meBarrelNoPID_ = ibook.book1D("BarrelNoPID",
555  "Barrel NoPID P;P [GeV]",
556  meBarrelPIDp->getNbinsX(),
557  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
558  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
559  incrementME(meBarrelNoPID_, meBarrelTruePiNoPID);
560  incrementME(meBarrelNoPID_, meBarrelTrueKNoPID);
561  incrementME(meBarrelNoPID_, meBarrelTruePNoPID);
562 
563  meEndcapNoPID_ = ibook.book1D("EndcapNoPID",
564  "Endcap NoPID P;P [GeV]",
565  meBarrelPIDp->getNbinsX(),
566  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
567  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
568  incrementME(meEndcapNoPID_, meEndcapTruePiNoPID);
569  incrementME(meEndcapNoPID_, meEndcapTrueKNoPID);
570  incrementME(meEndcapNoPID_, meEndcapTruePNoPID);
571 
572  meBarrelPiPurity_ = ibook.book1D("BarrelPiPurity",
573  "Barrel pi id. fraction true pi VS P;P [GeV]",
574  meBarrelPIDp->getNbinsX(),
575  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
576  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
577  meBarrelPiPurity_->getTH1()->SetMinimum(0.);
579 
580  meBarrelKPurity_ = ibook.book1D("BarrelKPurity",
581  "Barrel k id. fraction true k VS P;P [GeV]",
582  meBarrelPIDp->getNbinsX(),
583  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
584  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
585  meBarrelKPurity_->getTH1()->SetMinimum(0.);
587 
588  meBarrelPPurity_ = ibook.book1D("BarrelPPurity",
589  "Barrel p id. fraction true p VS P;P [GeV]",
590  meBarrelPIDp->getNbinsX(),
591  meBarrelPIDp->getTH1()->GetXaxis()->GetXmin(),
592  meBarrelPIDp->getTH1()->GetXaxis()->GetXmax());
593  meBarrelPPurity_->getTH1()->SetMinimum(0.);
595 
596  meEndcapPiPurity_ = ibook.book1D("EndcapPiPurity",
597  "Endcap pi id. fraction true pi VS P;P [GeV]",
598  meEndcapPIDp->getNbinsX(),
599  meEndcapPIDp->getTH1()->GetXaxis()->GetXmin(),
600  meEndcapPIDp->getTH1()->GetXaxis()->GetXmax());
601  meEndcapPiPurity_->getTH1()->SetMinimum(0.);
603 
604  meEndcapKPurity_ = ibook.book1D("EndcapKPurity",
605  "Endcap k id. fraction true k VS P;P [GeV]",
606  meEndcapPIDp->getNbinsX(),
607  meEndcapPIDp->getTH1()->GetXaxis()->GetXmin(),
608  meEndcapPIDp->getTH1()->GetXaxis()->GetXmax());
609  meEndcapKPurity_->getTH1()->SetMinimum(0.);
611 
612  meEndcapPPurity_ = ibook.book1D("EndcapPPurity",
613  "Endcap p id. fraction true p VS P;P [GeV]",
614  meEndcapPIDp->getNbinsX(),
615  meEndcapPIDp->getTH1()->GetXaxis()->GetXmin(),
616  meEndcapPIDp->getTH1()->GetXaxis()->GetXmax());
617  meEndcapPPurity_->getTH1()->SetMinimum(0.);
619 }
620 
621 // ------------ method fills 'descriptions' with the allowed parameters for the module ----------
624 
625  desc.add<std::string>("folder", "MTD/Vertices/");
626 
627  descriptions.add("Primary4DVertexPostProcessor", desc);
628 }
629 
void scaleby(MonitorElement *h, double scale)
std::string folder_
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
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void incrementME(MonitorElement *base, MonitorElement *toBeAdded)
virtual TH1F * getTH1F() const
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
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
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
virtual double getBinContent(int binx) const
get content of bin (1-D)