Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-22 22:49:26

0001 #include <string>
0002 
0003 #include "FWCore/Framework/interface/MakerMacros.h"
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "FWCore/ServiceRegistry/interface/Service.h"
0006 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0007 
0008 #include "DQMServices/Core/interface/DQMEDHarvester.h"
0009 #include "DQMServices/Core/interface/DQMStore.h"
0010 
0011 #include "DataFormats/ForwardDetId/interface/ETLDetId.h"
0012 
0013 class MtdTracksHarvester : public DQMEDHarvester {
0014 public:
0015   explicit MtdTracksHarvester(const edm::ParameterSet& iConfig);
0016   ~MtdTracksHarvester() override;
0017 
0018   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0019 
0020 protected:
0021   void dqmEndJob(DQMStore::IBooker&, DQMStore::IGetter&) override;
0022 
0023 private:
0024   void computeEfficiency1D(MonitorElement* num, MonitorElement* den, MonitorElement* result);
0025 
0026   const std::string folder_;
0027 
0028   // --- Histograms
0029   MonitorElement* meBtlEtaEff_;
0030   MonitorElement* meBtlPhiEff_;
0031   MonitorElement* meBtlPtEff_;
0032   MonitorElement* meEtlEtaEff_[2];
0033   MonitorElement* meEtlPhiEff_[2];
0034   MonitorElement* meEtlPtEff_[2];
0035   MonitorElement* meEtlEtaEff2_[2];
0036   MonitorElement* meEtlPhiEff2_[2];
0037   MonitorElement* meEtlPtEff2_[2];
0038   MonitorElement* meMVAPtSelEff_;
0039   MonitorElement* meMVAEtaSelEff_;
0040   MonitorElement* meMVAPtMatchEff_;
0041   MonitorElement* meMVAEtaMatchEff_;
0042   MonitorElement* meTPPtSelEff_;
0043   MonitorElement* meTPEtaSelEff_;
0044   MonitorElement* meTPPtMatchEff_;
0045   MonitorElement* meTPEtaMatchEff_;
0046   MonitorElement* meTPPtMatchEtl2Eff_;
0047   MonitorElement* meTPEtaMatchEtl2Eff_;
0048   MonitorElement* meTPmtdPtSelEff_;
0049   MonitorElement* meTPmtdEtaSelEff_;
0050   MonitorElement* meTPmtdPtMatchEff_;
0051   MonitorElement* meTPmtdEtaMatchEff_;
0052   MonitorElement* meTPAssocEff_;
0053 };
0054 
0055 // ------------ constructor and destructor --------------
0056 MtdTracksHarvester::MtdTracksHarvester(const edm::ParameterSet& iConfig)
0057     : folder_(iConfig.getParameter<std::string>("folder")) {}
0058 
0059 MtdTracksHarvester::~MtdTracksHarvester() {}
0060 
0061 // auxiliary method to compute efficiency from the ratio of two 1D MonitorElement
0062 void MtdTracksHarvester::computeEfficiency1D(MonitorElement* num, MonitorElement* den, MonitorElement* result) {
0063   for (int ibin = 1; ibin <= den->getNbinsX(); ibin++) {
0064     double eff = num->getBinContent(ibin) / den->getBinContent(ibin);
0065     double bin_err = sqrt((num->getBinContent(ibin) * (den->getBinContent(ibin) - num->getBinContent(ibin))) /
0066                           pow(den->getBinContent(ibin), 3));
0067     if (den->getBinContent(ibin) == 0) {
0068       eff = 0;
0069       bin_err = 0;
0070     }
0071     result->setBinContent(ibin, eff);
0072     result->setBinError(ibin, bin_err);
0073   }
0074 }
0075 
0076 // ------------ endjob tasks ----------------------------
0077 void MtdTracksHarvester::dqmEndJob(DQMStore::IBooker& ibook, DQMStore::IGetter& igetter) {
0078   // --- Get the monitoring histograms
0079   MonitorElement* meBTLTrackEffEtaTot = igetter.get(folder_ + "TrackBTLEffEtaTot");
0080   MonitorElement* meBTLTrackEffPhiTot = igetter.get(folder_ + "TrackBTLEffPhiTot");
0081   MonitorElement* meBTLTrackEffPtTot = igetter.get(folder_ + "TrackBTLEffPtTot");
0082   MonitorElement* meBTLTrackEffEtaMtd = igetter.get(folder_ + "TrackBTLEffEtaMtd");
0083   MonitorElement* meBTLTrackEffPhiMtd = igetter.get(folder_ + "TrackBTLEffPhiMtd");
0084   MonitorElement* meBTLTrackEffPtMtd = igetter.get(folder_ + "TrackBTLEffPtMtd");
0085   MonitorElement* meETLTrackEffEtaTotZneg = igetter.get(folder_ + "TrackETLEffEtaTotZneg");
0086   MonitorElement* meETLTrackEffPhiTotZneg = igetter.get(folder_ + "TrackETLEffPhiTotZneg");
0087   MonitorElement* meETLTrackEffPtTotZneg = igetter.get(folder_ + "TrackETLEffPtTotZneg");
0088   MonitorElement* meETLTrackEffEtaMtdZneg = igetter.get(folder_ + "TrackETLEffEtaMtdZneg");
0089   MonitorElement* meETLTrackEffPhiMtdZneg = igetter.get(folder_ + "TrackETLEffPhiMtdZneg");
0090   MonitorElement* meETLTrackEffPtMtdZneg = igetter.get(folder_ + "TrackETLEffPtMtdZneg");
0091   MonitorElement* meETLTrackEffEta2MtdZneg = igetter.get(folder_ + "TrackETLEffEta2MtdZneg");
0092   MonitorElement* meETLTrackEffPhi2MtdZneg = igetter.get(folder_ + "TrackETLEffPhi2MtdZneg");
0093   MonitorElement* meETLTrackEffPt2MtdZneg = igetter.get(folder_ + "TrackETLEffPt2MtdZneg");
0094   MonitorElement* meETLTrackEffEtaTotZpos = igetter.get(folder_ + "TrackETLEffEtaTotZpos");
0095   MonitorElement* meETLTrackEffPhiTotZpos = igetter.get(folder_ + "TrackETLEffPhiTotZpos");
0096   MonitorElement* meETLTrackEffPtTotZpos = igetter.get(folder_ + "TrackETLEffPtTotZpos");
0097   MonitorElement* meETLTrackEffEtaMtdZpos = igetter.get(folder_ + "TrackETLEffEtaMtdZpos");
0098   MonitorElement* meETLTrackEffPhiMtdZpos = igetter.get(folder_ + "TrackETLEffPhiMtdZpos");
0099   MonitorElement* meETLTrackEffPtMtdZpos = igetter.get(folder_ + "TrackETLEffPtMtdZpos");
0100   MonitorElement* meETLTrackEffEta2MtdZpos = igetter.get(folder_ + "TrackETLEffEta2MtdZpos");
0101   MonitorElement* meETLTrackEffPhi2MtdZpos = igetter.get(folder_ + "TrackETLEffPhi2MtdZpos");
0102   MonitorElement* meETLTrackEffPt2MtdZpos = igetter.get(folder_ + "TrackETLEffPt2MtdZpos");
0103   MonitorElement* meMVATrackEffPtTot = igetter.get(folder_ + "MVAEffPtTot");
0104   MonitorElement* meMVATrackMatchedEffPtTot = igetter.get(folder_ + "MVAMatchedEffPtTot");
0105   MonitorElement* meMVATrackMatchedEffPtMtd = igetter.get(folder_ + "MVAMatchedEffPtMtd");
0106   MonitorElement* meTrackMatchedTPEffPtTot = igetter.get(folder_ + "MatchedTPEffPtTot");
0107   MonitorElement* meTrackMatchedTPEffPtMtd = igetter.get(folder_ + "MatchedTPEffPtMtd");
0108   MonitorElement* meTrackMatchedTPEffPtEtl2Mtd = igetter.get(folder_ + "MatchedTPEffPtEtl2Mtd");
0109   MonitorElement* meTrackMatchedTPmtdEffPtTot = igetter.get(folder_ + "MatchedTPmtdEffPtTot");
0110   MonitorElement* meTrackMatchedTPmtdEffPtMtd = igetter.get(folder_ + "MatchedTPmtdEffPtMtd");
0111   MonitorElement* meMVATrackEffEtaTot = igetter.get(folder_ + "MVAEffEtaTot");
0112   MonitorElement* meMVATrackMatchedEffEtaTot = igetter.get(folder_ + "MVAMatchedEffEtaTot");
0113   MonitorElement* meMVATrackMatchedEffEtaMtd = igetter.get(folder_ + "MVAMatchedEffEtaMtd");
0114   MonitorElement* meTrackMatchedTPEffEtaTot = igetter.get(folder_ + "MatchedTPEffEtaTot");
0115   MonitorElement* meTrackMatchedTPEffEtaMtd = igetter.get(folder_ + "MatchedTPEffEtaMtd");
0116   MonitorElement* meTrackMatchedTPEffEtaEtl2Mtd = igetter.get(folder_ + "MatchedTPEffEtaEtl2Mtd");
0117   MonitorElement* meTrackMatchedTPmtdEffEtaTot = igetter.get(folder_ + "MatchedTPmtdEffEtaTot");
0118   MonitorElement* meTrackMatchedTPmtdEffEtaMtd = igetter.get(folder_ + "MatchedTPmtdEffEtaMtd");
0119   MonitorElement* meNTrackingParticles = igetter.get(folder_ + "NTrackingParticles");
0120   MonitorElement* meUnassDeposit = igetter.get(folder_ + "UnassDeposit");
0121 
0122   if (!meBTLTrackEffEtaTot || !meBTLTrackEffPhiTot || !meBTLTrackEffPtTot || !meBTLTrackEffEtaMtd ||
0123       !meBTLTrackEffPhiMtd || !meBTLTrackEffPtMtd || !meETLTrackEffEtaTotZneg || !meETLTrackEffPhiTotZneg ||
0124       !meETLTrackEffPtTotZneg || !meETLTrackEffEtaMtdZneg || !meETLTrackEffPhiMtdZneg || !meETLTrackEffPtMtdZneg ||
0125       !meETLTrackEffEta2MtdZneg || !meETLTrackEffPhi2MtdZneg || !meETLTrackEffPt2MtdZneg || !meETLTrackEffEtaTotZpos ||
0126       !meETLTrackEffPhiTotZpos || !meETLTrackEffPtTotZpos || !meETLTrackEffEtaMtdZpos || !meETLTrackEffPhiMtdZpos ||
0127       !meETLTrackEffPtMtdZpos || !meETLTrackEffEta2MtdZpos || !meETLTrackEffPhi2MtdZpos || !meETLTrackEffPt2MtdZpos ||
0128       !meMVATrackEffPtTot || !meMVATrackMatchedEffPtTot || !meMVATrackMatchedEffPtMtd || !meMVATrackEffEtaTot ||
0129       !meMVATrackMatchedEffEtaTot || !meMVATrackMatchedEffEtaMtd || !meTrackMatchedTPEffPtTot ||
0130       !meTrackMatchedTPEffPtMtd || !meTrackMatchedTPEffPtEtl2Mtd || !meTrackMatchedTPmtdEffPtTot ||
0131       !meTrackMatchedTPmtdEffPtMtd || !meTrackMatchedTPEffEtaTot || !meTrackMatchedTPEffEtaMtd ||
0132       !meTrackMatchedTPEffEtaEtl2Mtd || !meTrackMatchedTPmtdEffEtaTot || !meTrackMatchedTPmtdEffEtaMtd ||
0133       !meNTrackingParticles || !meUnassDeposit) {
0134     edm::LogError("MtdTracksHarvester") << "Monitoring histograms not found!" << std::endl;
0135     return;
0136   }
0137 
0138   // --- Book  histograms
0139   ibook.cd(folder_);
0140   meBtlEtaEff_ = ibook.book1D("BtlEtaEff",
0141                               " Track Efficiency VS Eta;#eta;Efficiency",
0142                               meBTLTrackEffEtaTot->getNbinsX(),
0143                               meBTLTrackEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
0144                               meBTLTrackEffEtaTot->getTH1()->GetXaxis()->GetXmax());
0145   meBtlEtaEff_->getTH1()->SetMinimum(0.);
0146   computeEfficiency1D(meBTLTrackEffEtaMtd, meBTLTrackEffEtaTot, meBtlEtaEff_);
0147 
0148   meBtlPhiEff_ = ibook.book1D("BtlPhiEff",
0149                               "Track Efficiency VS Phi;#phi [rad];Efficiency",
0150                               meBTLTrackEffPhiTot->getNbinsX(),
0151                               meBTLTrackEffPhiTot->getTH1()->GetXaxis()->GetXmin(),
0152                               meBTLTrackEffPhiTot->getTH1()->GetXaxis()->GetXmax());
0153   meBtlPhiEff_->getTH1()->SetMinimum(0.);
0154   computeEfficiency1D(meBTLTrackEffPhiMtd, meBTLTrackEffPhiTot, meBtlPhiEff_);
0155 
0156   meBtlPtEff_ = ibook.book1D("BtlPtEff",
0157                              "Track Efficiency VS Pt;Pt [GeV];Efficiency",
0158                              meBTLTrackEffPtTot->getNbinsX(),
0159                              meBTLTrackEffPtTot->getTH1()->GetXaxis()->GetXmin(),
0160                              meBTLTrackEffPtTot->getTH1()->GetXaxis()->GetXmax());
0161   meBtlPtEff_->getTH1()->SetMinimum(0.);
0162   computeEfficiency1D(meBTLTrackEffPtMtd, meBTLTrackEffPtTot, meBtlPtEff_);
0163 
0164   meEtlEtaEff_[0] = ibook.book1D("EtlEtaEffZneg",
0165                                  " Track Efficiency VS Eta (-Z);#eta;Efficiency",
0166                                  meETLTrackEffEtaTotZneg->getNbinsX(),
0167                                  meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmin(),
0168                                  meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmax());
0169   meEtlEtaEff_[0]->getTH1()->SetMinimum(0.);
0170   computeEfficiency1D(meETLTrackEffEtaMtdZneg, meETLTrackEffEtaTotZneg, meEtlEtaEff_[0]);
0171 
0172   meEtlPhiEff_[0] = ibook.book1D("EtlPhiEffZneg",
0173                                  "Track Efficiency VS Phi (-Z);#phi [rad];Efficiency",
0174                                  meETLTrackEffPhiTotZneg->getNbinsX(),
0175                                  meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmin(),
0176                                  meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmax());
0177   meEtlPhiEff_[0]->getTH1()->SetMinimum(0.);
0178   computeEfficiency1D(meETLTrackEffPhiMtdZneg, meETLTrackEffPhiTotZneg, meEtlPhiEff_[0]);
0179 
0180   meEtlPtEff_[0] = ibook.book1D("EtlPtEffZneg",
0181                                 "Track Efficiency VS Pt (-Z);Pt [GeV];Efficiency",
0182                                 meETLTrackEffPtTotZneg->getNbinsX(),
0183                                 meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmin(),
0184                                 meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmax());
0185   meEtlPtEff_[0]->getTH1()->SetMinimum(0.);
0186   computeEfficiency1D(meETLTrackEffPtMtdZneg, meETLTrackEffPtTotZneg, meEtlPtEff_[0]);
0187 
0188   meEtlEtaEff_[1] = ibook.book1D("EtlEtaEffZpos",
0189                                  " Track Efficiency VS Eta (+Z);#eta;Efficiency",
0190                                  meETLTrackEffEtaTotZpos->getNbinsX(),
0191                                  meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmin(),
0192                                  meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmax());
0193   meEtlEtaEff_[1]->getTH1()->SetMinimum(0.);
0194   computeEfficiency1D(meETLTrackEffEtaMtdZpos, meETLTrackEffEtaTotZpos, meEtlEtaEff_[1]);
0195 
0196   meEtlPhiEff_[1] = ibook.book1D("EtlPhiEffZpos",
0197                                  "Track Efficiency VS Phi (+Z);#phi [rad];Efficiency",
0198                                  meETLTrackEffPhiTotZpos->getNbinsX(),
0199                                  meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmin(),
0200                                  meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmax());
0201   meEtlPhiEff_[1]->getTH1()->SetMinimum(0.);
0202   computeEfficiency1D(meETLTrackEffPhiMtdZpos, meETLTrackEffPhiTotZpos, meEtlPhiEff_[1]);
0203 
0204   meEtlPtEff_[1] = ibook.book1D("EtlPtEffZpos",
0205                                 "Track Efficiency VS Pt (+Z);Pt [GeV];Efficiency",
0206                                 meETLTrackEffPtTotZpos->getNbinsX(),
0207                                 meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmin(),
0208                                 meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmax());
0209   meEtlPtEff_[1]->getTH1()->SetMinimum(0.);
0210   computeEfficiency1D(meETLTrackEffPtMtdZpos, meETLTrackEffPtTotZpos, meEtlPtEff_[1]);
0211 
0212   meEtlEtaEff2_[0] = ibook.book1D("EtlEtaEff2Zneg",
0213                                   " Track Efficiency VS Eta (-Z, 2 hit);#eta;Efficiency",
0214                                   meETLTrackEffEtaTotZneg->getNbinsX(),
0215                                   meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmin(),
0216                                   meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmax());
0217   meEtlEtaEff2_[0]->getTH1()->SetMinimum(0.);
0218   computeEfficiency1D(meETLTrackEffEta2MtdZneg, meETLTrackEffEtaTotZneg, meEtlEtaEff2_[0]);
0219 
0220   meEtlPhiEff2_[0] = ibook.book1D("EtlPhiEff2Zneg",
0221                                   "Track Efficiency VS Phi (-Z, 2 hit);#phi [rad];Efficiency",
0222                                   meETLTrackEffPhiTotZneg->getNbinsX(),
0223                                   meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmin(),
0224                                   meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmax());
0225   meEtlPhiEff2_[0]->getTH1()->SetMinimum(0.);
0226   computeEfficiency1D(meETLTrackEffPhi2MtdZneg, meETLTrackEffPhiTotZneg, meEtlPhiEff2_[0]);
0227 
0228   meEtlPtEff2_[0] = ibook.book1D("EtlPtEff2Zneg",
0229                                  "Track Efficiency VS Pt (-Z, 2 hit);Pt [GeV];Efficiency",
0230                                  meETLTrackEffPtTotZneg->getNbinsX(),
0231                                  meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmin(),
0232                                  meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmax());
0233   meEtlPtEff2_[0]->getTH1()->SetMinimum(0.);
0234   computeEfficiency1D(meETLTrackEffPt2MtdZneg, meETLTrackEffPtTotZneg, meEtlPtEff2_[0]);
0235 
0236   meEtlEtaEff2_[1] = ibook.book1D("EtlEtaEff2Zpos",
0237                                   "Track Efficiency VS Eta (+Z, 2 hit);#eta;Efficiency",
0238                                   meETLTrackEffEtaTotZpos->getNbinsX(),
0239                                   meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmin(),
0240                                   meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmax());
0241   meEtlEtaEff2_[1]->getTH1()->SetMinimum(0.);
0242   computeEfficiency1D(meETLTrackEffEta2MtdZpos, meETLTrackEffEtaTotZpos, meEtlEtaEff2_[1]);
0243 
0244   meEtlPhiEff2_[1] = ibook.book1D("EtlPhiEff2Zpos",
0245                                   "Track Efficiency VS Phi (+Z, 2 hit);#phi [rad];Efficiency",
0246                                   meETLTrackEffPhiTotZpos->getNbinsX(),
0247                                   meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmin(),
0248                                   meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmax());
0249   meEtlPhiEff2_[1]->getTH1()->SetMinimum(0.);
0250   computeEfficiency1D(meETLTrackEffPhi2MtdZpos, meETLTrackEffPhiTotZpos, meEtlPhiEff2_[1]);
0251 
0252   meEtlPtEff2_[1] = ibook.book1D("EtlPtEff2Zpos",
0253                                  "Track Efficiency VS Pt (+Z, 2 hit);Pt [GeV];Efficiency",
0254                                  meETLTrackEffPtTotZpos->getNbinsX(),
0255                                  meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmin(),
0256                                  meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmax());
0257   meEtlPtEff2_[1]->getTH1()->SetMinimum(0.);
0258   computeEfficiency1D(meETLTrackEffPt2MtdZpos, meETLTrackEffPtTotZpos, meEtlPtEff2_[1]);
0259 
0260   meMVAPtSelEff_ = ibook.book1D("MVAPtSelEff",
0261                                 "Track selected efficiency VS Pt;Pt [GeV];Efficiency",
0262                                 meMVATrackEffPtTot->getNbinsX(),
0263                                 meMVATrackEffPtTot->getTH1()->GetXaxis()->GetXmin(),
0264                                 meMVATrackEffPtTot->getTH1()->GetXaxis()->GetXmax());
0265   meMVAPtSelEff_->getTH1()->SetMinimum(0.);
0266   computeEfficiency1D(meMVATrackMatchedEffPtTot, meMVATrackEffPtTot, meMVAPtSelEff_);
0267 
0268   meMVAEtaSelEff_ = ibook.book1D("MVAEtaSelEff",
0269                                  "Track selected efficiency VS Eta;Eta;Efficiency",
0270                                  meMVATrackEffEtaTot->getNbinsX(),
0271                                  meMVATrackEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
0272                                  meMVATrackEffEtaTot->getTH1()->GetXaxis()->GetXmax());
0273   meMVAEtaSelEff_->getTH1()->SetMinimum(0.);
0274   computeEfficiency1D(meMVATrackMatchedEffEtaTot, meMVATrackEffEtaTot, meMVAEtaSelEff_);
0275 
0276   meMVAPtMatchEff_ = ibook.book1D("MVAPtMatchEff",
0277                                   "Track matched to GEN efficiency VS Pt;Pt [GeV];Efficiency",
0278                                   meMVATrackMatchedEffPtTot->getNbinsX(),
0279                                   meMVATrackMatchedEffPtTot->getTH1()->GetXaxis()->GetXmin(),
0280                                   meMVATrackMatchedEffPtTot->getTH1()->GetXaxis()->GetXmax());
0281   meMVAPtMatchEff_->getTH1()->SetMinimum(0.);
0282   computeEfficiency1D(meMVATrackMatchedEffPtMtd, meMVATrackMatchedEffPtTot, meMVAPtMatchEff_);
0283 
0284   meMVAEtaMatchEff_ = ibook.book1D("MVAEtaMatchEff",
0285                                    "Track matched to GEN efficiency VS Eta;Eta;Efficiency",
0286                                    meMVATrackMatchedEffEtaTot->getNbinsX(),
0287                                    meMVATrackMatchedEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
0288                                    meMVATrackMatchedEffEtaTot->getTH1()->GetXaxis()->GetXmax());
0289   meMVAEtaMatchEff_->getTH1()->SetMinimum(0.);
0290   computeEfficiency1D(meMVATrackMatchedEffEtaMtd, meMVATrackMatchedEffEtaTot, meMVAEtaMatchEff_);
0291 
0292   meTPPtSelEff_ = ibook.book1D("TPPtSelEff",
0293                                "Track selected efficiency TP VS Pt;Pt [GeV];Efficiency",
0294                                meMVATrackEffPtTot->getNbinsX(),
0295                                meMVATrackEffPtTot->getTH1()->GetXaxis()->GetXmin(),
0296                                meMVATrackEffPtTot->getTH1()->GetXaxis()->GetXmax());
0297   meTPPtSelEff_->getTH1()->SetMinimum(0.);
0298   computeEfficiency1D(meTrackMatchedTPEffPtTot, meMVATrackEffPtTot, meTPPtSelEff_);
0299 
0300   meTPEtaSelEff_ = ibook.book1D("TPEtaSelEff",
0301                                 "Track selected efficiency TP VS Eta;Eta;Efficiency",
0302                                 meMVATrackEffEtaTot->getNbinsX(),
0303                                 meMVATrackEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
0304                                 meMVATrackEffEtaTot->getTH1()->GetXaxis()->GetXmax());
0305   meTPEtaSelEff_->getTH1()->SetMinimum(0.);
0306   computeEfficiency1D(meTrackMatchedTPEffEtaTot, meMVATrackEffEtaTot, meTPEtaSelEff_);
0307 
0308   meTPPtMatchEff_ = ibook.book1D("TPPtMatchEff",
0309                                  "Track matched to TP efficiency VS Pt;Pt [GeV];Efficiency",
0310                                  meTrackMatchedTPEffPtTot->getNbinsX(),
0311                                  meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmin(),
0312                                  meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmax());
0313   meTPPtMatchEff_->getTH1()->SetMinimum(0.);
0314   computeEfficiency1D(meTrackMatchedTPEffPtMtd, meTrackMatchedTPEffPtTot, meTPPtMatchEff_);
0315 
0316   meTPEtaMatchEff_ = ibook.book1D("TPEtaMatchEff",
0317                                   "Track matched to TP efficiency VS Eta;Eta;Efficiency",
0318                                   meTrackMatchedTPEffEtaTot->getNbinsX(),
0319                                   meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
0320                                   meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmax());
0321   meTPEtaMatchEff_->getTH1()->SetMinimum(0.);
0322   computeEfficiency1D(meTrackMatchedTPEffEtaMtd, meTrackMatchedTPEffEtaTot, meTPEtaMatchEff_);
0323 
0324   meTPPtMatchEtl2Eff_ = ibook.book1D("TPPtMatchEtl2Eff",
0325                                      "Track matched to TP efficiency VS Pt, 2 ETL hits;Pt [GeV];Efficiency",
0326                                      meTrackMatchedTPEffPtTot->getNbinsX(),
0327                                      meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmin(),
0328                                      meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmax());
0329   meTPPtMatchEtl2Eff_->getTH1()->SetMinimum(0.);
0330   computeEfficiency1D(meTrackMatchedTPEffPtEtl2Mtd, meTrackMatchedTPEffPtTot, meTPPtMatchEtl2Eff_);
0331 
0332   meTPEtaMatchEtl2Eff_ = ibook.book1D("TPEtaMatchEtl2Eff",
0333                                       "Track matched to TP efficiency VS Eta, 2 ETL hits;Eta;Efficiency",
0334                                       meTrackMatchedTPEffEtaTot->getNbinsX(),
0335                                       meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
0336                                       meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmax());
0337   meTPEtaMatchEtl2Eff_->getTH1()->SetMinimum(0.);
0338   computeEfficiency1D(meTrackMatchedTPEffEtaEtl2Mtd, meTrackMatchedTPEffEtaTot, meTPEtaMatchEtl2Eff_);
0339 
0340   meTPmtdPtSelEff_ = ibook.book1D("TPmtdPtSelEff",
0341                                   "Track selected efficiency TP-mtd hit VS Pt;Pt [GeV];Efficiency",
0342                                   meMVATrackEffPtTot->getNbinsX(),
0343                                   meMVATrackEffPtTot->getTH1()->GetXaxis()->GetXmin(),
0344                                   meMVATrackEffPtTot->getTH1()->GetXaxis()->GetXmax());
0345   meTPmtdPtSelEff_->getTH1()->SetMinimum(0.);
0346   computeEfficiency1D(meTrackMatchedTPmtdEffPtTot, meMVATrackEffPtTot, meTPmtdPtSelEff_);
0347 
0348   meTPmtdEtaSelEff_ = ibook.book1D("TPmtdEtaSelEff",
0349                                    "Track selected efficiency TPmtd hit VS Eta;Eta;Efficiency",
0350                                    meMVATrackEffEtaTot->getNbinsX(),
0351                                    meMVATrackEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
0352                                    meMVATrackEffEtaTot->getTH1()->GetXaxis()->GetXmax());
0353   meTPmtdEtaSelEff_->getTH1()->SetMinimum(0.);
0354   computeEfficiency1D(meTrackMatchedTPmtdEffEtaTot, meMVATrackEffEtaTot, meTPmtdEtaSelEff_);
0355 
0356   meTPmtdPtMatchEff_ = ibook.book1D("TPmtdPtMatchEff",
0357                                     "Track matched to TP-mtd hit efficiency VS Pt;Pt [GeV];Efficiency",
0358                                     meTrackMatchedTPmtdEffPtTot->getNbinsX(),
0359                                     meTrackMatchedTPmtdEffPtTot->getTH1()->GetXaxis()->GetXmin(),
0360                                     meTrackMatchedTPmtdEffPtTot->getTH1()->GetXaxis()->GetXmax());
0361   meTPmtdPtMatchEff_->getTH1()->SetMinimum(0.);
0362   computeEfficiency1D(meTrackMatchedTPmtdEffPtMtd, meTrackMatchedTPmtdEffPtTot, meTPmtdPtMatchEff_);
0363 
0364   meTPmtdEtaMatchEff_ = ibook.book1D("TPmtdEtaMatchEff",
0365                                      "Track matched to TP-mtd hit efficiency VS Eta;Eta;Efficiency",
0366                                      meTrackMatchedTPmtdEffEtaTot->getNbinsX(),
0367                                      meTrackMatchedTPmtdEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
0368                                      meTrackMatchedTPmtdEffEtaTot->getTH1()->GetXaxis()->GetXmax());
0369   meTPmtdEtaMatchEff_->getTH1()->SetMinimum(0.);
0370   computeEfficiency1D(meTrackMatchedTPmtdEffEtaMtd, meTrackMatchedTPmtdEffEtaTot, meTPmtdEtaMatchEff_);
0371 
0372   meTPAssocEff_ =
0373       ibook.book1D("TPAssocEff",
0374                    "Tracking particles not associated to any MTD cell in events with at least one cell over threshold",
0375                    meNTrackingParticles->getNbinsX(),
0376                    meNTrackingParticles->getTH1()->GetXaxis()->GetXmin(),
0377                    meNTrackingParticles->getTH1()->GetXaxis()->GetXmax());
0378   meTPAssocEff_->getTH1()->SetMinimum(0.);
0379   computeEfficiency1D(meUnassDeposit, meNTrackingParticles, meTPAssocEff_);
0380 
0381   meBtlEtaEff_->getTH1()->SetMinimum(0.);
0382   meBtlPhiEff_->getTH1()->SetMinimum(0.);
0383   meBtlPtEff_->getTH1()->SetMinimum(0.);
0384   for (int i = 0; i < 2; i++) {
0385     meEtlEtaEff_[i]->getTH1()->SetMinimum(0.);
0386     meEtlPhiEff_[i]->getTH1()->SetMinimum(0.);
0387     meEtlPtEff_[i]->getTH1()->SetMinimum(0.);
0388     meEtlEtaEff2_[i]->getTH1()->SetMinimum(0.);
0389     meEtlPhiEff2_[i]->getTH1()->SetMinimum(0.);
0390     meEtlPtEff2_[i]->getTH1()->SetMinimum(0.);
0391   }
0392   meMVAPtSelEff_->getTH1()->SetMinimum(0.);
0393   meMVAEtaSelEff_->getTH1()->SetMinimum(0.);
0394   meMVAPtMatchEff_->getTH1()->SetMinimum(0.);
0395   meMVAEtaMatchEff_->getTH1()->SetMinimum(0.);
0396 }
0397 
0398 // ------------ method fills 'descriptions' with the allowed parameters for the module  ----------
0399 void MtdTracksHarvester::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0400   edm::ParameterSetDescription desc;
0401 
0402   desc.add<std::string>("folder", "MTD/Tracks/");
0403 
0404   descriptions.add("MtdTracksPostProcessor", desc);
0405 }
0406 
0407 DEFINE_FWK_MODULE(MtdTracksHarvester);