Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-10-08 05:12:12

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   void normalize(MonitorElement* h, double scale);
0026 
0027   const std::string folder_;
0028 
0029   // --- Histograms
0030   MonitorElement* meBtlEtaEff_;
0031   MonitorElement* meBtlPhiEff_;
0032   MonitorElement* meBtlPtEff_;
0033   MonitorElement* meEtlEtaEff_[2];
0034   MonitorElement* meEtlEtaEffLowPt_[2];
0035   MonitorElement* meEtlPhiEff_[2];
0036   MonitorElement* meEtlPtEff_[2];
0037   MonitorElement* meEtlEtaEff2_[2];
0038   MonitorElement* meEtlEtaEff2LowPt_[2];
0039   MonitorElement* meEtlPhiEff2_[2];
0040   MonitorElement* meEtlPtEff2_[2];
0041   MonitorElement* meTPPtSelEff_;
0042   MonitorElement* meTPEtaSelEff_;
0043   MonitorElement* meTPPtMatchEff_;
0044   MonitorElement* meTPEtaMatchEff_;
0045   MonitorElement* meTPPtMatchEtl2Eff_;
0046   MonitorElement* meTPEtaMatchEtl2Eff_;
0047   MonitorElement* meTPmtdPtSelEff_;
0048   MonitorElement* meTPmtdEtaSelEff_;
0049   MonitorElement* meTPmtdPtMatchEff_;
0050   MonitorElement* meTPmtdEtaMatchEff_;
0051   MonitorElement* meNoTimeFraction_;
0052   MonitorElement* meExtraPtEff_;
0053   MonitorElement* meExtraPtEtl2Eff_;
0054   MonitorElement* meExtraEtaEff_;
0055   MonitorElement* meExtraEtaEtl2Eff_;
0056   MonitorElement* meExtraPhiAtBTLEff_;
0057   MonitorElement* meExtraMTDfailExtenderEtaEff_;
0058   MonitorElement* meExtraMTDfailExtenderPtEff_;
0059 };
0060 
0061 // ------------ constructor and destructor --------------
0062 MtdTracksHarvester::MtdTracksHarvester(const edm::ParameterSet& iConfig)
0063     : folder_(iConfig.getParameter<std::string>("folder")) {}
0064 
0065 MtdTracksHarvester::~MtdTracksHarvester() {}
0066 
0067 // auxiliary method to compute efficiency from the ratio of two 1D MonitorElement
0068 void MtdTracksHarvester::computeEfficiency1D(MonitorElement* num, MonitorElement* den, MonitorElement* result) {
0069   for (int ibin = 1; ibin <= den->getNbinsX(); ibin++) {
0070     double eff = num->getBinContent(ibin) / den->getBinContent(ibin);
0071     double bin_err = sqrt((num->getBinContent(ibin) * (den->getBinContent(ibin) - num->getBinContent(ibin))) /
0072                           pow(den->getBinContent(ibin), 3));
0073     if (den->getBinContent(ibin) == 0) {
0074       eff = 0;
0075       bin_err = 0;
0076     }
0077     result->setBinContent(ibin, eff);
0078     result->setBinError(ibin, bin_err);
0079   }
0080 }
0081 
0082 void MtdTracksHarvester::normalize(MonitorElement* h, double scale) {
0083   double integral = h->getTH1F()->Integral();
0084   double norma = (integral > 0.) ? scale / integral : 0.;
0085   for (int ibin = 1; ibin <= h->getNbinsX(); ibin++) {
0086     double eff = h->getBinContent(ibin) * norma;
0087     double bin_err = h->getBinError(ibin) * norma;
0088     h->setBinContent(ibin, eff);
0089     h->setBinError(ibin, bin_err);
0090   }
0091 }
0092 
0093 // ------------ endjob tasks ----------------------------
0094 void MtdTracksHarvester::dqmEndJob(DQMStore::IBooker& ibook, DQMStore::IGetter& igetter) {
0095   // --- Get the monitoring histograms
0096   MonitorElement* meBTLTrackEffEtaTot = igetter.get(folder_ + "TrackBTLEffEtaTot");
0097   MonitorElement* meBTLTrackEffPhiTot = igetter.get(folder_ + "TrackBTLEffPhiTot");
0098   MonitorElement* meBTLTrackEffPtTot = igetter.get(folder_ + "TrackBTLEffPtTot");
0099   MonitorElement* meBTLTrackEffEtaMtd = igetter.get(folder_ + "TrackBTLEffEtaMtd");
0100   MonitorElement* meBTLTrackEffPhiMtd = igetter.get(folder_ + "TrackBTLEffPhiMtd");
0101   MonitorElement* meBTLTrackEffPtMtd = igetter.get(folder_ + "TrackBTLEffPtMtd");
0102   MonitorElement* meETLTrackEffEtaTotZneg = igetter.get(folder_ + "TrackETLEffEtaTotZneg");
0103   MonitorElement* meETLTrackEffEtaTotLowPt0 = igetter.get(folder_ + "TrackETLEffEtaTotLowPt0");
0104   MonitorElement* meETLTrackEffEtaTotLowPt1 = igetter.get(folder_ + "TrackETLEffEtaTotLowPt1");
0105   MonitorElement* meETLTrackEffPhiTotZneg = igetter.get(folder_ + "TrackETLEffPhiTotZneg");
0106   MonitorElement* meETLTrackEffPtTotZneg = igetter.get(folder_ + "TrackETLEffPtTotZneg");
0107   MonitorElement* meETLTrackEffEtaMtdZneg = igetter.get(folder_ + "TrackETLEffEtaMtdZneg");
0108   MonitorElement* meETLTrackEffEtaMtdLowPt0 = igetter.get(folder_ + "TrackETLEffEtaMtdLowPt0");
0109   MonitorElement* meETLTrackEffEtaMtdLowPt1 = igetter.get(folder_ + "TrackETLEffEtaMtdLowPt1");
0110   MonitorElement* meETLTrackEffPhiMtdZneg = igetter.get(folder_ + "TrackETLEffPhiMtdZneg");
0111   MonitorElement* meETLTrackEffPtMtdZneg = igetter.get(folder_ + "TrackETLEffPtMtdZneg");
0112   MonitorElement* meETLTrackEffEta2MtdZneg = igetter.get(folder_ + "TrackETLEffEta2MtdZneg");
0113   MonitorElement* meETLTrackEffEta2MtdLowPt0 = igetter.get(folder_ + "TrackETLEffEta2MtdLowPt0");
0114   MonitorElement* meETLTrackEffEta2MtdLowPt1 = igetter.get(folder_ + "TrackETLEffEta2MtdLowPt1");
0115   MonitorElement* meETLTrackEffPhi2MtdZneg = igetter.get(folder_ + "TrackETLEffPhi2MtdZneg");
0116   MonitorElement* meETLTrackEffPt2MtdZneg = igetter.get(folder_ + "TrackETLEffPt2MtdZneg");
0117   MonitorElement* meETLTrackEffEtaTotZpos = igetter.get(folder_ + "TrackETLEffEtaTotZpos");
0118   MonitorElement* meETLTrackEffPhiTotZpos = igetter.get(folder_ + "TrackETLEffPhiTotZpos");
0119   MonitorElement* meETLTrackEffPtTotZpos = igetter.get(folder_ + "TrackETLEffPtTotZpos");
0120   MonitorElement* meETLTrackEffEtaMtdZpos = igetter.get(folder_ + "TrackETLEffEtaMtdZpos");
0121   MonitorElement* meETLTrackEffPhiMtdZpos = igetter.get(folder_ + "TrackETLEffPhiMtdZpos");
0122   MonitorElement* meETLTrackEffPtMtdZpos = igetter.get(folder_ + "TrackETLEffPtMtdZpos");
0123   MonitorElement* meETLTrackEffEta2MtdZpos = igetter.get(folder_ + "TrackETLEffEta2MtdZpos");
0124   MonitorElement* meETLTrackEffPhi2MtdZpos = igetter.get(folder_ + "TrackETLEffPhi2MtdZpos");
0125   MonitorElement* meETLTrackEffPt2MtdZpos = igetter.get(folder_ + "TrackETLEffPt2MtdZpos");
0126   MonitorElement* meTrackPtTot = igetter.get(folder_ + "TrackPtTot");
0127   MonitorElement* meExtraPtMtd = igetter.get(folder_ + "ExtraPtMtd");
0128   MonitorElement* meExtraPtEtl2Mtd = igetter.get(folder_ + "ExtraPtEtl2Mtd");
0129   MonitorElement* meTrackMatchedTPEffPtTot = igetter.get(folder_ + "MatchedTPEffPtTot");
0130   MonitorElement* meTrackMatchedTPEffPtTotLV = igetter.get(folder_ + "MatchedTPEffPtTotLV");
0131   MonitorElement* meTrackMatchedTPEffPtMtd = igetter.get(folder_ + "MatchedTPEffPtMtd");
0132   MonitorElement* meTrackMatchedTPEffPtEtl2Mtd = igetter.get(folder_ + "MatchedTPEffPtEtl2Mtd");
0133   MonitorElement* meTrackMatchedTPmtdEffPtTot = igetter.get(folder_ + "MatchedTPmtdEffPtTot");
0134   MonitorElement* meTrackMatchedTPmtdEffPtMtd = igetter.get(folder_ + "MatchedTPmtdEffPtMtd");
0135   MonitorElement* meTrackEtaTot = igetter.get(folder_ + "TrackEtaTot");
0136   MonitorElement* meExtraEtaMtd = igetter.get(folder_ + "ExtraEtaMtd");
0137   MonitorElement* meExtraEtaEtl2Mtd = igetter.get(folder_ + "ExtraEtaEtl2Mtd");
0138   MonitorElement* meTrackMatchedTPEffEtaTot = igetter.get(folder_ + "MatchedTPEffEtaTot");
0139   MonitorElement* meTrackMatchedTPEffEtaTotLV = igetter.get(folder_ + "MatchedTPEffEtaTotLV");
0140   MonitorElement* meTrackMatchedTPEffEtaMtd = igetter.get(folder_ + "MatchedTPEffEtaMtd");
0141   MonitorElement* meTrackMatchedTPEffEtaEtl2Mtd = igetter.get(folder_ + "MatchedTPEffEtaEtl2Mtd");
0142   MonitorElement* meTrackMatchedTPmtdEffEtaTot = igetter.get(folder_ + "MatchedTPmtdEffEtaTot");
0143   MonitorElement* meTrackMatchedTPmtdEffEtaMtd = igetter.get(folder_ + "MatchedTPmtdEffEtaMtd");
0144   MonitorElement* meTrackNumHits = igetter.get(folder_ + "TrackNumHits");
0145   MonitorElement* meTrackNumHitsNT = igetter.get(folder_ + "TrackNumHitsNT");
0146   MonitorElement* meExtraPhiAtBTL = igetter.get(folder_ + "ExtraPhiAtBTL");
0147   MonitorElement* meExtraPhiAtBTLmatched = igetter.get(folder_ + "ExtraPhiAtBTLmatched");
0148   MonitorElement* meExtraBTLeneInCone = igetter.get(folder_ + "ExtraBTLeneInCone");
0149   MonitorElement* meExtraMTDfailExtenderEta = igetter.get(folder_ + "ExtraMTDfailExtenderEta");
0150   MonitorElement* meExtraMTDfailExtenderPt = igetter.get(folder_ + "ExtraMTDfailExtenderPt");
0151 
0152   if (!meBTLTrackEffEtaTot || !meBTLTrackEffPhiTot || !meBTLTrackEffPtTot || !meBTLTrackEffEtaMtd ||
0153       !meBTLTrackEffPhiMtd || !meBTLTrackEffPtMtd || !meETLTrackEffEtaTotZneg || !meETLTrackEffPhiTotZneg ||
0154       !meETLTrackEffPtTotZneg || !meETLTrackEffEtaTotLowPt0 || !meETLTrackEffEtaTotLowPt1 || !meETLTrackEffEtaMtdZneg ||
0155       !meETLTrackEffEtaMtdLowPt0 || !meETLTrackEffEtaMtdLowPt1 || !meETLTrackEffPhiMtdZneg || !meETLTrackEffPtMtdZneg ||
0156       !meETLTrackEffEta2MtdZneg || !meETLTrackEffEta2MtdLowPt0 || !meETLTrackEffEta2MtdLowPt1 ||
0157       !meETLTrackEffPhi2MtdZneg || !meETLTrackEffPt2MtdZneg || !meETLTrackEffEtaTotZpos || !meETLTrackEffPhiTotZpos ||
0158       !meETLTrackEffPtTotZpos || !meETLTrackEffEtaMtdZpos || !meETLTrackEffPhiMtdZpos || !meETLTrackEffPtMtdZpos ||
0159       !meETLTrackEffEta2MtdZpos || !meETLTrackEffPhi2MtdZpos || !meETLTrackEffPt2MtdZpos || !meTrackMatchedTPEffPtTot ||
0160       !meTrackMatchedTPEffPtTotLV || !meTrackMatchedTPEffPtMtd || !meTrackMatchedTPEffPtEtl2Mtd ||
0161       !meTrackMatchedTPmtdEffPtTot || !meTrackMatchedTPmtdEffPtMtd || !meTrackMatchedTPEffEtaTot ||
0162       !meTrackMatchedTPEffEtaTotLV || !meTrackMatchedTPEffEtaMtd || !meTrackMatchedTPEffEtaEtl2Mtd ||
0163       !meTrackMatchedTPmtdEffEtaTot || !meTrackMatchedTPmtdEffEtaMtd || !meTrackNumHits || !meTrackNumHitsNT ||
0164       !meTrackPtTot || !meTrackEtaTot || !meExtraPtMtd || !meExtraPtEtl2Mtd || !meExtraEtaMtd || !meExtraEtaEtl2Mtd ||
0165       !meExtraPhiAtBTL || !meExtraPhiAtBTLmatched || !meExtraBTLeneInCone || !meExtraMTDfailExtenderEta ||
0166       !meExtraMTDfailExtenderPt) {
0167     edm::LogError("MtdTracksHarvester") << "Monitoring histograms not found!" << std::endl;
0168     return;
0169   }
0170 
0171   // --- Book  histograms
0172   ibook.cd(folder_);
0173   meBtlEtaEff_ = ibook.book1D("BtlEtaEff",
0174                               " Track Efficiency VS Eta;#eta;Efficiency",
0175                               meBTLTrackEffEtaTot->getNbinsX(),
0176                               meBTLTrackEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
0177                               meBTLTrackEffEtaTot->getTH1()->GetXaxis()->GetXmax());
0178   meBtlEtaEff_->getTH1()->SetMinimum(0.);
0179   computeEfficiency1D(meBTLTrackEffEtaMtd, meBTLTrackEffEtaTot, meBtlEtaEff_);
0180 
0181   meBtlPhiEff_ = ibook.book1D("BtlPhiEff",
0182                               "Track Efficiency VS Phi;#phi [rad];Efficiency",
0183                               meBTLTrackEffPhiTot->getNbinsX(),
0184                               meBTLTrackEffPhiTot->getTH1()->GetXaxis()->GetXmin(),
0185                               meBTLTrackEffPhiTot->getTH1()->GetXaxis()->GetXmax());
0186   meBtlPhiEff_->getTH1()->SetMinimum(0.);
0187   computeEfficiency1D(meBTLTrackEffPhiMtd, meBTLTrackEffPhiTot, meBtlPhiEff_);
0188 
0189   meBtlPtEff_ = ibook.book1D("BtlPtEff",
0190                              "Track Efficiency VS Pt;Pt [GeV];Efficiency",
0191                              meBTLTrackEffPtTot->getNbinsX(),
0192                              meBTLTrackEffPtTot->getTH1()->GetXaxis()->GetXmin(),
0193                              meBTLTrackEffPtTot->getTH1()->GetXaxis()->GetXmax());
0194   meBtlPtEff_->getTH1()->SetMinimum(0.);
0195   computeEfficiency1D(meBTLTrackEffPtMtd, meBTLTrackEffPtTot, meBtlPtEff_);
0196 
0197   meEtlEtaEff_[0] = ibook.book1D("EtlEtaEffZneg",
0198                                  " Track Efficiency VS Eta (-Z);#eta;Efficiency",
0199                                  meETLTrackEffEtaTotZneg->getNbinsX(),
0200                                  meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmin(),
0201                                  meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmax());
0202   meEtlEtaEff_[0]->getTH1()->SetMinimum(0.);
0203   computeEfficiency1D(meETLTrackEffEtaMtdZneg, meETLTrackEffEtaTotZneg, meEtlEtaEff_[0]);
0204 
0205   meEtlEtaEffLowPt_[0] = ibook.book1D("EtlEtaEffLowPt0",
0206                                       " Track Efficiency VS Eta, 0.2 < pt < 0.45;#eta;Efficiency",
0207                                       meETLTrackEffEtaTotLowPt0->getNbinsX(),
0208                                       meETLTrackEffEtaTotLowPt0->getTH1()->GetXaxis()->GetXmin(),
0209                                       meETLTrackEffEtaTotLowPt0->getTH1()->GetXaxis()->GetXmax());
0210   meEtlEtaEffLowPt_[0]->getTH1()->SetMinimum(0.);
0211   computeEfficiency1D(meETLTrackEffEtaMtdLowPt0, meETLTrackEffEtaTotLowPt0, meEtlEtaEffLowPt_[0]);
0212 
0213   meEtlPhiEff_[0] = ibook.book1D("EtlPhiEffZneg",
0214                                  "Track Efficiency VS Phi (-Z);#phi [rad];Efficiency",
0215                                  meETLTrackEffPhiTotZneg->getNbinsX(),
0216                                  meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmin(),
0217                                  meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmax());
0218   meEtlPhiEff_[0]->getTH1()->SetMinimum(0.);
0219   computeEfficiency1D(meETLTrackEffPhiMtdZneg, meETLTrackEffPhiTotZneg, meEtlPhiEff_[0]);
0220 
0221   meEtlPtEff_[0] = ibook.book1D("EtlPtEffZneg",
0222                                 "Track Efficiency VS Pt (-Z);Pt [GeV];Efficiency",
0223                                 meETLTrackEffPtTotZneg->getNbinsX(),
0224                                 meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmin(),
0225                                 meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmax());
0226   meEtlPtEff_[0]->getTH1()->SetMinimum(0.);
0227   computeEfficiency1D(meETLTrackEffPtMtdZneg, meETLTrackEffPtTotZneg, meEtlPtEff_[0]);
0228 
0229   meEtlEtaEff_[1] = ibook.book1D("EtlEtaEffZpos",
0230                                  " Track Efficiency VS Eta (+Z);#eta;Efficiency",
0231                                  meETLTrackEffEtaTotZpos->getNbinsX(),
0232                                  meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmin(),
0233                                  meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmax());
0234   meEtlEtaEff_[1]->getTH1()->SetMinimum(0.);
0235   computeEfficiency1D(meETLTrackEffEtaMtdZpos, meETLTrackEffEtaTotZpos, meEtlEtaEff_[1]);
0236 
0237   meEtlEtaEffLowPt_[1] = ibook.book1D("EtlEtaEffLowPt1",
0238                                       " Track Efficiency VS Eta, 0.45 < pt < 0.7;#eta;Efficiency",
0239                                       meETLTrackEffEtaTotLowPt1->getNbinsX(),
0240                                       meETLTrackEffEtaTotLowPt1->getTH1()->GetXaxis()->GetXmin(),
0241                                       meETLTrackEffEtaTotLowPt1->getTH1()->GetXaxis()->GetXmax());
0242   meEtlEtaEffLowPt_[1]->getTH1()->SetMinimum(0.);
0243   computeEfficiency1D(meETLTrackEffEtaMtdLowPt1, meETLTrackEffEtaTotLowPt1, meEtlEtaEffLowPt_[1]);
0244 
0245   meEtlPhiEff_[1] = ibook.book1D("EtlPhiEffZpos",
0246                                  "Track Efficiency VS Phi (+Z);#phi [rad];Efficiency",
0247                                  meETLTrackEffPhiTotZpos->getNbinsX(),
0248                                  meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmin(),
0249                                  meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmax());
0250   meEtlPhiEff_[1]->getTH1()->SetMinimum(0.);
0251   computeEfficiency1D(meETLTrackEffPhiMtdZpos, meETLTrackEffPhiTotZpos, meEtlPhiEff_[1]);
0252 
0253   meEtlPtEff_[1] = ibook.book1D("EtlPtEffZpos",
0254                                 "Track Efficiency VS Pt (+Z);Pt [GeV];Efficiency",
0255                                 meETLTrackEffPtTotZpos->getNbinsX(),
0256                                 meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmin(),
0257                                 meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmax());
0258   meEtlPtEff_[1]->getTH1()->SetMinimum(0.);
0259   computeEfficiency1D(meETLTrackEffPtMtdZpos, meETLTrackEffPtTotZpos, meEtlPtEff_[1]);
0260 
0261   meEtlEtaEff2_[0] = ibook.book1D("EtlEtaEff2Zneg",
0262                                   " Track Efficiency VS Eta (-Z, 2 hit);#eta;Efficiency",
0263                                   meETLTrackEffEtaTotZneg->getNbinsX(),
0264                                   meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmin(),
0265                                   meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmax());
0266   meEtlEtaEff2_[0]->getTH1()->SetMinimum(0.);
0267   computeEfficiency1D(meETLTrackEffEta2MtdZneg, meETLTrackEffEtaTotZneg, meEtlEtaEff2_[0]);
0268 
0269   meEtlEtaEff2LowPt_[0] = ibook.book1D("EtlEtaEff2LowPt0",
0270                                        " Track Efficiency VS Eta (2 hits), 0.2 < pt < 0.45;#eta;Efficiency",
0271                                        meETLTrackEffEtaTotLowPt0->getNbinsX(),
0272                                        meETLTrackEffEtaTotLowPt0->getTH1()->GetXaxis()->GetXmin(),
0273                                        meETLTrackEffEtaTotLowPt0->getTH1()->GetXaxis()->GetXmax());
0274   meEtlEtaEff2LowPt_[0]->getTH1()->SetMinimum(0.);
0275   computeEfficiency1D(meETLTrackEffEta2MtdLowPt0, meETLTrackEffEtaTotLowPt0, meEtlEtaEff2LowPt_[0]);
0276 
0277   meEtlPhiEff2_[0] = ibook.book1D("EtlPhiEff2Zneg",
0278                                   "Track Efficiency VS Phi (-Z, 2 hits);#phi [rad];Efficiency",
0279                                   meETLTrackEffPhiTotZneg->getNbinsX(),
0280                                   meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmin(),
0281                                   meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmax());
0282   meEtlPhiEff2_[0]->getTH1()->SetMinimum(0.);
0283   computeEfficiency1D(meETLTrackEffPhi2MtdZneg, meETLTrackEffPhiTotZneg, meEtlPhiEff2_[0]);
0284 
0285   meEtlPtEff2_[0] = ibook.book1D("EtlPtEff2Zneg",
0286                                  "Track Efficiency VS Pt (-Z, 2 hits);Pt [GeV];Efficiency",
0287                                  meETLTrackEffPtTotZneg->getNbinsX(),
0288                                  meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmin(),
0289                                  meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmax());
0290   meEtlPtEff2_[0]->getTH1()->SetMinimum(0.);
0291   computeEfficiency1D(meETLTrackEffPt2MtdZneg, meETLTrackEffPtTotZneg, meEtlPtEff2_[0]);
0292 
0293   meEtlEtaEff2_[1] = ibook.book1D("EtlEtaEff2Zpos",
0294                                   "Track Efficiency VS Eta (+Z, 2 hits);#eta;Efficiency",
0295                                   meETLTrackEffEtaTotZpos->getNbinsX(),
0296                                   meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmin(),
0297                                   meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmax());
0298   meEtlEtaEff2_[1]->getTH1()->SetMinimum(0.);
0299   computeEfficiency1D(meETLTrackEffEta2MtdZpos, meETLTrackEffEtaTotZpos, meEtlEtaEff2_[1]);
0300 
0301   meEtlEtaEff2LowPt_[1] = ibook.book1D("EtlEtaEff2LowPt1",
0302                                        " Track Efficiency VS Eta (2 hits), 0.45 < pt < 0.7;#eta;Efficiency",
0303                                        meETLTrackEffEtaTotLowPt1->getNbinsX(),
0304                                        meETLTrackEffEtaTotLowPt1->getTH1()->GetXaxis()->GetXmin(),
0305                                        meETLTrackEffEtaTotLowPt1->getTH1()->GetXaxis()->GetXmax());
0306   meEtlEtaEff2LowPt_[1]->getTH1()->SetMinimum(0.);
0307   computeEfficiency1D(meETLTrackEffEta2MtdLowPt1, meETLTrackEffEtaTotLowPt1, meEtlEtaEff2LowPt_[1]);
0308 
0309   meEtlPhiEff2_[1] = ibook.book1D("EtlPhiEff2Zpos",
0310                                   "Track Efficiency VS Phi (+Z, 2 hits);#phi [rad];Efficiency",
0311                                   meETLTrackEffPhiTotZpos->getNbinsX(),
0312                                   meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmin(),
0313                                   meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmax());
0314   meEtlPhiEff2_[1]->getTH1()->SetMinimum(0.);
0315   computeEfficiency1D(meETLTrackEffPhi2MtdZpos, meETLTrackEffPhiTotZpos, meEtlPhiEff2_[1]);
0316 
0317   meEtlPtEff2_[1] = ibook.book1D("EtlPtEff2Zpos",
0318                                  "Track Efficiency VS Pt (+Z, 2 hits);Pt [GeV];Efficiency",
0319                                  meETLTrackEffPtTotZpos->getNbinsX(),
0320                                  meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmin(),
0321                                  meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmax());
0322   meEtlPtEff2_[1]->getTH1()->SetMinimum(0.);
0323   computeEfficiency1D(meETLTrackEffPt2MtdZpos, meETLTrackEffPtTotZpos, meEtlPtEff2_[1]);
0324 
0325   meExtraPtEff_ =
0326       ibook.book1D("ExtraPtEff",
0327                    "MTD matching efficiency wrt extrapolated track associated to LV VS Pt;Pt [GeV];Efficiency",
0328                    meTrackMatchedTPEffPtTotLV->getNbinsX(),
0329                    meTrackMatchedTPEffPtTotLV->getTH1()->GetXaxis()->GetXmin(),
0330                    meTrackMatchedTPEffPtTotLV->getTH1()->GetXaxis()->GetXmax());
0331   meExtraPtEff_->getTH1()->SetMinimum(0.);
0332   computeEfficiency1D(meExtraPtMtd, meTrackMatchedTPEffPtTotLV, meExtraPtEff_);
0333 
0334   meExtraPtEtl2Eff_ =
0335       ibook.book1D("ExtraPtEtl2Eff",
0336                    "MTD matching efficiency (2 ETL) wrt extrapolated track associated to LV VS Pt;Pt [GeV];Efficiency",
0337                    meTrackMatchedTPEffPtTotLV->getNbinsX(),
0338                    meTrackMatchedTPEffPtTotLV->getTH1()->GetXaxis()->GetXmin(),
0339                    meTrackMatchedTPEffPtTotLV->getTH1()->GetXaxis()->GetXmax());
0340   meExtraPtEtl2Eff_->getTH1()->SetMinimum(0.);
0341   computeEfficiency1D(meExtraPtEtl2Mtd, meTrackMatchedTPEffPtTotLV, meExtraPtEtl2Eff_);
0342 
0343   meExtraEtaEff_ = ibook.book1D("ExtraEtaEff",
0344                                 "MTD matching efficiency wrt extrapolated track associated to LV VS Eta;Eta;Efficiency",
0345                                 meTrackMatchedTPEffEtaTotLV->getNbinsX(),
0346                                 meTrackMatchedTPEffEtaTotLV->getTH1()->GetXaxis()->GetXmin(),
0347                                 meTrackMatchedTPEffEtaTotLV->getTH1()->GetXaxis()->GetXmax());
0348   meExtraEtaEff_->getTH1()->SetMinimum(0.);
0349   computeEfficiency1D(meExtraEtaMtd, meTrackMatchedTPEffEtaTotLV, meExtraEtaEff_);
0350 
0351   meExtraEtaEtl2Eff_ =
0352       ibook.book1D("ExtraEtaEtl2Eff",
0353                    "MTD matching efficiency (2 ETL) wrt extrapolated track associated to LV VS Eta;Eta;Efficiency",
0354                    meTrackMatchedTPEffEtaTotLV->getNbinsX(),
0355                    meTrackMatchedTPEffEtaTotLV->getTH1()->GetXaxis()->GetXmin(),
0356                    meTrackMatchedTPEffEtaTotLV->getTH1()->GetXaxis()->GetXmax());
0357   meExtraEtaEtl2Eff_->getTH1()->SetMinimum(0.);
0358   computeEfficiency1D(meExtraEtaEtl2Mtd, meTrackMatchedTPEffEtaTotLV, meExtraEtaEtl2Eff_);
0359 
0360   meTPPtSelEff_ = ibook.book1D("TPPtSelEff",
0361                                "Track selected efficiency TP VS Pt;Pt [GeV];Efficiency",
0362                                meTrackPtTot->getNbinsX(),
0363                                meTrackPtTot->getTH1()->GetXaxis()->GetXmin(),
0364                                meTrackPtTot->getTH1()->GetXaxis()->GetXmax());
0365   meTPPtSelEff_->getTH1()->SetMinimum(0.);
0366   computeEfficiency1D(meTrackMatchedTPEffPtTot, meTrackPtTot, meTPPtSelEff_);
0367 
0368   meTPEtaSelEff_ = ibook.book1D("TPEtaSelEff",
0369                                 "Track selected efficiency TP VS Eta;Eta;Efficiency",
0370                                 meTrackEtaTot->getNbinsX(),
0371                                 meTrackEtaTot->getTH1()->GetXaxis()->GetXmin(),
0372                                 meTrackEtaTot->getTH1()->GetXaxis()->GetXmax());
0373   meTPEtaSelEff_->getTH1()->SetMinimum(0.);
0374   computeEfficiency1D(meTrackMatchedTPEffEtaTot, meTrackEtaTot, meTPEtaSelEff_);
0375 
0376   meTPPtMatchEff_ = ibook.book1D("TPPtMatchEff",
0377                                  "Track matched to TP efficiency VS Pt;Pt [GeV];Efficiency",
0378                                  meTrackMatchedTPEffPtTot->getNbinsX(),
0379                                  meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmin(),
0380                                  meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmax());
0381   meTPPtMatchEff_->getTH1()->SetMinimum(0.);
0382   computeEfficiency1D(meTrackMatchedTPEffPtMtd, meTrackMatchedTPEffPtTot, meTPPtMatchEff_);
0383 
0384   meTPEtaMatchEff_ = ibook.book1D("TPEtaMatchEff",
0385                                   "Track matched to TP efficiency VS Eta;Eta;Efficiency",
0386                                   meTrackMatchedTPEffEtaTot->getNbinsX(),
0387                                   meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
0388                                   meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmax());
0389   meTPEtaMatchEff_->getTH1()->SetMinimum(0.);
0390   computeEfficiency1D(meTrackMatchedTPEffEtaMtd, meTrackMatchedTPEffEtaTot, meTPEtaMatchEff_);
0391 
0392   meTPPtMatchEtl2Eff_ = ibook.book1D("TPPtMatchEtl2Eff",
0393                                      "Track matched to TP efficiency VS Pt, 2 ETL hits;Pt [GeV];Efficiency",
0394                                      meTrackMatchedTPEffPtTot->getNbinsX(),
0395                                      meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmin(),
0396                                      meTrackMatchedTPEffPtTot->getTH1()->GetXaxis()->GetXmax());
0397   meTPPtMatchEtl2Eff_->getTH1()->SetMinimum(0.);
0398   computeEfficiency1D(meTrackMatchedTPEffPtEtl2Mtd, meTrackMatchedTPEffPtTot, meTPPtMatchEtl2Eff_);
0399 
0400   meTPEtaMatchEtl2Eff_ = ibook.book1D("TPEtaMatchEtl2Eff",
0401                                       "Track matched to TP efficiency VS Eta, 2 ETL hits;Eta;Efficiency",
0402                                       meTrackMatchedTPEffEtaTot->getNbinsX(),
0403                                       meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
0404                                       meTrackMatchedTPEffEtaTot->getTH1()->GetXaxis()->GetXmax());
0405   meTPEtaMatchEtl2Eff_->getTH1()->SetMinimum(0.);
0406   computeEfficiency1D(meTrackMatchedTPEffEtaEtl2Mtd, meTrackMatchedTPEffEtaTot, meTPEtaMatchEtl2Eff_);
0407 
0408   meTPmtdPtSelEff_ = ibook.book1D("TPmtdPtSelEff",
0409                                   "Track selected efficiency TP-mtd hit VS Pt;Pt [GeV];Efficiency",
0410                                   meTrackPtTot->getNbinsX(),
0411                                   meTrackPtTot->getTH1()->GetXaxis()->GetXmin(),
0412                                   meTrackPtTot->getTH1()->GetXaxis()->GetXmax());
0413   meTPmtdPtSelEff_->getTH1()->SetMinimum(0.);
0414   computeEfficiency1D(meTrackMatchedTPmtdEffPtTot, meTrackPtTot, meTPmtdPtSelEff_);
0415 
0416   meTPmtdEtaSelEff_ = ibook.book1D("TPmtdEtaSelEff",
0417                                    "Track selected efficiency TPmtd hit VS Eta;Eta;Efficiency",
0418                                    meTrackEtaTot->getNbinsX(),
0419                                    meTrackEtaTot->getTH1()->GetXaxis()->GetXmin(),
0420                                    meTrackEtaTot->getTH1()->GetXaxis()->GetXmax());
0421   meTPmtdEtaSelEff_->getTH1()->SetMinimum(0.);
0422   computeEfficiency1D(meTrackMatchedTPmtdEffEtaTot, meTrackEtaTot, meTPmtdEtaSelEff_);
0423 
0424   meTPmtdPtMatchEff_ = ibook.book1D("TPmtdPtMatchEff",
0425                                     "Track matched to TP-mtd hit efficiency VS Pt;Pt [GeV];Efficiency",
0426                                     meTrackMatchedTPmtdEffPtTot->getNbinsX(),
0427                                     meTrackMatchedTPmtdEffPtTot->getTH1()->GetXaxis()->GetXmin(),
0428                                     meTrackMatchedTPmtdEffPtTot->getTH1()->GetXaxis()->GetXmax());
0429   meTPmtdPtMatchEff_->getTH1()->SetMinimum(0.);
0430   computeEfficiency1D(meTrackMatchedTPmtdEffPtMtd, meTrackMatchedTPmtdEffPtTot, meTPmtdPtMatchEff_);
0431 
0432   meTPmtdEtaMatchEff_ = ibook.book1D("TPmtdEtaMatchEff",
0433                                      "Track matched to TP-mtd hit efficiency VS Eta;Eta;Efficiency",
0434                                      meTrackMatchedTPmtdEffEtaTot->getNbinsX(),
0435                                      meTrackMatchedTPmtdEffEtaTot->getTH1()->GetXaxis()->GetXmin(),
0436                                      meTrackMatchedTPmtdEffEtaTot->getTH1()->GetXaxis()->GetXmax());
0437   meTPmtdEtaMatchEff_->getTH1()->SetMinimum(0.);
0438   computeEfficiency1D(meTrackMatchedTPmtdEffEtaMtd, meTrackMatchedTPmtdEffEtaTot, meTPmtdEtaMatchEff_);
0439 
0440   meNoTimeFraction_ = ibook.book1D("NoTimeFraction",
0441                                    "Fraction of tracks with MTD hits and no time associated; Num. of hits",
0442                                    meTrackNumHits->getNbinsX(),
0443                                    meTrackNumHits->getTH1()->GetXaxis()->GetXmin(),
0444                                    meTrackNumHits->getTH1()->GetXaxis()->GetXmax());
0445   meNoTimeFraction_->getTH1()->SetMinimum(0.);
0446   computeEfficiency1D(meTrackNumHitsNT, meTrackNumHits, meNoTimeFraction_);
0447 
0448   meBtlEtaEff_->getTH1()->SetMinimum(0.);
0449   meBtlPhiEff_->getTH1()->SetMinimum(0.);
0450   meBtlPtEff_->getTH1()->SetMinimum(0.);
0451   for (int i = 0; i < 2; i++) {
0452     meEtlEtaEff_[i]->getTH1()->SetMinimum(0.);
0453     meEtlEtaEffLowPt_[i]->getTH1()->SetMinimum(0.);
0454     meEtlPhiEff_[i]->getTH1()->SetMinimum(0.);
0455     meEtlPtEff_[i]->getTH1()->SetMinimum(0.);
0456     meEtlEtaEff2_[i]->getTH1()->SetMinimum(0.);
0457     meEtlEtaEff2LowPt_[i]->getTH1()->SetMinimum(0.);
0458     meEtlPhiEff2_[i]->getTH1()->SetMinimum(0.);
0459     meEtlPtEff2_[i]->getTH1()->SetMinimum(0.);
0460   }
0461 
0462   meExtraPhiAtBTLEff_ = ibook.book1D("ExtraPhiAtBTLEff",
0463                                      "Efficiency to match hits at BTL surface of extrapolated tracks associated to LV",
0464                                      meExtraPhiAtBTL->getNbinsX(),
0465                                      meExtraPhiAtBTL->getTH1()->GetXaxis()->GetXmin(),
0466                                      meExtraPhiAtBTL->getTH1()->GetXaxis()->GetXmax());
0467   meExtraPhiAtBTLEff_->getTH1()->SetMinimum(0.);
0468   computeEfficiency1D(meExtraPhiAtBTLmatched, meExtraPhiAtBTL, meExtraPhiAtBTLEff_);
0469 
0470   normalize(meExtraBTLeneInCone, 1.);
0471 
0472   meExtraMTDfailExtenderEtaEff_ =
0473       ibook.book1D("ExtraMTDfailExtenderEtaEff",
0474                    "Track associated to LV extrapolated at MTD surface no extender efficiency VS Eta;Eta;Efficiency",
0475                    meTrackMatchedTPEffEtaTotLV->getNbinsX(),
0476                    meTrackMatchedTPEffEtaTotLV->getTH1()->GetXaxis()->GetXmin(),
0477                    meTrackMatchedTPEffEtaTotLV->getTH1()->GetXaxis()->GetXmax());
0478   meExtraMTDfailExtenderEtaEff_->getTH1()->SetMinimum(0.);
0479   computeEfficiency1D(meExtraMTDfailExtenderEta, meTrackMatchedTPEffEtaTotLV, meExtraMTDfailExtenderEtaEff_);
0480 
0481   meExtraMTDfailExtenderPtEff_ = ibook.book1D(
0482       "ExtraMTDfailExtenderPtEff",
0483       "Track associated to LV extrapolated at MTD surface no extender efficiency VS Pt;Pt [GeV];Efficiency",
0484       meTrackMatchedTPEffPtTotLV->getNbinsX(),
0485       meTrackMatchedTPEffPtTotLV->getTH1()->GetXaxis()->GetXmin(),
0486       meTrackMatchedTPEffPtTotLV->getTH1()->GetXaxis()->GetXmax());
0487   meExtraMTDfailExtenderPtEff_->getTH1()->SetMinimum(0.);
0488   computeEfficiency1D(meExtraMTDfailExtenderPt, meTrackMatchedTPEffPtTotLV, meExtraMTDfailExtenderPtEff_);
0489 }
0490 
0491 // ------------ method fills 'descriptions' with the allowed parameters for the module  ----------
0492 void MtdTracksHarvester::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0493   edm::ParameterSetDescription desc;
0494 
0495   desc.add<std::string>("folder", "MTD/Tracks/");
0496 
0497   descriptions.add("MtdTracksPostProcessor", desc);
0498 }
0499 
0500 DEFINE_FWK_MODULE(MtdTracksHarvester);