69 for (
int ibin = 1; ibin <= den->
getNbinsX(); ibin++) {
77 result->setBinContent(ibin, eff);
78 result->setBinError(ibin, bin_err);
83 double integral =
h->getTH1F()->Integral();
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);
148 if (!meBTLTrackEffEtaTot || !meBTLTrackEffPhiTot || !meBTLTrackEffPtTot || !meBTLTrackEffEtaMtd ||
149 !meBTLTrackEffPhiMtd || !meBTLTrackEffPtMtd || !meETLTrackEffEtaTotZneg || !meETLTrackEffPhiTotZneg ||
150 !meETLTrackEffPtTotZneg || !meETLTrackEffEtaMtdZneg || !meETLTrackEffPhiMtdZneg || !meETLTrackEffPtMtdZneg ||
151 !meETLTrackEffEta2MtdZneg || !meETLTrackEffPhi2MtdZneg || !meETLTrackEffPt2MtdZneg || !meETLTrackEffEtaTotZpos ||
152 !meETLTrackEffPhiTotZpos || !meETLTrackEffPtTotZpos || !meETLTrackEffEtaMtdZpos || !meETLTrackEffPhiMtdZpos ||
153 !meETLTrackEffPtMtdZpos || !meETLTrackEffEta2MtdZpos || !meETLTrackEffPhi2MtdZpos || !meETLTrackEffPt2MtdZpos ||
154 !meMVATrackEffPtTot || !meMVATrackMatchedEffPtTot || !meMVATrackMatchedEffPtMtd || !meMVATrackEffEtaTot ||
155 !meMVATrackMatchedEffEtaTot || !meMVATrackMatchedEffEtaMtd || !meTrackMatchedTPEffPtTot ||
156 !meTrackMatchedTPEffPtMtd || !meTrackMatchedTPEffPtEtl2Mtd || !meTrackMatchedTPmtdEffPtTot ||
157 !meTrackMatchedTPmtdEffPtMtd || !meTrackMatchedTPEffEtaTot || !meTrackMatchedTPEffEtaMtd ||
158 !meTrackMatchedTPEffEtaEtl2Mtd || !meTrackMatchedTPmtdEffEtaTot || !meTrackMatchedTPmtdEffEtaMtd ||
159 !meTrackNumHits || !meTrackNumHitsNT || !meTrackPtTot || !meTrackEtaTot) {
160 edm::LogError(
"MtdTracksHarvester") <<
"Monitoring histograms not found!" << std::endl;
167 " Track Efficiency VS Eta;#eta;Efficiency",
169 meBTLTrackEffEtaTot->
getTH1()->GetXaxis()->GetXmin(),
170 meBTLTrackEffEtaTot->
getTH1()->GetXaxis()->GetXmax());
175 "Track Efficiency VS Phi;#phi [rad];Efficiency",
177 meBTLTrackEffPhiTot->
getTH1()->GetXaxis()->GetXmin(),
178 meBTLTrackEffPhiTot->
getTH1()->GetXaxis()->GetXmax());
183 "Track Efficiency VS Pt;Pt [GeV];Efficiency",
185 meBTLTrackEffPtTot->
getTH1()->GetXaxis()->GetXmin(),
186 meBTLTrackEffPtTot->
getTH1()->GetXaxis()->GetXmax());
191 " Track Efficiency VS Eta (-Z);#eta;Efficiency",
193 meETLTrackEffEtaTotZneg->
getTH1()->GetXaxis()->GetXmin(),
194 meETLTrackEffEtaTotZneg->
getTH1()->GetXaxis()->GetXmax());
199 "Track Efficiency VS Phi (-Z);#phi [rad];Efficiency",
201 meETLTrackEffPhiTotZneg->
getTH1()->GetXaxis()->GetXmin(),
202 meETLTrackEffPhiTotZneg->
getTH1()->GetXaxis()->GetXmax());
207 "Track Efficiency VS Pt (-Z);Pt [GeV];Efficiency",
209 meETLTrackEffPtTotZneg->
getTH1()->GetXaxis()->GetXmin(),
210 meETLTrackEffPtTotZneg->
getTH1()->GetXaxis()->GetXmax());
215 " Track Efficiency VS Eta (+Z);#eta;Efficiency",
217 meETLTrackEffEtaTotZpos->
getTH1()->GetXaxis()->GetXmin(),
218 meETLTrackEffEtaTotZpos->
getTH1()->GetXaxis()->GetXmax());
223 "Track Efficiency VS Phi (+Z);#phi [rad];Efficiency",
225 meETLTrackEffPhiTotZpos->
getTH1()->GetXaxis()->GetXmin(),
226 meETLTrackEffPhiTotZpos->
getTH1()->GetXaxis()->GetXmax());
231 "Track Efficiency VS Pt (+Z);Pt [GeV];Efficiency",
233 meETLTrackEffPtTotZpos->
getTH1()->GetXaxis()->GetXmin(),
234 meETLTrackEffPtTotZpos->
getTH1()->GetXaxis()->GetXmax());
239 " Track Efficiency VS Eta (-Z, 2 hit);#eta;Efficiency",
241 meETLTrackEffEtaTotZneg->
getTH1()->GetXaxis()->GetXmin(),
242 meETLTrackEffEtaTotZneg->
getTH1()->GetXaxis()->GetXmax());
247 "Track Efficiency VS Phi (-Z, 2 hit);#phi [rad];Efficiency",
249 meETLTrackEffPhiTotZneg->
getTH1()->GetXaxis()->GetXmin(),
250 meETLTrackEffPhiTotZneg->
getTH1()->GetXaxis()->GetXmax());
255 "Track Efficiency VS Pt (-Z, 2 hit);Pt [GeV];Efficiency",
257 meETLTrackEffPtTotZneg->
getTH1()->GetXaxis()->GetXmin(),
258 meETLTrackEffPtTotZneg->
getTH1()->GetXaxis()->GetXmax());
263 "Track Efficiency VS Eta (+Z, 2 hit);#eta;Efficiency",
265 meETLTrackEffEtaTotZpos->
getTH1()->GetXaxis()->GetXmin(),
266 meETLTrackEffEtaTotZpos->
getTH1()->GetXaxis()->GetXmax());
271 "Track Efficiency VS Phi (+Z, 2 hit);#phi [rad];Efficiency",
273 meETLTrackEffPhiTotZpos->
getTH1()->GetXaxis()->GetXmin(),
274 meETLTrackEffPhiTotZpos->
getTH1()->GetXaxis()->GetXmax());
279 "Track Efficiency VS Pt (+Z, 2 hit);Pt [GeV];Efficiency",
281 meETLTrackEffPtTotZpos->
getTH1()->GetXaxis()->GetXmin(),
282 meETLTrackEffPtTotZpos->
getTH1()->GetXaxis()->GetXmax());
286 if (meExtraPtMtd && meExtraPtEtl2Mtd && meExtraEtaMtd && meExtraEtaEtl2Mtd) {
288 "MTD matching efficiency wrt extrapolated track VS Pt;Pt [GeV];Efficiency",
290 meMVATrackEffPtTot->
getTH1()->GetXaxis()->GetXmin(),
291 meMVATrackEffPtTot->
getTH1()->GetXaxis()->GetXmax());
296 "MTD matching efficiency (2 ETL) wrt extrapolated track VS Pt;Pt [GeV];Efficiency",
298 meMVATrackEffPtTot->
getTH1()->GetXaxis()->GetXmin(),
299 meMVATrackEffPtTot->
getTH1()->GetXaxis()->GetXmax());
304 "MTD matching efficiency wrt extrapolated track VS Eta;Eta;Efficiency",
306 meMVATrackEffEtaTot->
getTH1()->GetXaxis()->GetXmin(),
307 meMVATrackEffEtaTot->
getTH1()->GetXaxis()->GetXmax());
312 "MTD matching efficiency (2 ETL) wrt extrapolated track VS Eta;Eta;Efficiency",
314 meMVATrackEffEtaTot->
getTH1()->GetXaxis()->GetXmin(),
315 meMVATrackEffEtaTot->
getTH1()->GetXaxis()->GetXmax());
321 "Track selected efficiency VS Pt;Pt [GeV];Efficiency",
323 meMVATrackEffPtTot->
getTH1()->GetXaxis()->GetXmin(),
324 meMVATrackEffPtTot->
getTH1()->GetXaxis()->GetXmax());
329 "Track selected efficiency VS Eta;Eta;Efficiency",
331 meMVATrackEffEtaTot->
getTH1()->GetXaxis()->GetXmin(),
332 meMVATrackEffEtaTot->
getTH1()->GetXaxis()->GetXmax());
337 "Track matched to GEN efficiency VS Pt;Pt [GeV];Efficiency",
339 meMVATrackMatchedEffPtTot->
getTH1()->GetXaxis()->GetXmin(),
340 meMVATrackMatchedEffPtTot->
getTH1()->GetXaxis()->GetXmax());
345 "Track matched to GEN efficiency VS Eta;Eta;Efficiency",
347 meMVATrackMatchedEffEtaTot->
getTH1()->GetXaxis()->GetXmin(),
348 meMVATrackMatchedEffEtaTot->
getTH1()->GetXaxis()->GetXmax());
353 "Track selected efficiency TP VS Pt;Pt [GeV];Efficiency",
355 meMVATrackEffPtTot->
getTH1()->GetXaxis()->GetXmin(),
356 meMVATrackEffPtTot->
getTH1()->GetXaxis()->GetXmax());
361 "Track selected efficiency TP VS Eta;Eta;Efficiency",
363 meMVATrackEffEtaTot->
getTH1()->GetXaxis()->GetXmin(),
364 meMVATrackEffEtaTot->
getTH1()->GetXaxis()->GetXmax());
369 "Track matched to TP efficiency VS Pt;Pt [GeV];Efficiency",
371 meTrackMatchedTPEffPtTot->
getTH1()->GetXaxis()->GetXmin(),
372 meTrackMatchedTPEffPtTot->
getTH1()->GetXaxis()->GetXmax());
377 "Track matched to TP efficiency VS Eta;Eta;Efficiency",
379 meTrackMatchedTPEffEtaTot->
getTH1()->GetXaxis()->GetXmin(),
380 meTrackMatchedTPEffEtaTot->
getTH1()->GetXaxis()->GetXmax());
385 "Track matched to TP efficiency VS Pt, 2 ETL hits;Pt [GeV];Efficiency",
387 meTrackMatchedTPEffPtTot->
getTH1()->GetXaxis()->GetXmin(),
388 meTrackMatchedTPEffPtTot->
getTH1()->GetXaxis()->GetXmax());
393 "Track matched to TP efficiency VS Eta, 2 ETL hits;Eta;Efficiency",
395 meTrackMatchedTPEffEtaTot->
getTH1()->GetXaxis()->GetXmin(),
396 meTrackMatchedTPEffEtaTot->
getTH1()->GetXaxis()->GetXmax());
401 "Track selected efficiency TP-mtd hit VS Pt;Pt [GeV];Efficiency",
403 meMVATrackEffPtTot->
getTH1()->GetXaxis()->GetXmin(),
404 meMVATrackEffPtTot->
getTH1()->GetXaxis()->GetXmax());
409 "Track selected efficiency TPmtd hit VS Eta;Eta;Efficiency",
411 meMVATrackEffEtaTot->
getTH1()->GetXaxis()->GetXmin(),
412 meMVATrackEffEtaTot->
getTH1()->GetXaxis()->GetXmax());
417 "Track matched to TP-mtd hit efficiency VS Pt;Pt [GeV];Efficiency",
418 meTrackMatchedTPmtdEffPtTot->
getNbinsX(),
419 meTrackMatchedTPmtdEffPtTot->
getTH1()->GetXaxis()->GetXmin(),
420 meTrackMatchedTPmtdEffPtTot->
getTH1()->GetXaxis()->GetXmax());
425 "Track matched to TP-mtd hit efficiency VS Eta;Eta;Efficiency",
426 meTrackMatchedTPmtdEffEtaTot->
getNbinsX(),
427 meTrackMatchedTPmtdEffEtaTot->
getTH1()->GetXaxis()->GetXmin(),
428 meTrackMatchedTPmtdEffEtaTot->
getTH1()->GetXaxis()->GetXmax());
433 "Fraction of tracks with MTD hits and no time associated; Num. of hits",
435 meTrackNumHits->
getTH1()->GetXaxis()->GetXmin(),
436 meTrackNumHits->
getTH1()->GetXaxis()->GetXmax());
443 for (
int i = 0;
i < 2;
i++) {
456 if (meExtraPtMtd && meExtraPtEtl2Mtd && meExtraEtaMtd && meExtraEtaEtl2Mtd) {
458 "MTD matching efficiency wrt extrapolated track VS Pt;Pt [GeV];Efficiency",
460 meMVATrackEffPtTot->
getTH1()->GetXaxis()->GetXmin(),
461 meMVATrackEffPtTot->
getTH1()->GetXaxis()->GetXmax());
466 "MTD matching efficiency (2 ETL) wrt extrapolated track VS Pt;Pt [GeV];Efficiency",
468 meMVATrackEffPtTot->
getTH1()->GetXaxis()->GetXmin(),
469 meMVATrackEffPtTot->
getTH1()->GetXaxis()->GetXmax());
474 "MTD matching efficiency wrt extrapolated track VS Eta;Eta;Efficiency",
476 meMVATrackEffEtaTot->
getTH1()->GetXaxis()->GetXmin(),
477 meMVATrackEffEtaTot->
getTH1()->GetXaxis()->GetXmax());
482 "MTD matching efficiency (2 ETL) wrt extrapolated track VS Eta;Eta;Efficiency",
484 meMVATrackEffEtaTot->
getTH1()->GetXaxis()->GetXmin(),
485 meMVATrackEffEtaTot->
getTH1()->GetXaxis()->GetXmax());
490 if (meExtraPhiAtBTL && meExtraPhiAtBTLmatched && meExtraBTLeneInCone) {
492 "Efficiency to match hits at BTL surface",
494 meExtraPhiAtBTL->
getTH1()->GetXaxis()->GetXmin(),
495 meExtraPhiAtBTL->
getTH1()->GetXaxis()->GetXmax());
509 descriptions.
add(
"MtdTracksPostProcessor",
desc);
MonitorElement * meExtraPtEff_
MonitorElement * meTPEtaMatchEtl2Eff_
MtdTracksHarvester(const edm::ParameterSet &iConfig)
MonitorElement * meTPEtaSelEff_
MonitorElement * meEtlEtaEff2_[2]
MonitorElement * meTPEtaMatchEff_
MonitorElement * meExtraEtaEtl2Eff_
MonitorElement * meMVAEtaMatchEff_
MonitorElement * meExtraPhiAtBTLEff_
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_
MonitorElement * meEtlPhiEff_[2]
MonitorElement * meTPPtMatchEtl2Eff_
MonitorElement * meMVAPtMatchEff_
#define DEFINE_FWK_MODULE(type)
MonitorElement * meEtlPtEff_[2]
const std::string folder_
MonitorElement * meBtlPtEff_
Integral< F, X >::type integral(const F &f)
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
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())
MonitorElement * meMVAEtaSelEff_
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
MonitorElement * meEtlEtaEff_[2]
MonitorElement * meTPmtdPtSelEff_
MonitorElement * meTPmtdPtMatchEff_
virtual double getBinContent(int binx) const
get content of bin (1-D)