Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-09-18 22:46:56

0001 /*
0002   JetMETHLTOffline DQM code
0003   Migrated to use DQMEDAnalyzer by: Jyothsna Rani Komaragiri, Oct 2014
0004 */
0005 
0006 #include "DQMOffline/Trigger/interface/JetMETHLTOfflineSource.h"
0007 
0008 #include "FWCore/Common/interface/TriggerNames.h"
0009 #include "FWCore/Framework/interface/Run.h"
0010 #include "FWCore/Framework/interface/MakerMacros.h"
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0013 
0014 #include "DataFormats/Common/interface/Handle.h"
0015 #include "DataFormats/Common/interface/TriggerResults.h"
0016 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
0017 #include "DataFormats/HLTReco/interface/TriggerObject.h"
0018 #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
0019 #include "DataFormats/Math/interface/deltaR.h"
0020 
0021 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
0022 
0023 #include "DQMServices/Core/interface/DQMStore.h"
0024 
0025 #include "TMath.h"
0026 #include "TH1F.h"
0027 #include "TH2F.h"
0028 #include "TProfile.h"
0029 #include "TPRegexp.h"
0030 
0031 #include <cmath>
0032 
0033 using namespace edm;
0034 using namespace reco;
0035 using namespace std;
0036 using namespace trigger;
0037 
0038 JetMETHLTOfflineSource::JetMETHLTOfflineSource(const edm::ParameterSet& iConfig) : isSetup_(false) {
0039   LogDebug("JetMETHLTOfflineSource") << "constructor....";
0040 
0041   //
0042   dirname_ = iConfig.getUntrackedParameter("dirname", std::string("HLT/JetMET/"));
0043   processname_ = iConfig.getParameter<std::string>("processname");
0044   triggerSummaryLabel_ = iConfig.getParameter<edm::InputTag>("triggerSummaryLabel");
0045   triggerResultsLabel_ = iConfig.getParameter<edm::InputTag>("triggerResultsLabel");
0046   triggerSummaryToken = consumes<trigger::TriggerEvent>(triggerSummaryLabel_);
0047   triggerResultsToken = consumes<edm::TriggerResults>(triggerResultsLabel_);
0048   triggerSummaryFUToken = consumes<trigger::TriggerEvent>(
0049       edm::InputTag(triggerSummaryLabel_.label(), triggerSummaryLabel_.instance(), std::string("FU")));
0050   triggerResultsFUToken = consumes<edm::TriggerResults>(
0051       edm::InputTag(triggerResultsLabel_.label(), triggerResultsLabel_.instance(), std::string("FU")));
0052   //
0053   verbose_ = iConfig.getUntrackedParameter<bool>("verbose", false);
0054   runStandalone_ = iConfig.getUntrackedParameter<bool>("runStandalone", false);
0055   //
0056   plotAll_ = iConfig.getUntrackedParameter<bool>("plotAll", true);
0057   plotEff_ = iConfig.getUntrackedParameter<bool>("plotEff", true);
0058   nameForEff_ = iConfig.getUntrackedParameter<bool>("nameForEff", true);
0059   MuonTrigPaths_ = iConfig.getUntrackedParameter<vector<std::string> >("pathnameMuon");
0060   MBTrigPaths_ = iConfig.getUntrackedParameter<vector<std::string> >("pathnameMB");
0061   //CaloJet, CaloMET
0062   caloJetsToken = consumes<reco::CaloJetCollection>(iConfig.getParameter<edm::InputTag>("CaloJetCollectionLabel"));
0063   caloMetToken = consumes<reco::CaloMETCollection>(iConfig.getParameter<edm::InputTag>("CaloMETCollectionLabel"));
0064   //PFJet, PFMET
0065   pfJetsToken = consumes<reco::PFJetCollection>(iConfig.getParameter<edm::InputTag>("PFJetCollectionLabel"));
0066   pfMetToken = consumes<reco::PFMETCollection>(iConfig.getParameter<edm::InputTag>("PFMETCollectionLabel"));
0067   //pfmhtTag_       = iConfig.getParameter<edm::InputTag>("PFMHTCollectionLabel");
0068   //Vertex info
0069   vertexToken = consumes<reco::VertexCollection>(std::string("offlinePrimaryVertices"));
0070   //
0071   CaloJetCorToken_ = consumes<reco::JetCorrector>(iConfig.getParameter<edm::InputTag>("CaloJetCorLabel"));
0072   PFJetCorToken_ = consumes<reco::JetCorrector>(iConfig.getParameter<edm::InputTag>("PFJetCorLabel"));
0073   //JetID
0074   jetID = new reco::helper::JetIDHelper(iConfig.getParameter<ParameterSet>("JetIDParams"), consumesCollector());
0075   _fEMF = iConfig.getUntrackedParameter<double>("fEMF", 0.01);
0076   _feta = iConfig.getUntrackedParameter<double>("feta", 2.60);
0077   _fHPD = iConfig.getUntrackedParameter<double>("fHPD", 0.98);
0078   _n90Hits = iConfig.getUntrackedParameter<double>("n90Hits", 1.0);
0079   _min_NHEF = iConfig.getUntrackedParameter<double>("minNHEF", 0.);
0080   _max_NHEF = iConfig.getUntrackedParameter<double>("maxNHEF", 0.99);
0081   _min_CHEF = iConfig.getUntrackedParameter<double>("minCHEF", 0.);
0082   _max_CHEF = iConfig.getUntrackedParameter<double>("maxCHEF", 1.);
0083   _min_NEMF = iConfig.getUntrackedParameter<double>("minNEMF", 0.);
0084   _max_NEMF = iConfig.getUntrackedParameter<double>("maxNEMF", 0.99);
0085   _min_CEMF = iConfig.getUntrackedParameter<double>("minCEMF", 0.);
0086   _max_CEMF = iConfig.getUntrackedParameter<double>("maxCEMF", 0.99);
0087   //Paths
0088   pathFilter_ = iConfig.getUntrackedParameter<vector<std::string> >("pathFilter");
0089   pathRejectKeyword_ = iConfig.getUntrackedParameter<vector<std::string> >("pathRejectKeyword");
0090   std::vector<edm::ParameterSet> paths = iConfig.getParameter<std::vector<edm::ParameterSet> >("pathPairs");
0091   for (auto& path : paths) {
0092     custompathnamepairs_.push_back(
0093         make_pair(path.getParameter<std::string>("pathname"), path.getParameter<std::string>("denompathname")));
0094   }
0095 }
0096 
0097 //------------------------------------------------------------------------//
0098 JetMETHLTOfflineSource::~JetMETHLTOfflineSource() {
0099   //
0100   // do anything here that needs to be done at desctruction time
0101   // (e.g. close files, deallocate resources etc.)
0102   delete jetID;
0103 }
0104 
0105 //------------------------------------------------------------------------//
0106 void JetMETHLTOfflineSource::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0107   if (verbose_) {
0108     cout << endl;
0109     cout << "============================================================" << endl;
0110     cout << " New event" << endl << endl;
0111   }
0112 
0113   //---------- triggerResults ----------
0114   iEvent.getByToken(triggerResultsToken, triggerResults_);
0115   if (!triggerResults_.isValid()) {
0116     iEvent.getByToken(triggerResultsFUToken, triggerResults_);
0117     if (!triggerResults_.isValid()) {
0118       if (verbose_)
0119         cout << " triggerResults not valid" << endl;
0120       edm::LogInfo("JetMETHLTOfflineSource") << "TriggerResults not found, "
0121                                                 "skipping event";
0122       return;
0123     }
0124   }
0125   if (verbose_)
0126     cout << " done triggerResults" << endl;
0127 
0128   //---------- triggerResults ----------
0129   triggerNames_ = iEvent.triggerNames(*triggerResults_);
0130 
0131   //---------- triggerSummary ----------
0132   iEvent.getByToken(triggerSummaryToken, triggerObj_);
0133   if (!triggerObj_.isValid()) {
0134     iEvent.getByToken(triggerSummaryFUToken, triggerObj_);
0135     if (!triggerObj_.isValid()) {
0136       edm::LogInfo("JetMETHLTOfflineSource") << "TriggerEvent not found, "
0137                                                 "skipping event";
0138       return;
0139     }
0140   }
0141   if (verbose_)
0142     cout << " done triggerSummary" << endl;
0143 
0144   if (verbose_) {
0145     cout << endl;
0146     cout << "============================================================" << endl;
0147     cout << " Reading in offline objects" << endl << endl;
0148   }
0149 
0150   //------------ Offline Objects -------
0151   iEvent.getByToken(caloJetsToken, calojetColl_);
0152   if (!calojetColl_.isValid())
0153     return;
0154   calojet = *calojetColl_;
0155   //std::stable_sort( calojet.begin(), calojet.end(), PtSorter() );
0156 
0157   if (verbose_)
0158     cout << " done calo" << endl;
0159 
0160   iEvent.getByToken(pfJetsToken, pfjetColl_);
0161   if (!pfjetColl_.isValid())
0162     return;
0163   pfjet = *pfjetColl_;
0164   //std::stable_sort( pfjet.begin(), pfjet.end(), PtSorter() );
0165 
0166   if (verbose_)
0167     cout << " done pf" << endl;
0168 
0169   iEvent.getByToken(caloMetToken, calometColl_);
0170   if (!calometColl_.isValid())
0171     return;
0172 
0173   iEvent.getByToken(pfMetToken, pfmetColl_);
0174   if (!pfmetColl_.isValid())
0175     return;
0176 
0177   if (verbose_) {
0178     cout << endl;
0179     cout << "============================================================" << endl;
0180     cout << " Read in offline objects" << endl << endl;
0181   }
0182 
0183   //---------- Event counting (DEBUG) ----------
0184   if (verbose_ && iEvent.id().event() % 10000 == 0)
0185     cout << "Run = " << iEvent.id().run() << ", LS = " << iEvent.luminosityBlock()
0186          << ", Event = " << iEvent.id().event() << endl;
0187 
0188   //Define on-the-fly correction Jet
0189   for (int i = 0; i < 2; i++) {
0190     CaloJetPx[i] = 0.;
0191     CaloJetPy[i] = 0.;
0192     CaloJetPt[i] = 0.;
0193     CaloJetEta[i] = 0.;
0194     CaloJetPhi[i] = 0.;
0195     CaloJetEMF[i] = 0.;
0196     CaloJetfHPD[i] = 0.;
0197     CaloJetn90[i] = 0.;
0198     PFJetPx[i] = 0.;
0199     PFJetPy[i] = 0.;
0200     PFJetPt[i] = 0.;
0201     PFJetEta[i] = 0.;
0202     PFJetPhi[i] = 0.;
0203     PFJetNHEF[i] = 0.;
0204     PFJetCHEF[i] = 0.;
0205     PFJetNEMF[i] = 0.;
0206     PFJetCEMF[i] = 0.;
0207   }
0208 
0209   //---------- CaloJet Correction (on-the-fly) ----------
0210   edm::Handle<reco::JetCorrector> calocorrector;
0211   iEvent.getByToken(CaloJetCorToken_, calocorrector);
0212   auto calojet_ = calojet.begin();
0213   for (; calojet_ != calojet.end(); ++calojet_) {
0214     double scale = calocorrector->correction(*calojet_);
0215     jetID->calculate(iEvent, iSetup, *calojet_);
0216 
0217     if (scale * calojet_->pt() > CaloJetPt[0]) {
0218       CaloJetPt[1] = CaloJetPt[0];
0219       CaloJetPx[1] = CaloJetPx[0];
0220       CaloJetPy[1] = CaloJetPy[0];
0221       CaloJetEta[1] = CaloJetEta[0];
0222       CaloJetPhi[1] = CaloJetPhi[0];
0223       CaloJetEMF[1] = CaloJetEMF[0];
0224       CaloJetfHPD[1] = CaloJetfHPD[0];
0225       CaloJetn90[1] = CaloJetn90[0];
0226       //
0227       CaloJetPt[0] = scale * calojet_->pt();
0228       CaloJetPx[0] = scale * calojet_->px();
0229       CaloJetPy[0] = scale * calojet_->py();
0230       CaloJetEta[0] = calojet_->eta();
0231       CaloJetPhi[0] = calojet_->phi();
0232       CaloJetEMF[0] = calojet_->emEnergyFraction();
0233       CaloJetfHPD[0] = jetID->fHPD();
0234       CaloJetn90[0] = jetID->n90Hits();
0235     } else if (scale * calojet_->pt() < CaloJetPt[0] && scale * calojet_->pt() > CaloJetPt[1]) {
0236       CaloJetPt[1] = scale * calojet_->pt();
0237       CaloJetPx[1] = scale * calojet_->px();
0238       CaloJetPy[1] = scale * calojet_->py();
0239       CaloJetEta[1] = calojet_->eta();
0240       CaloJetPhi[1] = calojet_->phi();
0241       CaloJetEMF[1] = calojet_->emEnergyFraction();
0242       CaloJetfHPD[1] = jetID->fHPD();
0243       CaloJetn90[1] = jetID->n90Hits();
0244     } else {
0245     }
0246   }
0247 
0248   //---------- PFJet Correction (on-the-fly) ----------
0249   pfMHTx_All = 0.;
0250   pfMHTy_All = 0.;
0251   edm::Handle<reco::JetCorrector> pfcorrector;
0252   iEvent.getByToken(PFJetCorToken_, pfcorrector);
0253   auto pfjet_ = pfjet.begin();
0254   for (; pfjet_ != pfjet.end(); ++pfjet_) {
0255     double scale = pfcorrector->correction(*pfjet_);
0256     pfMHTx_All = pfMHTx_All + scale * pfjet_->px();
0257     pfMHTy_All = pfMHTy_All + scale * pfjet_->py();
0258     if (scale * pfjet_->pt() > PFJetPt[0]) {
0259       PFJetPt[1] = PFJetPt[0];
0260       PFJetPx[1] = PFJetPx[0];
0261       PFJetPy[1] = PFJetPy[0];
0262       PFJetEta[1] = PFJetEta[0];
0263       PFJetPhi[1] = PFJetPhi[0];
0264       PFJetNHEF[1] = PFJetNHEF[0];
0265       PFJetCHEF[1] = PFJetCHEF[0];
0266       PFJetNEMF[1] = PFJetNEMF[0];
0267       PFJetCEMF[1] = PFJetCEMF[0];
0268       //
0269       PFJetPt[0] = scale * pfjet_->pt();
0270       PFJetPx[0] = scale * pfjet_->px();
0271       PFJetPy[0] = scale * pfjet_->py();
0272       PFJetEta[0] = pfjet_->eta();
0273       PFJetPhi[0] = pfjet_->phi();
0274       PFJetNHEF[0] = pfjet_->neutralHadronEnergyFraction();
0275       PFJetCHEF[0] = pfjet_->chargedHadronEnergyFraction();
0276       PFJetNEMF[0] = pfjet_->neutralEmEnergyFraction();
0277       PFJetCEMF[0] = pfjet_->chargedEmEnergyFraction();
0278     } else if (scale * pfjet_->pt() < PFJetPt[0] && scale * pfjet_->pt() > PFJetPt[1]) {
0279       PFJetPt[1] = scale * pfjet_->pt();
0280       PFJetPx[1] = scale * pfjet_->px();
0281       PFJetPy[1] = scale * pfjet_->py();
0282       PFJetEta[1] = pfjet_->eta();
0283       PFJetPhi[1] = pfjet_->phi();
0284       PFJetNHEF[1] = pfjet_->neutralHadronEnergyFraction();
0285       PFJetCHEF[1] = pfjet_->chargedHadronEnergyFraction();
0286       PFJetNEMF[1] = pfjet_->neutralEmEnergyFraction();
0287       PFJetCEMF[1] = pfjet_->chargedEmEnergyFraction();
0288     } else {
0289     }
0290   }
0291 
0292   if (verbose_) {
0293     for (int i = 0; i < 2; i++) {
0294       cout << "CaloJet-0: " << CaloJetPt[i] << ", Eta = " << CaloJetEta[i] << ", Phi = " << CaloJetPhi[i] << endl;
0295       cout << "fHPD = " << CaloJetfHPD[0] << ", n90 = " << CaloJetn90[0] << endl;
0296     }
0297     for (int i = 0; i < 2; i++) {
0298       cout << "PFJet-0: " << PFJetPt[i] << ", Eta = " << PFJetEta[i] << ", Phi = " << PFJetPhi[i] << endl;
0299     }
0300   }
0301 
0302   //---------- RUN ----------
0303   fillMEforMonTriggerSummary(iEvent, iSetup);
0304   if (plotAll_)
0305     fillMEforMonAllTrigger(iEvent, iSetup);
0306   if (plotEff_)
0307     fillMEforEffAllTrigger(iEvent, iSetup);
0308   if (runStandalone_)
0309     fillMEforTriggerNTfired();
0310 }
0311 
0312 //------------------------------------------------------------------------//
0313 // Trigger summary for all paths
0314 void JetMETHLTOfflineSource::fillMEforMonTriggerSummary(const Event& iEvent, const edm::EventSetup& iSetup) {
0315   if (verbose_)
0316     cout << ">> Inside fillMEforMonTriggerSummary " << endl;
0317   bool muTrig = false;
0318 
0319   for (auto const& MuonTrigPath : MuonTrigPaths_) {
0320     const unsigned int nPath(hltConfig_.size());
0321     for (unsigned int j = 0; j != nPath; ++j) {
0322       std::string pathname = hltConfig_.triggerName(j);
0323       if (pathname.find(MuonTrigPath) != std::string::npos) {
0324         if (isHLTPathAccepted(pathname)) {
0325           muTrig = true;
0326           if (verbose_)
0327             cout << "fillMEforMonTriggerSummary: Muon Match" << endl;
0328         }
0329       }
0330       if (muTrig)
0331         break;
0332     }
0333     if (muTrig)
0334       break;
0335   }
0336 
0337   bool mbTrig = false;
0338   for (auto const& MBTrigPath : MBTrigPaths_) {
0339     const unsigned int nPath(hltConfig_.size());
0340     for (unsigned int j = 0; j != nPath; ++j) {
0341       std::string pathname = hltConfig_.triggerName(j);
0342       if (pathname.find(MBTrigPath) != std::string::npos) {
0343         if (isHLTPathAccepted(pathname)) {
0344           mbTrig = true;
0345           if (verbose_)
0346             cout << "fillMEforMonTriggerSummary: MinBias Match" << endl;
0347         }
0348       }
0349       if (mbTrig)
0350         break;
0351     }
0352     if (mbTrig)
0353       break;
0354   }
0355 
0356   auto v = hltPathsAll_.begin();
0357   for (; v != hltPathsAll_.end(); ++v) {
0358     bool trigFirst = false;
0359     double binV = TriggerPosition(v->getPath());
0360     if (isHLTPathAccepted(v->getPath()))
0361       trigFirst = true;
0362     if (!trigFirst)
0363       continue;
0364     if (trigFirst) {
0365       rate_All->Fill(binV);
0366       correlation_All->Fill(binV, binV);
0367       if (muTrig && runStandalone_) {
0368         rate_AllWrtMu->Fill(binV);
0369         correlation_AllWrtMu->Fill(binV, binV);
0370       }
0371       if (mbTrig && runStandalone_) {
0372         rate_AllWrtMB->Fill(binV);
0373         correlation_AllWrtMB->Fill(binV, binV);
0374       }
0375     }
0376     for (auto w = v + 1; w != hltPathsAll_.end(); ++w) {
0377       bool trigSec = false;
0378       double binW = TriggerPosition(w->getPath());
0379       if (isHLTPathAccepted(w->getPath()))
0380         trigSec = true;
0381       if (trigSec && trigFirst) {
0382         correlation_All->Fill(binV, binW);
0383         if (muTrig && runStandalone_)
0384           correlation_AllWrtMu->Fill(binV, binW);
0385         if (mbTrig && runStandalone_)
0386           correlation_AllWrtMB->Fill(binV, binW);
0387       }
0388       if (!trigSec && trigFirst) {
0389         correlation_All->Fill(binW, binV);
0390         if (muTrig && runStandalone_)
0391           correlation_AllWrtMu->Fill(binW, binV);
0392         if (mbTrig && runStandalone_)
0393           correlation_AllWrtMB->Fill(binW, binV);
0394       }
0395     }
0396   }
0397 
0398   //Vertex
0399   edm::Handle<VertexCollection> Vtx;
0400   iEvent.getByToken(vertexToken, Vtx);
0401   int vtxcnt = 0;
0402   for (auto const& itv : *Vtx) {
0403     //if(vtxcnt>=20) break;
0404     PVZ->Fill(itv.z());
0405     //chi2vtx[vtxcnt] = itv->chi2();
0406     //ndofvtx[vtxcnt] = itv->ndof();
0407     //ntrkvtx[vtxcnt] = itv->tracksSize();
0408     vtxcnt++;
0409   }
0410   NVertices->Fill(vtxcnt);
0411 }
0412 
0413 //------------------------------------------------------------------------//
0414 void JetMETHLTOfflineSource::fillMEforTriggerNTfired() {
0415   if (verbose_)
0416     cout << ">> Inside fillMEforTriggerNTfired" << endl;
0417   if (!triggerResults_.isValid())
0418     return;
0419   if (verbose_)
0420     cout << "   ... and triggerResults is valid" << endl;
0421 
0422   //
0423   for (auto& v : hltPathsAll_) {
0424     unsigned index = triggerNames_.triggerIndex(v.getPath());
0425     if (index < triggerNames_.size()) {
0426       v.getMEhisto_TriggerSummary()->Fill(0.);
0427       edm::InputTag l1Tag(v.getl1Path(), "", processname_);
0428       const int l1Index = triggerObj_->filterIndex(l1Tag);
0429       bool l1found = false;
0430       if (l1Index < triggerObj_->sizeFilters())
0431         l1found = true;
0432       if (!l1found)
0433         v.getMEhisto_TriggerSummary()->Fill(1.);
0434       if (!l1found && !(triggerResults_->accept(index)))
0435         v.getMEhisto_TriggerSummary()->Fill(2.);
0436       if (!l1found && (triggerResults_->accept(index)))
0437         v.getMEhisto_TriggerSummary()->Fill(3.);
0438       if (l1found)
0439         v.getMEhisto_TriggerSummary()->Fill(4.);
0440       if (l1found && (triggerResults_->accept(index)))
0441         v.getMEhisto_TriggerSummary()->Fill(5.);
0442       if (l1found && !(triggerResults_->accept(index)))
0443         v.getMEhisto_TriggerSummary()->Fill(6.);
0444       if (!(triggerResults_->accept(index)) && l1found) {
0445         //cout<<v->getTriggerType()<<endl;
0446         if ((v.getTriggerType() == "SingleJet_Trigger") && (calojetColl_.isValid()) && !calojet.empty()) {
0447           auto jet = calojet.begin();
0448           v.getMEhisto_JetPt()->Fill(jet->pt());
0449           v.getMEhisto_EtavsPt()->Fill(jet->eta(), jet->pt());
0450           v.getMEhisto_PhivsPt()->Fill(jet->phi(), jet->pt());
0451         }
0452         // single jet trigger is not fired
0453 
0454         if ((v.getTriggerType() == "DiJet_Trigger") && calojetColl_.isValid() && !calojet.empty()) {
0455           v.getMEhisto_JetSize()->Fill(calojet.size());
0456           if (calojet.size() >= 2) {
0457             auto jet = calojet.begin();
0458             auto jet2 = calojet.begin();
0459             jet2++;
0460             double jet3pt = 0.;
0461             if (calojet.size() > 2) {
0462               auto jet3 = jet2++;
0463               jet3pt = jet3->pt();
0464             }
0465             v.getMEhisto_Pt12()->Fill((jet->pt() + jet2->pt()) / 2.);
0466             v.getMEhisto_Eta12()->Fill((jet->eta() + jet2->eta()) / 2.);
0467             v.getMEhisto_Phi12()->Fill(deltaPhi(jet->phi(), jet2->phi()));
0468             v.getMEhisto_Pt3()->Fill(jet3pt);
0469             v.getMEhisto_Pt12Pt3()->Fill((jet->pt() + jet2->pt()) / 2., jet3pt);
0470             v.getMEhisto_Pt12Phi12()->Fill((jet->pt() + jet2->pt()) / 2., deltaPhi(jet->phi(), jet2->phi()));
0471           }
0472         }  // di jet trigger is not fired
0473 
0474         if (((v.getTriggerType() == "MET_Trigger") || (v.getTriggerType() == "TET_Trigger")) &&
0475             calometColl_.isValid()) {
0476           const CaloMETCollection* calometcol = calometColl_.product();
0477           const CaloMET met = calometcol->front();
0478           v.getMEhisto_JetPt()->Fill(met.pt());
0479         }  //MET trigger is not fired
0480       }    // L1 is fired
0481     }      //
0482   }        // trigger not fired
0483 }
0484 
0485 //------------------------------------------------------------------------//
0486 void JetMETHLTOfflineSource::fillMEforMonAllTrigger(const Event& iEvent, const edm::EventSetup& iSetup) {
0487   if (verbose_)
0488     cout << ">> Inside fillMEforMonAllTrigger " << endl;
0489   if (!triggerResults_.isValid())
0490     return;
0491   if (verbose_)
0492     cout << "   ... and triggerResults is valid" << endl;
0493 
0494   const trigger::TriggerObjectCollection& toc(triggerObj_->getObjects());
0495   for (auto& v : hltPathsAll_) {
0496     if (verbose_)
0497       cout << "   + Checking path " << v.getPath();
0498     if (isHLTPathAccepted(v.getPath()) == false) {
0499       if (verbose_)
0500         cout << " - failed" << endl;
0501       continue;
0502     }
0503     if (verbose_)
0504       cout << " - PASSED! " << endl;
0505 
0506     //New jet collection (after apply JEC)
0507     std::vector<double> jetPtVec;
0508     std::vector<double> jetPhiVec;
0509     std::vector<double> jetEtaVec;
0510     std::vector<double> jetPxVec;
0511     std::vector<double> jetPyVec;
0512     std::vector<double> hltPtVec;
0513     std::vector<double> hltPhiVec;
0514     std::vector<double> hltEtaVec;
0515     std::vector<double> hltPxVec;
0516     std::vector<double> hltPyVec;
0517 
0518     //This will be used to find out punch through trigger
0519     //bool fillL1HLT = false;
0520 
0521     //L1 and HLT indices
0522     if (verbose_) {
0523       cout << "     - L1Path = " << v.getl1Path() << endl;
0524       cout << "     - Label  = " << v.getLabel() << endl;
0525     }
0526 
0527     //edm::InputTag l1Tag(v->getl1Path(),"",processname_);
0528     edm::InputTag l1Tag(v.getLabel(), "", processname_);
0529     const int l1Index = triggerObj_->filterIndex(l1Tag);
0530     if (verbose_)
0531       cout << "     - l1Index = " << l1Index << " - l1Tag = [" << l1Tag << "]" << endl;
0532 
0533     edm::InputTag hltTag(v.getLabel(), "", processname_);
0534     const int hltIndex = triggerObj_->filterIndex(hltTag);
0535     if (verbose_)
0536       cout << "     - hltIndex = " << hltIndex << " - hltTag = [" << hltTag << "]" << endl;
0537 
0538     //bool l1TrigBool = false;
0539     bool hltTrigBool = false;
0540     bool diJetFire = false;
0541     int jetsize = 0;
0542 
0543     if (l1Index >= triggerObj_->sizeFilters()) {
0544       edm::LogInfo("JetMETHLTOfflineSource") << "no index " << l1Index << " of that name " << l1Tag;
0545       if (verbose_)
0546         cout << "[JetMETHLTOfflineSource::fillMEforMonAllTrigger] - No index l1Index=" << l1Index << " of that name \""
0547              << l1Tag << "\"" << endl;
0548     } else {
0549       //l1TrigBool = true;
0550       const trigger::Keys& kl1 = triggerObj_->filterKeys(l1Index);
0551       //
0552       if (v.getObjectType() == trigger::TriggerJet && v.getTriggerType() == "SingleJet_Trigger")
0553         v.getMEhisto_N_L1()->Fill(kl1.size());
0554       //
0555       auto ki = kl1.begin();
0556       for (; ki != kl1.end(); ++ki) {
0557         double l1TrigEta = -100;
0558         double l1TrigPhi = -100;
0559         //
0560         if (v.getObjectType() == trigger::TriggerJet) {
0561           l1TrigEta = toc[*ki].eta();
0562           l1TrigPhi = toc[*ki].phi();
0563           if (v.getTriggerType() == "SingleJet_Trigger") {
0564             v.getMEhisto_Pt_L1()->Fill(toc[*ki].pt());
0565             if (isBarrel(toc[*ki].eta()))
0566               v.getMEhisto_PtBarrel_L1()->Fill(toc[*ki].pt());
0567             if (isEndCap(toc[*ki].eta()))
0568               v.getMEhisto_PtEndcap_L1()->Fill(toc[*ki].pt());
0569             if (isForward(toc[*ki].eta()))
0570               v.getMEhisto_PtForward_L1()->Fill(toc[*ki].pt());
0571             v.getMEhisto_Eta_L1()->Fill(toc[*ki].eta());
0572             v.getMEhisto_Phi_L1()->Fill(toc[*ki].phi());
0573             v.getMEhisto_EtaPhi_L1()->Fill(toc[*ki].eta(), toc[*ki].phi());
0574           }
0575         }
0576         if (v.getObjectType() == trigger::TriggerMET || v.getObjectType() == trigger::TriggerTET) {
0577           v.getMEhisto_Pt_L1()->Fill(toc[*ki].pt());
0578           v.getMEhisto_Phi_L1()->Fill(toc[*ki].phi());
0579         }
0580 
0581         //-----------------------------------------------
0582         if (hltIndex >= triggerObj_->sizeFilters()) {
0583           edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt" << hltIndex << " of that name ";
0584           if (verbose_)
0585             cout << "[JetMETHLTOfflineSource::fillMEforMonAllTrigger] - No index hltIndex=" << hltIndex
0586                  << " of that name " << endl;
0587         } else {
0588           const trigger::Keys& khlt = triggerObj_->filterKeys(hltIndex);
0589           if (v.getObjectType() == trigger::TriggerJet && ki == kl1.begin() &&
0590               v.getTriggerType() == "SingleJet_Trigger")
0591             v.getMEhisto_N_HLT()->Fill(khlt.size());
0592           //
0593           auto kj = khlt.begin();
0594           //Define hltTrigBool
0595           for (; kj != khlt.end(); ++kj) {
0596             if (v.getObjectType() == trigger::TriggerJet) {
0597               double hltTrigEta = -100;
0598               double hltTrigPhi = -100;
0599               hltTrigEta = toc[*kj].eta();
0600               hltTrigPhi = toc[*kj].phi();
0601               if ((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi)) < 0.4 &&
0602                   (v.getTriggerType() == "DiJet_Trigger"))
0603                 hltTrigBool = true;
0604             }
0605           }
0606           //
0607           kj = khlt.begin();
0608           for (; kj != khlt.end(); ++kj) {
0609             double hltTrigEta = -100.;
0610             double hltTrigPhi = -100.;
0611             //fillL1HLT = true;
0612             //MET Triggers
0613             if (verbose_)
0614               cout << "+ MET Triggers plots" << endl;
0615             if (v.getObjectType() == trigger::TriggerMET || (v.getObjectType() == trigger::TriggerTET)) {
0616               v.getMEhisto_Pt_HLT()->Fill(toc[*kj].pt());
0617               v.getMEhisto_Phi_HLT()->Fill(toc[*kj].phi());
0618               v.getMEhisto_PtCorrelation_L1HLT()->Fill(toc[*ki].pt(), toc[*kj].pt());
0619               v.getMEhisto_PhiCorrelation_L1HLT()->Fill(toc[*ki].phi(), toc[*kj].phi());
0620               v.getMEhisto_PtResolution_L1HLT()->Fill((toc[*ki].pt() - toc[*kj].pt()) / (toc[*ki].pt()));
0621               v.getMEhisto_PhiResolution_L1HLT()->Fill(toc[*ki].phi() - toc[*kj].phi());
0622             }
0623             //Jet Triggers
0624             if (verbose_)
0625               cout << "+ Jet Trigger plots" << endl;
0626             if (v.getObjectType() == trigger::TriggerJet) {
0627               if (verbose_)
0628                 cout << "  - Going for those..." << endl;
0629               hltTrigEta = toc[*kj].eta();
0630               hltTrigPhi = toc[*kj].phi();
0631               if ((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi)) < 0.4) {
0632                 if (v.getTriggerType() == "SingleJet_Trigger") {
0633                   v.getMEhisto_PtCorrelation_L1HLT()->Fill(toc[*ki].pt(), toc[*kj].pt());
0634                   v.getMEhisto_EtaCorrelation_L1HLT()->Fill(toc[*ki].eta(), toc[*kj].eta());
0635                   v.getMEhisto_PhiCorrelation_L1HLT()->Fill(toc[*ki].phi(), toc[*kj].phi());
0636                   v.getMEhisto_PtResolution_L1HLT()->Fill((toc[*ki].pt() - toc[*kj].pt()) / (toc[*ki].pt()));
0637                   v.getMEhisto_EtaResolution_L1HLT()->Fill(toc[*ki].eta() - toc[*kj].eta());
0638                   v.getMEhisto_PhiResolution_L1HLT()->Fill(toc[*ki].phi() - toc[*kj].phi());
0639                 }
0640               }
0641               if (((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi) < 0.4) ||
0642                    ((v.getTriggerType() == "DiJet_Trigger") && hltTrigBool)) &&
0643                   !diJetFire) {
0644                 if (v.getTriggerType() == "SingleJet_Trigger") {
0645                   v.getMEhisto_Pt_HLT()->Fill(toc[*kj].pt());
0646                   if (isBarrel(toc[*kj].eta()))
0647                     v.getMEhisto_PtBarrel_HLT()->Fill(toc[*kj].pt());
0648                   if (isEndCap(toc[*kj].eta()))
0649                     v.getMEhisto_PtEndcap_HLT()->Fill(toc[*kj].pt());
0650                   if (isForward(toc[*kj].eta()))
0651                     v.getMEhisto_PtForward_HLT()->Fill(toc[*kj].pt());
0652                   v.getMEhisto_Eta_HLT()->Fill(toc[*kj].eta());
0653                   v.getMEhisto_Phi_HLT()->Fill(toc[*kj].phi());
0654                   v.getMEhisto_EtaPhi_HLT()->Fill(toc[*kj].eta(), toc[*kj].phi());
0655                 }
0656 
0657                 //Calojet
0658                 if (calojetColl_.isValid() && (v.getObjectType() == trigger::TriggerJet) && (v.getPath() == "PFJet")) {
0659                   //CaloJetCollection::const_iterator jet = calojet.begin();
0660                   //for(; jet != calojet.end(); ++jet) {
0661                   for (int iCalo = 0; iCalo < 2; iCalo++) {
0662                     if (deltaR(hltTrigEta, hltTrigPhi, CaloJetEta[iCalo], CaloJetPhi[iCalo]) < 0.4) {
0663                       jetsize++;
0664                       if (v.getTriggerType() == "SingleJet_Trigger") {
0665                         v.getMEhisto_Pt()->Fill(CaloJetPt[iCalo]);
0666                         if (isBarrel(CaloJetEta[iCalo]))
0667                           v.getMEhisto_PtBarrel()->Fill(CaloJetPt[iCalo]);
0668                         if (isEndCap(CaloJetEta[iCalo]))
0669                           v.getMEhisto_PtEndcap()->Fill(CaloJetPt[iCalo]);
0670                         if (isForward(CaloJetEta[iCalo]))
0671                           v.getMEhisto_PtForward()->Fill(CaloJetPt[iCalo]);
0672                         //
0673                         v.getMEhisto_Eta()->Fill(CaloJetEta[iCalo]);
0674                         v.getMEhisto_Phi()->Fill(CaloJetPhi[iCalo]);
0675                         v.getMEhisto_EtaPhi()->Fill(CaloJetEta[iCalo], CaloJetPhi[iCalo]);
0676                         //
0677                         v.getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].pt(), CaloJetPt[iCalo]);
0678                         v.getMEhisto_EtaCorrelation_HLTRecObj()->Fill(toc[*kj].eta(), CaloJetEta[iCalo]);
0679                         v.getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(), CaloJetPhi[iCalo]);
0680                         //
0681                         v.getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].pt() - CaloJetPt[iCalo]) /
0682                                                                     (toc[*kj].pt()));
0683                         v.getMEhisto_EtaResolution_HLTRecObj()->Fill(toc[*kj].eta() - CaloJetEta[iCalo]);
0684                         v.getMEhisto_PhiResolution_HLTRecObj()->Fill(toc[*kj].phi() - CaloJetPhi[iCalo]);
0685                       }
0686 
0687                       //-------------------------------------------------------
0688                       if ((v.getTriggerType() == "DiJet_Trigger")) {
0689                         jetPhiVec.push_back(CaloJetPhi[iCalo]);
0690                         jetPtVec.push_back(CaloJetPt[iCalo]);
0691                         jetEtaVec.push_back(CaloJetEta[iCalo]);
0692                         jetPxVec.push_back(CaloJetPx[iCalo]);
0693                         jetPyVec.push_back(CaloJetPy[iCalo]);
0694                         //
0695                         hltPhiVec.push_back(toc[*kj].phi());
0696                         hltPtVec.push_back(toc[*kj].pt());
0697                         hltEtaVec.push_back(toc[*kj].eta());
0698                         hltPxVec.push_back(toc[*kj].px());
0699                         hltPyVec.push_back(toc[*kj].py());
0700                       }
0701                     }  // matching jet
0702                   }    // Jet Loop
0703                 }      // valid calojet collection, with calojet trigger
0704 
0705                 //PFJet trigger
0706                 if (pfjetColl_.isValid() && (v.getObjectType() == trigger::TriggerJet) && (v.getPath() != "PFJet")) {
0707                   //PFJetCollection::const_iterator jet = pfjet.begin();
0708                   //for(; jet != pfjet.end(); ++jet){
0709                   for (int iPF = 0; iPF < 2; iPF++) {
0710                     if (deltaR(hltTrigEta, hltTrigPhi, PFJetEta[iPF], PFJetPhi[iPF]) < 0.4) {
0711                       jetsize++;
0712                       if (v.getTriggerType() == "SingleJet_Trigger") {
0713                         v.getMEhisto_Pt()->Fill(PFJetPt[iPF]);
0714                         if (isBarrel(PFJetEta[iPF]))
0715                           v.getMEhisto_PtBarrel()->Fill(PFJetPt[iPF]);
0716                         if (isEndCap(PFJetEta[iPF]))
0717                           v.getMEhisto_PtEndcap()->Fill(PFJetPt[iPF]);
0718                         if (isForward(PFJetEta[iPF]))
0719                           v.getMEhisto_PtForward()->Fill(PFJetPt[iPF]);
0720                         //
0721                         v.getMEhisto_Eta()->Fill(PFJetEta[iPF]);
0722                         v.getMEhisto_Phi()->Fill(PFJetPhi[iPF]);
0723                         v.getMEhisto_EtaPhi()->Fill(PFJetEta[iPF], PFJetPhi[iPF]);
0724                         //
0725                         v.getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].pt(), PFJetPt[iPF]);
0726                         v.getMEhisto_EtaCorrelation_HLTRecObj()->Fill(toc[*kj].eta(), PFJetEta[iPF]);
0727                         v.getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(), PFJetPhi[iPF]);
0728                         //
0729                         v.getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].pt() - PFJetPt[iPF]) / (toc[*kj].pt()));
0730                         v.getMEhisto_EtaResolution_HLTRecObj()->Fill(toc[*kj].eta() - PFJetEta[iPF]);
0731                         v.getMEhisto_PhiResolution_HLTRecObj()->Fill(toc[*kj].phi() - PFJetPhi[iPF]);
0732                       }
0733 
0734                       //-------------------------------------------------------
0735                       if ((v.getTriggerType() == "DiJet_Trigger")) {
0736                         jetPhiVec.push_back(PFJetPhi[iPF]);
0737                         jetPtVec.push_back(PFJetPt[iPF]);
0738                         jetEtaVec.push_back(PFJetEta[iPF]);
0739                         jetPxVec.push_back(PFJetPx[iPF]);
0740                         jetPyVec.push_back(PFJetPy[iPF]);
0741                         //
0742                         hltPhiVec.push_back(toc[*kj].phi());
0743                         hltPtVec.push_back(toc[*kj].pt());
0744                         hltEtaVec.push_back(toc[*kj].eta());
0745                         hltPxVec.push_back(toc[*kj].px());
0746                         hltPyVec.push_back(toc[*kj].py());
0747                       }
0748                     }  // matching jet
0749                   }    //PFJet loop
0750                 }      //valid pfjet collection, with pfjet trigger
0751                        //
0752               }        // hlt matching with l1
0753             }          // jet trigger
0754 
0755             //------------------------------------------------------
0756             if (calometColl_.isValid() &&
0757                 ((v.getObjectType() == trigger::TriggerMET) || (v.getObjectType() == trigger::TriggerTET)) &&
0758                 (v.getPath().find("HLT_PFMET") == std::string::npos)) {
0759               const CaloMETCollection* calometcol = calometColl_.product();
0760               const CaloMET met = calometcol->front();
0761               //
0762               v.getMEhisto_Pt()->Fill(met.et());
0763               v.getMEhisto_Phi()->Fill(met.phi());
0764               //
0765               v.getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].et(), met.et());
0766               v.getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(), met.phi());
0767               v.getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].et() - met.et()) / (toc[*kj].et()));
0768               v.getMEhisto_PhiResolution_HLTRecObj()->Fill(toc[*kj].phi() - met.phi());
0769             }
0770 
0771             //--------------------------------------------------------
0772             if (pfmetColl_.isValid() &&
0773                 ((v.getObjectType() == trigger::TriggerMET) || (v.getObjectType() == trigger::TriggerTET)) &&
0774                 (v.getPath().find("HLT_PFMET") != std::string::npos)) {
0775               const PFMETCollection* pfmetcol = pfmetColl_.product();
0776               const PFMET pfmet = pfmetcol->front();
0777               //
0778               v.getMEhisto_Pt()->Fill(pfmet.et());
0779               v.getMEhisto_Phi()->Fill(pfmet.phi());
0780               //
0781               v.getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].et(), pfmet.et());
0782               v.getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(), pfmet.phi());
0783               v.getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].et() - pfmet.et()) / (toc[*kj].et()));
0784               v.getMEhisto_PhiResolution_HLTRecObj()->Fill(toc[*kj].phi() - pfmet.phi());
0785             }
0786           }  //Loop over HLT trigger candidates
0787           if ((v.getTriggerType() == "DiJet_Trigger"))
0788             diJetFire = true;
0789         }  // Valid hlt trigger object
0790       }    // Loop over L1 objects
0791     }      // Valid L1 trigger object
0792     v.getMEhisto_N()->Fill(jetsize);
0793 
0794     //--------------------------------------------------------
0795     if ((v.getTriggerType() == "DiJet_Trigger") && jetPtVec.size() > 1) {
0796       double AveJetPt = (jetPtVec[0] + jetPtVec[1]) / 2;
0797       double AveJetEta = (jetEtaVec[0] + jetEtaVec[1]) / 2;
0798       double JetDelPhi = deltaPhi(jetPhiVec[0], jetPhiVec[1]);
0799       double AveHLTPt = (hltPtVec[0] + hltPtVec[1]) / 2;
0800       double AveHLTEta = (hltEtaVec[0] + hltEtaVec[1]) / 2;
0801       double HLTDelPhi = deltaPhi(hltPhiVec[0], hltPhiVec[1]);
0802       v.getMEhisto_AveragePt_RecObj()->Fill(AveJetPt);
0803       v.getMEhisto_AverageEta_RecObj()->Fill(AveJetEta);
0804       v.getMEhisto_DeltaPhi_RecObj()->Fill(JetDelPhi);
0805       //
0806       v.getMEhisto_AveragePt_HLTObj()->Fill(AveHLTPt);
0807       v.getMEhisto_AverageEta_HLTObj()->Fill(AveHLTEta);
0808       v.getMEhisto_DeltaPhi_HLTObj()->Fill(HLTDelPhi);
0809     }
0810   }
0811   if (verbose_)
0812     cout << "<< Exiting fillMEforMonAllTrigger " << endl;
0813 }
0814 
0815 //------------------------------------------------------------------------//
0816 void JetMETHLTOfflineSource::fillMEforEffAllTrigger(const Event& iEvent, const edm::EventSetup& iSetup) {
0817   if (!triggerResults_.isValid())
0818     return;
0819 
0820   int num = -1;
0821   int denom = -1;
0822   bool denompassed = false;
0823   bool numpassed = false;
0824   const trigger::TriggerObjectCollection& toc(triggerObj_->getObjects());
0825 
0826   for (auto& v : hltPathsEff_) {
0827     num++;
0828     denom++;
0829     denompassed = false;
0830     numpassed = false;
0831 
0832     unsigned indexNum = triggerNames_.triggerIndex(v.getPath());
0833     unsigned indexDenom = triggerNames_.triggerIndex(v.getDenomPath());
0834 
0835     if (indexNum < triggerNames_.size() && triggerResults_->accept(indexNum))
0836       numpassed = true;
0837     if (indexDenom < triggerNames_.size() && triggerResults_->accept(indexDenom))
0838       denompassed = true;
0839 
0840     if (denompassed == false)
0841       continue;
0842 
0843     //if(numpassed==true){
0844     edm::InputTag hltTag(v.getLabel(), "", processname_);
0845     const int hltIndex = triggerObj_->filterIndex(hltTag);
0846     edm::InputTag l1Tag(v.getl1Path(), "", processname_);
0847     const int l1Index = triggerObj_->filterIndex(l1Tag);
0848     //}
0849 
0850     //----------------------------------------------------------------------
0851     //double pTcut = 0;
0852     double trigLowpTcut = 0;
0853     double trigMedpTcut = 0;
0854     double trigHighpTcut = 0;
0855     double trigLowpTcutFwd = 0;
0856     double trigMedpTcutFwd = 0;
0857     double trigHighpTcutFwd = 0;
0858     //
0859     //double pTPFcut = 0 ;
0860     double trigLowpTPFcut = 0;
0861     double trigMedpTPFcut = 0;
0862     double trigHighpTPFcut = 0;
0863     double trigLowpTPFcutFwd = 0;
0864     double trigMedpTPFcutFwd = 0;
0865     double trigHighpTPFcutFwd = 0;
0866     //
0867     //cout<<"pre-path" << v->getPath()<<endl;
0868     size_t jetstrfound = v.getPath().find("Jet");
0869     //size_t censtrfound = v->getPath().find("Central"); //shoouldn't be needed?
0870     string tpath = v.getPath();
0871     string jetTrigVal;
0872     float jetVal = 0.;
0873     //
0874     if (jetstrfound != string::npos) {  // && ustrfound != string::npos ){
0875       //cout<<v->getPath()<<endl;
0876       for (int trig = int(jetstrfound) + 3; trig < int(jetstrfound) + 7; trig++) {  // int(ustrfound); trig++){
0877         if (!isdigit(tpath[trig]))
0878           break;
0879         jetTrigVal += tpath[trig];
0880       }
0881       jetVal = atof(jetTrigVal.c_str());
0882       //
0883       if (jetVal > 0.) {
0884         if (jetVal < 50.) {
0885           //pTcut = jetVal / 2.;
0886           trigMedpTcut = jetVal + 5.;
0887           trigHighpTcut = jetVal + 10.;
0888           //
0889           trigLowpTcutFwd = jetVal + 9.;
0890           trigMedpTcutFwd = jetVal + 15.;
0891           trigHighpTcutFwd = jetVal + 21.;
0892         } else {
0893           //pTcut = jetVal - 20. ;
0894           trigMedpTcut = jetVal + 2.;
0895           trigHighpTcut = jetVal + 60.;
0896           //
0897           trigLowpTcutFwd = jetVal + 22.;
0898           trigMedpTcutFwd = jetVal + 25.;
0899           trigHighpTcutFwd = jetVal + 110.;
0900         }
0901         trigLowpTcut = jetVal;
0902       }
0903       //
0904       if (jetVal > 0.) {
0905         if (jetVal < 50.) {
0906           //pTPFcut = jetVal ;
0907           trigMedpTPFcut = jetVal + 20.;
0908           trigHighpTPFcut = jetVal + 40.;
0909           //
0910           trigLowpTPFcutFwd = jetVal + 60.;
0911           trigMedpTPFcutFwd = jetVal + 80.;
0912           trigHighpTPFcutFwd = jetVal + 100.;
0913         } else {
0914           //pTPFcut = jetVal  ;
0915           trigMedpTPFcut = jetVal + 40.;
0916           trigHighpTPFcut = jetVal + 140.;
0917           //
0918           trigLowpTPFcutFwd = jetVal + 110.;
0919           trigMedpTPFcutFwd = jetVal + 130.;
0920           trigHighpTPFcutFwd = jetVal + 190.;
0921         }
0922         trigLowpTPFcut = jetVal;
0923       }
0924     }
0925     //----------------------------------------------------------------------
0926 
0927     //CaloJet paths
0928     if (verbose_)
0929       std::cout << "fillMEforEffAllTrigger: CaloJet -------------------" << std::endl;
0930     if (calojetColl_.isValid() && (v.getObjectType() == trigger::TriggerJet)) {
0931       //cout<<"   - CaloJet "<<endl;
0932       //&& (v->getPath().find("HLT_PFJet")==std::string::npos)
0933       //&& (v->getPath().find("HLT_DiPFJet")==std::string::npos)){
0934       bool jetIDbool = false;
0935       double leadjpt = CaloJetPt[0];
0936       double leadjeta = CaloJetEta[0];
0937       double leadjphi = CaloJetPhi[0];
0938       //double ljemf    = CaloJetEMF[0];
0939       double ljfhpd = CaloJetfHPD[0];
0940       double ljn90 = CaloJetn90[0];
0941       if ((v.getTriggerType() == "SingleJet_Trigger") && !calojet.empty()) {  //this line stops the central jets
0942         if ((ljfhpd < _fHPD) && (ljn90 > _n90Hits)) {
0943           if (verbose_)
0944             cout << "Passed CaloJet ID -------------------" << endl;
0945           jetIDbool = true;
0946           //Denominator fill
0947           v.getMEhisto_DenominatorPt()->Fill(leadjpt);
0948           if (isBarrel(leadjeta))
0949             v.getMEhisto_DenominatorPtBarrel()->Fill(leadjpt);
0950           if (isEndCap(leadjeta))
0951             v.getMEhisto_DenominatorPtEndcap()->Fill(leadjpt);
0952           if (isForward(leadjeta))
0953             v.getMEhisto_DenominatorPtForward()->Fill(leadjpt);
0954           v.getMEhisto_DenominatorEta()->Fill(leadjeta);
0955           v.getMEhisto_DenominatorPhi()->Fill(leadjphi);
0956           v.getMEhisto_DenominatorEtaPhi()->Fill(leadjeta, leadjphi);
0957           if (isBarrel(leadjeta)) {
0958             v.getMEhisto_DenominatorEtaBarrel()->Fill(leadjeta);
0959             v.getMEhisto_DenominatorPhiBarrel()->Fill(leadjphi);
0960           }
0961           if (isEndCap(leadjeta)) {
0962             v.getMEhisto_DenominatorEtaEndcap()->Fill(leadjeta);
0963             v.getMEhisto_DenominatorPhiEndcap()->Fill(leadjphi);
0964           }
0965           if (isForward(leadjeta)) {
0966             v.getMEhisto_DenominatorEtaForward()->Fill(leadjeta);
0967             v.getMEhisto_DenominatorPhiForward()->Fill(leadjphi);
0968           }
0969           if ((leadjpt > trigLowpTcut && !isForward(leadjeta)) || (leadjpt > trigLowpTcutFwd && isForward(leadjeta))) {
0970             v.getMEhisto_DenominatorEta_LowpTcut()->Fill(leadjeta);
0971             v.getMEhisto_DenominatorPhi_LowpTcut()->Fill(leadjphi);
0972             v.getMEhisto_DenominatorEtaPhi_LowpTcut()->Fill(leadjeta, leadjphi);
0973           }
0974           if ((leadjpt > trigMedpTcut && !isForward(leadjeta)) || (leadjpt > trigMedpTcutFwd && isForward(leadjeta))) {
0975             v.getMEhisto_DenominatorEta_MedpTcut()->Fill(leadjeta);
0976             v.getMEhisto_DenominatorPhi_MedpTcut()->Fill(leadjphi);
0977             v.getMEhisto_DenominatorEtaPhi_MedpTcut()->Fill(leadjeta, leadjphi);
0978           }
0979           if ((leadjpt > trigHighpTcut && !isForward(leadjeta)) ||
0980               (leadjpt > trigHighpTcutFwd && isForward(leadjeta))) {
0981             v.getMEhisto_DenominatorEta_HighpTcut()->Fill(leadjeta);
0982             v.getMEhisto_DenominatorPhi_HighpTcut()->Fill(leadjphi);
0983             v.getMEhisto_DenominatorEtaPhi_HighpTcut()->Fill(leadjeta, leadjphi);
0984           }
0985 
0986           //Numerator fill
0987           if (numpassed) {
0988             //
0989             double dRmin = 99999.;
0990             double dPhimin = 9999.;
0991             if (v.getPath().find("L1") != std::string::npos) {
0992               if (l1Index >= triggerObj_->sizeFilters()) {
0993                 edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt" << hltIndex << " of that name ";
0994               } else {
0995                 const trigger::Keys& kl1 = triggerObj_->filterKeys(l1Index);
0996                 for (unsigned short ki : kl1) {
0997                   double dR = deltaR(toc[ki].eta(), toc[ki].phi(), leadjeta, leadjphi);
0998                   if (dR < dRmin) {
0999                     dRmin = dR;
1000                   }
1001                 }
1002               }
1003             } else {
1004               if (hltIndex >= triggerObj_->sizeFilters()) {
1005                 edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt" << hltIndex << " of that name ";
1006               } else {
1007                 const trigger::Keys& khlt = triggerObj_->filterKeys(hltIndex);
1008                 auto kj = khlt.begin();
1009                 for (; kj != khlt.end(); ++kj) {
1010                   double dR = deltaR(toc[*kj].eta(), toc[*kj].phi(), leadjeta, leadjphi);
1011                   if (dR < dRmin) {
1012                     dRmin = dR;
1013                   }
1014                   double dPhi = deltaPhi(toc[*kj].phi(), leadjphi);
1015                   if (dPhi < dPhimin) {
1016                     dPhimin = dPhi;
1017                   }
1018                 }
1019                 //v->getMEhisto_DeltaPhi()->Fill(dPhimin);
1020                 v.getMEhisto_DeltaPhi()->Fill(dPhimin);
1021                 v.getMEhisto_DeltaR()->Fill(dRmin);
1022               }
1023             }
1024             if (dRmin < 0.1 || (v.getPath().find("L1") != std::string::npos && dRmin < 0.4)) {
1025               v.getMEhisto_NumeratorPt()->Fill(leadjpt);
1026               if (isBarrel(leadjeta))
1027                 v.getMEhisto_NumeratorPtBarrel()->Fill(leadjpt);
1028               if (isEndCap(leadjeta))
1029                 v.getMEhisto_NumeratorPtEndcap()->Fill(leadjpt);
1030               if (isForward(leadjeta))
1031                 v.getMEhisto_NumeratorPtForward()->Fill(leadjpt);
1032               v.getMEhisto_NumeratorEta()->Fill(leadjeta);
1033               v.getMEhisto_NumeratorPhi()->Fill(leadjphi);
1034               v.getMEhisto_NumeratorEtaPhi()->Fill(leadjeta, leadjphi);
1035               if (isBarrel(leadjeta)) {
1036                 v.getMEhisto_NumeratorEtaBarrel()->Fill(leadjeta);
1037                 v.getMEhisto_NumeratorPhiBarrel()->Fill(leadjphi);
1038               }
1039               if (isEndCap(leadjeta)) {
1040                 v.getMEhisto_NumeratorEtaEndcap()->Fill(leadjeta);
1041                 v.getMEhisto_NumeratorPhiEndcap()->Fill(leadjphi);
1042               }
1043               if (isForward(leadjeta)) {
1044                 v.getMEhisto_NumeratorEtaForward()->Fill(leadjeta);
1045                 v.getMEhisto_NumeratorPhiForward()->Fill(leadjphi);
1046               }
1047               if ((leadjpt > trigLowpTcut && !isForward(leadjeta)) ||
1048                   (leadjpt > trigLowpTcutFwd && isForward(leadjeta))) {
1049                 v.getMEhisto_NumeratorEta_LowpTcut()->Fill(leadjeta);
1050                 v.getMEhisto_NumeratorPhi_LowpTcut()->Fill(leadjphi);
1051                 v.getMEhisto_NumeratorEtaPhi_LowpTcut()->Fill(leadjeta, leadjphi);
1052               }
1053               if ((leadjpt > trigMedpTcut && !isForward(leadjeta)) ||
1054                   (leadjpt > trigMedpTcutFwd && isForward(leadjeta))) {
1055                 v.getMEhisto_NumeratorEta_MedpTcut()->Fill(leadjeta);
1056                 v.getMEhisto_NumeratorPhi_MedpTcut()->Fill(leadjphi);
1057                 v.getMEhisto_NumeratorEtaPhi_MedpTcut()->Fill(leadjeta, leadjphi);
1058               }
1059               if ((leadjpt > trigHighpTcut && !isForward(leadjeta)) ||
1060                   (leadjpt > trigHighpTcutFwd && isForward(leadjeta))) {
1061                 v.getMEhisto_NumeratorEta_HighpTcut()->Fill(leadjeta);
1062                 v.getMEhisto_NumeratorPhi_HighpTcut()->Fill(leadjphi);
1063                 v.getMEhisto_NumeratorEtaPhi_HighpTcut()->Fill(leadjeta, leadjphi);
1064               }
1065             }
1066           }  //numpassed
1067         }    //CalojetID filter
1068       }
1069 
1070       if (jetIDbool == true && (v.getTriggerType() == "DiJet_Trigger") && calojet.size() > 1) {
1071         if (((CaloJetEMF[1] > _fEMF || std::abs(CaloJetEta[1]) > _feta) && CaloJetfHPD[0] < _fHPD &&
1072              CaloJetn90[0] > _n90Hits)) {
1073           v.getMEhisto_DenominatorPt()->Fill((CaloJetPt[0] + CaloJetPt[1]) / 2.);
1074           v.getMEhisto_DenominatorEta()->Fill((CaloJetEta[0] + CaloJetEta[1]) / 2.);
1075           if (numpassed == true) {
1076             v.getMEhisto_NumeratorPt()->Fill((CaloJetPt[0] + CaloJetPt[1]) / 2.);
1077             v.getMEhisto_NumeratorEta()->Fill((CaloJetEta[0] + CaloJetEta[1]) / 2.);
1078           }
1079         }
1080       }
1081     }  // Jet trigger and valid jet collection
1082 
1083     //PFJet paths
1084     if (verbose_)
1085       std::cout << "fillMEforEffAllTrigger: PFJet -------------------" << std::endl;
1086     if (pfjetColl_.isValid() && (v.getObjectType() == trigger::TriggerJet)) {
1087       //cout<<"   - PFJet "<<endl;
1088       //&& (v->getPath().find("HLT_PFJet")!=std::string::npos)
1089       //&& (v->getPath().find("HLT_DiPFJet")!=std::string::npos)){
1090       bool jetIDbool = false;
1091       double leadjpt = PFJetPt[0];
1092       double leadjeta = PFJetEta[0];
1093       double leadjphi = PFJetPhi[0];
1094       double ljNHEF = PFJetNHEF[0];
1095       double ljCHEF = PFJetCHEF[0];
1096       double ljNEMF = PFJetNEMF[0];
1097       double ljCEMF = PFJetCEMF[0];
1098       //double sleadjpt  = PFJetPt[1];
1099       //double sleadjeta = PFJetEta[1];
1100       //double sleadjphi = PFJetPhi[1];
1101       double sljNHEF = PFJetNHEF[1];
1102       double sljCHEF = PFJetCHEF[1];
1103       double sljNEMF = PFJetNEMF[1];
1104       double sljCEMF = PFJetCEMF[1];
1105       //
1106       double pfMHTx = pfMHTx_All;
1107       double pfMHTy = pfMHTy_All;
1108       //
1109       if ((v.getTriggerType() == "SingleJet_Trigger") && !pfjet.empty()) {  //this line stops the central jets
1110 
1111         //======get pfmht
1112         _pfMHT = sqrt(pfMHTx * pfMHTx + pfMHTy * pfMHTy);
1113         v.getMEhisto_DenominatorPFMHT()->Fill(_pfMHT);
1114 
1115         if (ljNHEF >= _min_NHEF && ljNHEF <= _max_NHEF && ljCHEF >= _min_CHEF && ljCHEF <= _max_CHEF &&
1116             ljNEMF >= _min_NEMF && ljNEMF <= _max_NEMF && ljCEMF >= _min_CEMF && ljCEMF <= _max_CEMF) {
1117           if (verbose_)
1118             cout << "Passed PFJet ID -------------------" << endl;
1119           jetIDbool = true;
1120           v.getMEhisto_DenominatorPFPt()->Fill(leadjpt);
1121           if (isBarrel(leadjeta))
1122             v.getMEhisto_DenominatorPFPtBarrel()->Fill(leadjpt);
1123           if (isEndCap(leadjeta))
1124             v.getMEhisto_DenominatorPFPtEndcap()->Fill(leadjpt);
1125           if (isForward(leadjeta))
1126             v.getMEhisto_DenominatorPFPtForward()->Fill(leadjpt);
1127           v.getMEhisto_DenominatorPFEta()->Fill(leadjeta);
1128           v.getMEhisto_DenominatorPFPhi()->Fill(leadjphi);
1129           v.getMEhisto_DenominatorPFEtaPhi()->Fill(leadjeta, leadjphi);
1130           if (isBarrel(leadjeta)) {
1131             v.getMEhisto_DenominatorPFEtaBarrel()->Fill(leadjeta);
1132             v.getMEhisto_DenominatorPFPhiBarrel()->Fill(leadjphi);
1133           }
1134           if (isEndCap(leadjeta)) {
1135             v.getMEhisto_DenominatorPFEtaEndcap()->Fill(leadjeta);
1136             v.getMEhisto_DenominatorPFPhiEndcap()->Fill(leadjphi);
1137           }
1138           if (isForward(leadjeta)) {
1139             v.getMEhisto_DenominatorPFEtaForward()->Fill(leadjeta);
1140             v.getMEhisto_DenominatorPFPhiForward()->Fill(leadjphi);
1141           }
1142           if ((leadjpt > trigLowpTPFcut && !isForward(leadjeta)) ||
1143               (leadjpt > trigLowpTPFcutFwd && isForward(leadjeta))) {
1144             v.getMEhisto_DenominatorPFEta_LowpTcut()->Fill(leadjeta);
1145             v.getMEhisto_DenominatorPFPhi_LowpTcut()->Fill(leadjphi);
1146             v.getMEhisto_DenominatorPFEtaPhi_LowpTcut()->Fill(leadjeta, leadjphi);
1147           }
1148           if ((leadjpt > trigMedpTPFcut && !isForward(leadjeta)) ||
1149               (leadjpt > trigMedpTPFcutFwd && isForward(leadjeta))) {
1150             v.getMEhisto_DenominatorPFEta_MedpTcut()->Fill(leadjeta);
1151             v.getMEhisto_DenominatorPFPhi_MedpTcut()->Fill(leadjphi);
1152             v.getMEhisto_DenominatorPFEtaPhi_MedpTcut()->Fill(leadjeta, leadjphi);
1153           }
1154           if ((leadjpt > trigHighpTPFcut && !isForward(leadjeta)) ||
1155               (leadjpt > trigHighpTPFcutFwd && isForward(leadjeta))) {
1156             v.getMEhisto_DenominatorPFEta_HighpTcut()->Fill(leadjeta);
1157             v.getMEhisto_DenominatorPFPhi_HighpTcut()->Fill(leadjphi);
1158             v.getMEhisto_DenominatorPFEtaPhi_HighpTcut()->Fill(leadjeta, leadjphi);
1159           }
1160 
1161           //Numerator fill
1162           if (numpassed) {
1163             double dRmin = 99999.;
1164             double dPhimin = 9999.;
1165             if (v.getPath().find("L1") != std::string::npos) {
1166               if (l1Index >= triggerObj_->sizeFilters()) {
1167                 edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt" << hltIndex << " of that name ";
1168               } else {
1169                 const trigger::Keys& kl1 = triggerObj_->filterKeys(l1Index);
1170                 for (unsigned short ki : kl1) {
1171                   double dR = deltaR(toc[ki].eta(), toc[ki].phi(), leadjeta, leadjphi);
1172                   if (dR < dRmin) {
1173                     dRmin = dR;
1174                   }
1175                 }
1176               }
1177             } else {
1178               if (hltIndex >= triggerObj_->sizeFilters()) {
1179                 edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt" << hltIndex << " of that name ";
1180               } else {
1181                 const trigger::Keys& khlt = triggerObj_->filterKeys(hltIndex);
1182                 for (unsigned short kj : khlt) {
1183                   double dR = deltaR(toc[kj].eta(), toc[kj].phi(), leadjeta, leadjphi);
1184                   if (dR < dRmin) {
1185                     dRmin = dR;
1186                   }
1187                   double dPhi = deltaPhi(toc[kj].phi(), leadjphi);
1188                   if (dPhi < dPhimin) {
1189                     dPhimin = dPhi;
1190                   }
1191                 }
1192                 v.getMEhisto_PFDeltaPhi()->Fill(dPhimin);
1193                 v.getMEhisto_PFDeltaR()->Fill(dRmin);
1194               }
1195             }
1196             if (dRmin < 0.1 || (v.getPath().find("L1") != std::string::npos && dRmin < 0.4)) {
1197               v.getMEhisto_NumeratorPFPt()->Fill(leadjpt);
1198               if (isBarrel(leadjeta))
1199                 v.getMEhisto_NumeratorPFPtBarrel()->Fill(leadjpt);
1200               if (isEndCap(leadjeta))
1201                 v.getMEhisto_NumeratorPFPtEndcap()->Fill(leadjpt);
1202               if (isForward(leadjeta))
1203                 v.getMEhisto_NumeratorPFPtForward()->Fill(leadjpt);
1204               v.getMEhisto_NumeratorPFEta()->Fill(leadjeta);
1205               v.getMEhisto_NumeratorPFPhi()->Fill(leadjphi);
1206               v.getMEhisto_NumeratorPFEtaPhi()->Fill(leadjeta, leadjphi);
1207               if (isBarrel(leadjeta)) {
1208                 v.getMEhisto_NumeratorPFEtaBarrel()->Fill(leadjeta);
1209                 v.getMEhisto_NumeratorPFPhiBarrel()->Fill(leadjphi);
1210               }
1211               if (isEndCap(leadjeta)) {
1212                 v.getMEhisto_NumeratorPFEtaEndcap()->Fill(leadjeta);
1213                 v.getMEhisto_NumeratorPFPhiEndcap()->Fill(leadjphi);
1214               }
1215               if (isForward(leadjeta)) {
1216                 v.getMEhisto_NumeratorPFEtaForward()->Fill(leadjeta);
1217                 v.getMEhisto_NumeratorPFPhiForward()->Fill(leadjphi);
1218               }
1219               if ((leadjpt > trigLowpTPFcut && !isForward(leadjeta)) ||
1220                   (leadjpt > trigLowpTPFcutFwd && isForward(leadjeta))) {
1221                 v.getMEhisto_NumeratorPFEta_LowpTcut()->Fill(leadjeta);
1222                 v.getMEhisto_NumeratorPFPhi_LowpTcut()->Fill(leadjphi);
1223                 v.getMEhisto_NumeratorPFEtaPhi_LowpTcut()->Fill(leadjeta, leadjphi);
1224               }
1225               if ((leadjpt > trigMedpTPFcut && !isForward(leadjeta)) ||
1226                   (leadjpt > trigMedpTPFcutFwd && isForward(leadjeta))) {
1227                 v.getMEhisto_NumeratorPFEta_MedpTcut()->Fill(leadjeta);
1228                 v.getMEhisto_NumeratorPFPhi_MedpTcut()->Fill(leadjphi);
1229                 v.getMEhisto_NumeratorPFEtaPhi_MedpTcut()->Fill(leadjeta, leadjphi);
1230               }
1231               if ((leadjpt > trigHighpTPFcut && !isForward(leadjeta)) ||
1232                   (leadjpt > trigHighpTPFcutFwd && isForward(leadjeta))) {
1233                 v.getMEhisto_NumeratorPFEta_HighpTcut()->Fill(leadjeta);
1234                 v.getMEhisto_NumeratorPFPhi_HighpTcut()->Fill(leadjphi);
1235                 v.getMEhisto_NumeratorPFEtaPhi_HighpTcut()->Fill(leadjeta, leadjphi);
1236               }
1237             }
1238           }
1239         }
1240       }
1241       if (jetIDbool == true && (v.getTriggerType() == "DiJet_Trigger") && pfjet.size() > 1) {
1242         if (ljNHEF >= _min_NHEF && ljNHEF <= _max_NHEF && ljCHEF >= _min_CHEF && ljCHEF <= _max_CHEF &&
1243             ljNEMF >= _min_NEMF && ljNEMF <= _max_NEMF && ljCEMF >= _min_CEMF && ljCEMF <= _max_CEMF &&
1244             sljNHEF >= _min_NHEF && sljNHEF <= _max_NHEF && sljCHEF >= _min_CHEF && sljCHEF <= _max_CHEF &&
1245             sljNEMF >= _min_NEMF && sljNEMF <= _max_NEMF && sljCEMF >= _min_CEMF && sljCEMF <= _max_CEMF) {
1246           v.getMEhisto_DenominatorPFPt()->Fill((PFJetPt[0] + PFJetPt[1]) / 2.);
1247           v.getMEhisto_DenominatorPFEta()->Fill((PFJetEta[0] + PFJetEta[1]) / 2.);
1248           if (numpassed) {
1249             v.getMEhisto_NumeratorPFPt()->Fill((PFJetPt[0] + PFJetPt[1]) / 2.);
1250             v.getMEhisto_NumeratorPFEta()->Fill((PFJetEta[0] + PFJetEta[1]) / 2.);
1251           }
1252         }
1253       }
1254     }  // PF Jet trigger and valid jet collection
1255 
1256     //CaloMET path
1257     if (verbose_)
1258       std::cout << "fillMEforEffAllTrigger: CaloMET -------------------" << std::endl;
1259     if (calometColl_.isValid() &&
1260         ((v.getObjectType() == trigger::TriggerMET) || (v.getObjectType() == trigger::TriggerTET)) &&
1261         (v.getPath().find("HLT_PFMET") == std::string::npos)) {
1262       const CaloMETCollection* calometcol = calometColl_.product();
1263       const CaloMET met = calometcol->front();
1264       v.getMEhisto_DenominatorPt()->Fill(met.et());
1265       v.getMEhisto_DenominatorPhi()->Fill(met.phi());
1266       if (numpassed) {
1267         v.getMEhisto_NumeratorPt()->Fill(met.et());
1268         v.getMEhisto_NumeratorPhi()->Fill(met.phi());
1269         if (hltIndex >= triggerObj_->sizeFilters()) {
1270           edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt" << hltIndex << " of that name ";
1271         } else {
1272           double dPhimin = 9999.;  //
1273           const trigger::Keys& khlt = triggerObj_->filterKeys(hltIndex);
1274           for (unsigned short kj : khlt) {
1275             double dPhi = deltaPhi(toc[kj].phi(), met.phi());
1276             if (dPhi < dPhimin) {
1277               dPhimin = dPhi;
1278             }
1279           }
1280           v.getMEhisto_DeltaPhi()->Fill(dPhimin);
1281         }
1282       }
1283     }
1284 
1285     //PFMET
1286     if (verbose_)
1287       std::cout << "fillMEforEffAllTrigger: PFMET -------------------" << std::endl;
1288     if (pfmetColl_.isValid() &&
1289         ((v.getObjectType() == trigger::TriggerMET) || (v.getObjectType() == trigger::TriggerTET)) &&
1290         (v.getPath().find("HLT_PFMET") != std::string::npos)) {
1291       const PFMETCollection* pfmetcol = pfmetColl_.product();
1292       const PFMET met = pfmetcol->front();
1293       v.getMEhisto_DenominatorPt()->Fill(met.et());
1294       v.getMEhisto_DenominatorPhi()->Fill(met.phi());
1295       if (numpassed) {
1296         v.getMEhisto_NumeratorPt()->Fill(met.et());
1297         v.getMEhisto_NumeratorPhi()->Fill(met.phi());
1298         if (hltIndex >= triggerObj_->sizeFilters()) {
1299           edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt" << hltIndex << " of that name ";
1300         } else {
1301           double dPhimin = 9999.;  //
1302           const trigger::Keys& khlt = triggerObj_->filterKeys(hltIndex);
1303           for (unsigned short kj : khlt) {
1304             double dPhi = deltaPhi(toc[kj].phi(), met.phi());
1305             if (dPhi < dPhimin) {
1306               dPhimin = dPhi;
1307             }
1308           }
1309           v.getMEhisto_DeltaPhi()->Fill(dPhimin);
1310         }
1311       }
1312     }
1313 
1314     /*
1315       if(pfmhtColl_.isValid() && ((v->getObjectType() == trigger::TriggerMET)|| (v->getObjectType() == trigger::TriggerTET))){
1316       const PFMHTCollection *pfmhtcol = pfmhtColl_.product();
1317       const PFMHT met = pfmhtcol->front();
1318       v->getMEhisto_DenominatorPFPt()->Fill(met.pt());
1319       v->getMEhisto_DenominatorPFPhi()->Fill(met.phi());
1320       }// PFMHT  trigger and valid MET collection 
1321     */
1322   }  // trigger under study
1323 }
1324 
1325 //------------------------------------------------------------------------//
1326 //This method is called before the booking action in the DQMStore is triggered.
1327 void JetMETHLTOfflineSource::dqmBeginRun(edm::Run const& run, edm::EventSetup const& c) {
1328   if (!isSetup_) {
1329     //--- htlConfig_
1330     bool changed(true);
1331     if (!hltConfig_.init(run, c, processname_, changed)) {
1332       LogDebug("HLTJetMETDQMSource") << "HLTConfigProvider failed to initialize.";
1333     }
1334 
1335     /*
1336       Here we select the Single Jet, DiJet, MET trigger. SingleJet and DiJet trigger are saved under same object type "TriggerJet". 
1337       We can easily separate out single and di jet trigger later. For the first trigger in the list, denominator trigger is dummy 
1338       (empty) whereas for other triggers denom is previous trigger of same type. e.g. SingleJet50 has singleJet30 as denominator.
1339     */
1340 
1341     const unsigned int n(hltConfig_.size());
1342     int singleJet = 0;
1343     int diJet = 0;
1344     int met = 0;
1345     int tet = 0;
1346     for (unsigned int i = 0; i != n; ++i) {
1347       bool denomFound = false;
1348       bool numFound = false;
1349       bool checkPath = false;
1350 
1351       //Look for paths if "path name fraction" is found in the pathname
1352       std::string pathname = hltConfig_.triggerName(i);
1353       //Filter only paths JetMET triggers are interested in
1354       auto controlPathname = pathFilter_.begin();
1355       for (; controlPathname != pathFilter_.end(); ++controlPathname) {
1356         if (pathname.find((*controlPathname)) != std::string::npos) {
1357           checkPath = true;
1358           break;
1359         }
1360       }
1361       if (checkPath == false)
1362         continue;
1363 
1364       //Reject if keyword(s) is found in the pathname
1365       auto rejectPathname = pathRejectKeyword_.begin();
1366       for (; rejectPathname != pathRejectKeyword_.end(); ++rejectPathname) {
1367         if (pathname.find((*rejectPathname)) != std::string::npos) {
1368           checkPath = false;
1369           break;
1370         }
1371       }
1372       if (checkPath == false)
1373         continue;
1374 
1375       //
1376       if (verbose_)
1377         cout << "==pathname==" << pathname << endl;
1378       std::string dpathname = MuonTrigPaths_[0];
1379       std::string l1pathname = "dummy";
1380       std::string denompathname = "";
1381       unsigned int usedPrescale = 1;
1382       unsigned int objectType = 0;
1383       std::string triggerType = "";
1384       std::string filtername("dummy");
1385       std::string Denomfiltername("denomdummy");
1386 
1387       if (pathname.find("Jet") != std::string::npos && !(pathname.find("DoubleJet") != std::string::npos) &&
1388           !(pathname.find("DiJet") != std::string::npos) && !(pathname.find("DiPFJet") != std::string::npos) &&
1389           !(pathname.find("BTag") != std::string::npos) && !(pathname.find("Mu") != std::string::npos) &&
1390           !(pathname.find("Fwd") != std::string::npos)) {
1391         triggerType = "SingleJet_Trigger";
1392         objectType = trigger::TriggerJet;
1393       }
1394       if (pathname.find("DiJet") != std::string::npos || pathname.find("DiPFJet") != std::string::npos ||
1395           pathname.find("DoubleJet") != std::string::npos) {
1396         triggerType = "DiJet_Trigger";
1397         objectType = trigger::TriggerJet;
1398       }
1399       if (pathname.find("MET") != std::string::npos) {
1400         triggerType = "MET_Trigger";
1401         objectType = trigger::TriggerMET;
1402       }
1403       if (pathname.find("HT") != std::string::npos) {
1404         triggerType = "TET_Trigger";
1405         objectType = trigger::TriggerTET;
1406       }
1407 
1408       //
1409       if (objectType == trigger::TriggerJet && !(pathname.find("DiJet") != std::string::npos) &&
1410           !(pathname.find("DiPFJet") != std::string::npos) && !(pathname.find("DoubleJet") != std::string::npos)) {
1411         singleJet++;
1412         if (singleJet > 1)
1413           dpathname = dpathname = hltConfig_.triggerName(i - 1);
1414         if (singleJet == 1)
1415           dpathname = MuonTrigPaths_[0];
1416       }
1417       if (objectType == trigger::TriggerJet &&
1418           ((pathname.find("DiJet") != std::string::npos) || (pathname.find("DiPFJet") != std::string::npos))) {
1419         diJet++;
1420         if (diJet > 1)
1421           dpathname = dpathname = hltConfig_.triggerName(i - 1);
1422         if (diJet == 1)
1423           dpathname = MuonTrigPaths_[0];
1424       }
1425       if (objectType == trigger::TriggerMET) {
1426         met++;
1427         if (met > 1)
1428           dpathname = dpathname = hltConfig_.triggerName(i - 1);
1429         if (met == 1)
1430           dpathname = MuonTrigPaths_[0];
1431       }
1432       if (objectType == trigger::TriggerTET) {
1433         tet++;
1434         if (tet > 1)
1435           dpathname = dpathname = hltConfig_.triggerName(i - 1);
1436         if (tet == 1)
1437           dpathname = MuonTrigPaths_[0];
1438       }
1439 
1440       // find L1 condition for numpath with numpath objecttype
1441       // find PSet for L1 global seed for numpath,sss
1442       // list module labels for numpath
1443 
1444       // Checking if the trigger exist in HLT table or not
1445       for (unsigned int i = 0; i != n; ++i) {
1446         std::string HLTname = hltConfig_.triggerName(i);
1447         if (HLTname == pathname)
1448           numFound = true;
1449         if (HLTname == dpathname)
1450           denomFound = true;
1451       }
1452 
1453       if (numFound) {  //make trigger exist in the menu
1454         //ml needs change l1pathname
1455         l1pathname = getL1ConditionModuleName(pathname);  //ml added L1conditionmodulename
1456         //ml added
1457         std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(pathname);
1458         for (auto& numpathmodule : numpathmodules) {
1459           edm::InputTag testTag(numpathmodule, "", processname_);
1460           if ((hltConfig_.moduleType(numpathmodule) == "HLT1CaloJet") ||
1461               (hltConfig_.moduleType(numpathmodule) == "HLT1PFJet") ||
1462               (hltConfig_.moduleType(numpathmodule) == "HLTDiJetAveFilter") ||
1463               (hltConfig_.moduleType(numpathmodule) == "HLTDiPFJetAveFilter") ||
1464               (hltConfig_.moduleType(numpathmodule) == "HLT1CaloMET") ||
1465               (hltConfig_.moduleType(numpathmodule) == "HLTMhtFilter") ||
1466               (hltConfig_.moduleType(numpathmodule) == "HLTPrescaler"))
1467             filtername = numpathmodule;
1468         }
1469       }
1470 
1471       if (objectType != 0 && denomFound) {
1472         std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(dpathname);
1473         for (auto& numpathmodule : numpathmodules) {
1474           edm::InputTag testTag(numpathmodule, "", processname_);
1475           if ((hltConfig_.moduleType(numpathmodule) == "HLT1CaloJet") ||
1476               (hltConfig_.moduleType(numpathmodule) == "HLT1PFJet") ||
1477               (hltConfig_.moduleType(numpathmodule) == "HLTDiJetAveFilter") ||
1478               (hltConfig_.moduleType(numpathmodule) == "HLTDiPFJetAveFilter") ||
1479               (hltConfig_.moduleType(numpathmodule) == "HLT1CaloMET") ||
1480               (hltConfig_.moduleType(numpathmodule) == "HLTMhtFilter") ||
1481               (hltConfig_.moduleType(numpathmodule) == "HLTPrescaler"))
1482             Denomfiltername = numpathmodule;
1483         }
1484       }
1485 
1486       if (objectType != 0 && numFound) {
1487         if (verbose_)
1488           cout << "=Pathname= " << pathname << " | =Denompath= " << dpathname << " | =Filtername= " << filtername
1489                << " | =Denomfiltername= " << Denomfiltername << " | =L1pathname= " << l1pathname
1490                << " | =ObjectType= " << objectType << endl;
1491         if (!((pathname.find("HT") != std::string::npos) || (pathname.find("Quad") != std::string::npos))) {
1492           hltPathsAll_.push_back(PathInfo(usedPrescale,
1493                                           dpathname,
1494                                           pathname,
1495                                           l1pathname,
1496                                           filtername,
1497                                           Denomfiltername,
1498                                           processname_,
1499                                           objectType,
1500                                           triggerType));
1501           if (!nameForEff_ && denomFound)
1502             hltPathsEff_.push_back(PathInfo(usedPrescale,
1503                                             dpathname,
1504                                             pathname,
1505                                             l1pathname,
1506                                             filtername,
1507                                             Denomfiltername,
1508                                             processname_,
1509                                             objectType,
1510                                             triggerType));
1511         }
1512         hltPathsAllTriggerSummary_.push_back(PathInfo(usedPrescale,
1513                                                       dpathname,
1514                                                       pathname,
1515                                                       l1pathname,
1516                                                       filtername,
1517                                                       Denomfiltername,
1518                                                       processname_,
1519                                                       objectType,
1520                                                       triggerType));
1521       }
1522     }  //Loop over paths
1523 
1524     if (verbose_)
1525       cout << "get names for efficicncy------------------" << endl;
1526     //---------bool to pick trigger names pair from config file-------------
1527     if (nameForEff_) {
1528       std::string l1pathname = "dummy";
1529       std::string denompathname = "";
1530       unsigned int usedPrescale = 1;
1531       unsigned int objectType = 0;
1532       std::string triggerType = "";
1533       std::string filtername("dummy");
1534       std::string Denomfiltername("denomdummy");
1535       for (auto& custompathnamepair : custompathnamepairs_) {
1536         std::string pathname = custompathnamepair.first;
1537         std::string dpathname = custompathnamepair.second;
1538         bool numFound = false;
1539         bool denomFound = false;
1540         // Checking if the trigger exist in HLT table or not
1541         for (unsigned int i = 0; i != n; ++i) {
1542           std::string HLTname = hltConfig_.triggerName(i);
1543           if (HLTname.find(pathname) != std::string::npos) {
1544             numFound = true;
1545             pathname = HLTname;
1546           }  //changed to get versions
1547           if (HLTname.find(dpathname) != std::string::npos) {
1548             denomFound = true;
1549             dpathname = HLTname;
1550           }
1551         }
1552         if (numFound && denomFound) {
1553           if (pathname.find("Jet") != std::string::npos && !(pathname.find("DiJet") != std::string::npos) &&
1554               !(pathname.find("DiPFJet") != std::string::npos) && !(pathname.find("DoubleJet") != std::string::npos) &&
1555               !(pathname.find("BTag") != std::string::npos) && !(pathname.find("Mu") != std::string::npos) &&
1556               !(pathname.find("Fwd") != std::string::npos)) {
1557             triggerType = "SingleJet_Trigger";
1558             objectType = trigger::TriggerJet;
1559           }
1560           if (pathname.find("DiJet") != std::string::npos || pathname.find("DiPFJet") != std::string::npos ||
1561               pathname.find("DoubleJet") != std::string::npos) {
1562             triggerType = "DiJet_Trigger";
1563             objectType = trigger::TriggerJet;
1564           }
1565           if (pathname.find("MET") != std::string::npos) {
1566             triggerType = "MET_Trigger";
1567             objectType = trigger::TriggerMET;
1568           }
1569           if (pathname.find("TET") != std::string::npos) {
1570             triggerType = "TET_Trigger";
1571             objectType = trigger::TriggerTET;
1572           }
1573 
1574           l1pathname = getL1ConditionModuleName(pathname);  //ml added L1conditionmodulename
1575           std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(pathname);
1576           for (auto& numpathmodule : numpathmodules) {
1577             edm::InputTag testTag(numpathmodule, "", processname_);
1578             if ((hltConfig_.moduleType(numpathmodule) == "HLT1CaloJet") ||
1579                 (hltConfig_.moduleType(numpathmodule) == "HLT1PFJet") ||
1580                 (hltConfig_.moduleType(numpathmodule) == "HLTDiJetAveFilter") ||
1581                 (hltConfig_.moduleType(numpathmodule) == "HLTDiPFJetAveFilter") ||
1582                 (hltConfig_.moduleType(numpathmodule) == "HLT1CaloMET") ||
1583                 (hltConfig_.moduleType(numpathmodule) == "HLTMhtFilter") ||
1584                 (hltConfig_.moduleType(numpathmodule) == "HLTPrescaler"))
1585               filtername = numpathmodule;
1586           }
1587 
1588           if (objectType != 0) {
1589             std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(dpathname);
1590             for (auto& numpathmodule : numpathmodules) {
1591               edm::InputTag testTag(numpathmodule, "", processname_);
1592               if ((hltConfig_.moduleType(numpathmodule) == "HLT1CaloJet") ||
1593                   (hltConfig_.moduleType(numpathmodule) == "HLT1PFJet") ||
1594                   (hltConfig_.moduleType(numpathmodule) == "HLTDiJetAveFilter") ||
1595                   (hltConfig_.moduleType(numpathmodule) == "HLTDiPFJetAveFilter") ||
1596                   (hltConfig_.moduleType(numpathmodule) == "HLT1CaloMET") ||
1597                   (hltConfig_.moduleType(numpathmodule) == "HLTMhtFilter") ||
1598                   (hltConfig_.moduleType(numpathmodule) == "HLTPrescaler"))
1599                 Denomfiltername = numpathmodule;
1600             }
1601 
1602             if (verbose_)
1603               cout << "==pathname==" << pathname << "==denompath==" << dpathname << "==filtername==" << filtername
1604                    << "==denomfiltername==" << Denomfiltername << "==l1pathname==" << l1pathname
1605                    << "==objectType==" << objectType << endl;
1606             hltPathsEff_.push_back(PathInfo(usedPrescale,
1607                                             dpathname,
1608                                             pathname,
1609                                             l1pathname,
1610                                             filtername,
1611                                             Denomfiltername,
1612                                             processname_,
1613                                             objectType,
1614                                             triggerType));
1615           }
1616         }
1617       }
1618     }
1619 
1620     if (verbose_)
1621       cout << "== end hltPathsEff_.push_back ======" << endl;
1622   }
1623 }
1624 
1625 //------------------------------------------------------------------------//
1626 void JetMETHLTOfflineSource::bookHistograms(DQMStore::IBooker& iBooker, edm::Run const& run, edm::EventSetup const& c) {
1627   if (!isSetup_) {
1628     iBooker.setCurrentFolder(dirname_);
1629 
1630     //-----------------------------------------------------------------
1631     //---book trigger summary histos
1632     if (!isSetup_) {
1633       std::string foldernm = "/TriggerSummary/";
1634       iBooker.setCurrentFolder(dirname_ + foldernm);
1635 
1636       int TrigBins_ = hltPathsAllTriggerSummary_.size();
1637       double TrigMin_ = -0.5;
1638       double TrigMax_ = hltPathsAllTriggerSummary_.size() - 0.5;
1639 
1640       std::string histonm = "JetMET_TriggerRate";
1641       std::string histot = "JetMET TriggerRate Summary";
1642       rate_All = iBooker.book1D(histonm.c_str(), histot.c_str(), TrigBins_, TrigMin_, TrigMax_);
1643 
1644       histonm = "JetMET_TriggerRate_Correlation";
1645       histot = "JetMET TriggerRate Correlation Summary;y&&!x;x&&y";
1646       correlation_All =
1647           iBooker.book2D(histonm.c_str(), histot.c_str(), TrigBins_, TrigMin_, TrigMax_, TrigBins_, TrigMin_, TrigMax_);
1648 
1649       histonm = "JetMET_NVertices";
1650       histot = "No. of vertices";
1651       NVertices = iBooker.book1D(histonm.c_str(), histot.c_str(), 100, 0, 50);
1652 
1653       histonm = "JetMET_PVZ";
1654       histot = "Primary Vertex Z pos";
1655       PVZ = iBooker.book1D(histonm.c_str(), histot.c_str(), 100, -50., 50.);
1656 
1657       if (runStandalone_) {
1658         histonm = "JetMET_TriggerRate_WrtMuTrigger";
1659         histot = "JetMET TriggerRate Summary Wrt Muon Trigger ";
1660         rate_AllWrtMu = iBooker.book1D(histonm.c_str(), histot.c_str(), TrigBins_, TrigMin_, TrigMax_);
1661 
1662         histonm = "JetMET_TriggerRate_Correlation_WrtMuTrigger";
1663         histot = "JetMET TriggerRate Correlation Summary Wrt Muon Trigger;y&&!x;x&&y";
1664         correlation_AllWrtMu = iBooker.book2D(
1665             histonm.c_str(), histot.c_str(), TrigBins_, TrigMin_, TrigMax_, TrigBins_, TrigMin_, TrigMax_);
1666 
1667         histonm = "JetMET_TriggerRate_WrtMBTrigger";
1668         histot = "JetMET TriggerRate Summary Wrt MB Trigger";
1669         rate_AllWrtMB = iBooker.book1D(histonm.c_str(), histot.c_str(), TrigBins_, TrigMin_, TrigMax_);
1670 
1671         histonm = "JetMET_TriggerRate_Correlation_WrtMBTrigger";
1672         histot = "JetMET TriggerRate Correlation Wrt MB Trigger;y&&!x;x&&y";
1673         correlation_AllWrtMB = iBooker.book2D(
1674             histonm.c_str(), histot.c_str(), TrigBins_, TrigMin_, TrigMax_, TrigBins_, TrigMin_, TrigMax_);
1675       }
1676       isSetup_ = true;
1677     }
1678     //---Set bin label
1679 
1680     for (auto& v : hltPathsAllTriggerSummary_) {
1681       std::string labelnm("dummy");
1682       labelnm = v.getPath();
1683       int nbins = rate_All->getTH1()->GetNbinsX();
1684       for (int ibin = 1; ibin < nbins + 1; ibin++) {
1685         const char* binLabel = rate_All->getTH1()->GetXaxis()->GetBinLabel(ibin);
1686         std::string binLabel_str = string(binLabel);
1687         if (binLabel_str == labelnm)
1688           break;
1689         if (binLabel[0] == '\0') {
1690           rate_All->setBinLabel(ibin, labelnm);
1691           correlation_All->setBinLabel(ibin, labelnm, 1);
1692           correlation_All->setBinLabel(ibin, labelnm, 2);
1693           if (runStandalone_) {
1694             rate_AllWrtMu->setBinLabel(ibin, labelnm);
1695             rate_AllWrtMB->setBinLabel(ibin, labelnm);
1696             correlation_AllWrtMu->setBinLabel(ibin, labelnm, 1);
1697             correlation_AllWrtMB->setBinLabel(ibin, labelnm, 1);
1698             correlation_AllWrtMu->setBinLabel(ibin, labelnm, 2);
1699             correlation_AllWrtMB->setBinLabel(ibin, labelnm, 2);
1700           }
1701           break;
1702         }
1703       }
1704     }
1705 
1706     // Now define histos for All triggers
1707     if (plotAll_) {
1708       //
1709       int Nbins_ = 10;
1710       double Nmin_ = -0.5;
1711       double Nmax_ = 9.5;
1712       //
1713       int Ptbins_ = 100;
1714       if (runStandalone_)
1715         Ptbins_ = 1000;
1716       double PtMin_ = 0.;
1717       double PtMax_ = 1000.;
1718       //
1719       int Etabins_ = 50;
1720       if (runStandalone_)
1721         Etabins_ = 100;
1722       double EtaMin_ = -5.;
1723       double EtaMax_ = 5.;
1724       //
1725       int Phibins_ = 35;
1726       double PhiMin_ = -3.5;
1727       double PhiMax_ = 3.5;
1728 
1729       int Resbins_ = 30;
1730       double ResMin_ = -1.5;
1731       double ResMax_ = 1.5;
1732       //
1733       std::string dirName = dirname_ + "/MonitorAllTriggers/";
1734       for (auto& v : hltPathsAll_) {
1735         //
1736         std::string trgPathName = HLTConfigProvider::removeVersion(v.getPath());
1737         std::string subdirName = dirName + trgPathName;
1738         std::string trigPath = "(" + trgPathName + ")";
1739         iBooker.setCurrentFolder(subdirName);
1740 
1741         std::string labelname("ME");
1742         std::string histoname(labelname + "");
1743         std::string title(labelname + "");
1744 
1745         MonitorElement* dummy;
1746         dummy = iBooker.bookFloat("dummy");
1747 
1748         if (v.getObjectType() == trigger::TriggerJet && v.getTriggerType() == "SingleJet_Trigger") {
1749           histoname = labelname + "_recObjN";
1750           title = labelname + "_recObjN;Reco multiplicity()" + trigPath;
1751           MonitorElement* N = iBooker.book1D(histoname.c_str(), title.c_str(), Nbins_, Nmin_, Nmax_);
1752           N->getTH1();
1753 
1754           histoname = labelname + "_recObjPt";
1755           title = labelname + "_recObjPt; Reco Pt[GeV/c]" + trigPath;
1756           MonitorElement* Pt = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
1757           Pt->getTH1();
1758 
1759           histoname = labelname + "_recObjPtBarrel";
1760           title = labelname + "_recObjPtBarrel;Reco Pt[GeV/c]" + trigPath;
1761           MonitorElement* PtBarrel = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
1762           PtBarrel->getTH1();
1763 
1764           histoname = labelname + "_recObjPtEndcap";
1765           title = labelname + "_recObjPtEndcap;Reco Pt[GeV/c]" + trigPath;
1766           MonitorElement* PtEndcap = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
1767           PtEndcap->getTH1();
1768 
1769           histoname = labelname + "_recObjPtForward";
1770           title = labelname + "_recObjPtForward;Reco Pt[GeV/c]" + trigPath;
1771           MonitorElement* PtForward = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
1772           PtForward->getTH1();
1773 
1774           histoname = labelname + "_recObjEta";
1775           title = labelname + "_recObjEta;Reco #eta" + trigPath;
1776           MonitorElement* Eta = iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
1777           Eta->getTH1();
1778 
1779           histoname = labelname + "_recObjPhi";
1780           title = labelname + "_recObjPhi;Reco #Phi" + trigPath;
1781           MonitorElement* Phi = iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
1782           Phi->getTH1();
1783 
1784           histoname = labelname + "_recObjEtaPhi";
1785           title = labelname + "_recObjEtaPhi;Reco #eta;Reco #Phi" + trigPath;
1786           MonitorElement* EtaPhi =
1787               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
1788           EtaPhi->getTH1();
1789 
1790           histoname = labelname + "_l1ObjPt";
1791           title = labelname + "_l1ObjPt;L1 Pt[GeV/c]" + trigPath;
1792           MonitorElement* Pt_L1 = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
1793           Pt_L1->getTH1();
1794 
1795           histoname = labelname + "_l1ObjEta";
1796           title = labelname + "_l1ObjEta;L1 #eta" + trigPath;
1797           MonitorElement* Eta_L1 = iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
1798           Eta_L1->getTH1();
1799 
1800           histoname = labelname + "_l1ObjPhi";
1801           title = labelname + "_l1ObjPhi;L1 #Phi" + trigPath;
1802           MonitorElement* Phi_L1 = iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
1803           Phi_L1->getTH1();
1804 
1805           histoname = labelname + "_l1ObjEtaPhi";
1806           title = labelname + "_l1ObjEtaPhi;L1 #eta;L1 #Phi" + trigPath;
1807           MonitorElement* EtaPhi_L1 =
1808               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
1809           EtaPhi_L1->getTH1();
1810 
1811           histoname = labelname + "_l1ObjN";
1812           title = labelname + "_l1ObjN;L1 multiplicity" + trigPath;
1813           MonitorElement* N_L1 = iBooker.book1D(histoname.c_str(), title.c_str(), Nbins_, Nmin_, Nmax_);
1814           N_L1->getTH1();
1815 
1816           histoname = labelname + "_l1ObjPtBarrel";
1817           title = labelname + "_l1ObjPtBarrel;L1 Pt[GeV/c]" + trigPath;
1818           MonitorElement* PtBarrel_L1 = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
1819           PtBarrel_L1->getTH1();
1820 
1821           histoname = labelname + "_l1ObjPtEndcap";
1822           title = labelname + "_l1ObjPtEndcap;L1 Pt[GeV/c]" + trigPath;
1823           MonitorElement* PtEndcap_L1 = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
1824           PtEndcap_L1->getTH1();
1825 
1826           histoname = labelname + "_l1ObjPtForward";
1827           title = labelname + "_l1ObjPtForward;L1 Pt[GeV/c]" + trigPath;
1828           MonitorElement* PtForward_L1 = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
1829           PtForward_L1->getTH1();
1830 
1831           histoname = labelname + "_hltObjN";
1832           title = labelname + "_hltObjN;HLT multiplicity" + trigPath;
1833           MonitorElement* N_HLT = iBooker.book1D(histoname.c_str(), title.c_str(), Nbins_, Nmin_, Nmax_);
1834           N_HLT->getTH1();
1835 
1836           histoname = labelname + "_hltObjPtBarrel";
1837           title = labelname + "_hltObjPtBarrel;HLT Pt[GeV/c]" + trigPath;
1838           MonitorElement* PtBarrel_HLT = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
1839           PtBarrel_HLT->getTH1();
1840 
1841           histoname = labelname + "_hltObjPtEndcap";
1842           title = labelname + "_hltObjPtEndcap;HLT Pt[GeV/c]" + trigPath;
1843           MonitorElement* PtEndcap_HLT = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
1844           PtEndcap_HLT->getTH1();
1845 
1846           histoname = labelname + "_hltObjPtForward";
1847           title = labelname + "_hltObjPtForward;HLT Pt[GeV/c]" + trigPath;
1848           MonitorElement* PtForward_HLT = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
1849           PtForward_HLT->getTH1();
1850 
1851           histoname = labelname + "_hltObjPt";
1852           title = labelname + "_hltObjPt;HLT Pt[GeV/c]" + trigPath;
1853           MonitorElement* Pt_HLT = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
1854           Pt_HLT->getTH1();
1855 
1856           histoname = labelname + "_hltObjEta";
1857           title = labelname + "_hltObjEta;HLT #eta" + trigPath;
1858           MonitorElement* Eta_HLT = iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
1859           Eta_HLT->getTH1();
1860 
1861           histoname = labelname + "_hltObjPhi";
1862           title = labelname + "_hltObjPhi;HLT #Phi" + trigPath;
1863           MonitorElement* Phi_HLT = iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
1864           Phi_HLT->getTH1();
1865 
1866           histoname = labelname + "_hltObjEtaPhi";
1867           title = labelname + "_hltObjEtaPhi;HLT #eta;HLT #Phi" + trigPath;
1868           MonitorElement* EtaPhi_HLT =
1869               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
1870           EtaPhi_HLT->getTH1();
1871 
1872           histoname = labelname + "_l1HLTPtResolution";
1873           title = labelname + "_l1HLTPtResolution;(Pt(L1)-Pt(HLT))/Pt(L1)" + trigPath;
1874           MonitorElement* PtResolution_L1HLT =
1875               iBooker.book1D(histoname.c_str(), title.c_str(), Resbins_, ResMin_, ResMax_);
1876           PtResolution_L1HLT->getTH1();
1877 
1878           histoname = labelname + "_l1HLTEtaResolution";
1879           title = labelname + "_l1HLTEtaResolution;#eta(L1)-#eta(HLT)" + trigPath;
1880           MonitorElement* EtaResolution_L1HLT =
1881               iBooker.book1D(histoname.c_str(), title.c_str(), Resbins_, ResMin_, ResMax_);
1882           EtaResolution_L1HLT->getTH1();
1883 
1884           histoname = labelname + "_l1HLTPhiResolution";
1885           title = labelname + "_l1HLTPhiResolution;#Phi(L1)-#Phi(HLT)" + trigPath;
1886           MonitorElement* PhiResolution_L1HLT =
1887               iBooker.book1D(histoname.c_str(), title.c_str(), Resbins_, ResMin_, ResMax_);
1888           PhiResolution_L1HLT->getTH1();
1889 
1890           histoname = labelname + "_l1HLTPtCorrelation";
1891           title = labelname + "_l1HLTPtCorrelation;Pt(L1)[GeV/c];Pt(HLT)[GeV/c]" + trigPath;
1892           MonitorElement* PtCorrelation_L1HLT =
1893               iBooker.book2D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_, Ptbins_, PtMin_, PtMax_);
1894           PtCorrelation_L1HLT->getTH1();
1895 
1896           histoname = labelname + "_l1HLTEtaCorrelation";
1897           title = labelname + "_l1HLTEtaCorrelation;#eta(L1);#eta(HLT)" + trigPath;
1898           MonitorElement* EtaCorrelation_L1HLT =
1899               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Etabins_, EtaMin_, EtaMax_);
1900           EtaCorrelation_L1HLT->getTH1();
1901 
1902           histoname = labelname + "_l1HLTPhiCorrelation";
1903           title = labelname + "_l1HLTPhiCorrelation;#Phi(L1);#Phi(HLT)" + trigPath;
1904           MonitorElement* PhiCorrelation_L1HLT =
1905               iBooker.book2D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_, Phibins_, PhiMin_, PhiMax_);
1906           PhiCorrelation_L1HLT->getTH1();
1907 
1908           histoname = labelname + "_hltRecObjPtResolution";
1909           title = labelname + "_hltRecObjPtResolution;(Pt(HLT)-Pt(Reco))/Pt(HLT)" + trigPath;
1910           MonitorElement* PtResolution_HLTRecObj =
1911               iBooker.book1D(histoname.c_str(), title.c_str(), Resbins_, ResMin_, ResMax_);
1912           PtResolution_HLTRecObj->getTH1();
1913 
1914           histoname = labelname + "_hltRecObjEtaResolution";
1915           title = labelname + "_hltRecObjEtaResolution;#eta(HLT)-#eta(Reco)" + trigPath;
1916           MonitorElement* EtaResolution_HLTRecObj =
1917               iBooker.book1D(histoname.c_str(), title.c_str(), Resbins_, ResMin_, ResMax_);
1918           EtaResolution_HLTRecObj->getTH1();
1919 
1920           histoname = labelname + "_hltRecObjPhiResolution";
1921           title = labelname + "_hltRecObjPhiResolution;#Phi(HLT)-#Phi(Reco)" + trigPath;
1922           MonitorElement* PhiResolution_HLTRecObj =
1923               iBooker.book1D(histoname.c_str(), title.c_str(), Resbins_, ResMin_, ResMax_);
1924           PhiResolution_HLTRecObj->getTH1();
1925 
1926           histoname = labelname + "_hltRecObjPtCorrelation";
1927           title = labelname + "_hltRecObjPtCorrelation;Pt(HLT)[GeV/c];Pt(Reco)[GeV/c]" + trigPath;
1928           MonitorElement* PtCorrelation_HLTRecObj =
1929               iBooker.book2D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_, Ptbins_, PtMin_, PtMax_);
1930           PtCorrelation_HLTRecObj->getTH1();
1931 
1932           histoname = labelname + "_hltRecObjEtaCorrelation";
1933           title = labelname + "_hltRecObjEtaCorrelation;#eta(HLT);#eta(Reco)" + trigPath;
1934           MonitorElement* EtaCorrelation_HLTRecObj =
1935               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Etabins_, EtaMin_, EtaMax_);
1936           EtaCorrelation_HLTRecObj->getTH1();
1937 
1938           histoname = labelname + "_hltRecObjPhiCorrelation";
1939           title = labelname + "_hltRecObjPhiCorrelation;#Phi(HLT);#Phi(Reco)" + trigPath;
1940           MonitorElement* PhiCorrelation_HLTRecObj =
1941               iBooker.book2D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_, Phibins_, PhiMin_, PhiMax_);
1942           PhiCorrelation_HLTRecObj->getTH1();
1943 
1944           v.setHistos(N,
1945                       Pt,
1946                       PtBarrel,
1947                       PtEndcap,
1948                       PtForward,
1949                       Eta,
1950                       Phi,
1951                       EtaPhi,
1952                       N_L1,
1953                       Pt_L1,
1954                       PtBarrel_L1,
1955                       PtEndcap_L1,
1956                       PtForward_L1,
1957                       Eta_L1,
1958                       Phi_L1,
1959                       EtaPhi_L1,
1960                       N_HLT,
1961                       Pt_HLT,
1962                       PtBarrel_HLT,
1963                       PtEndcap_HLT,
1964                       PtForward_HLT,
1965                       Eta_HLT,
1966                       Phi_HLT,
1967                       EtaPhi_HLT,
1968                       PtResolution_L1HLT,
1969                       EtaResolution_L1HLT,
1970                       PhiResolution_L1HLT,
1971                       PtResolution_HLTRecObj,
1972                       EtaResolution_HLTRecObj,
1973                       PhiResolution_HLTRecObj,
1974                       PtCorrelation_L1HLT,
1975                       EtaCorrelation_L1HLT,
1976                       PhiCorrelation_L1HLT,
1977                       PtCorrelation_HLTRecObj,
1978                       EtaCorrelation_HLTRecObj,
1979                       PhiCorrelation_HLTRecObj,
1980                       dummy,
1981                       dummy,
1982                       dummy,
1983                       dummy,
1984                       dummy,
1985                       dummy,
1986                       dummy,
1987                       dummy,
1988                       dummy);
1989         }  // histos for SingleJet Triggers
1990 
1991         if (v.getObjectType() == trigger::TriggerJet && v.getTriggerType() == "DiJet_Trigger") {
1992           histoname = labelname + "_RecObjAveragePt";
1993           title = labelname + "_RecObjAveragePt;Reco Average Pt[GeV/c]" + trigPath;
1994           MonitorElement* jetAveragePt = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
1995           jetAveragePt->getTH1();
1996 
1997           histoname = labelname + "_RecObjAverageEta";
1998           title = labelname + "_RecObjAverageEta;Reco Average #eta" + trigPath;
1999           MonitorElement* jetAverageEta = iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2000           jetAverageEta->getTH1();
2001 
2002           histoname = labelname + "_RecObjPhiDifference";
2003           title = labelname + "_RecObjPhiDifference;Reco #Delta#Phi" + trigPath;
2004           MonitorElement* jetPhiDifference =
2005               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2006           jetPhiDifference->getTH1();
2007 
2008           histoname = labelname + "_hltObjAveragePt";
2009           title = labelname + "_hltObjAveragePt;HLT Average Pt[GeV/c]" + trigPath;
2010           MonitorElement* hltAveragePt = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2011           hltAveragePt->getTH1();
2012 
2013           histoname = labelname + "_hltObjAverageEta";
2014           title = labelname + "_hltObjAverageEta;HLT Average #eta" + trigPath;
2015           MonitorElement* hltAverageEta = iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2016           hltAverageEta->getTH1();
2017 
2018           histoname = labelname + "_hltObjPhiDifference";
2019           title = labelname + "_hltObjPhiDifference;Reco #Delta#Phi" + trigPath;
2020           MonitorElement* hltPhiDifference =
2021               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2022           hltPhiDifference->getTH1();
2023 
2024           v.setHistos(dummy,
2025                       dummy,
2026                       dummy,
2027                       dummy,
2028                       dummy,
2029                       dummy,
2030                       dummy,
2031                       dummy,
2032                       dummy,
2033                       dummy,
2034                       dummy,
2035                       dummy,
2036                       dummy,
2037                       dummy,
2038                       dummy,
2039                       dummy,
2040                       dummy,
2041                       dummy,
2042                       dummy,
2043                       dummy,
2044                       dummy,
2045                       dummy,
2046                       dummy,
2047                       dummy,
2048                       dummy,
2049                       dummy,
2050                       dummy,
2051                       dummy,
2052                       dummy,
2053                       dummy,
2054                       dummy,
2055                       dummy,
2056                       dummy,
2057                       dummy,
2058                       dummy,
2059                       dummy,
2060                       jetAveragePt,
2061                       jetAverageEta,
2062                       jetPhiDifference,
2063                       hltAveragePt,
2064                       hltAverageEta,
2065                       hltPhiDifference,
2066                       dummy,
2067                       dummy,
2068                       dummy);
2069         }  // histos for DiJet Triggers
2070 
2071         if (v.getObjectType() == trigger::TriggerMET || (v.getObjectType() == trigger::TriggerTET)) {
2072           histoname = labelname + "_recObjPt";
2073           title = labelname + "_recObjPt;Reco Pt[GeV/c]" + trigPath;
2074           MonitorElement* Pt = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2075           Pt->getTH1();
2076 
2077           histoname = labelname + "_recObjPhi";
2078           title = labelname + "_recObjPhi;Reco #Phi" + trigPath;
2079           MonitorElement* Phi = iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2080           Phi->getTH1();
2081 
2082           histoname = labelname + "_l1ObjPt";
2083           title = labelname + "_l1ObjPt;L1 Pt[GeV/c]" + trigPath;
2084           MonitorElement* Pt_L1 = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2085           Pt_L1->getTH1();
2086 
2087           histoname = labelname + "_l1ObjPhi";
2088           title = labelname + "_l1ObjPhi;L1 #Phi" + trigPath;
2089           MonitorElement* Phi_L1 = iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2090           Phi_L1->getTH1();
2091 
2092           histoname = labelname + "_hltObjPt";
2093           title = labelname + "_hltObjPt;HLT Pt[GeV/c]" + trigPath;
2094           MonitorElement* Pt_HLT = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2095           Pt_HLT->getTH1();
2096 
2097           histoname = labelname + "_hltObjPhi";
2098           title = labelname + "_hltObjPhi;HLT #Phi" + trigPath;
2099           MonitorElement* Phi_HLT = iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2100           Phi_HLT->getTH1();
2101 
2102           histoname = labelname + "_l1HLTPtResolution";
2103           title = labelname + "_l1HLTPtResolution;(Pt(L1)-Pt(HLT))/Pt(L1)" + trigPath;
2104           MonitorElement* PtResolution_L1HLT =
2105               iBooker.book1D(histoname.c_str(), title.c_str(), Resbins_, ResMin_, ResMax_);
2106           PtResolution_L1HLT->getTH1();
2107 
2108           histoname = labelname + "_l1HLTPhiResolution";
2109           title = labelname + "_l1HLTPhiResolution;#Phi(L1)-#Phi(HLT)" + trigPath;
2110           MonitorElement* PhiResolution_L1HLT =
2111               iBooker.book1D(histoname.c_str(), title.c_str(), Resbins_, ResMin_, ResMax_);
2112           PhiResolution_L1HLT->getTH1();
2113 
2114           histoname = labelname + "_l1HLTPtCorrelation";
2115           title = labelname + "_l1HLTPtCorrelation;Pt(L1)[GeV/c];Pt(HLT)[GeV/c]" + trigPath;
2116           MonitorElement* PtCorrelation_L1HLT =
2117               iBooker.book2D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_, Ptbins_, PtMin_, PtMax_);
2118           PtCorrelation_L1HLT->getTH1();
2119 
2120           histoname = labelname + "_l1HLTPhiCorrelation";
2121           title = labelname + "_l1HLTPhiCorrelation;#Phi(L1);#Phi(HLT)" + trigPath;
2122           MonitorElement* PhiCorrelation_L1HLT =
2123               iBooker.book2D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_, Phibins_, PhiMin_, PhiMax_);
2124           PhiCorrelation_L1HLT->getTH1();
2125 
2126           histoname = labelname + "_hltRecObjPtResolution";
2127           title = labelname + "_hltRecObjPtResolution;(Pt(HLT)-Pt(Reco))/Pt(HLT)" + trigPath;
2128           MonitorElement* PtResolution_HLTRecObj =
2129               iBooker.book1D(histoname.c_str(), title.c_str(), Resbins_, ResMin_, ResMax_);
2130           PtResolution_HLTRecObj->getTH1();
2131 
2132           histoname = labelname + "_hltRecObjPhiResolution";
2133           title = labelname + "_hltRecObjPhiResolution;#Phi(HLT)-#Phi(Reco)" + trigPath;
2134           MonitorElement* PhiResolution_HLTRecObj =
2135               iBooker.book1D(histoname.c_str(), title.c_str(), Resbins_, ResMin_, ResMax_);
2136           PhiResolution_HLTRecObj->getTH1();
2137 
2138           histoname = labelname + "_hltRecObjPtCorrelation";
2139           title = labelname + "_hltRecObjPtCorrelation;Pt(HLT)[GeV/c];Pt(Reco)[GeV/c]" + trigPath;
2140           MonitorElement* PtCorrelation_HLTRecObj =
2141               iBooker.book2D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_, Ptbins_, PtMin_, PtMax_);
2142           PtCorrelation_HLTRecObj->getTH1();
2143 
2144           histoname = labelname + "_hltRecObjPhiCorrelation";
2145           title = labelname + "_hltRecObjPhiCorrelation;#Phi(HLT);#Phi(Reco)" + trigPath;
2146           MonitorElement* PhiCorrelation_HLTRecObj =
2147               iBooker.book2D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_, Phibins_, PhiMin_, PhiMax_);
2148           PhiCorrelation_HLTRecObj->getTH1();
2149 
2150           v.setHistos(dummy,
2151                       Pt,
2152                       dummy,
2153                       dummy,
2154                       dummy,
2155                       dummy,
2156                       Phi,
2157                       dummy,
2158                       dummy,
2159                       Pt_L1,
2160                       dummy,
2161                       dummy,
2162                       dummy,
2163                       dummy,
2164                       Phi_L1,
2165                       dummy,
2166                       dummy,
2167                       Pt_HLT,
2168                       dummy,
2169                       dummy,
2170                       dummy,
2171                       dummy,
2172                       Phi_HLT,
2173                       dummy,
2174                       PtResolution_L1HLT,
2175                       dummy,
2176                       PhiResolution_L1HLT,
2177                       PtResolution_HLTRecObj,
2178                       dummy,
2179                       PhiResolution_HLTRecObj,
2180                       PtCorrelation_L1HLT,
2181                       dummy,
2182                       PhiCorrelation_L1HLT,
2183                       PtCorrelation_HLTRecObj,
2184                       dummy,
2185                       PhiCorrelation_HLTRecObj,
2186                       dummy,
2187                       dummy,
2188                       dummy,
2189                       dummy,
2190                       dummy,
2191                       dummy,
2192                       dummy,
2193                       dummy,
2194                       dummy);
2195         }  // histos for MET Triggers
2196       }
2197     }  //plotAll_
2198 
2199     //-------Now Efficiency histos--------
2200     if (plotEff_) {
2201       int Ptbins_ = 100;
2202       if (runStandalone_)
2203         Ptbins_ = 1000;
2204       double PtMin_ = 0.;
2205       double PtMax_ = 1000.;
2206       //
2207       int Etabins_ = 50;
2208       double EtaMin_ = -5.;
2209       double EtaMax_ = 5.;
2210       //
2211       int Phibins_ = 35;
2212       double PhiMin_ = -3.5;
2213       double PhiMax_ = 3.5;
2214       // Now define histos wrt lower threshold trigger
2215       std::string dirName1 = dirname_ + "/RelativeTriggerEff/";
2216       for (auto& v : hltPathsEff_) {
2217         //
2218         std::string trgPathName = HLTConfigProvider::removeVersion(v.getPath());
2219         std::string trgPathNameD = HLTConfigProvider::removeVersion(v.getDenomPath());
2220         //
2221         std::string labelname("ME");
2222         std::string subdirName = dirName1 + trgPathName + "_wrt_" + trgPathNameD;
2223         iBooker.setCurrentFolder(subdirName);
2224         //
2225         std::string histoname(labelname + "");
2226         std::string title(labelname + "");
2227 
2228         MonitorElement* dummy;
2229         dummy = iBooker.bookFloat("dummy");
2230 
2231         if ((v.getObjectType() == trigger::TriggerJet) && (v.getTriggerType() == "SingleJet_Trigger")) {
2232           histoname = labelname + "_NumeratorPt";
2233           title = labelname + "NumeratorPt;Calo Pt[GeV/c]";
2234           MonitorElement* NumeratorPt = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2235           NumeratorPt->getTH1();
2236 
2237           histoname = labelname + "_NumeratorPtBarrel";
2238           title = labelname + "NumeratorPtBarrel;Calo Pt[GeV/c] ";
2239           MonitorElement* NumeratorPtBarrel = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2240           NumeratorPtBarrel->getTH1();
2241 
2242           histoname = labelname + "_NumeratorPtEndcap";
2243           title = labelname + "NumeratorPtEndcap;Calo Pt[GeV/c]";
2244           MonitorElement* NumeratorPtEndcap = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2245           NumeratorPtEndcap->getTH1();
2246 
2247           histoname = labelname + "_NumeratorPtForward";
2248           title = labelname + "NumeratorPtForward;Calo Pt[GeV/c]";
2249           MonitorElement* NumeratorPtForward =
2250               iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2251           NumeratorPtForward->getTH1();
2252 
2253           histoname = labelname + "_NumeratorEta";
2254           title = labelname + "NumeratorEta;Calo #eta ";
2255           MonitorElement* NumeratorEta = iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2256           NumeratorEta->getTH1();
2257 
2258           histoname = labelname + "_NumeratorPhi";
2259           title = labelname + "NumeratorPhi;Calo #Phi";
2260           MonitorElement* NumeratorPhi = iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2261           NumeratorPhi->getTH1();
2262 
2263           histoname = labelname + "_NumeratorEtaPhi";
2264           title = labelname + "NumeratorEtaPhi;Calo #eta;Calo #Phi";
2265           MonitorElement* NumeratorEtaPhi =
2266               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
2267           NumeratorEtaPhi->getTH1();
2268 
2269           histoname = labelname + "_NumeratorEtaBarrel";
2270           title = labelname + "NumeratorEtaBarrel;Calo #eta ";
2271           MonitorElement* NumeratorEtaBarrel =
2272               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2273           NumeratorEtaBarrel->getTH1();
2274 
2275           histoname = labelname + "_NumeratorPhiBarrel";
2276           title = labelname + "NumeratorPhiBarrel;Calo #Phi";
2277           MonitorElement* NumeratorPhiBarrel =
2278               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2279           NumeratorPhiBarrel->getTH1();
2280 
2281           histoname = labelname + "_NumeratorEtaEndcap";
2282           title = labelname + "NumeratorEtaEndcap;Calo #eta ";
2283           MonitorElement* NumeratorEtaEndcap =
2284               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2285           NumeratorEtaEndcap->getTH1();
2286 
2287           histoname = labelname + "_NumeratorPhiEndcap";
2288           title = labelname + "NumeratorPhiEndcap;Calo #Phi";
2289           MonitorElement* NumeratorPhiEndcap =
2290               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2291           NumeratorPhiEndcap->getTH1();
2292 
2293           histoname = labelname + "_NumeratorEtaForward";
2294           title = labelname + "NumeratorEtaForward;Calo #eta ";
2295           MonitorElement* NumeratorEtaForward =
2296               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2297           NumeratorEtaForward->getTH1();
2298 
2299           histoname = labelname + "_NumeratorPhiForward";
2300           title = labelname + "NumeratorPhiForward;Calo #Phi";
2301           MonitorElement* NumeratorPhiForward =
2302               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2303           NumeratorPhiForward->getTH1();
2304 
2305           histoname = labelname + "_NumeratorEta_LowpTcut";
2306           title = labelname + "NumeratorEta_LowpTcut;Calo #eta ";
2307           MonitorElement* NumeratorEta_LowpTcut =
2308               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2309           NumeratorEta_LowpTcut->getTH1();
2310 
2311           histoname = labelname + "_NumeratorPhi_LowpTcut";
2312           title = labelname + "NumeratorPhi_LowpTcut;Calo #Phi";
2313           MonitorElement* NumeratorPhi_LowpTcut =
2314               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2315           NumeratorPhi_LowpTcut->getTH1();
2316 
2317           histoname = labelname + "_NumeratorEtaPhi_LowpTcut";
2318           title = labelname + "NumeratorEtaPhi_LowpTcut;Calo #eta;Calo #Phi";
2319           MonitorElement* NumeratorEtaPhi_LowpTcut =
2320               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
2321           NumeratorEtaPhi_LowpTcut->getTH1();
2322 
2323           histoname = labelname + "_NumeratorEta_MedpTcut";
2324           title = labelname + "NumeratorEta_MedpTcut;Calo #eta ";
2325           MonitorElement* NumeratorEta_MedpTcut =
2326               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2327           NumeratorEta_MedpTcut->getTH1();
2328 
2329           histoname = labelname + "_NumeratorPhi_MedpTcut";
2330           title = labelname + "NumeratorPhi_MedpTcut;Calo #Phi";
2331           MonitorElement* NumeratorPhi_MedpTcut =
2332               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2333           NumeratorPhi_MedpTcut->getTH1();
2334 
2335           histoname = labelname + "_NumeratorEtaPhi_MedpTcut";
2336           title = labelname + "NumeratorEtaPhi_MedpTcut;Calo #eta;Calo #Phi";
2337           MonitorElement* NumeratorEtaPhi_MedpTcut =
2338               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
2339           NumeratorEtaPhi_MedpTcut->getTH1();
2340 
2341           histoname = labelname + "_NumeratorEta_HighpTcut";
2342           title = labelname + "NumeratorEta_HighpTcut;Calo #eta ";
2343           MonitorElement* NumeratorEta_HighpTcut =
2344               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2345           NumeratorEta_HighpTcut->getTH1();
2346 
2347           histoname = labelname + "_NumeratorPhi_HighpTcut";
2348           title = labelname + "NumeratorPhi_HighpTcut;Calo #Phi";
2349           MonitorElement* NumeratorPhi_HighpTcut =
2350               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2351           NumeratorPhi_HighpTcut->getTH1();
2352 
2353           histoname = labelname + "_NumeratorEtaPhi_HighpTcut";
2354           title = labelname + "NumeratorEtaPhi_HighpTcut;Calo #eta;Calo #Phi";
2355           MonitorElement* NumeratorEtaPhi_HighpTcut =
2356               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
2357           NumeratorEtaPhi_HighpTcut->getTH1();
2358 
2359           histoname = labelname + "_DenominatorPt";
2360           title = labelname + "DenominatorPt;Calo Pt[GeV/c]";
2361           MonitorElement* DenominatorPt = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2362           DenominatorPt->getTH1();
2363 
2364           histoname = labelname + "_DenominatorPtBarrel";
2365           title = labelname + "DenominatorPtBarrel;Calo Pt[GeV/c]";
2366           MonitorElement* DenominatorPtBarrel =
2367               iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2368           DenominatorPtBarrel->getTH1();
2369 
2370           histoname = labelname + "_DenominatorPtEndcap";
2371           title = labelname + "DenominatorPtEndcap;Calo Pt[GeV/c]";
2372           MonitorElement* DenominatorPtEndcap =
2373               iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2374           DenominatorPtEndcap->getTH1();
2375 
2376           histoname = labelname + "_DenominatorPtForward";
2377           title = labelname + "DenominatorPtForward;Calo Pt[GeV/c] ";
2378           MonitorElement* DenominatorPtForward =
2379               iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2380           DenominatorPtForward->getTH1();
2381 
2382           histoname = labelname + "_DenominatorEta";
2383           title = labelname + "DenominatorEta;Calo #eta ";
2384           MonitorElement* DenominatorEta = iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2385           DenominatorEta->getTH1();
2386 
2387           histoname = labelname + "_DenominatorPhi";
2388           title = labelname + "DenominatorPhi;Calo #Phi";
2389           MonitorElement* DenominatorPhi = iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2390           DenominatorPhi->getTH1();
2391 
2392           histoname = labelname + "_DenominatorEtaPhi";
2393           title = labelname + "DenominatorEtaPhi;Calo #eta; Calo #Phi";
2394           MonitorElement* DenominatorEtaPhi =
2395               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
2396           DenominatorEtaPhi->getTH1();
2397 
2398           histoname = labelname + "_DenominatorEtaBarrel";
2399           title = labelname + "DenominatorEtaBarrel;Calo #eta ";
2400           MonitorElement* DenominatorEtaBarrel =
2401               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2402           DenominatorEtaBarrel->getTH1();
2403 
2404           histoname = labelname + "_DenominatorPhiBarrel";
2405           title = labelname + "DenominatorPhiBarrel;Calo #Phi";
2406           MonitorElement* DenominatorPhiBarrel =
2407               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2408           DenominatorPhiBarrel->getTH1();
2409 
2410           histoname = labelname + "_DenominatorEtaEndcap";
2411           title = labelname + "DenominatorEtaEndcap;Calo #eta ";
2412           MonitorElement* DenominatorEtaEndcap =
2413               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2414           DenominatorEtaEndcap->getTH1();
2415 
2416           histoname = labelname + "_DenominatorPhiEndcap";
2417           title = labelname + "DenominatorPhiEndcap;Calo #Phi";
2418           MonitorElement* DenominatorPhiEndcap =
2419               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2420           DenominatorPhiEndcap->getTH1();
2421 
2422           histoname = labelname + "_DenominatorEtaForward";
2423           title = labelname + "DenominatorEtaForward;Calo #eta ";
2424           MonitorElement* DenominatorEtaForward =
2425               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2426           DenominatorEtaForward->getTH1();
2427 
2428           histoname = labelname + "_DenominatorPhiForward";
2429           title = labelname + "DenominatorPhiForward;Calo #Phi";
2430           MonitorElement* DenominatorPhiForward =
2431               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2432           DenominatorPhiForward->getTH1();
2433 
2434           histoname = labelname + "_DenominatorEta_LowpTcut";
2435           title = labelname + "DenominatorEta_LowpTcut;Calo #eta ";
2436           MonitorElement* DenominatorEta_LowpTcut =
2437               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2438           DenominatorEta_LowpTcut->getTH1();
2439 
2440           histoname = labelname + "_DenominatorPhi_LowpTcut";
2441           title = labelname + "DenominatorPhi_LowpTcut;Calo #Phi";
2442           MonitorElement* DenominatorPhi_LowpTcut =
2443               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2444           DenominatorPhi_LowpTcut->getTH1();
2445 
2446           histoname = labelname + "_DenominatorEtaPhi_LowpTcut";
2447           title = labelname + "DenominatorEtaPhi_LowpTcut;Calo #eta;Calo #Phi";
2448           MonitorElement* DenominatorEtaPhi_LowpTcut =
2449               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
2450           DenominatorEtaPhi_LowpTcut->getTH1();
2451 
2452           histoname = labelname + "_DenominatorEta_MedpTcut";
2453           title = labelname + "DenominatorEta_MedpTcut;Calo #eta ";
2454           MonitorElement* DenominatorEta_MedpTcut =
2455               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2456           DenominatorEta_MedpTcut->getTH1();
2457 
2458           histoname = labelname + "_DenominatorPhi_MedpTcut";
2459           title = labelname + "DenominatorPhi_MedpTcut;Calo #Phi";
2460           MonitorElement* DenominatorPhi_MedpTcut =
2461               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2462           DenominatorPhi_MedpTcut->getTH1();
2463 
2464           histoname = labelname + "_DenominatorEtaPhi_MedpTcut";
2465           title = labelname + "DenominatorEtaPhi_MedpTcut;Calo #eta;Calo #Phi";
2466           MonitorElement* DenominatorEtaPhi_MedpTcut =
2467               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
2468           DenominatorEtaPhi_MedpTcut->getTH1();
2469 
2470           histoname = labelname + "_DenominatorEta_HighpTcut";
2471           title = labelname + "DenominatorEta_HighpTcut;Calo #eta ";
2472           MonitorElement* DenominatorEta_HighpTcut =
2473               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2474           DenominatorEta_HighpTcut->getTH1();
2475 
2476           histoname = labelname + "_DenominatorPhi_HighpTcut";
2477           title = labelname + "DenominatorPhi_HighpTcut;Calo #Phi";
2478           MonitorElement* DenominatorPhi_HighpTcut =
2479               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2480           DenominatorPhi_HighpTcut->getTH1();
2481 
2482           histoname = labelname + "_DenominatorEtaPhi_HighpTcut";
2483           title = labelname + "DenominatorEtaPhi_HighpTcut;Calo #eta;Calo #Phi";
2484           MonitorElement* DenominatorEtaPhi_HighpTcut =
2485               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
2486           DenominatorEtaPhi_HighpTcut->getTH1();
2487 
2488           histoname = labelname + "_DeltaR";
2489           title = labelname + "DeltaR;";
2490           MonitorElement* DeltaR = iBooker.book1D(histoname.c_str(), title.c_str(), 100, 0., 1.5);
2491           DeltaR->getTH1();
2492 
2493           histoname = labelname + "_DeltaPhi";
2494           title = labelname + "DeltaPhi;";
2495           MonitorElement* DeltaPhi = iBooker.book1D(histoname.c_str(), title.c_str(), 500, -5.0, 5.0);
2496           DeltaPhi->getTH1();
2497 
2498           histoname = labelname + "_NumeratorPFMHT";
2499           title = labelname + "NumeratorPFMHT;PFMHT[GeV/c]";
2500           MonitorElement* NumeratorPFMHT = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2501           NumeratorPFMHT->getTH1();
2502 
2503           histoname = labelname + "_NumeratorPFPt";
2504           title = labelname + "NumeratorPFPt;PF Pt[GeV/c]";
2505           MonitorElement* NumeratorPFPt = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2506           NumeratorPFPt->getTH1();
2507 
2508           histoname = labelname + "_NumeratorPFPtBarrel";
2509           title = labelname + "NumeratorPFPtBarrel;PF Pt[GeV/c] ";
2510           MonitorElement* NumeratorPFPtBarrel =
2511               iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2512           NumeratorPFPtBarrel->getTH1();
2513 
2514           histoname = labelname + "_NumeratorPFPtEndcap";
2515           title = labelname + "NumeratorPFPtEndcap;PF Pt[GeV/c]";
2516           MonitorElement* NumeratorPFPtEndcap =
2517               iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2518           NumeratorPFPtEndcap->getTH1();
2519 
2520           histoname = labelname + "_NumeratorPFPtForward";
2521           title = labelname + "NumeratorPFPtForward;PF Pt[GeV/c]";
2522           MonitorElement* NumeratorPFPtForward =
2523               iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2524           NumeratorPFPtForward->getTH1();
2525 
2526           histoname = labelname + "_NumeratorPFEta";
2527           title = labelname + "NumeratorPFEta;PF #eta ";
2528           MonitorElement* NumeratorPFEta = iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2529           NumeratorPFEta->getTH1();
2530 
2531           histoname = labelname + "_NumeratorPFPhi";
2532           title = labelname + "NumeratorPFPhi;Calo #Phi";
2533           MonitorElement* NumeratorPFPhi = iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2534           NumeratorPFPhi->getTH1();
2535 
2536           histoname = labelname + "_NumeratorPFEtaPhi";
2537           title = labelname + "NumeratorPFEtaPhi;PF #eta;Calo #Phi";
2538           MonitorElement* NumeratorPFEtaPhi =
2539               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
2540           NumeratorPFEtaPhi->getTH1();
2541 
2542           histoname = labelname + "_NumeratorPFEtaBarrel";
2543           title = labelname + "NumeratorPFEtaBarrel;PF #eta ";
2544           MonitorElement* NumeratorPFEtaBarrel =
2545               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2546           NumeratorPFEtaBarrel->getTH1();
2547 
2548           histoname = labelname + "_NumeratorPFPhiBarrel";
2549           title = labelname + "NumeratorPFPhiBarrel;PF #Phi";
2550           MonitorElement* NumeratorPFPhiBarrel =
2551               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2552           NumeratorPFPhiBarrel->getTH1();
2553 
2554           histoname = labelname + "_NumeratorPFEtaEndcap";
2555           title = labelname + "NumeratorPFEtaEndcap;Calo #eta ";
2556           MonitorElement* NumeratorPFEtaEndcap =
2557               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2558           NumeratorPFEtaEndcap->getTH1();
2559 
2560           histoname = labelname + "_NumeratorPFPhiEndcap";
2561           title = labelname + "NumeratorPFPhiEndcap;PF #Phi";
2562           MonitorElement* NumeratorPFPhiEndcap =
2563               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2564           NumeratorPFPhiEndcap->getTH1();
2565 
2566           histoname = labelname + "_NumeratorPFEtaForward";
2567           title = labelname + "NumeratorPFEtaForward;Calo #eta ";
2568           MonitorElement* NumeratorPFEtaForward =
2569               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2570           NumeratorPFEtaForward->getTH1();
2571 
2572           histoname = labelname + "_NumeratorPFPhiForward";
2573           title = labelname + "NumeratorPFPhiForward;PF #Phi";
2574           MonitorElement* NumeratorPFPhiForward =
2575               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2576           NumeratorPFPhiForward->getTH1();
2577 
2578           histoname = labelname + "_NumeratorPFEta_LowpTcut";
2579           title = labelname + "NumeratorPFEta_LowpTcut;PF #eta ";
2580           MonitorElement* NumeratorPFEta_LowpTcut =
2581               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2582           NumeratorPFEta_LowpTcut->getTH1();
2583 
2584           histoname = labelname + "_NumeratorPFPhi_LowpTcut";
2585           title = labelname + "NumeratorPFPhi_LowpTcut;PF #Phi";
2586           MonitorElement* NumeratorPFPhi_LowpTcut =
2587               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2588           NumeratorPFPhi_LowpTcut->getTH1();
2589 
2590           histoname = labelname + "_NumeratorPFEtaPhi_LowpTcut";
2591           title = labelname + "NumeratorPFEtaPhi_LowpTcut;PF #eta;Calo #Phi";
2592           MonitorElement* NumeratorPFEtaPhi_LowpTcut =
2593               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
2594           NumeratorPFEtaPhi_LowpTcut->getTH1();
2595 
2596           histoname = labelname + "_NumeratorPFEta_MedpTcut";
2597           title = labelname + "NumeratorPFEta_MedpTcut;PF #eta ";
2598           MonitorElement* NumeratorPFEta_MedpTcut =
2599               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2600           NumeratorPFEta_MedpTcut->getTH1();
2601 
2602           histoname = labelname + "_NumeratorPFPhi_MedpTcut";
2603           title = labelname + "NumeratorPFPhi_MedpTcut;PF #Phi";
2604           MonitorElement* NumeratorPFPhi_MedpTcut =
2605               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2606           NumeratorPFPhi_MedpTcut->getTH1();
2607 
2608           histoname = labelname + "_NumeratorPFEtaPhi_MedpTcut";
2609           title = labelname + "NumeratorPFEtaPhi_MedpTcut;PF #eta;PF #Phi";
2610           MonitorElement* NumeratorPFEtaPhi_MedpTcut =
2611               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
2612           NumeratorPFEtaPhi_MedpTcut->getTH1();
2613 
2614           histoname = labelname + "_NumeratorPFEta_HighpTcut";
2615           title = labelname + "NumeratorPFEta_HighpTcut;Calo #eta ";
2616           MonitorElement* NumeratorPFEta_HighpTcut =
2617               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2618           NumeratorPFEta_HighpTcut->getTH1();
2619 
2620           histoname = labelname + "_NumeratorPFPhi_HighpTcut";
2621           title = labelname + "NumeratorPFPhi_HighpTcut;PF #Phi";
2622           MonitorElement* NumeratorPFPhi_HighpTcut =
2623               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2624           NumeratorPFPhi_HighpTcut->getTH1();
2625 
2626           histoname = labelname + "_NumeratorPFEtaPhi_HighpTcut";
2627           title = labelname + "NumeratorPFEtaPhi_HighpTcut;PF #eta;PF #Phi";
2628           MonitorElement* NumeratorPFEtaPhi_HighpTcut =
2629               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
2630           NumeratorPFEtaPhi_HighpTcut->getTH1();
2631 
2632           histoname = labelname + "_DenominatorPFMHT";
2633           title = labelname + "DenominatorPFMHT;PF Pt[GeV/c]";
2634           MonitorElement* DenominatorPFMHT = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2635           DenominatorPFMHT->getTH1();
2636 
2637           histoname = labelname + "_DenominatorPFPt";
2638           title = labelname + "DenominatorPFPt;PF Pt[GeV/c]";
2639           MonitorElement* DenominatorPFPt = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2640           DenominatorPFPt->getTH1();
2641 
2642           histoname = labelname + "_DenominatorPFPtBarrel";
2643           title = labelname + "DenominatorPFPtBarrel;Calo Pt[GeV/c]";
2644           MonitorElement* DenominatorPFPtBarrel =
2645               iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2646           DenominatorPFPtBarrel->getTH1();
2647 
2648           histoname = labelname + "_DenominatorPFPtEndcap";
2649           title = labelname + "DenominatorPFPtEndcap;PF Pt[GeV/c]";
2650           MonitorElement* DenominatorPFPtEndcap =
2651               iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2652           DenominatorPFPtEndcap->getTH1();
2653 
2654           histoname = labelname + "_DenominatorPFPtForward";
2655           title = labelname + "DenominatorPFPtForward;PF Pt[GeV/c] ";
2656           MonitorElement* DenominatorPFPtForward =
2657               iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2658           DenominatorPFPtForward->getTH1();
2659 
2660           histoname = labelname + "_DenominatorPFEta";
2661           title = labelname + "DenominatorPFEta;PF #eta ";
2662           MonitorElement* DenominatorPFEta =
2663               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2664           DenominatorPFEta->getTH1();
2665 
2666           histoname = labelname + "_DenominatorPFPhi";
2667           title = labelname + "DenominatorPFPhi;PF #Phi";
2668           MonitorElement* DenominatorPFPhi =
2669               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2670           DenominatorPFPhi->getTH1();
2671 
2672           histoname = labelname + "_DenominatorPFEtaPhi";
2673           title = labelname + "DenominatorPFEtaPhi;PF #eta; Calo #Phi";
2674           MonitorElement* DenominatorPFEtaPhi =
2675               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
2676           DenominatorPFEtaPhi->getTH1();
2677 
2678           histoname = labelname + "_DenominatorPFEtaBarrel";
2679           title = labelname + "DenominatorPFEtaBarrel;Calo #eta ";
2680           MonitorElement* DenominatorPFEtaBarrel =
2681               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2682           DenominatorPFEtaBarrel->getTH1();
2683 
2684           histoname = labelname + "_DenominatorPFPhiBarrel";
2685           title = labelname + "DenominatorPFPhiBarrel;PF #Phi";
2686           MonitorElement* DenominatorPFPhiBarrel =
2687               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2688           DenominatorPFPhiBarrel->getTH1();
2689 
2690           histoname = labelname + "_DenominatorPFEtaEndcap";
2691           title = labelname + "DenominatorPFEtaEndcap;PF #eta ";
2692           MonitorElement* DenominatorPFEtaEndcap =
2693               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2694           DenominatorPFEtaEndcap->getTH1();
2695 
2696           histoname = labelname + "_DenominatorPFPhiEndcap";
2697           title = labelname + "DenominatorPFPhiEndcap;Calo #Phi";
2698           MonitorElement* DenominatorPFPhiEndcap =
2699               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2700           DenominatorPFPhiEndcap->getTH1();
2701 
2702           histoname = labelname + "_DenominatorPFEtaForward";
2703           title = labelname + "DenominatorPFEtaForward;PF #eta ";
2704           MonitorElement* DenominatorPFEtaForward =
2705               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2706           DenominatorPFEtaForward->getTH1();
2707 
2708           histoname = labelname + "_DenominatorPFPhiForward";
2709           title = labelname + "DenominatorPFPhiForward;PF #Phi";
2710           MonitorElement* DenominatorPFPhiForward =
2711               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2712           DenominatorPFPhiForward->getTH1();
2713 
2714           histoname = labelname + "_DenominatorPFEta_LowpTcut";
2715           title = labelname + "DenominatorPFEta_LowpTcut;PF #eta ";
2716           MonitorElement* DenominatorPFEta_LowpTcut =
2717               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2718           DenominatorPFEta_LowpTcut->getTH1();
2719 
2720           histoname = labelname + "_DenominatorPFPhi_LowpTcut";
2721           title = labelname + "DenominatorPFPhi_LowpTcut;PF #Phi";
2722           MonitorElement* DenominatorPFPhi_LowpTcut =
2723               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2724           DenominatorPFPhi_LowpTcut->getTH1();
2725 
2726           histoname = labelname + "_DenominatorPFEtaPhi_LowpTcut";
2727           title = labelname + "DenominatorPFEtaPhi_LowpTcut;PF #eta;Calo #Phi";
2728           MonitorElement* DenominatorPFEtaPhi_LowpTcut =
2729               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
2730           DenominatorPFEtaPhi_LowpTcut->getTH1();
2731 
2732           histoname = labelname + "_DenominatorPFEta_MedpTcut";
2733           title = labelname + "DenominatorPFEta_MedpTcut;PF #eta ";
2734           MonitorElement* DenominatorPFEta_MedpTcut =
2735               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2736           DenominatorPFEta_MedpTcut->getTH1();
2737 
2738           histoname = labelname + "_DenominatorPFPhi_MedpTcut";
2739           title = labelname + "DenominatorPFPhi_MedpTcut;PF #Phi";
2740           MonitorElement* DenominatorPFPhi_MedpTcut =
2741               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2742           DenominatorPFPhi_MedpTcut->getTH1();
2743 
2744           histoname = labelname + "_DenominatorPFEtaPhi_MedpTcut";
2745           title = labelname + "DenominatorPFEtaPhi_MedpTcut;PF #eta;Calo #Phi";
2746           MonitorElement* DenominatorPFEtaPhi_MedpTcut =
2747               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
2748           DenominatorPFEtaPhi_MedpTcut->getTH1();
2749 
2750           histoname = labelname + "_DenominatorPFEta_HighpTcut";
2751           title = labelname + "DenominatorPFEta_HighpTcut;PF #eta ";
2752           MonitorElement* DenominatorPFEta_HighpTcut =
2753               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2754           DenominatorPFEta_HighpTcut->getTH1();
2755 
2756           histoname = labelname + "_DenominatorPFPhi_HighpTcut";
2757           title = labelname + "DenominatorPFPhi_HighpTcut;PF #Phi";
2758           MonitorElement* DenominatorPFPhi_HighpTcut =
2759               iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
2760           DenominatorPFPhi_HighpTcut->getTH1();
2761 
2762           histoname = labelname + "_DenominatorPFEtaPhi_HighpTcut";
2763           title = labelname + "DenominatorPFEtaPhi_HighpTcut;PF #eta;Calo #Phi";
2764           MonitorElement* DenominatorPFEtaPhi_HighpTcut =
2765               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Phibins_, PhiMin_, PhiMax_);
2766           DenominatorPFEtaPhi_HighpTcut->getTH1();
2767 
2768           histoname = labelname + "_PFDeltaR";
2769           title = labelname + "PFDeltaR;";
2770           MonitorElement* PFDeltaR = iBooker.book1D(histoname.c_str(), title.c_str(), 100, 0., 1.5);
2771           PFDeltaR->getTH1();
2772 
2773           histoname = labelname + "_PFDeltaPhi";
2774           title = labelname + "PFDeltaPhi;";
2775           MonitorElement* PFDeltaPhi = iBooker.book1D(histoname.c_str(), title.c_str(), 500, -5.0, 5.0);
2776           PFDeltaPhi->getTH1();
2777 
2778           v.setEffHistos(NumeratorPt,
2779                          NumeratorPtBarrel,
2780                          NumeratorPtEndcap,
2781                          NumeratorPtForward,
2782                          NumeratorEta,
2783                          NumeratorPhi,
2784                          NumeratorEtaPhi,
2785                          //
2786                          NumeratorEtaBarrel,
2787                          NumeratorPhiBarrel,
2788                          NumeratorEtaEndcap,
2789                          NumeratorPhiEndcap,
2790                          NumeratorEtaForward,
2791                          NumeratorPhiForward,
2792                          NumeratorEta_LowpTcut,
2793                          NumeratorPhi_LowpTcut,
2794                          NumeratorEtaPhi_LowpTcut,
2795                          NumeratorEta_MedpTcut,
2796                          NumeratorPhi_MedpTcut,
2797                          NumeratorEtaPhi_MedpTcut,
2798                          NumeratorEta_HighpTcut,
2799                          NumeratorPhi_HighpTcut,
2800                          NumeratorEtaPhi_HighpTcut,
2801                          //
2802                          DenominatorPt,
2803                          DenominatorPtBarrel,
2804                          DenominatorPtEndcap,
2805                          DenominatorPtForward,
2806                          DenominatorEta,
2807                          DenominatorPhi,
2808                          DenominatorEtaPhi,
2809                          //
2810                          DenominatorEtaBarrel,
2811                          DenominatorPhiBarrel,
2812                          DenominatorEtaEndcap,
2813                          DenominatorPhiEndcap,
2814                          DenominatorEtaForward,
2815                          DenominatorPhiForward,
2816                          DenominatorEta_LowpTcut,
2817                          DenominatorPhi_LowpTcut,
2818                          DenominatorEtaPhi_LowpTcut,
2819                          DenominatorEta_MedpTcut,
2820                          DenominatorPhi_MedpTcut,
2821                          DenominatorEtaPhi_MedpTcut,
2822                          DenominatorEta_HighpTcut,
2823                          DenominatorPhi_HighpTcut,
2824                          DenominatorEtaPhi_HighpTcut,
2825                          DeltaR,
2826                          DeltaPhi,
2827                          //
2828                          NumeratorPFPt,
2829                          NumeratorPFMHT,
2830                          NumeratorPFPtBarrel,
2831                          NumeratorPFPtEndcap,
2832                          NumeratorPFPtForward,
2833                          NumeratorPFEta,
2834                          NumeratorPFPhi,
2835                          NumeratorPFEtaPhi,
2836                          NumeratorPFEtaBarrel,
2837                          NumeratorPFPhiBarrel,
2838                          NumeratorPFEtaEndcap,
2839                          NumeratorPFPhiEndcap,
2840                          NumeratorPFEtaForward,
2841                          NumeratorPFPhiForward,
2842                          NumeratorPFEta_LowpTcut,
2843                          NumeratorPFPhi_LowpTcut,
2844                          NumeratorPFEtaPhi_LowpTcut,
2845                          NumeratorPFEta_MedpTcut,
2846                          NumeratorPFPhi_MedpTcut,
2847                          NumeratorPFEtaPhi_MedpTcut,
2848                          NumeratorPFEta_HighpTcut,
2849                          NumeratorPFPhi_HighpTcut,
2850                          NumeratorPFEtaPhi_HighpTcut,
2851                          DenominatorPFPt,
2852                          DenominatorPFMHT,
2853                          DenominatorPFPtBarrel,
2854                          DenominatorPFPtEndcap,
2855                          DenominatorPFPtForward,
2856                          DenominatorPFEta,
2857                          DenominatorPFPhi,
2858                          DenominatorPFEtaPhi,
2859                          DenominatorPFEtaBarrel,
2860                          DenominatorPFPhiBarrel,
2861                          DenominatorPFEtaEndcap,
2862                          DenominatorPFPhiEndcap,
2863                          DenominatorPFEtaForward,
2864                          DenominatorPFPhiForward,
2865                          DenominatorPFEta_LowpTcut,
2866                          DenominatorPFPhi_LowpTcut,
2867                          DenominatorPFEtaPhi_LowpTcut,
2868                          DenominatorPFEta_MedpTcut,
2869                          DenominatorPFPhi_MedpTcut,
2870                          DenominatorPFEtaPhi_MedpTcut,
2871                          DenominatorPFEta_HighpTcut,
2872                          DenominatorPFPhi_HighpTcut,
2873                          DenominatorPFEtaPhi_HighpTcut,
2874                          PFDeltaR,
2875                          PFDeltaPhi);
2876 
2877         }  // Loop over Jet Trigger
2878 
2879         if ((v.getObjectType() == trigger::TriggerJet) && (v.getTriggerType() == "DiJet_Trigger")) {
2880           histoname = labelname + "_NumeratorAvrgPt";
2881           title = labelname + "NumeratorAvrgPt;Calo Pt[GeV/c]";
2882           MonitorElement* NumeratorPt = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2883           NumeratorPt->getTH1();
2884 
2885           histoname = labelname + "_NumeratorAvrgEta";
2886           title = labelname + "NumeratorAvrgEta;Calo #eta";
2887           MonitorElement* NumeratorEta = iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2888           NumeratorEta->getTH1();
2889 
2890           histoname = labelname + "_DenominatorAvrgPt";
2891           title = labelname + "DenominatorAvrgPt;Calo Pt[GeV/c] ";
2892           MonitorElement* DenominatorPt = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2893           DenominatorPt->getTH1();
2894 
2895           histoname = labelname + "_DenominatorAvrgEta";
2896           title = labelname + "DenominatorAvrgEta;Calo #eta";
2897           MonitorElement* DenominatorEta = iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2898           DenominatorEta->getTH1();
2899 
2900           histoname = labelname + "_DeltaR";
2901           title = labelname + "DeltaR;";
2902           MonitorElement* DeltaR = iBooker.book1D(histoname.c_str(), title.c_str(), 100, 0., 1.5);
2903           DeltaR->getTH1();
2904 
2905           histoname = labelname + "_DeltaPhi";
2906           title = labelname + "DeltaPhi;";
2907           MonitorElement* DeltaPhi = iBooker.book1D(histoname.c_str(), title.c_str(), 500, -5., 5.);
2908           DeltaPhi->getTH1();
2909 
2910           //add PF histo: SJ
2911           histoname = labelname + "_NumeratorAvrgPFPt";
2912           title = labelname + "NumeratorAvrgPFPt;PF Pt[GeV/c]";
2913           MonitorElement* NumeratorPFPt = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2914           NumeratorPFPt->getTH1();
2915 
2916           histoname = labelname + "_NumeratorAvrgPFEta";
2917           title = labelname + "NumeratorAvrgPFEta;PF #eta";
2918           MonitorElement* NumeratorPFEta = iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2919           NumeratorPFEta->getTH1();
2920 
2921           histoname = labelname + "_DenominatorAvrgPFPt";
2922           title = labelname + "DenominatorAvrgPFPt;PF Pt[GeV/c] ";
2923           MonitorElement* DenominatorPFPt = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
2924           DenominatorPFPt->getTH1();
2925 
2926           histoname = labelname + "_DenominatorAvrgPFEta";
2927           title = labelname + "DenominatorAvrgPFEta;PF #eta";
2928           MonitorElement* DenominatorPFEta =
2929               iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
2930           DenominatorPFEta->getTH1();
2931 
2932           histoname = labelname + "_PFDeltaR";
2933           title = labelname + "PFDeltaR;";
2934           MonitorElement* PFDeltaR = iBooker.book1D(histoname.c_str(), title.c_str(), 100, 0., 1.5);
2935           PFDeltaR->getTH1();
2936 
2937           histoname = labelname + "_PFDeltaPhi";
2938           title = labelname + "PFDeltaPhi;";
2939           MonitorElement* PFDeltaPhi = iBooker.book1D(histoname.c_str(), title.c_str(), 500, -5., 5.);
2940           PFDeltaPhi->getTH1();
2941 
2942           v.setEffHistos(dummy,
2943                          dummy,
2944                          dummy,
2945                          dummy,
2946                          dummy,
2947                          dummy,
2948                          dummy,
2949                          dummy,
2950                          dummy,
2951                          dummy,
2952                          dummy,
2953                          dummy,
2954                          dummy,
2955                          dummy,
2956                          dummy,
2957                          dummy,
2958                          dummy,
2959                          dummy,
2960                          dummy,
2961                          dummy,
2962                          dummy,
2963                          dummy,
2964                          dummy,
2965                          dummy,
2966                          dummy,
2967                          dummy,
2968                          dummy,
2969                          dummy,
2970                          dummy,
2971                          dummy,
2972                          dummy,
2973                          dummy,
2974                          dummy,
2975                          dummy,
2976                          dummy,
2977                          dummy,
2978                          dummy,
2979                          dummy,
2980                          dummy,
2981                          dummy,
2982                          dummy,
2983                          dummy,
2984                          dummy,
2985                          dummy,
2986                          dummy,
2987                          dummy,
2988                          dummy,
2989                          dummy,
2990                          dummy,
2991                          dummy,
2992                          dummy,
2993                          dummy,
2994                          dummy,
2995                          dummy,
2996                          dummy,
2997                          dummy,
2998                          dummy,
2999                          dummy,
3000                          dummy,
3001                          dummy,
3002                          dummy,
3003                          dummy,
3004                          dummy,
3005                          dummy,
3006                          dummy,
3007                          dummy,
3008                          dummy,
3009                          dummy,
3010                          dummy,
3011                          dummy,
3012                          dummy,
3013                          dummy,
3014                          dummy,
3015                          dummy,
3016                          dummy,
3017                          dummy,
3018                          dummy,
3019                          dummy,
3020                          dummy,
3021                          dummy,
3022                          dummy,
3023                          dummy,
3024                          dummy,
3025                          dummy,
3026                          dummy,
3027                          dummy,
3028                          dummy,
3029                          dummy,
3030                          dummy,
3031                          dummy,
3032                          dummy,
3033                          dummy,
3034                          dummy,
3035                          dummy);
3036         }
3037 
3038         if (v.getObjectType() == trigger::TriggerMET || (v.getObjectType() == trigger::TriggerTET)) {
3039           histoname = labelname + "_NumeratorPt";
3040           if (v.getPath().find("HLT_PFMET") == std::string::npos)
3041             title = labelname + "NumeratorPt; CaloMET[GeV/c]";
3042           else
3043             title = labelname + "NumeratorPt; PFMET[GeV/c]";
3044           MonitorElement* NumeratorPt = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
3045           NumeratorPt->getTH1();
3046 
3047           histoname = labelname + "_NumeratorPhi";
3048           title = labelname + "NumeratorPhi; #Phi";
3049           MonitorElement* NumeratorPhi = iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
3050           NumeratorPhi->getTH1();
3051 
3052           histoname = labelname + "_DenominatorPt";
3053           if (v.getPath().find("HLT_PFMET") == std::string::npos)
3054             title = labelname + "DenominatorPt; CaloMET[GeV/c]";
3055           else
3056             title = labelname + "DenominatorPt; PFMET[GeV/c]";
3057           MonitorElement* DenominatorPt = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
3058           DenominatorPt->getTH1();
3059 
3060           histoname = labelname + "_DenominatorPhi";
3061           title = labelname + "DenominatorPhi; #Phi";
3062           MonitorElement* DenominatorPhi = iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
3063           DenominatorPhi->getTH1();
3064 
3065           v.setEffHistos(NumeratorPt,
3066                          dummy,
3067                          dummy,
3068                          dummy,
3069                          dummy,
3070                          NumeratorPhi,
3071                          dummy,
3072                          dummy,
3073                          dummy,
3074                          dummy,
3075                          dummy,
3076                          dummy,
3077                          dummy,
3078                          dummy,
3079                          dummy,
3080                          dummy,
3081                          dummy,
3082                          dummy,
3083                          dummy,
3084                          dummy,
3085                          dummy,
3086                          dummy,
3087                          DenominatorPt,
3088                          dummy,
3089                          dummy,
3090                          dummy,
3091                          dummy,
3092                          DenominatorPhi,
3093                          dummy,
3094                          dummy,
3095                          dummy,
3096                          dummy,
3097                          dummy,
3098                          dummy,
3099                          dummy,
3100                          dummy,
3101                          dummy,
3102                          dummy,
3103                          dummy,
3104                          dummy,
3105                          dummy,
3106                          dummy,
3107                          dummy,
3108                          dummy,
3109                          dummy,
3110                          dummy,
3111                          dummy,
3112                          dummy,
3113                          dummy,
3114                          dummy,
3115                          dummy,
3116                          dummy,
3117                          dummy,
3118                          dummy,
3119                          dummy,
3120                          dummy,
3121                          dummy,
3122                          dummy,
3123                          dummy,
3124                          dummy,
3125                          dummy,
3126                          dummy,
3127                          dummy,
3128                          dummy,
3129                          dummy,
3130                          dummy,
3131                          dummy,
3132                          dummy,
3133                          dummy,
3134                          dummy,
3135                          dummy,
3136                          dummy,
3137                          dummy,
3138                          dummy,
3139                          dummy,
3140                          dummy,
3141                          dummy,
3142                          dummy,
3143                          dummy,
3144                          dummy,
3145                          dummy,
3146                          dummy,
3147                          dummy,
3148                          dummy,
3149                          dummy,
3150                          dummy,
3151                          dummy,
3152                          dummy,
3153                          dummy,
3154                          dummy,
3155                          dummy,
3156                          dummy,
3157                          dummy,
3158                          dummy);
3159         }  // Loop over MET trigger
3160       }
3161     }  //plotEff_
3162 
3163     if (runStandalone_) {  //runStandalone
3164       //--------Histos to see WHY trigger is NOT fired----------
3165       int Nbins_ = 10;
3166       int Nmin_ = 0;
3167       int Nmax_ = 10;
3168       int Ptbins_ = 1000;
3169       int Etabins_ = 40;
3170       int Phibins_ = 35;
3171       double PtMin_ = 0.;
3172       double PtMax_ = 1000.;
3173       double EtaMin_ = -5.;
3174       double EtaMax_ = 5.;
3175       double PhiMin_ = -3.14159;
3176       double PhiMax_ = 3.14159;
3177 
3178       std::string dirName4_ = dirname_ + "/TriggerNotFired/";
3179       //      iBooker.setCurrentFolder(dirName4);
3180 
3181       for (auto& v : hltPathsAll_) {
3182         MonitorElement* dummy;
3183         dummy = iBooker.bookFloat("dummy");
3184 
3185         std::string labelname("ME");
3186         std::string histoname(labelname + "");
3187         std::string title(labelname + "");
3188         iBooker.setCurrentFolder(dirName4_ + v.getPath());
3189 
3190         histoname = labelname + "_TriggerSummary";
3191         title = labelname + "Summary of trigger levels";
3192         MonitorElement* TriggerSummary = iBooker.book1D(histoname.c_str(), title.c_str(), 7, -0.5, 6.5);
3193 
3194         std::vector<std::string> trigger;
3195         trigger.emplace_back("Nevt");
3196         trigger.emplace_back("L1 failed");
3197         trigger.emplace_back("L1 & HLT failed");
3198         trigger.emplace_back("L1 failed but not HLT");
3199         trigger.emplace_back("L1 passed");
3200         trigger.emplace_back("L1 & HLT passed");
3201         trigger.emplace_back("L1 passed but not HLT");
3202 
3203         for (unsigned int i = 0; i < trigger.size(); i++)
3204           TriggerSummary->setBinLabel(i + 1, trigger[i]);
3205 
3206         if ((v.getTriggerType() == "SingleJet_Trigger")) {
3207           histoname = labelname + "_JetPt";
3208           title = labelname + "Leading jet pT;Pt[GeV/c]";
3209           MonitorElement* JetPt = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
3210           JetPt->getTH1();
3211 
3212           histoname = labelname + "_JetEtaVsPt";
3213           title = labelname + "Leading jet #eta vs pT;#eta;Pt[GeV/c]";
3214           MonitorElement* JetEtaVsPt =
3215               iBooker.book2D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_, Ptbins_, PtMin_, PtMax_);
3216           JetEtaVsPt->getTH1();
3217 
3218           histoname = labelname + "_JetPhiVsPt";
3219           title = labelname + "Leading jet #Phi vs pT;#Phi;Pt[GeV/c]";
3220           MonitorElement* JetPhiVsPt =
3221               iBooker.book2D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_, Ptbins_, PtMin_, PtMax_);
3222           JetPhiVsPt->getTH1();
3223 
3224           v.setDgnsHistos(
3225               TriggerSummary, dummy, JetPt, JetEtaVsPt, JetPhiVsPt, dummy, dummy, dummy, dummy, dummy, dummy);
3226         }  // single Jet trigger
3227 
3228         if ((v.getTriggerType() == "DiJet_Trigger")) {
3229           histoname = labelname + "_JetSize";
3230           title = labelname + "Jet Size;multiplicity";
3231           MonitorElement* JetSize = iBooker.book1D(histoname.c_str(), title.c_str(), Nbins_, Nmin_, Nmax_);
3232           JetSize->getTH1();
3233 
3234           histoname = labelname + "_AvergPt";
3235           title = labelname + "Average Pt;Pt[GeV/c]";
3236           MonitorElement* Pt12 = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
3237           Pt12->getTH1();
3238 
3239           histoname = labelname + "_AvergEta";
3240           title = labelname + "Average Eta;#eta";
3241           MonitorElement* Eta12 = iBooker.book1D(histoname.c_str(), title.c_str(), Etabins_, EtaMin_, EtaMax_);
3242           Eta12->getTH1();
3243 
3244           histoname = labelname + "_PhiDifference";
3245           title = labelname + "#Delta#Phi;#Delta#Phi";
3246           MonitorElement* Phi12 = iBooker.book1D(histoname.c_str(), title.c_str(), Phibins_, PhiMin_, PhiMax_);
3247           Phi12->getTH1();
3248 
3249           histoname = labelname + "_Pt3Jet";
3250           title = labelname + "Pt of 3rd Jet;Pt[GeV/c]";
3251           MonitorElement* Pt3 = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
3252           Pt3->getTH1();
3253 
3254           histoname = labelname + "_Pt12VsPt3Jet";
3255           title = labelname + "Pt of 3rd Jet vs Average Pt of leading jets;Avergage Pt[GeV/c]; Pt of 3rd Jet [GeV/c]";
3256           MonitorElement* Pt12Pt3 =
3257               iBooker.book2D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_, Ptbins_, PtMin_, PtMax_);
3258           Pt12Pt3->getTH1();
3259 
3260           histoname = labelname + "_Pt12VsPhi12";
3261           title = labelname +
3262                   "Average Pt of leading jets vs #Delta#Phi between leading jets;Avergage Pt[GeV/c]; #Delta#Phi";
3263           MonitorElement* Pt12Phi12 =
3264               iBooker.book2D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_, Phibins_, PhiMin_, PhiMax_);
3265           Pt12Phi12->getTH1();
3266 
3267           v.setDgnsHistos(TriggerSummary, JetSize, dummy, dummy, dummy, Pt12, Eta12, Phi12, Pt3, Pt12Pt3, Pt12Phi12);
3268         }  // Dijet Jet trigger
3269 
3270         if ((v.getTriggerType() == "MET_Trigger")) {
3271           histoname = labelname + "_MET";
3272           title = labelname + "MET;Pt[GeV/c]";
3273           MonitorElement* MET = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
3274           MET->getTH1();
3275 
3276           v.setDgnsHistos(TriggerSummary, dummy, MET, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy);
3277         }  // MET trigger
3278 
3279         if ((v.getTriggerType() == "TET_Trigger")) {
3280           histoname = labelname + "_TET";
3281           title = labelname + "TET;Pt[GeV/c]";
3282           MonitorElement* TET = iBooker.book1D(histoname.c_str(), title.c_str(), Ptbins_, PtMin_, PtMax_);
3283           TET->getTH1();
3284 
3285           v.setDgnsHistos(TriggerSummary, dummy, TET, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy);
3286         }  // TET trigger
3287       }
3288     }  //runStandalone
3289   }
3290 }
3291 //------------------------------------------------------------------------//
3292 const std::string JetMETHLTOfflineSource::getL1ConditionModuleName(const std::string& pathname) {
3293   // find L1 condition for numpath with numpath objecttype
3294   // find PSet for L1 global seed for numpath,
3295   // list module labels for numpath
3296   std::string l1pathname = "dummy";
3297 
3298   std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(pathname);
3299 
3300   for (auto& numpathmodule : numpathmodules) {
3301     if (hltConfig_.moduleType(numpathmodule) == "HLTLevel1GTSeed") {
3302       l1pathname = numpathmodule;
3303       break;
3304     }
3305   }
3306   return l1pathname;
3307 }
3308 
3309 //------------------------------------------------------------------------//
3310 bool JetMETHLTOfflineSource::isBarrel(double eta) {
3311   bool output = false;
3312   if (fabs(eta) <= 1.3)
3313     output = true;
3314   return output;
3315 }
3316 
3317 //------------------------------------------------------------------------//
3318 bool JetMETHLTOfflineSource::isEndCap(double eta) {
3319   bool output = false;
3320   if (fabs(eta) <= 3.0 && fabs(eta) > 1.3)
3321     output = true;
3322   return output;
3323 }
3324 
3325 //------------------------------------------------------------------------//
3326 bool JetMETHLTOfflineSource::isForward(double eta) {
3327   bool output = false;
3328   if (fabs(eta) > 3.0)
3329     output = true;
3330   return output;
3331 }
3332 
3333 //------------------------------------------------------------------------//
3334 bool JetMETHLTOfflineSource::validPathHLT(std::string pathname) {
3335   // hltConfig_ has to be defined first before calling this method
3336   bool output = false;
3337   for (unsigned int j = 0; j != hltConfig_.size(); ++j) {
3338     if (hltConfig_.triggerName(j) == pathname)
3339       output = true;
3340   }
3341   return output;
3342 }
3343 
3344 //------------------------------------------------------------------------//
3345 bool JetMETHLTOfflineSource::isHLTPathAccepted(std::string pathName) {
3346   // triggerResults_, triggerNames_ has to be defined first before calling this method
3347   bool output = false;
3348   if (triggerResults_.isValid()) {
3349     unsigned index = triggerNames_.triggerIndex(pathName);
3350     if (index < triggerNames_.size() && triggerResults_->accept(index))
3351       output = true;
3352   }
3353   return output;
3354 }
3355 
3356 //------------------------------------------------------------------------//
3357 // This returns the position of trigger name defined in summary histograms
3358 double JetMETHLTOfflineSource::TriggerPosition(std::string trigName) {
3359   int nbins = rate_All->getTH1()->GetNbinsX();
3360   double binVal = -100;
3361   for (int ibin = 1; ibin < nbins + 1; ibin++) {
3362     const char* binLabel = rate_All->getTH1()->GetXaxis()->GetBinLabel(ibin);
3363     if (binLabel[0] == '\0')
3364       continue;
3365     //       std::string binLabel_str = string(binLabel);
3366     //       if(binLabel_str.compare(trigName)!=0)continue;
3367     if (trigName != binLabel)
3368       continue;
3369 
3370     if (trigName == binLabel) {
3371       binVal = rate_All->getTH1()->GetBinCenter(ibin);
3372       break;
3373     }
3374   }
3375   return binVal;
3376 }
3377 
3378 //------------------------------------------------------------------------//
3379 bool JetMETHLTOfflineSource::isTriggerObjectFound(std::string objectName) {
3380   // processname_, triggerObj_ has to be defined before calling this method
3381   bool output = false;
3382   edm::InputTag testTag(objectName, "", processname_);
3383   const int index = triggerObj_->filterIndex(testTag);
3384   if (index >= triggerObj_->sizeFilters()) {
3385     edm::LogInfo("JetMETHLTOfflineSource") << "no index " << index << " of that name ";
3386   } else {
3387     const trigger::Keys& k = triggerObj_->filterKeys(index);
3388     if (!k.empty())
3389       output = true;
3390   }
3391   return output;
3392 }
3393 //------------------------------------------------------------------------//
3394 
3395 #include "FWCore/Framework/interface/MakerMacros.h"
3396 DEFINE_FWK_MODULE(JetMETHLTOfflineSource);