CMS 3D CMS Logo

MtdTracksHarvester.cc
Go to the documentation of this file.
1 #include <string>
2 
7 
10 
12 
14 public:
15  explicit MtdTracksHarvester(const edm::ParameterSet& iConfig);
16  ~MtdTracksHarvester() override;
17 
18  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
19 
20 protected:
22 
23 private:
25 
27 
28  // --- Histograms
53 };
54 
55 // ------------ constructor and destructor --------------
57  : folder_(iConfig.getParameter<std::string>("folder")) {}
58 
60 
61 // auxiliary method to compute efficiency from the ratio of two 1D MonitorElement
63  for (int ibin = 1; ibin <= den->getNbinsX(); ibin++) {
64  double eff = num->getBinContent(ibin) / den->getBinContent(ibin);
65  double bin_err = sqrt((num->getBinContent(ibin) * (den->getBinContent(ibin) - num->getBinContent(ibin))) /
66  pow(den->getBinContent(ibin), 3));
67  if (den->getBinContent(ibin) == 0) {
68  eff = 0;
69  bin_err = 0;
70  }
71  result->setBinContent(ibin, eff);
72  result->setBinError(ibin, bin_err);
73  }
74 }
75 
76 // ------------ endjob tasks ----------------------------
78  // --- Get the monitoring histograms
79  MonitorElement* meBTLTrackEffEtaTot = igetter.get(folder_ + "TrackBTLEffEtaTot");
80  MonitorElement* meBTLTrackEffPhiTot = igetter.get(folder_ + "TrackBTLEffPhiTot");
81  MonitorElement* meBTLTrackEffPtTot = igetter.get(folder_ + "TrackBTLEffPtTot");
82  MonitorElement* meBTLTrackEffEtaMtd = igetter.get(folder_ + "TrackBTLEffEtaMtd");
83  MonitorElement* meBTLTrackEffPhiMtd = igetter.get(folder_ + "TrackBTLEffPhiMtd");
84  MonitorElement* meBTLTrackEffPtMtd = igetter.get(folder_ + "TrackBTLEffPtMtd");
85  MonitorElement* meETLTrackEffEtaTotZneg = igetter.get(folder_ + "TrackETLEffEtaTotZneg");
86  MonitorElement* meETLTrackEffPhiTotZneg = igetter.get(folder_ + "TrackETLEffPhiTotZneg");
87  MonitorElement* meETLTrackEffPtTotZneg = igetter.get(folder_ + "TrackETLEffPtTotZneg");
88  MonitorElement* meETLTrackEffEtaMtdZneg = igetter.get(folder_ + "TrackETLEffEtaMtdZneg");
89  MonitorElement* meETLTrackEffPhiMtdZneg = igetter.get(folder_ + "TrackETLEffPhiMtdZneg");
90  MonitorElement* meETLTrackEffPtMtdZneg = igetter.get(folder_ + "TrackETLEffPtMtdZneg");
91  MonitorElement* meETLTrackEffEta2MtdZneg = igetter.get(folder_ + "TrackETLEffEta2MtdZneg");
92  MonitorElement* meETLTrackEffPhi2MtdZneg = igetter.get(folder_ + "TrackETLEffPhi2MtdZneg");
93  MonitorElement* meETLTrackEffPt2MtdZneg = igetter.get(folder_ + "TrackETLEffPt2MtdZneg");
94  MonitorElement* meETLTrackEffEtaTotZpos = igetter.get(folder_ + "TrackETLEffEtaTotZpos");
95  MonitorElement* meETLTrackEffPhiTotZpos = igetter.get(folder_ + "TrackETLEffPhiTotZpos");
96  MonitorElement* meETLTrackEffPtTotZpos = igetter.get(folder_ + "TrackETLEffPtTotZpos");
97  MonitorElement* meETLTrackEffEtaMtdZpos = igetter.get(folder_ + "TrackETLEffEtaMtdZpos");
98  MonitorElement* meETLTrackEffPhiMtdZpos = igetter.get(folder_ + "TrackETLEffPhiMtdZpos");
99  MonitorElement* meETLTrackEffPtMtdZpos = igetter.get(folder_ + "TrackETLEffPtMtdZpos");
100  MonitorElement* meETLTrackEffEta2MtdZpos = igetter.get(folder_ + "TrackETLEffEta2MtdZpos");
101  MonitorElement* meETLTrackEffPhi2MtdZpos = igetter.get(folder_ + "TrackETLEffPhi2MtdZpos");
102  MonitorElement* meETLTrackEffPt2MtdZpos = igetter.get(folder_ + "TrackETLEffPt2MtdZpos");
103  MonitorElement* meMVATrackEffPtTot = igetter.get(folder_ + "MVAEffPtTot");
104  MonitorElement* meMVATrackMatchedEffPtTot = igetter.get(folder_ + "MVAMatchedEffPtTot");
105  MonitorElement* meMVATrackMatchedEffPtMtd = igetter.get(folder_ + "MVAMatchedEffPtMtd");
106  MonitorElement* meTrackMatchedTPEffPtTot = igetter.get(folder_ + "MatchedTPEffPtTot");
107  MonitorElement* meTrackMatchedTPEffPtMtd = igetter.get(folder_ + "MatchedTPEffPtMtd");
108  MonitorElement* meTrackMatchedTPEffPtEtl2Mtd = igetter.get(folder_ + "MatchedTPEffPtEtl2Mtd");
109  MonitorElement* meTrackMatchedTPmtdEffPtTot = igetter.get(folder_ + "MatchedTPmtdEffPtTot");
110  MonitorElement* meTrackMatchedTPmtdEffPtMtd = igetter.get(folder_ + "MatchedTPmtdEffPtMtd");
111  MonitorElement* meMVATrackEffEtaTot = igetter.get(folder_ + "MVAEffEtaTot");
112  MonitorElement* meMVATrackMatchedEffEtaTot = igetter.get(folder_ + "MVAMatchedEffEtaTot");
113  MonitorElement* meMVATrackMatchedEffEtaMtd = igetter.get(folder_ + "MVAMatchedEffEtaMtd");
114  MonitorElement* meTrackMatchedTPEffEtaTot = igetter.get(folder_ + "MatchedTPEffEtaTot");
115  MonitorElement* meTrackMatchedTPEffEtaMtd = igetter.get(folder_ + "MatchedTPEffEtaMtd");
116  MonitorElement* meTrackMatchedTPEffEtaEtl2Mtd = igetter.get(folder_ + "MatchedTPEffEtaEtl2Mtd");
117  MonitorElement* meTrackMatchedTPmtdEffEtaTot = igetter.get(folder_ + "MatchedTPmtdEffEtaTot");
118  MonitorElement* meTrackMatchedTPmtdEffEtaMtd = igetter.get(folder_ + "MatchedTPmtdEffEtaMtd");
119  MonitorElement* meNTrackingParticles = igetter.get(folder_ + "NTrackingParticles");
120  MonitorElement* meUnassDeposit = igetter.get(folder_ + "UnassDeposit");
121 
122  if (!meBTLTrackEffEtaTot || !meBTLTrackEffPhiTot || !meBTLTrackEffPtTot || !meBTLTrackEffEtaMtd ||
123  !meBTLTrackEffPhiMtd || !meBTLTrackEffPtMtd || !meETLTrackEffEtaTotZneg || !meETLTrackEffPhiTotZneg ||
124  !meETLTrackEffPtTotZneg || !meETLTrackEffEtaMtdZneg || !meETLTrackEffPhiMtdZneg || !meETLTrackEffPtMtdZneg ||
125  !meETLTrackEffEta2MtdZneg || !meETLTrackEffPhi2MtdZneg || !meETLTrackEffPt2MtdZneg || !meETLTrackEffEtaTotZpos ||
126  !meETLTrackEffPhiTotZpos || !meETLTrackEffPtTotZpos || !meETLTrackEffEtaMtdZpos || !meETLTrackEffPhiMtdZpos ||
127  !meETLTrackEffPtMtdZpos || !meETLTrackEffEta2MtdZpos || !meETLTrackEffPhi2MtdZpos || !meETLTrackEffPt2MtdZpos ||
128  !meMVATrackEffPtTot || !meMVATrackMatchedEffPtTot || !meMVATrackMatchedEffPtMtd || !meMVATrackEffEtaTot ||
129  !meMVATrackMatchedEffEtaTot || !meMVATrackMatchedEffEtaMtd || !meTrackMatchedTPEffPtTot ||
130  !meTrackMatchedTPEffPtMtd || !meTrackMatchedTPEffPtEtl2Mtd || !meTrackMatchedTPmtdEffPtTot ||
131  !meTrackMatchedTPmtdEffPtMtd || !meTrackMatchedTPEffEtaTot || !meTrackMatchedTPEffEtaMtd ||
132  !meTrackMatchedTPEffEtaEtl2Mtd || !meTrackMatchedTPmtdEffEtaTot || !meTrackMatchedTPmtdEffEtaMtd ||
133  !meNTrackingParticles || !meUnassDeposit) {
134  edm::LogError("MtdTracksHarvester") << "Monitoring histograms not found!" << std::endl;
135  return;
136  }
137 
138  // --- Book histograms
139  ibook.cd(folder_);
140  meBtlEtaEff_ = ibook.book1D("BtlEtaEff",
141  " Track Efficiency VS Eta;#eta;Efficiency",
142  meBTLTrackEffEtaTot->getNbinsX(),
143  meBTLTrackEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
144  meBTLTrackEffEtaTot->getTH1()->GetXaxis()->GetXmax());
145  meBtlEtaEff_->getTH1()->SetMinimum(0.);
146  computeEfficiency1D(meBTLTrackEffEtaMtd, meBTLTrackEffEtaTot, meBtlEtaEff_);
147 
148  meBtlPhiEff_ = ibook.book1D("BtlPhiEff",
149  "Track Efficiency VS Phi;#phi [rad];Efficiency",
150  meBTLTrackEffPhiTot->getNbinsX(),
151  meBTLTrackEffPhiTot->getTH1()->GetXaxis()->GetXmin(),
152  meBTLTrackEffPhiTot->getTH1()->GetXaxis()->GetXmax());
153  meBtlPhiEff_->getTH1()->SetMinimum(0.);
154  computeEfficiency1D(meBTLTrackEffPhiMtd, meBTLTrackEffPhiTot, meBtlPhiEff_);
155 
156  meBtlPtEff_ = ibook.book1D("BtlPtEff",
157  "Track Efficiency VS Pt;Pt [GeV];Efficiency",
158  meBTLTrackEffPtTot->getNbinsX(),
159  meBTLTrackEffPtTot->getTH1()->GetXaxis()->GetXmin(),
160  meBTLTrackEffPtTot->getTH1()->GetXaxis()->GetXmax());
161  meBtlPtEff_->getTH1()->SetMinimum(0.);
162  computeEfficiency1D(meBTLTrackEffPtMtd, meBTLTrackEffPtTot, meBtlPtEff_);
163 
164  meEtlEtaEff_[0] = ibook.book1D("EtlEtaEffZneg",
165  " Track Efficiency VS Eta (-Z);#eta;Efficiency",
166  meETLTrackEffEtaTotZneg->getNbinsX(),
167  meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmin(),
168  meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmax());
169  meEtlEtaEff_[0]->getTH1()->SetMinimum(0.);
170  computeEfficiency1D(meETLTrackEffEtaMtdZneg, meETLTrackEffEtaTotZneg, meEtlEtaEff_[0]);
171 
172  meEtlPhiEff_[0] = ibook.book1D("EtlPhiEffZneg",
173  "Track Efficiency VS Phi (-Z);#phi [rad];Efficiency",
174  meETLTrackEffPhiTotZneg->getNbinsX(),
175  meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmin(),
176  meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmax());
177  meEtlPhiEff_[0]->getTH1()->SetMinimum(0.);
178  computeEfficiency1D(meETLTrackEffPhiMtdZneg, meETLTrackEffPhiTotZneg, meEtlPhiEff_[0]);
179 
180  meEtlPtEff_[0] = ibook.book1D("EtlPtEffZneg",
181  "Track Efficiency VS Pt (-Z);Pt [GeV];Efficiency",
182  meETLTrackEffPtTotZneg->getNbinsX(),
183  meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmin(),
184  meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmax());
185  meEtlPtEff_[0]->getTH1()->SetMinimum(0.);
186  computeEfficiency1D(meETLTrackEffPtMtdZneg, meETLTrackEffPtTotZneg, meEtlPtEff_[0]);
187 
188  meEtlEtaEff_[1] = ibook.book1D("EtlEtaEffZpos",
189  " Track Efficiency VS Eta (+Z);#eta;Efficiency",
190  meETLTrackEffEtaTotZpos->getNbinsX(),
191  meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmin(),
192  meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmax());
193  meEtlEtaEff_[1]->getTH1()->SetMinimum(0.);
194  computeEfficiency1D(meETLTrackEffEtaMtdZpos, meETLTrackEffEtaTotZpos, meEtlEtaEff_[1]);
195 
196  meEtlPhiEff_[1] = ibook.book1D("EtlPhiEffZpos",
197  "Track Efficiency VS Phi (+Z);#phi [rad];Efficiency",
198  meETLTrackEffPhiTotZpos->getNbinsX(),
199  meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmin(),
200  meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmax());
201  meEtlPhiEff_[1]->getTH1()->SetMinimum(0.);
202  computeEfficiency1D(meETLTrackEffPhiMtdZpos, meETLTrackEffPhiTotZpos, meEtlPhiEff_[1]);
203 
204  meEtlPtEff_[1] = ibook.book1D("EtlPtEffZpos",
205  "Track Efficiency VS Pt (+Z);Pt [GeV];Efficiency",
206  meETLTrackEffPtTotZpos->getNbinsX(),
207  meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmin(),
208  meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmax());
209  meEtlPtEff_[1]->getTH1()->SetMinimum(0.);
210  computeEfficiency1D(meETLTrackEffPtMtdZpos, meETLTrackEffPtTotZpos, meEtlPtEff_[1]);
211 
212  meEtlEtaEff2_[0] = ibook.book1D("EtlEtaEff2Zneg",
213  " Track Efficiency VS Eta (-Z, 2 hit);#eta;Efficiency",
214  meETLTrackEffEtaTotZneg->getNbinsX(),
215  meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmin(),
216  meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmax());
217  meEtlEtaEff2_[0]->getTH1()->SetMinimum(0.);
218  computeEfficiency1D(meETLTrackEffEta2MtdZneg, meETLTrackEffEtaTotZneg, meEtlEtaEff2_[0]);
219 
220  meEtlPhiEff2_[0] = ibook.book1D("EtlPhiEff2Zneg",
221  "Track Efficiency VS Phi (-Z, 2 hit);#phi [rad];Efficiency",
222  meETLTrackEffPhiTotZneg->getNbinsX(),
223  meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmin(),
224  meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmax());
225  meEtlPhiEff2_[0]->getTH1()->SetMinimum(0.);
226  computeEfficiency1D(meETLTrackEffPhi2MtdZneg, meETLTrackEffPhiTotZneg, meEtlPhiEff2_[0]);
227 
228  meEtlPtEff2_[0] = ibook.book1D("EtlPtEff2Zneg",
229  "Track Efficiency VS Pt (-Z, 2 hit);Pt [GeV];Efficiency",
230  meETLTrackEffPtTotZneg->getNbinsX(),
231  meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmin(),
232  meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmax());
233  meEtlPtEff2_[0]->getTH1()->SetMinimum(0.);
234  computeEfficiency1D(meETLTrackEffPt2MtdZneg, meETLTrackEffPtTotZneg, meEtlPtEff2_[0]);
235 
236  meEtlEtaEff2_[1] = ibook.book1D("EtlEtaEff2Zpos",
237  "Track Efficiency VS Eta (+Z, 2 hit);#eta;Efficiency",
238  meETLTrackEffEtaTotZpos->getNbinsX(),
239  meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmin(),
240  meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmax());
241  meEtlEtaEff2_[1]->getTH1()->SetMinimum(0.);
242  computeEfficiency1D(meETLTrackEffEta2MtdZpos, meETLTrackEffEtaTotZpos, meEtlEtaEff2_[1]);
243 
244  meEtlPhiEff2_[1] = ibook.book1D("EtlPhiEff2Zpos",
245  "Track Efficiency VS Phi (+Z, 2 hit);#phi [rad];Efficiency",
246  meETLTrackEffPhiTotZpos->getNbinsX(),
247  meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmin(),
248  meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmax());
249  meEtlPhiEff2_[1]->getTH1()->SetMinimum(0.);
250  computeEfficiency1D(meETLTrackEffPhi2MtdZpos, meETLTrackEffPhiTotZpos, meEtlPhiEff2_[1]);
251 
252  meEtlPtEff2_[1] = ibook.book1D("EtlPtEff2Zpos",
253  "Track Efficiency VS Pt (+Z, 2 hit);Pt [GeV];Efficiency",
254  meETLTrackEffPtTotZpos->getNbinsX(),
255  meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmin(),
256  meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmax());
257  meEtlPtEff2_[1]->getTH1()->SetMinimum(0.);
258  computeEfficiency1D(meETLTrackEffPt2MtdZpos, meETLTrackEffPtTotZpos, meEtlPtEff2_[1]);
259 
260  meMVAPtSelEff_ = ibook.book1D("MVAPtSelEff",
261  "Track selected efficiency VS Pt;Pt [GeV];Efficiency",
262  meMVATrackEffPtTot->getNbinsX(),
263  meMVATrackEffPtTot->getTH1()->GetXaxis()->GetXmin(),
264  meMVATrackEffPtTot->getTH1()->GetXaxis()->GetXmax());
265  meMVAPtSelEff_->getTH1()->SetMinimum(0.);
266  computeEfficiency1D(meMVATrackMatchedEffPtTot, meMVATrackEffPtTot, meMVAPtSelEff_);
267 
268  meMVAEtaSelEff_ = ibook.book1D("MVAEtaSelEff",
269  "Track selected efficiency VS Eta;Eta;Efficiency",
270  meMVATrackEffEtaTot->getNbinsX(),
271  meMVATrackEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
272  meMVATrackEffEtaTot->getTH1()->GetXaxis()->GetXmax());
273  meMVAEtaSelEff_->getTH1()->SetMinimum(0.);
274  computeEfficiency1D(meMVATrackMatchedEffEtaTot, meMVATrackEffEtaTot, meMVAEtaSelEff_);
275 
276  meMVAPtMatchEff_ = ibook.book1D("MVAPtMatchEff",
277  "Track matched to GEN efficiency VS Pt;Pt [GeV];Efficiency",
278  meMVATrackMatchedEffPtTot->getNbinsX(),
279  meMVATrackMatchedEffPtTot->getTH1()->GetXaxis()->GetXmin(),
280  meMVATrackMatchedEffPtTot->getTH1()->GetXaxis()->GetXmax());
281  meMVAPtMatchEff_->getTH1()->SetMinimum(0.);
282  computeEfficiency1D(meMVATrackMatchedEffPtMtd, meMVATrackMatchedEffPtTot, meMVAPtMatchEff_);
283 
284  meMVAEtaMatchEff_ = ibook.book1D("MVAEtaMatchEff",
285  "Track matched to GEN efficiency VS Eta;Eta;Efficiency",
286  meMVATrackMatchedEffEtaTot->getNbinsX(),
287  meMVATrackMatchedEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
288  meMVATrackMatchedEffEtaTot->getTH1()->GetXaxis()->GetXmax());
289  meMVAEtaMatchEff_->getTH1()->SetMinimum(0.);
290  computeEfficiency1D(meMVATrackMatchedEffEtaMtd, meMVATrackMatchedEffEtaTot, meMVAEtaMatchEff_);
291 
292  meTPPtSelEff_ = ibook.book1D("TPPtSelEff",
293  "Track selected efficiency TP VS Pt;Pt [GeV];Efficiency",
294  meMVATrackEffPtTot->getNbinsX(),
295  meMVATrackEffPtTot->getTH1()->GetXaxis()->GetXmin(),
296  meMVATrackEffPtTot->getTH1()->GetXaxis()->GetXmax());
297  meTPPtSelEff_->getTH1()->SetMinimum(0.);
298  computeEfficiency1D(meTrackMatchedTPEffPtTot, meMVATrackEffPtTot, meTPPtSelEff_);
299 
300  meTPEtaSelEff_ = ibook.book1D("TPEtaSelEff",
301  "Track selected efficiency TP VS Eta;Eta;Efficiency",
302  meMVATrackEffEtaTot->getNbinsX(),
303  meMVATrackEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
304  meMVATrackEffEtaTot->getTH1()->GetXaxis()->GetXmax());
305  meTPEtaSelEff_->getTH1()->SetMinimum(0.);
306  computeEfficiency1D(meTrackMatchedTPEffEtaTot, meMVATrackEffEtaTot, meTPEtaSelEff_);
307 
308  meTPPtMatchEff_ = ibook.book1D("TPPtMatchEff",
309  "Track matched to TP efficiency VS Pt;Pt [GeV];Efficiency",
310  meTrackMatchedTPEffPtTot->getNbinsX(),
311  meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmin(),
312  meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmax());
313  meTPPtMatchEff_->getTH1()->SetMinimum(0.);
314  computeEfficiency1D(meTrackMatchedTPEffPtMtd, meTrackMatchedTPEffPtTot, meTPPtMatchEff_);
315 
316  meTPEtaMatchEff_ = ibook.book1D("TPEtaMatchEff",
317  "Track matched to TP efficiency VS Eta;Eta;Efficiency",
318  meTrackMatchedTPEffEtaTot->getNbinsX(),
319  meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
320  meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmax());
321  meTPEtaMatchEff_->getTH1()->SetMinimum(0.);
322  computeEfficiency1D(meTrackMatchedTPEffEtaMtd, meTrackMatchedTPEffEtaTot, meTPEtaMatchEff_);
323 
324  meTPPtMatchEtl2Eff_ = ibook.book1D("TPPtMatchEtl2Eff",
325  "Track matched to TP efficiency VS Pt, 2 ETL hits;Pt [GeV];Efficiency",
326  meTrackMatchedTPEffPtTot->getNbinsX(),
327  meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmin(),
328  meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmax());
329  meTPPtMatchEtl2Eff_->getTH1()->SetMinimum(0.);
330  computeEfficiency1D(meTrackMatchedTPEffPtEtl2Mtd, meTrackMatchedTPEffPtTot, meTPPtMatchEtl2Eff_);
331 
332  meTPEtaMatchEtl2Eff_ = ibook.book1D("TPEtaMatchEtl2Eff",
333  "Track matched to TP efficiency VS Eta, 2 ETL hits;Eta;Efficiency",
334  meTrackMatchedTPEffEtaTot->getNbinsX(),
335  meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
336  meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmax());
337  meTPEtaMatchEtl2Eff_->getTH1()->SetMinimum(0.);
338  computeEfficiency1D(meTrackMatchedTPEffEtaEtl2Mtd, meTrackMatchedTPEffEtaTot, meTPEtaMatchEtl2Eff_);
339 
340  meTPmtdPtSelEff_ = ibook.book1D("TPmtdPtSelEff",
341  "Track selected efficiency TP-mtd hit VS Pt;Pt [GeV];Efficiency",
342  meMVATrackEffPtTot->getNbinsX(),
343  meMVATrackEffPtTot->getTH1()->GetXaxis()->GetXmin(),
344  meMVATrackEffPtTot->getTH1()->GetXaxis()->GetXmax());
345  meTPmtdPtSelEff_->getTH1()->SetMinimum(0.);
346  computeEfficiency1D(meTrackMatchedTPmtdEffPtTot, meMVATrackEffPtTot, meTPmtdPtSelEff_);
347 
348  meTPmtdEtaSelEff_ = ibook.book1D("TPmtdEtaSelEff",
349  "Track selected efficiency TPmtd hit VS Eta;Eta;Efficiency",
350  meMVATrackEffEtaTot->getNbinsX(),
351  meMVATrackEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
352  meMVATrackEffEtaTot->getTH1()->GetXaxis()->GetXmax());
353  meTPmtdEtaSelEff_->getTH1()->SetMinimum(0.);
354  computeEfficiency1D(meTrackMatchedTPmtdEffEtaTot, meMVATrackEffEtaTot, meTPmtdEtaSelEff_);
355 
356  meTPmtdPtMatchEff_ = ibook.book1D("TPmtdPtMatchEff",
357  "Track matched to TP-mtd hit efficiency VS Pt;Pt [GeV];Efficiency",
358  meTrackMatchedTPmtdEffPtTot->getNbinsX(),
359  meTrackMatchedTPmtdEffPtTot->getTH1()->GetXaxis()->GetXmin(),
360  meTrackMatchedTPmtdEffPtTot->getTH1()->GetXaxis()->GetXmax());
361  meTPmtdPtMatchEff_->getTH1()->SetMinimum(0.);
362  computeEfficiency1D(meTrackMatchedTPmtdEffPtMtd, meTrackMatchedTPmtdEffPtTot, meTPmtdPtMatchEff_);
363 
364  meTPmtdEtaMatchEff_ = ibook.book1D("TPmtdEtaMatchEff",
365  "Track matched to TP-mtd hit efficiency VS Eta;Eta;Efficiency",
366  meTrackMatchedTPmtdEffEtaTot->getNbinsX(),
367  meTrackMatchedTPmtdEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
368  meTrackMatchedTPmtdEffEtaTot->getTH1()->GetXaxis()->GetXmax());
369  meTPmtdEtaMatchEff_->getTH1()->SetMinimum(0.);
370  computeEfficiency1D(meTrackMatchedTPmtdEffEtaMtd, meTrackMatchedTPmtdEffEtaTot, meTPmtdEtaMatchEff_);
371 
372  meTPAssocEff_ =
373  ibook.book1D("TPAssocEff",
374  "Tracking particles not associated to any MTD cell in events with at least one cell over threshold",
375  meNTrackingParticles->getNbinsX(),
376  meNTrackingParticles->getTH1()->GetXaxis()->GetXmin(),
377  meNTrackingParticles->getTH1()->GetXaxis()->GetXmax());
378  meTPAssocEff_->getTH1()->SetMinimum(0.);
379  computeEfficiency1D(meUnassDeposit, meNTrackingParticles, meTPAssocEff_);
380 
381  meBtlEtaEff_->getTH1()->SetMinimum(0.);
382  meBtlPhiEff_->getTH1()->SetMinimum(0.);
383  meBtlPtEff_->getTH1()->SetMinimum(0.);
384  for (int i = 0; i < 2; i++) {
385  meEtlEtaEff_[i]->getTH1()->SetMinimum(0.);
386  meEtlPhiEff_[i]->getTH1()->SetMinimum(0.);
387  meEtlPtEff_[i]->getTH1()->SetMinimum(0.);
388  meEtlEtaEff2_[i]->getTH1()->SetMinimum(0.);
389  meEtlPhiEff2_[i]->getTH1()->SetMinimum(0.);
390  meEtlPtEff2_[i]->getTH1()->SetMinimum(0.);
391  }
392  meMVAPtSelEff_->getTH1()->SetMinimum(0.);
393  meMVAEtaSelEff_->getTH1()->SetMinimum(0.);
394  meMVAPtMatchEff_->getTH1()->SetMinimum(0.);
395  meMVAEtaMatchEff_->getTH1()->SetMinimum(0.);
396 }
397 
398 // ------------ method fills 'descriptions' with the allowed parameters for the module ----------
401 
402  desc.add<std::string>("folder", "MTD/Tracks/");
403 
404  descriptions.add("MtdTracksPostProcessor", desc);
405 }
406 
MonitorElement * meTPEtaMatchEtl2Eff_
MtdTracksHarvester(const edm::ParameterSet &iConfig)
MonitorElement * meTPEtaSelEff_
std::string folder_
MonitorElement * meEtlEtaEff2_[2]
MonitorElement * meTPAssocEff_
MonitorElement * meTPEtaMatchEff_
MonitorElement * meMVAEtaMatchEff_
Log< level::Error, false > LogError
MonitorElement * meTPmtdEtaMatchEff_
MonitorElement * meTPPtSelEff_
MonitorElement * meEtlPhiEff2_[2]
void computeEfficiency1D(MonitorElement *num, MonitorElement *den, MonitorElement *result)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
MonitorElement * meMVAPtSelEff_
T sqrt(T t)
Definition: SSEVec.h:19
MonitorElement * meEtlPhiEff_[2]
MonitorElement * meTPPtMatchEtl2Eff_
MonitorElement * meMVAPtMatchEff_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
MonitorElement * meEtlPtEff_[2]
const std::string folder_
MonitorElement * meBtlPtEff_
MonitorElement * meTPmtdEtaSelEff_
MonitorElement * meTPPtMatchEff_
MonitorElement * meEtlPtEff2_[2]
void add(std::string const &label, ParameterSetDescription const &psetDescription)
MonitorElement * meBtlEtaEff_
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:690
virtual TH1 * getTH1() const
~MtdTracksHarvester() override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MonitorElement * meBtlPhiEff_
virtual int getNbinsX() const
get # of bins in X-axis
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * meMVAEtaSelEff_
MonitorElement * meEtlEtaEff_[2]
MonitorElement * meTPmtdPtSelEff_
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
MonitorElement * meTPmtdPtMatchEff_
virtual double getBinContent(int binx) const
get content of bin (1-D)