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  void normalize(MonitorElement* h, double scale);
26 
28 
29  // --- Histograms
59 };
60 
61 // ------------ constructor and destructor --------------
63  : folder_(iConfig.getParameter<std::string>("folder")) {}
64 
66 
67 // auxiliary method to compute efficiency from the ratio of two 1D MonitorElement
69  for (int ibin = 1; ibin <= den->getNbinsX(); ibin++) {
70  double eff = num->getBinContent(ibin) / den->getBinContent(ibin);
71  double bin_err = sqrt((num->getBinContent(ibin) * (den->getBinContent(ibin) - num->getBinContent(ibin))) /
72  pow(den->getBinContent(ibin), 3));
73  if (den->getBinContent(ibin) == 0) {
74  eff = 0;
75  bin_err = 0;
76  }
77  result->setBinContent(ibin, eff);
78  result->setBinError(ibin, bin_err);
79  }
80 }
81 
83  double integral = h->getTH1F()->Integral();
84  double norma = (integral > 0.) ? scale / integral : 0.;
85  for (int ibin = 1; ibin <= h->getNbinsX(); ibin++) {
86  double eff = h->getBinContent(ibin) * norma;
87  double bin_err = h->getBinError(ibin) * norma;
88  h->setBinContent(ibin, eff);
89  h->setBinError(ibin, bin_err);
90  }
91 }
92 
93 // ------------ endjob tasks ----------------------------
95  // --- Get the monitoring histograms
96  MonitorElement* meBTLTrackEffEtaTot = igetter.get(folder_ + "TrackBTLEffEtaTot");
97  MonitorElement* meBTLTrackEffPhiTot = igetter.get(folder_ + "TrackBTLEffPhiTot");
98  MonitorElement* meBTLTrackEffPtTot = igetter.get(folder_ + "TrackBTLEffPtTot");
99  MonitorElement* meBTLTrackEffEtaMtd = igetter.get(folder_ + "TrackBTLEffEtaMtd");
100  MonitorElement* meBTLTrackEffPhiMtd = igetter.get(folder_ + "TrackBTLEffPhiMtd");
101  MonitorElement* meBTLTrackEffPtMtd = igetter.get(folder_ + "TrackBTLEffPtMtd");
102  MonitorElement* meETLTrackEffEtaTotZneg = igetter.get(folder_ + "TrackETLEffEtaTotZneg");
103  MonitorElement* meETLTrackEffEtaTotLowPt0 = igetter.get(folder_ + "TrackETLEffEtaTotLowPt0");
104  MonitorElement* meETLTrackEffEtaTotLowPt1 = igetter.get(folder_ + "TrackETLEffEtaTotLowPt1");
105  MonitorElement* meETLTrackEffPhiTotZneg = igetter.get(folder_ + "TrackETLEffPhiTotZneg");
106  MonitorElement* meETLTrackEffPtTotZneg = igetter.get(folder_ + "TrackETLEffPtTotZneg");
107  MonitorElement* meETLTrackEffEtaMtdZneg = igetter.get(folder_ + "TrackETLEffEtaMtdZneg");
108  MonitorElement* meETLTrackEffEtaMtdLowPt0 = igetter.get(folder_ + "TrackETLEffEtaMtdLowPt0");
109  MonitorElement* meETLTrackEffEtaMtdLowPt1 = igetter.get(folder_ + "TrackETLEffEtaMtdLowPt1");
110  MonitorElement* meETLTrackEffPhiMtdZneg = igetter.get(folder_ + "TrackETLEffPhiMtdZneg");
111  MonitorElement* meETLTrackEffPtMtdZneg = igetter.get(folder_ + "TrackETLEffPtMtdZneg");
112  MonitorElement* meETLTrackEffEta2MtdZneg = igetter.get(folder_ + "TrackETLEffEta2MtdZneg");
113  MonitorElement* meETLTrackEffEta2MtdLowPt0 = igetter.get(folder_ + "TrackETLEffEta2MtdLowPt0");
114  MonitorElement* meETLTrackEffEta2MtdLowPt1 = igetter.get(folder_ + "TrackETLEffEta2MtdLowPt1");
115  MonitorElement* meETLTrackEffPhi2MtdZneg = igetter.get(folder_ + "TrackETLEffPhi2MtdZneg");
116  MonitorElement* meETLTrackEffPt2MtdZneg = igetter.get(folder_ + "TrackETLEffPt2MtdZneg");
117  MonitorElement* meETLTrackEffEtaTotZpos = igetter.get(folder_ + "TrackETLEffEtaTotZpos");
118  MonitorElement* meETLTrackEffPhiTotZpos = igetter.get(folder_ + "TrackETLEffPhiTotZpos");
119  MonitorElement* meETLTrackEffPtTotZpos = igetter.get(folder_ + "TrackETLEffPtTotZpos");
120  MonitorElement* meETLTrackEffEtaMtdZpos = igetter.get(folder_ + "TrackETLEffEtaMtdZpos");
121  MonitorElement* meETLTrackEffPhiMtdZpos = igetter.get(folder_ + "TrackETLEffPhiMtdZpos");
122  MonitorElement* meETLTrackEffPtMtdZpos = igetter.get(folder_ + "TrackETLEffPtMtdZpos");
123  MonitorElement* meETLTrackEffEta2MtdZpos = igetter.get(folder_ + "TrackETLEffEta2MtdZpos");
124  MonitorElement* meETLTrackEffPhi2MtdZpos = igetter.get(folder_ + "TrackETLEffPhi2MtdZpos");
125  MonitorElement* meETLTrackEffPt2MtdZpos = igetter.get(folder_ + "TrackETLEffPt2MtdZpos");
126  MonitorElement* meTrackPtTot = igetter.get(folder_ + "TrackPtTot");
127  MonitorElement* meExtraPtMtd = igetter.get(folder_ + "ExtraPtMtd");
128  MonitorElement* meExtraPtEtl2Mtd = igetter.get(folder_ + "ExtraPtEtl2Mtd");
129  MonitorElement* meTrackMatchedTPEffPtTot = igetter.get(folder_ + "MatchedTPEffPtTot");
130  MonitorElement* meTrackMatchedTPEffPtTotLV = igetter.get(folder_ + "MatchedTPEffPtTotLV");
131  MonitorElement* meTrackMatchedTPEffPtMtd = igetter.get(folder_ + "MatchedTPEffPtMtd");
132  MonitorElement* meTrackMatchedTPEffPtEtl2Mtd = igetter.get(folder_ + "MatchedTPEffPtEtl2Mtd");
133  MonitorElement* meTrackMatchedTPmtdEffPtTot = igetter.get(folder_ + "MatchedTPmtdEffPtTot");
134  MonitorElement* meTrackMatchedTPmtdEffPtMtd = igetter.get(folder_ + "MatchedTPmtdEffPtMtd");
135  MonitorElement* meTrackEtaTot = igetter.get(folder_ + "TrackEtaTot");
136  MonitorElement* meExtraEtaMtd = igetter.get(folder_ + "ExtraEtaMtd");
137  MonitorElement* meExtraEtaEtl2Mtd = igetter.get(folder_ + "ExtraEtaEtl2Mtd");
138  MonitorElement* meTrackMatchedTPEffEtaTot = igetter.get(folder_ + "MatchedTPEffEtaTot");
139  MonitorElement* meTrackMatchedTPEffEtaTotLV = igetter.get(folder_ + "MatchedTPEffEtaTotLV");
140  MonitorElement* meTrackMatchedTPEffEtaMtd = igetter.get(folder_ + "MatchedTPEffEtaMtd");
141  MonitorElement* meTrackMatchedTPEffEtaEtl2Mtd = igetter.get(folder_ + "MatchedTPEffEtaEtl2Mtd");
142  MonitorElement* meTrackMatchedTPmtdEffEtaTot = igetter.get(folder_ + "MatchedTPmtdEffEtaTot");
143  MonitorElement* meTrackMatchedTPmtdEffEtaMtd = igetter.get(folder_ + "MatchedTPmtdEffEtaMtd");
144  MonitorElement* meTrackNumHits = igetter.get(folder_ + "TrackNumHits");
145  MonitorElement* meTrackNumHitsNT = igetter.get(folder_ + "TrackNumHitsNT");
146  MonitorElement* meExtraPhiAtBTL = igetter.get(folder_ + "ExtraPhiAtBTL");
147  MonitorElement* meExtraPhiAtBTLmatched = igetter.get(folder_ + "ExtraPhiAtBTLmatched");
148  MonitorElement* meExtraBTLeneInCone = igetter.get(folder_ + "ExtraBTLeneInCone");
149  MonitorElement* meExtraMTDfailExtenderEta = igetter.get(folder_ + "ExtraMTDfailExtenderEta");
150  MonitorElement* meExtraMTDfailExtenderPt = igetter.get(folder_ + "ExtraMTDfailExtenderPt");
151 
152  if (!meBTLTrackEffEtaTot || !meBTLTrackEffPhiTot || !meBTLTrackEffPtTot || !meBTLTrackEffEtaMtd ||
153  !meBTLTrackEffPhiMtd || !meBTLTrackEffPtMtd || !meETLTrackEffEtaTotZneg || !meETLTrackEffPhiTotZneg ||
154  !meETLTrackEffPtTotZneg || !meETLTrackEffEtaTotLowPt0 || !meETLTrackEffEtaTotLowPt1 || !meETLTrackEffEtaMtdZneg ||
155  !meETLTrackEffEtaMtdLowPt0 || !meETLTrackEffEtaMtdLowPt1 || !meETLTrackEffPhiMtdZneg || !meETLTrackEffPtMtdZneg ||
156  !meETLTrackEffEta2MtdZneg || !meETLTrackEffEta2MtdLowPt0 || !meETLTrackEffEta2MtdLowPt1 ||
157  !meETLTrackEffPhi2MtdZneg || !meETLTrackEffPt2MtdZneg || !meETLTrackEffEtaTotZpos || !meETLTrackEffPhiTotZpos ||
158  !meETLTrackEffPtTotZpos || !meETLTrackEffEtaMtdZpos || !meETLTrackEffPhiMtdZpos || !meETLTrackEffPtMtdZpos ||
159  !meETLTrackEffEta2MtdZpos || !meETLTrackEffPhi2MtdZpos || !meETLTrackEffPt2MtdZpos || !meTrackMatchedTPEffPtTot ||
160  !meTrackMatchedTPEffPtTotLV || !meTrackMatchedTPEffPtMtd || !meTrackMatchedTPEffPtEtl2Mtd ||
161  !meTrackMatchedTPmtdEffPtTot || !meTrackMatchedTPmtdEffPtMtd || !meTrackMatchedTPEffEtaTot ||
162  !meTrackMatchedTPEffEtaTotLV || !meTrackMatchedTPEffEtaMtd || !meTrackMatchedTPEffEtaEtl2Mtd ||
163  !meTrackMatchedTPmtdEffEtaTot || !meTrackMatchedTPmtdEffEtaMtd || !meTrackNumHits || !meTrackNumHitsNT ||
164  !meTrackPtTot || !meTrackEtaTot || !meExtraPtMtd || !meExtraPtEtl2Mtd || !meExtraEtaMtd || !meExtraEtaEtl2Mtd ||
165  !meExtraPhiAtBTL || !meExtraPhiAtBTLmatched || !meExtraBTLeneInCone || !meExtraMTDfailExtenderEta ||
166  !meExtraMTDfailExtenderPt) {
167  edm::LogError("MtdTracksHarvester") << "Monitoring histograms not found!" << std::endl;
168  return;
169  }
170 
171  // --- Book histograms
172  ibook.cd(folder_);
173  meBtlEtaEff_ = ibook.book1D("BtlEtaEff",
174  " Track Efficiency VS Eta;#eta;Efficiency",
175  meBTLTrackEffEtaTot->getNbinsX(),
176  meBTLTrackEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
177  meBTLTrackEffEtaTot->getTH1()->GetXaxis()->GetXmax());
178  meBtlEtaEff_->getTH1()->SetMinimum(0.);
179  computeEfficiency1D(meBTLTrackEffEtaMtd, meBTLTrackEffEtaTot, meBtlEtaEff_);
180 
181  meBtlPhiEff_ = ibook.book1D("BtlPhiEff",
182  "Track Efficiency VS Phi;#phi [rad];Efficiency",
183  meBTLTrackEffPhiTot->getNbinsX(),
184  meBTLTrackEffPhiTot->getTH1()->GetXaxis()->GetXmin(),
185  meBTLTrackEffPhiTot->getTH1()->GetXaxis()->GetXmax());
186  meBtlPhiEff_->getTH1()->SetMinimum(0.);
187  computeEfficiency1D(meBTLTrackEffPhiMtd, meBTLTrackEffPhiTot, meBtlPhiEff_);
188 
189  meBtlPtEff_ = ibook.book1D("BtlPtEff",
190  "Track Efficiency VS Pt;Pt [GeV];Efficiency",
191  meBTLTrackEffPtTot->getNbinsX(),
192  meBTLTrackEffPtTot->getTH1()->GetXaxis()->GetXmin(),
193  meBTLTrackEffPtTot->getTH1()->GetXaxis()->GetXmax());
194  meBtlPtEff_->getTH1()->SetMinimum(0.);
195  computeEfficiency1D(meBTLTrackEffPtMtd, meBTLTrackEffPtTot, meBtlPtEff_);
196 
197  meEtlEtaEff_[0] = ibook.book1D("EtlEtaEffZneg",
198  " Track Efficiency VS Eta (-Z);#eta;Efficiency",
199  meETLTrackEffEtaTotZneg->getNbinsX(),
200  meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmin(),
201  meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmax());
202  meEtlEtaEff_[0]->getTH1()->SetMinimum(0.);
203  computeEfficiency1D(meETLTrackEffEtaMtdZneg, meETLTrackEffEtaTotZneg, meEtlEtaEff_[0]);
204 
205  meEtlEtaEffLowPt_[0] = ibook.book1D("EtlEtaEffLowPt0",
206  " Track Efficiency VS Eta, 0.2 < pt < 0.45;#eta;Efficiency",
207  meETLTrackEffEtaTotLowPt0->getNbinsX(),
208  meETLTrackEffEtaTotLowPt0->getTH1()->GetXaxis()->GetXmin(),
209  meETLTrackEffEtaTotLowPt0->getTH1()->GetXaxis()->GetXmax());
210  meEtlEtaEffLowPt_[0]->getTH1()->SetMinimum(0.);
211  computeEfficiency1D(meETLTrackEffEtaMtdLowPt0, meETLTrackEffEtaTotLowPt0, meEtlEtaEffLowPt_[0]);
212 
213  meEtlPhiEff_[0] = ibook.book1D("EtlPhiEffZneg",
214  "Track Efficiency VS Phi (-Z);#phi [rad];Efficiency",
215  meETLTrackEffPhiTotZneg->getNbinsX(),
216  meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmin(),
217  meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmax());
218  meEtlPhiEff_[0]->getTH1()->SetMinimum(0.);
219  computeEfficiency1D(meETLTrackEffPhiMtdZneg, meETLTrackEffPhiTotZneg, meEtlPhiEff_[0]);
220 
221  meEtlPtEff_[0] = ibook.book1D("EtlPtEffZneg",
222  "Track Efficiency VS Pt (-Z);Pt [GeV];Efficiency",
223  meETLTrackEffPtTotZneg->getNbinsX(),
224  meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmin(),
225  meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmax());
226  meEtlPtEff_[0]->getTH1()->SetMinimum(0.);
227  computeEfficiency1D(meETLTrackEffPtMtdZneg, meETLTrackEffPtTotZneg, meEtlPtEff_[0]);
228 
229  meEtlEtaEff_[1] = ibook.book1D("EtlEtaEffZpos",
230  " Track Efficiency VS Eta (+Z);#eta;Efficiency",
231  meETLTrackEffEtaTotZpos->getNbinsX(),
232  meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmin(),
233  meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmax());
234  meEtlEtaEff_[1]->getTH1()->SetMinimum(0.);
235  computeEfficiency1D(meETLTrackEffEtaMtdZpos, meETLTrackEffEtaTotZpos, meEtlEtaEff_[1]);
236 
237  meEtlEtaEffLowPt_[1] = ibook.book1D("EtlEtaEffLowPt1",
238  " Track Efficiency VS Eta, 0.45 < pt < 0.7;#eta;Efficiency",
239  meETLTrackEffEtaTotLowPt1->getNbinsX(),
240  meETLTrackEffEtaTotLowPt1->getTH1()->GetXaxis()->GetXmin(),
241  meETLTrackEffEtaTotLowPt1->getTH1()->GetXaxis()->GetXmax());
242  meEtlEtaEffLowPt_[1]->getTH1()->SetMinimum(0.);
243  computeEfficiency1D(meETLTrackEffEtaMtdLowPt1, meETLTrackEffEtaTotLowPt1, meEtlEtaEffLowPt_[1]);
244 
245  meEtlPhiEff_[1] = ibook.book1D("EtlPhiEffZpos",
246  "Track Efficiency VS Phi (+Z);#phi [rad];Efficiency",
247  meETLTrackEffPhiTotZpos->getNbinsX(),
248  meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmin(),
249  meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmax());
250  meEtlPhiEff_[1]->getTH1()->SetMinimum(0.);
251  computeEfficiency1D(meETLTrackEffPhiMtdZpos, meETLTrackEffPhiTotZpos, meEtlPhiEff_[1]);
252 
253  meEtlPtEff_[1] = ibook.book1D("EtlPtEffZpos",
254  "Track Efficiency VS Pt (+Z);Pt [GeV];Efficiency",
255  meETLTrackEffPtTotZpos->getNbinsX(),
256  meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmin(),
257  meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmax());
258  meEtlPtEff_[1]->getTH1()->SetMinimum(0.);
259  computeEfficiency1D(meETLTrackEffPtMtdZpos, meETLTrackEffPtTotZpos, meEtlPtEff_[1]);
260 
261  meEtlEtaEff2_[0] = ibook.book1D("EtlEtaEff2Zneg",
262  " Track Efficiency VS Eta (-Z, 2 hit);#eta;Efficiency",
263  meETLTrackEffEtaTotZneg->getNbinsX(),
264  meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmin(),
265  meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmax());
266  meEtlEtaEff2_[0]->getTH1()->SetMinimum(0.);
267  computeEfficiency1D(meETLTrackEffEta2MtdZneg, meETLTrackEffEtaTotZneg, meEtlEtaEff2_[0]);
268 
269  meEtlEtaEff2LowPt_[0] = ibook.book1D("EtlEtaEff2LowPt0",
270  " Track Efficiency VS Eta (2 hits), 0.2 < pt < 0.45;#eta;Efficiency",
271  meETLTrackEffEtaTotLowPt0->getNbinsX(),
272  meETLTrackEffEtaTotLowPt0->getTH1()->GetXaxis()->GetXmin(),
273  meETLTrackEffEtaTotLowPt0->getTH1()->GetXaxis()->GetXmax());
274  meEtlEtaEff2LowPt_[0]->getTH1()->SetMinimum(0.);
275  computeEfficiency1D(meETLTrackEffEta2MtdLowPt0, meETLTrackEffEtaTotLowPt0, meEtlEtaEff2LowPt_[0]);
276 
277  meEtlPhiEff2_[0] = ibook.book1D("EtlPhiEff2Zneg",
278  "Track Efficiency VS Phi (-Z, 2 hits);#phi [rad];Efficiency",
279  meETLTrackEffPhiTotZneg->getNbinsX(),
280  meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmin(),
281  meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmax());
282  meEtlPhiEff2_[0]->getTH1()->SetMinimum(0.);
283  computeEfficiency1D(meETLTrackEffPhi2MtdZneg, meETLTrackEffPhiTotZneg, meEtlPhiEff2_[0]);
284 
285  meEtlPtEff2_[0] = ibook.book1D("EtlPtEff2Zneg",
286  "Track Efficiency VS Pt (-Z, 2 hits);Pt [GeV];Efficiency",
287  meETLTrackEffPtTotZneg->getNbinsX(),
288  meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmin(),
289  meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmax());
290  meEtlPtEff2_[0]->getTH1()->SetMinimum(0.);
291  computeEfficiency1D(meETLTrackEffPt2MtdZneg, meETLTrackEffPtTotZneg, meEtlPtEff2_[0]);
292 
293  meEtlEtaEff2_[1] = ibook.book1D("EtlEtaEff2Zpos",
294  "Track Efficiency VS Eta (+Z, 2 hits);#eta;Efficiency",
295  meETLTrackEffEtaTotZpos->getNbinsX(),
296  meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmin(),
297  meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmax());
298  meEtlEtaEff2_[1]->getTH1()->SetMinimum(0.);
299  computeEfficiency1D(meETLTrackEffEta2MtdZpos, meETLTrackEffEtaTotZpos, meEtlEtaEff2_[1]);
300 
301  meEtlEtaEff2LowPt_[1] = ibook.book1D("EtlEtaEff2LowPt1",
302  " Track Efficiency VS Eta (2 hits), 0.45 < pt < 0.7;#eta;Efficiency",
303  meETLTrackEffEtaTotLowPt1->getNbinsX(),
304  meETLTrackEffEtaTotLowPt1->getTH1()->GetXaxis()->GetXmin(),
305  meETLTrackEffEtaTotLowPt1->getTH1()->GetXaxis()->GetXmax());
306  meEtlEtaEff2LowPt_[1]->getTH1()->SetMinimum(0.);
307  computeEfficiency1D(meETLTrackEffEta2MtdLowPt1, meETLTrackEffEtaTotLowPt1, meEtlEtaEff2LowPt_[1]);
308 
309  meEtlPhiEff2_[1] = ibook.book1D("EtlPhiEff2Zpos",
310  "Track Efficiency VS Phi (+Z, 2 hits);#phi [rad];Efficiency",
311  meETLTrackEffPhiTotZpos->getNbinsX(),
312  meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmin(),
313  meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmax());
314  meEtlPhiEff2_[1]->getTH1()->SetMinimum(0.);
315  computeEfficiency1D(meETLTrackEffPhi2MtdZpos, meETLTrackEffPhiTotZpos, meEtlPhiEff2_[1]);
316 
317  meEtlPtEff2_[1] = ibook.book1D("EtlPtEff2Zpos",
318  "Track Efficiency VS Pt (+Z, 2 hits);Pt [GeV];Efficiency",
319  meETLTrackEffPtTotZpos->getNbinsX(),
320  meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmin(),
321  meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmax());
322  meEtlPtEff2_[1]->getTH1()->SetMinimum(0.);
323  computeEfficiency1D(meETLTrackEffPt2MtdZpos, meETLTrackEffPtTotZpos, meEtlPtEff2_[1]);
324 
325  meExtraPtEff_ =
326  ibook.book1D("ExtraPtEff",
327  "MTD matching efficiency wrt extrapolated track associated to LV VS Pt;Pt [GeV];Efficiency",
328  meTrackMatchedTPEffEtaTotLV->getNbinsX(),
329  meTrackMatchedTPEffEtaTotLV->getTH1()->GetXaxis()->GetXmin(),
330  meTrackMatchedTPEffEtaTotLV->getTH1()->GetXaxis()->GetXmax());
331  meExtraPtEff_->getTH1()->SetMinimum(0.);
332  computeEfficiency1D(meExtraPtMtd, meTrackMatchedTPEffPtTotLV, meExtraPtEff_);
333 
335  ibook.book1D("ExtraPtEtl2Eff",
336  "MTD matching efficiency (2 ETL) wrt extrapolated track associated to LV VS Pt;Pt [GeV];Efficiency",
337  meTrackMatchedTPEffEtaTotLV->getNbinsX(),
338  meTrackMatchedTPEffEtaTotLV->getTH1()->GetXaxis()->GetXmin(),
339  meTrackMatchedTPEffEtaTotLV->getTH1()->GetXaxis()->GetXmax());
340  meExtraPtEtl2Eff_->getTH1()->SetMinimum(0.);
341  computeEfficiency1D(meExtraPtEtl2Mtd, meTrackMatchedTPEffPtTotLV, meExtraPtEtl2Eff_);
342 
343  meExtraEtaEff_ = ibook.book1D("ExtraEtaEff",
344  "MTD matching efficiency wrt extrapolated track associated to LV VS Eta;Eta;Efficiency",
345  meTrackMatchedTPEffEtaTotLV->getNbinsX(),
346  meTrackMatchedTPEffEtaTotLV->getTH1()->GetXaxis()->GetXmin(),
347  meTrackMatchedTPEffEtaTotLV->getTH1()->GetXaxis()->GetXmax());
348  meExtraEtaEff_->getTH1()->SetMinimum(0.);
349  computeEfficiency1D(meExtraEtaMtd, meTrackMatchedTPEffEtaTotLV, meExtraEtaEff_);
350 
352  ibook.book1D("ExtraEtaEtl2Eff",
353  "MTD matching efficiency (2 ETL) wrt extrapolated track associated to LV VS Eta;Eta;Efficiency",
354  meTrackMatchedTPEffEtaTotLV->getNbinsX(),
355  meTrackMatchedTPEffEtaTotLV->getTH1()->GetXaxis()->GetXmin(),
356  meTrackMatchedTPEffEtaTotLV->getTH1()->GetXaxis()->GetXmax());
357  meExtraEtaEtl2Eff_->getTH1()->SetMinimum(0.);
358  computeEfficiency1D(meExtraEtaEtl2Mtd, meTrackMatchedTPEffEtaTotLV, meExtraEtaEtl2Eff_);
359 
360  meTPPtSelEff_ = ibook.book1D("TPPtSelEff",
361  "Track selected efficiency TP VS Pt;Pt [GeV];Efficiency",
362  meTrackPtTot->getNbinsX(),
363  meTrackPtTot->getTH1()->GetXaxis()->GetXmin(),
364  meTrackPtTot->getTH1()->GetXaxis()->GetXmax());
365  meTPPtSelEff_->getTH1()->SetMinimum(0.);
366  computeEfficiency1D(meTrackMatchedTPEffPtTot, meTrackPtTot, meTPPtSelEff_);
367 
368  meTPEtaSelEff_ = ibook.book1D("TPEtaSelEff",
369  "Track selected efficiency TP VS Eta;Eta;Efficiency",
370  meTrackEtaTot->getNbinsX(),
371  meTrackEtaTot->getTH1()->GetXaxis()->GetXmin(),
372  meTrackEtaTot->getTH1()->GetXaxis()->GetXmax());
373  meTPEtaSelEff_->getTH1()->SetMinimum(0.);
374  computeEfficiency1D(meTrackMatchedTPEffEtaTot, meTrackEtaTot, meTPEtaSelEff_);
375 
376  meTPPtMatchEff_ = ibook.book1D("TPPtMatchEff",
377  "Track matched to TP efficiency VS Pt;Pt [GeV];Efficiency",
378  meTrackMatchedTPEffPtTot->getNbinsX(),
379  meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmin(),
380  meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmax());
381  meTPPtMatchEff_->getTH1()->SetMinimum(0.);
382  computeEfficiency1D(meTrackMatchedTPEffPtMtd, meTrackMatchedTPEffPtTot, meTPPtMatchEff_);
383 
384  meTPEtaMatchEff_ = ibook.book1D("TPEtaMatchEff",
385  "Track matched to TP efficiency VS Eta;Eta;Efficiency",
386  meTrackMatchedTPEffEtaTot->getNbinsX(),
387  meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
388  meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmax());
389  meTPEtaMatchEff_->getTH1()->SetMinimum(0.);
390  computeEfficiency1D(meTrackMatchedTPEffEtaMtd, meTrackMatchedTPEffEtaTot, meTPEtaMatchEff_);
391 
392  meTPPtMatchEtl2Eff_ = ibook.book1D("TPPtMatchEtl2Eff",
393  "Track matched to TP efficiency VS Pt, 2 ETL hits;Pt [GeV];Efficiency",
394  meTrackMatchedTPEffPtTot->getNbinsX(),
395  meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmin(),
396  meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmax());
397  meTPPtMatchEtl2Eff_->getTH1()->SetMinimum(0.);
398  computeEfficiency1D(meTrackMatchedTPEffPtEtl2Mtd, meTrackMatchedTPEffPtTot, meTPPtMatchEtl2Eff_);
399 
400  meTPEtaMatchEtl2Eff_ = ibook.book1D("TPEtaMatchEtl2Eff",
401  "Track matched to TP efficiency VS Eta, 2 ETL hits;Eta;Efficiency",
402  meTrackMatchedTPEffEtaTot->getNbinsX(),
403  meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
404  meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmax());
405  meTPEtaMatchEtl2Eff_->getTH1()->SetMinimum(0.);
406  computeEfficiency1D(meTrackMatchedTPEffEtaEtl2Mtd, meTrackMatchedTPEffEtaTot, meTPEtaMatchEtl2Eff_);
407 
408  meTPmtdPtSelEff_ = ibook.book1D("TPmtdPtSelEff",
409  "Track selected efficiency TP-mtd hit VS Pt;Pt [GeV];Efficiency",
410  meTrackPtTot->getNbinsX(),
411  meTrackPtTot->getTH1()->GetXaxis()->GetXmin(),
412  meTrackPtTot->getTH1()->GetXaxis()->GetXmax());
413  meTPmtdPtSelEff_->getTH1()->SetMinimum(0.);
414  computeEfficiency1D(meTrackMatchedTPmtdEffPtTot, meTrackPtTot, meTPmtdPtSelEff_);
415 
416  meTPmtdEtaSelEff_ = ibook.book1D("TPmtdEtaSelEff",
417  "Track selected efficiency TPmtd hit VS Eta;Eta;Efficiency",
418  meTrackEtaTot->getNbinsX(),
419  meTrackEtaTot->getTH1()->GetXaxis()->GetXmin(),
420  meTrackEtaTot->getTH1()->GetXaxis()->GetXmax());
421  meTPmtdEtaSelEff_->getTH1()->SetMinimum(0.);
422  computeEfficiency1D(meTrackMatchedTPmtdEffEtaTot, meTrackEtaTot, meTPmtdEtaSelEff_);
423 
424  meTPmtdPtMatchEff_ = ibook.book1D("TPmtdPtMatchEff",
425  "Track matched to TP-mtd hit efficiency VS Pt;Pt [GeV];Efficiency",
426  meTrackMatchedTPmtdEffPtTot->getNbinsX(),
427  meTrackMatchedTPmtdEffPtTot->getTH1()->GetXaxis()->GetXmin(),
428  meTrackMatchedTPmtdEffPtTot->getTH1()->GetXaxis()->GetXmax());
429  meTPmtdPtMatchEff_->getTH1()->SetMinimum(0.);
430  computeEfficiency1D(meTrackMatchedTPmtdEffPtMtd, meTrackMatchedTPmtdEffPtTot, meTPmtdPtMatchEff_);
431 
432  meTPmtdEtaMatchEff_ = ibook.book1D("TPmtdEtaMatchEff",
433  "Track matched to TP-mtd hit efficiency VS Eta;Eta;Efficiency",
434  meTrackMatchedTPmtdEffEtaTot->getNbinsX(),
435  meTrackMatchedTPmtdEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
436  meTrackMatchedTPmtdEffEtaTot->getTH1()->GetXaxis()->GetXmax());
437  meTPmtdEtaMatchEff_->getTH1()->SetMinimum(0.);
438  computeEfficiency1D(meTrackMatchedTPmtdEffEtaMtd, meTrackMatchedTPmtdEffEtaTot, meTPmtdEtaMatchEff_);
439 
440  meNoTimeFraction_ = ibook.book1D("NoTimeFraction",
441  "Fraction of tracks with MTD hits and no time associated; Num. of hits",
442  meTrackNumHits->getNbinsX(),
443  meTrackNumHits->getTH1()->GetXaxis()->GetXmin(),
444  meTrackNumHits->getTH1()->GetXaxis()->GetXmax());
445  meNoTimeFraction_->getTH1()->SetMinimum(0.);
446  computeEfficiency1D(meTrackNumHitsNT, meTrackNumHits, meNoTimeFraction_);
447 
448  meBtlEtaEff_->getTH1()->SetMinimum(0.);
449  meBtlPhiEff_->getTH1()->SetMinimum(0.);
450  meBtlPtEff_->getTH1()->SetMinimum(0.);
451  for (int i = 0; i < 2; i++) {
452  meEtlEtaEff_[i]->getTH1()->SetMinimum(0.);
453  meEtlEtaEffLowPt_[i]->getTH1()->SetMinimum(0.);
454  meEtlPhiEff_[i]->getTH1()->SetMinimum(0.);
455  meEtlPtEff_[i]->getTH1()->SetMinimum(0.);
456  meEtlEtaEff2_[i]->getTH1()->SetMinimum(0.);
457  meEtlEtaEff2LowPt_[i]->getTH1()->SetMinimum(0.);
458  meEtlPhiEff2_[i]->getTH1()->SetMinimum(0.);
459  meEtlPtEff2_[i]->getTH1()->SetMinimum(0.);
460  }
461 
462  meExtraPhiAtBTLEff_ = ibook.book1D("ExtraPhiAtBTLEff",
463  "Efficiency to match hits at BTL surface of extrapolated tracks associated to LV",
464  meExtraPhiAtBTL->getNbinsX(),
465  meExtraPhiAtBTL->getTH1()->GetXaxis()->GetXmin(),
466  meExtraPhiAtBTL->getTH1()->GetXaxis()->GetXmax());
467  meExtraPhiAtBTLEff_->getTH1()->SetMinimum(0.);
468  computeEfficiency1D(meExtraPhiAtBTLmatched, meExtraPhiAtBTL, meExtraPhiAtBTLEff_);
469 
470  normalize(meExtraBTLeneInCone, 1.);
471 
473  ibook.book1D("ExtraMTDfailExtenderEtaEff",
474  "Track associated to LV extrapolated at MTD surface no extender efficiency VS Eta;Eta;Efficiency",
475  meTrackMatchedTPEffEtaTotLV->getNbinsX(),
476  meTrackMatchedTPEffEtaTotLV->getTH1()->GetXaxis()->GetXmin(),
477  meTrackMatchedTPEffEtaTotLV->getTH1()->GetXaxis()->GetXmax());
478  meExtraMTDfailExtenderEtaEff_->getTH1()->SetMinimum(0.);
479  computeEfficiency1D(meExtraMTDfailExtenderEta, meTrackMatchedTPEffEtaTotLV, meExtraMTDfailExtenderEtaEff_);
480 
482  "ExtraMTDfailExtenderPtEff",
483  "Track associated to LV extrapolated at MTD surface no extender efficiency VS Pt;Pt [GeV];Efficiency",
484  meTrackMatchedTPEffPtTotLV->getNbinsX(),
485  meTrackMatchedTPEffPtTotLV->getTH1()->GetXaxis()->GetXmin(),
486  meTrackMatchedTPEffPtTotLV->getTH1()->GetXaxis()->GetXmax());
487  meExtraMTDfailExtenderPtEff_->getTH1()->SetMinimum(0.);
488  computeEfficiency1D(meExtraMTDfailExtenderPt, meTrackMatchedTPEffPtTotLV, meExtraMTDfailExtenderPtEff_);
489 }
490 
491 // ------------ method fills 'descriptions' with the allowed parameters for the module ----------
494 
495  desc.add<std::string>("folder", "MTD/Tracks/");
496 
497  descriptions.add("MtdTracksPostProcessor", desc);
498 }
499 
MonitorElement * meExtraPtEff_
MonitorElement * meTPEtaMatchEtl2Eff_
MonitorElement * meExtraMTDfailExtenderPtEff_
MtdTracksHarvester(const edm::ParameterSet &iConfig)
MonitorElement * meTPEtaSelEff_
std::string folder_
MonitorElement * meEtlEtaEff2_[2]
MonitorElement * meTPEtaMatchEff_
MonitorElement * meExtraEtaEtl2Eff_
MonitorElement * meExtraPhiAtBTLEff_
Log< level::Error, false > LogError
MonitorElement * meEtlEtaEff2LowPt_[2]
MonitorElement * meTPmtdEtaMatchEff_
MonitorElement * meTPPtSelEff_
MonitorElement * meEtlPhiEff2_[2]
void computeEfficiency1D(MonitorElement *num, MonitorElement *den, MonitorElement *result)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
T sqrt(T t)
Definition: SSEVec.h:23
MonitorElement * meEtlPhiEff_[2]
MonitorElement * meTPPtMatchEtl2Eff_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
MonitorElement * meEtlPtEff_[2]
const std::string folder_
MonitorElement * meBtlPtEff_
MonitorElement * meEtlEtaEffLowPt_[2]
Integral< F, X >::type integral(const F &f)
Definition: Integral.h:70
MonitorElement * meTPmtdEtaSelEff_
void normalize(MonitorElement *h, double scale)
MonitorElement * meTPPtMatchEff_
MonitorElement * meEtlPtEff2_[2]
MonitorElement * meExtraPtEtl2Eff_
MonitorElement * meExtraEtaEff_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
MonitorElement * meBtlEtaEff_
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
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 * meNoTimeFraction_
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
MonitorElement * meEtlEtaEff_[2]
MonitorElement * meTPmtdPtSelEff_
MonitorElement * meExtraMTDfailExtenderEtaEff_
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)