CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/DQMOffline/Trigger/src/JetMETHLTOfflineSource.cc

Go to the documentation of this file.
00001 /*
00002   JetMETHLTOffline DQM code
00003   Responsible: Sunil Bansal, Shabnam Jabeen, Michael Luk, Phat Srimanobhas
00004   Contact: Phat Srimanobhas (srimanob@mail.cern.ch)
00005   Last modified: 31 July 2012
00006 */
00007 
00008 #include "DQMOffline/Trigger/interface/JetMETHLTOfflineSource.h"
00009 
00010 #include "FWCore/Common/interface/TriggerNames.h"
00011 #include "FWCore/Framework/interface/EDAnalyzer.h"
00012 #include "FWCore/Framework/interface/Run.h"
00013 #include "FWCore/Framework/interface/MakerMacros.h"
00014 #include "FWCore/Framework/interface/ESHandle.h"
00015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00016 #include "FWCore/ServiceRegistry/interface/Service.h"
00017 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00018 
00019 #include "DataFormats/Common/interface/Handle.h"
00020 #include "DataFormats/Common/interface/TriggerResults.h"
00021 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
00022 #include "DataFormats/HLTReco/interface/TriggerObject.h"
00023 #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
00024 #include "DataFormats/Math/interface/deltaR.h"
00025 
00026 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
00027 
00028 #include "JetMETCorrections/Objects/interface/JetCorrector.h"
00029 
00030 #include "DQMServices/Core/interface/MonitorElement.h"
00031 
00032 #include "TMath.h"
00033 #include "TH1F.h"
00034 #include "TH2F.h"
00035 #include "TProfile.h"
00036 #include "TPRegexp.h"
00037 
00038 #include "math.h"
00039 
00040 using namespace edm;
00041 using namespace reco;
00042 using namespace std;
00043 using namespace trigger;
00044   
00045 JetMETHLTOfflineSource::JetMETHLTOfflineSource(const edm::ParameterSet& iConfig):
00046   isSetup_(false)
00047 {
00048   LogDebug("JetMETHLTOfflineSource") << "constructor....";
00049   
00050   dbe = Service < DQMStore > ().operator->();
00051   if ( ! dbe ) {
00052     LogDebug("JetMETHLTOfflineSource") << "unabel to get DQMStore service?";
00053   }
00054   if (iConfig.getUntrackedParameter < bool > ("DQMStore", false)) {
00055     dbe->setVerbose(0);
00056   }
00057   //
00058   dirname_             = iConfig.getUntrackedParameter("dirname",std::string("HLT/JetMET/"));
00059   processname_         = iConfig.getParameter<std::string>("processname");
00060   triggerSummaryLabel_ = iConfig.getParameter<edm::InputTag>("triggerSummaryLabel");
00061   triggerResultsLabel_ = iConfig.getParameter<edm::InputTag>("triggerResultsLabel");
00062   //
00063   verbose_             = iConfig.getUntrackedParameter< bool >("verbose", false);
00064   runStandalone_       = iConfig.getUntrackedParameter< bool >("runStandalone", false);
00065   //
00066   plotAll_             = iConfig.getUntrackedParameter< bool >("plotAll", true);
00067   plotAllwrtMu_        = iConfig.getUntrackedParameter< bool >("plotAllwrtMu", false);
00068   plotEff_             = iConfig.getUntrackedParameter< bool >("plotEff", true); 
00069   plotEffwrtMu_        = iConfig.getUntrackedParameter< bool >("plotEffwrtMu", false); 
00070   plotEffwrtMB_        = iConfig.getUntrackedParameter< bool >("plotEffwrtMB", false);
00071   nameForEff_          = iConfig.getUntrackedParameter< bool >("nameForEff", true); 
00072   MuonTrigPaths_       = iConfig.getUntrackedParameter<vector<std::string> >("pathnameMuon");
00073   MBTrigPaths_         = iConfig.getUntrackedParameter<vector<std::string> >("pathnameMB");
00074   //CaloJet, CaloMET
00075   caloJetsTag_         = iConfig.getParameter<edm::InputTag>("CaloJetCollectionLabel");
00076   caloMETTag_          = iConfig.getParameter<edm::InputTag>("CaloMETCollectionLabel");
00077   //PFJet, PFMET
00078   pfJetsTag_           = iConfig.getParameter<edm::InputTag>("PFJetCollectionLabel");
00079   pfMETTag_            = iConfig.getParameter<edm::InputTag>("PFMETCollectionLabel");
00080   //pfmhtTag_       = iConfig.getParameter<edm::InputTag>("PFMHTCollectionLabel");
00081   //
00082   CaloJetCorService_   = iConfig.getParameter<std::string>("CaloJetCorService");
00083   PFJetCorService_     = iConfig.getParameter<std::string>("PFJetCorService");
00084   //JetID
00085   jetID                = new reco::helper::JetIDHelper(iConfig.getParameter<ParameterSet>("JetIDParams"));
00086   _fEMF                = iConfig.getUntrackedParameter< double >("fEMF", 0.01);
00087   _feta                = iConfig.getUntrackedParameter< double >("feta", 2.60);
00088   _fHPD                = iConfig.getUntrackedParameter< double >("fHPD", 0.98);
00089   _n90Hits             = iConfig.getUntrackedParameter< double >("n90Hits", 1.0);
00090   _min_NHEF            = iConfig.getUntrackedParameter< double >("minNHEF",0.); 
00091   _max_NHEF            = iConfig.getUntrackedParameter< double >("maxNHEF",0.99);
00092   _min_CHEF            = iConfig.getUntrackedParameter< double >("minCHEF",0.);
00093   _max_CHEF            = iConfig.getUntrackedParameter< double >("maxCHEF",1.);
00094   _min_NEMF            = iConfig.getUntrackedParameter< double >("minNEMF",0.);
00095   _max_NEMF            = iConfig.getUntrackedParameter< double >("maxNEMF",0.99);
00096   _min_CEMF            = iConfig.getUntrackedParameter< double >("minCEMF",0.);
00097   _max_CEMF            = iConfig.getUntrackedParameter< double >("maxCEMF",0.99);
00098   //Paths
00099   pathFilter_          = iConfig.getUntrackedParameter<vector<std::string> >("pathFilter");
00100   pathRejectKeyword_   = iConfig.getUntrackedParameter<vector<std::string> >("pathRejectKeyword");
00101   std::vector<edm::ParameterSet> paths =  iConfig.getParameter<std::vector<edm::ParameterSet> >("pathPairs");
00102   for(std::vector<edm::ParameterSet>::iterator pathconf = paths.begin() ; pathconf != paths.end();  pathconf++) { 
00103     custompathnamepairs_.push_back(make_pair(
00104                                              pathconf->getParameter<std::string>("pathname"),
00105                                              pathconf->getParameter<std::string>("denompathname")
00106                                              ));
00107   }
00108 }
00109 
00110 
00111 JetMETHLTOfflineSource::~JetMETHLTOfflineSource()
00112 { 
00113   //
00114   // do anything here that needs to be done at desctruction time
00115   // (e.g. close files, deallocate resources etc.)
00116 }
00117 
00118 
00119 void
00120 JetMETHLTOfflineSource::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
00121 { 
00122   //---------- triggerResults ----------
00123   iEvent.getByLabel(triggerResultsLabel_, triggerResults_);
00124   if(!triggerResults_.isValid()) {
00125     edm::InputTag triggerResultsLabelFU(triggerResultsLabel_.label(),triggerResultsLabel_.instance(), "FU");
00126     iEvent.getByLabel(triggerResultsLabelFU,triggerResults_);
00127     if(!triggerResults_.isValid()) {
00128       edm::LogInfo("FourVectorHLTOffline") << "TriggerResults not found, "
00129         "skipping event";
00130       return;
00131     }
00132   }
00133   
00134   //---------- triggerResults ----------
00135   //int npath;
00136   if(&triggerResults_) {  
00137     // Check how many HLT triggers are in triggerResults
00138     //npath = triggerResults_->size();
00139     triggerNames_ = iEvent.triggerNames(*triggerResults_);
00140   } 
00141   else {
00142     edm::LogInfo("CaloMETHLTOfflineSource") << "TriggerResults::HLT not found, "
00143       "automatically select events";
00144     return;
00145   } 
00146   
00147   //---------- triggerSummary ----------
00148   iEvent.getByLabel(triggerSummaryLabel_,triggerObj_);
00149   if(!triggerObj_.isValid()) {
00150     edm::InputTag triggerSummaryLabelFU(triggerSummaryLabel_.label(),triggerSummaryLabel_.instance(), "FU");
00151     iEvent.getByLabel(triggerSummaryLabelFU,triggerObj_);
00152     if(!triggerObj_.isValid()) {
00153       edm::LogInfo("FourVectorHLTOffline") << "TriggerEvent not found, "
00154         "skipping event";
00155       return;
00156     }
00157   } 
00158   
00159   //------------ Offline Objects -------
00160   bool ValidJetColl_ = iEvent.getByLabel(caloJetsTag_,calojetColl_);
00161   if(!ValidJetColl_) return;
00162   calojet = *calojetColl_; 
00163   //std::stable_sort( calojet.begin(), calojet.end(), PtSorter() ); 
00164   
00165   bool ValidPFJetColl_ = iEvent.getByLabel(pfJetsTag_,pfjetColl_);
00166   if(!ValidPFJetColl_) return;
00167   pfjet = *pfjetColl_; 
00168   //std::stable_sort( pfjet.begin(), pfjet.end(), PtSorter() );
00169   
00170   bool ValidMETColl_ = iEvent.getByLabel(caloMETTag_, calometColl_);
00171   if(!ValidMETColl_) return;
00172   
00173   bool ValidPFMETColl_ = iEvent.getByLabel(pfMETTag_, pfmetColl_);
00174   if(!ValidPFMETColl_) return; 
00175   
00176   //---------- Event counting (DEBUG) ----------
00177   if(verbose_ && iEvent.id().event()%10000==0)
00178     cout<<"Run = "<<iEvent.id().run()<<", LS = "<<iEvent.luminosityBlock()<<", Event = "<<iEvent.id().event()<<endl;  
00179   
00180   //Define on-the-fly correction Jet
00181   for(int i=0; i<2; i++){
00182     CaloJetPx[i]   = 0.;
00183     CaloJetPy[i]   = 0.;
00184     CaloJetPt[i]   = 0.;
00185     CaloJetEta[i]  = 0.;
00186     CaloJetPhi[i]  = 0.;
00187     CaloJetEMF[i]  = 0.;
00188     CaloJetfHPD[i] = 0.;
00189     CaloJetn90[i]  = 0.;
00190     PFJetPx[i]     = 0.;
00191     PFJetPy[i]     = 0.;
00192     PFJetPt[i]     = 0.;
00193     PFJetEta[i]    = 0.;
00194     PFJetPhi[i]    = 0.;
00195     PFJetNHEF[i]   = 0.;
00196     PFJetCHEF[i]   = 0.;
00197     PFJetNEMF[i]   = 0.;
00198     PFJetCEMF[i]   = 0.;
00199   }
00200 
00201   //---------- CaloJet Correction (on-the-fly) ----------
00202   const JetCorrector* calocorrector = JetCorrector::getJetCorrector(CaloJetCorService_,iSetup);
00203   CaloJetCollection::const_iterator calojet_ = calojet.begin();
00204   for(; calojet_ != calojet.end(); ++calojet_){
00205     double scale = calocorrector->correction(*calojet_,iEvent, iSetup); 
00206     jetID->calculate(iEvent, *calojet_);
00207     
00208     if(scale*calojet_->pt()>CaloJetPt[0]){
00209       CaloJetPt[1]   = CaloJetPt[0]; 
00210       CaloJetPx[1]   = CaloJetPx[0];
00211       CaloJetPy[1]   = CaloJetPy[0];
00212       CaloJetEta[1]  = CaloJetEta[0];
00213       CaloJetPhi[1]  = CaloJetPhi[0];
00214       CaloJetEMF[1]  = CaloJetEMF[0];
00215       CaloJetfHPD[1] = CaloJetfHPD[0];
00216       CaloJetn90[1]  = CaloJetn90[0];
00217       //
00218       CaloJetPt[0]   = scale*calojet_->pt();
00219       CaloJetPx[0]   = scale*calojet_->px();
00220       CaloJetPy[0]   = scale*calojet_->py();
00221       CaloJetEta[0]  = calojet_->eta();
00222       CaloJetPhi[0]  = calojet_->phi();
00223       CaloJetEMF[0]  = calojet_->emEnergyFraction();
00224       CaloJetfHPD[0] = jetID->fHPD();
00225       CaloJetn90[0]  = jetID->n90Hits();
00226     }
00227     else if(scale*calojet_->pt()<CaloJetPt[0] && scale*calojet_->pt()>CaloJetPt[1] ){
00228       CaloJetPt[1]   = scale*calojet_->pt();
00229       CaloJetPx[1]   = scale*calojet_->px();
00230       CaloJetPy[1]   = scale*calojet_->py();
00231       CaloJetEta[1]  = calojet_->eta();
00232       CaloJetPhi[1]  = calojet_->phi();
00233       CaloJetEMF[1]  = calojet_->emEnergyFraction();
00234       CaloJetfHPD[1] = jetID->fHPD();
00235       CaloJetn90[1]  = jetID->n90Hits();
00236     }
00237     else{}
00238   }
00239   
00240   //---------- PFJet Correction (on-the-fly) ----------
00241   pfMHTx_All = 0.;
00242   pfMHTy_All = 0.;
00243   const JetCorrector* pfcorrector = JetCorrector::getJetCorrector(PFJetCorService_,iSetup);
00244   PFJetCollection::const_iterator pfjet_ = pfjet.begin();
00245   for(; pfjet_ != pfjet.end(); ++pfjet_){
00246     double scale = pfcorrector->correction(*pfjet_,iEvent, iSetup);
00247     pfMHTx_All = pfMHTx_All + scale*pfjet_->px();
00248     pfMHTy_All = pfMHTy_All + scale*pfjet_->py();
00249     if(scale*pfjet_->pt()>PFJetPt[0]){
00250       PFJetPt[1]   = PFJetPt[0];
00251       PFJetPx[1]   = PFJetPx[0];
00252       PFJetPy[1]   = PFJetPy[0];
00253       PFJetEta[1]  = PFJetEta[0];
00254       PFJetPhi[1]  = PFJetPhi[0];
00255       PFJetNHEF[1] = PFJetNHEF[0]; 
00256       PFJetCHEF[1] = PFJetCHEF[0];
00257       PFJetNEMF[1] = PFJetNEMF[0]; 
00258       PFJetCEMF[1] = PFJetCEMF[0];
00259       //
00260       PFJetPt[0]   = scale*pfjet_->pt();
00261       PFJetPx[0]   = scale*pfjet_->px();
00262       PFJetPy[0]   = scale*pfjet_->py();
00263       PFJetEta[0]  = pfjet_->eta();
00264       PFJetPhi[0]  = pfjet_->phi();
00265       PFJetNHEF[0] = pfjet_->neutralHadronEnergyFraction();
00266       PFJetCHEF[0] = pfjet_->chargedHadronEnergyFraction();
00267       PFJetNEMF[0] = pfjet_->neutralEmEnergyFraction();
00268       PFJetCEMF[0] = pfjet_->chargedEmEnergyFraction();
00269     }
00270     else if(scale*pfjet_->pt()<PFJetPt[0] && scale*pfjet_->pt()>PFJetPt[1] ){
00271       PFJetPt[1]   = scale*pfjet_->pt();
00272       PFJetPx[1]   = scale*pfjet_->px();
00273       PFJetPy[1]   = scale*pfjet_->py();
00274       PFJetEta[1]  = pfjet_->eta();
00275       PFJetPhi[1]  = pfjet_->phi(); 
00276       PFJetNHEF[1] = pfjet_->neutralHadronEnergyFraction();
00277       PFJetCHEF[1] = pfjet_->chargedHadronEnergyFraction();
00278       PFJetNEMF[1] = pfjet_->neutralEmEnergyFraction();
00279       PFJetCEMF[1] = pfjet_->chargedEmEnergyFraction();
00280     }
00281     else{}
00282   }
00283   
00284   if(verbose_){
00285     for(int i = 0; i<2; i++){
00286       cout<<"CaloJet-0: "<<CaloJetPt[i]<<", Eta = "<<CaloJetEta[i]<<", Phi = "<<CaloJetPhi[i]<<endl;
00287       cout<<"fHPD = "<<CaloJetfHPD[0]<<", n90 = "<<CaloJetn90[0]<<endl;
00288     }
00289     for(int i = 0; i<2; i++){
00290       cout<<"PFJet-0: "<<PFJetPt[i]<<", Eta = "<<PFJetEta[i]<<", Phi = "<<PFJetPhi[i]<<endl;
00291     }
00292   }
00293 
00294   //---------- RUN ----------
00295   fillMEforMonTriggerSummary(iEvent, iSetup);
00296   if(plotAll_)                  fillMEforMonAllTrigger(iEvent, iSetup);
00297   if(plotAllwrtMu_)             fillMEforMonAllTriggerwrtMuonTrigger(iEvent,iSetup);
00298   if(plotEff_)                  fillMEforEffAllTrigger(iEvent,iSetup);
00299   if(plotEff_ && plotEffwrtMu_) fillMEforEffWrtMuTrigger(iEvent,iSetup); 
00300   if(plotEff_ && plotEffwrtMB_) fillMEforEffWrtMBTrigger(iEvent,iSetup);
00301   if(runStandalone_)            fillMEforTriggerNTfired();
00302 }
00303 
00304 // Trigger summary for all paths
00305 void 
00306 JetMETHLTOfflineSource::fillMEforMonTriggerSummary(const Event & iEvent, const edm::EventSetup& iSetup)
00307 {
00308   bool muTrig = false;
00309   
00310   for(size_t i=0;i<MuonTrigPaths_.size();++i){
00311     const unsigned int nPath(hltConfig_.size());
00312     for (unsigned int j=0; j!=nPath; ++j) {
00313       std::string pathname = hltConfig_.triggerName(j);
00314       if(pathname.find(MuonTrigPaths_[i]) != std::string::npos){
00315         if(isHLTPathAccepted(pathname)){ 
00316           muTrig = true;
00317           if(verbose_) cout<<"fillMEforMonTriggerSummary: Muon Match"<<endl;
00318         }
00319       }
00320       if(muTrig) break;
00321     }
00322     if(muTrig) break;
00323   }
00324  
00325   bool mbTrig = false;
00326   for(size_t i=0;i<MBTrigPaths_.size();++i){
00327     const unsigned int nPath(hltConfig_.size());
00328     for (unsigned int j=0; j!=nPath; ++j) {
00329       std::string pathname = hltConfig_.triggerName(j);
00330       if(pathname.find(MBTrigPaths_[i]) != std::string::npos){
00331         if(isHLTPathAccepted(pathname)){
00332           mbTrig = true;
00333           if(verbose_) cout<<"fillMEforMonTriggerSummary: MinBias Match"<<endl;
00334         }
00335       }
00336       if(mbTrig) break;
00337     }
00338     if(mbTrig) break;
00339   }
00340   
00341   PathInfoCollection::iterator v = hltPathsAll_.begin();
00342   for(; v!= hltPathsAll_.end(); ++v ){
00343     bool trigFirst= false;  
00344     double binV = TriggerPosition(v->getPath());       
00345     if(isHLTPathAccepted(v->getPath())) trigFirst = true;
00346     if(!trigFirst)continue;
00347     if(trigFirst){
00348       rate_All->Fill(binV);
00349       correlation_All->Fill(binV,binV);
00350       if(muTrig && runStandalone_){
00351         rate_AllWrtMu->Fill(binV);
00352         correlation_AllWrtMu->Fill(binV,binV);
00353       }
00354       if(mbTrig && runStandalone_){
00355         rate_AllWrtMB->Fill(binV);
00356         correlation_AllWrtMB->Fill(binV,binV);
00357       }
00358     }
00359     for(PathInfoCollection::iterator w = v+1; w!= hltPathsAll_.end(); ++w ){
00360       bool trigSec = false; 
00361       double binW = TriggerPosition(w->getPath()); 
00362       if(isHLTPathAccepted(w->getPath()))trigSec = true;
00363       if(trigSec && trigFirst){
00364         correlation_All->Fill(binV,binW);
00365         if(muTrig && runStandalone_) correlation_AllWrtMu->Fill(binV,binW);
00366         if(mbTrig && runStandalone_) correlation_AllWrtMB->Fill(binV,binW); 
00367       }
00368       if(!trigSec && trigFirst){
00369         correlation_All->Fill(binW,binV); 
00370         if(muTrig && runStandalone_) correlation_AllWrtMu->Fill(binW,binV);
00371         if(mbTrig && runStandalone_) correlation_AllWrtMB->Fill(binW,binV);
00372       }
00373     }
00374   }
00375 
00376   //Vertex
00377   edm::Handle<VertexCollection> Vtx;
00378   iEvent.getByLabel ("offlinePrimaryVertices",Vtx);
00379   int vtxcnt=0;
00380   for (VertexCollection::const_iterator itv=Vtx->begin(); itv!=Vtx->end(); itv++){
00381     //if(vtxcnt>=20) break;
00382     PVZ->Fill(itv->z());
00383     //chi2vtx[vtxcnt] = itv->chi2();
00384     //ndofvtx[vtxcnt] = itv->ndof();
00385     //ntrkvtx[vtxcnt] = itv->tracksSize();
00386     vtxcnt++;
00387   }
00388   NVertices->Fill(vtxcnt);
00389 }
00390 
00391 void 
00392 JetMETHLTOfflineSource::fillMEforTriggerNTfired()
00393 {
00394   //int npath;
00395   if(&triggerResults_) { /*npath = triggerResults_->size();*/ } 
00396   else { return; }
00397   
00398   //
00399   for(PathInfoCollection::iterator v = hltPathsAll_.begin(); v!= hltPathsAll_.end(); ++v ){
00400     unsigned index = triggerNames_.triggerIndex(v->getPath()); 
00401     if (index < triggerNames_.size() ){
00402       v->getMEhisto_TriggerSummary()->Fill(0.);
00403       edm::InputTag l1Tag(v->getl1Path(),"",processname_);
00404       const int l1Index = triggerObj_->filterIndex(l1Tag);
00405       bool l1found = false;
00406       if(l1Index < triggerObj_->sizeFilters() ) l1found = true;
00407       if(!l1found)v->getMEhisto_TriggerSummary()->Fill(1.);
00408       if(!l1found && !(triggerResults_->accept(index)))v->getMEhisto_TriggerSummary()->Fill(2.);
00409       if(!l1found && (triggerResults_->accept(index)))v->getMEhisto_TriggerSummary()->Fill(3.);
00410       if(l1found)v->getMEhisto_TriggerSummary()->Fill(4.);
00411       if(l1found && (triggerResults_->accept(index)))v->getMEhisto_TriggerSummary()->Fill(5.); 
00412       if(l1found && !(triggerResults_->accept(index)))v->getMEhisto_TriggerSummary()->Fill(6.);
00413       if(!(triggerResults_->accept(index)) && l1found){ 
00414         //cout<<v->getTriggerType()<<endl;
00415         if((v->getTriggerType().compare("SingleJet_Trigger") == 0) && (calojetColl_.isValid()) && calojet.size()){
00416           CaloJetCollection::const_iterator jet = calojet.begin();
00417           v->getMEhisto_JetPt()->Fill(jet->pt());
00418           v->getMEhisto_EtavsPt()->Fill(jet->eta(),jet->pt());
00419           v->getMEhisto_PhivsPt()->Fill(jet->phi(),jet->pt());
00420         }
00421         // single jet trigger is not fired
00422 
00423         if((v->getTriggerType().compare("DiJet_Trigger") == 0) && calojetColl_.isValid()  && calojet.size()){
00424           v->getMEhisto_JetSize()->Fill(calojet.size());
00425           if (calojet.size()>=2){
00426             CaloJetCollection::const_iterator jet = calojet.begin();
00427             CaloJetCollection::const_iterator jet2= calojet.begin(); jet2++;
00428             double jet3pt = 0.;
00429             if(calojet.size()>2){
00430               CaloJetCollection::const_iterator jet3 = jet2++;
00431               jet3pt = jet3->pt();
00432             }
00433             v->getMEhisto_Pt12()->Fill((jet->pt()+jet2->pt())/2.);
00434             v->getMEhisto_Eta12()->Fill((jet->eta()+jet2->eta())/2.);
00435             v->getMEhisto_Phi12()->Fill(deltaPhi(jet->phi(),jet2->phi()));
00436             v->getMEhisto_Pt3()->Fill(jet3pt);
00437             v->getMEhisto_Pt12Pt3()->Fill((jet->pt()+jet2->pt())/2., jet3pt);
00438             v->getMEhisto_Pt12Phi12()->Fill((jet->pt()+jet2->pt())/2., deltaPhi(jet->phi(),jet2->phi()));
00439           }
00440         }// di jet trigger is not fired 
00441         
00442         if(((v->getTriggerType().compare("MET_Trigger") == 0)|| (v->getTriggerType().compare("TET_Trigger") == 0)) && calometColl_.isValid() ){
00443           const CaloMETCollection *calometcol = calometColl_.product();
00444           const CaloMET met = calometcol->front();
00445           v->getMEhisto_JetPt()->Fill(met.pt());
00446         }//MET trigger is not fired   
00447       } // L1 is fired
00448     }//
00449   }// trigger not fired
00450 }
00451 
00452 void 
00453 JetMETHLTOfflineSource::fillMEforMonAllTrigger(const Event & iEvent, const edm::EventSetup& iSetup)
00454 {
00455   //int npath;
00456   if(&triggerResults_) { /*npath = triggerResults_->size();*/ } 
00457   else { return; }
00458   
00459   const trigger::TriggerObjectCollection & toc(triggerObj_->getObjects());
00460   PathInfoCollection::iterator v = hltPathsAll_.begin();
00461   for(; v!= hltPathsAll_.end(); ++v ){
00462     if(isHLTPathAccepted(v->getPath())==false) continue;
00463     
00464     //New jet collection (after apply JEC)
00465     std::vector<double>jetPtVec;
00466     std::vector<double>jetPhiVec; 
00467     std::vector<double>jetEtaVec;
00468     std::vector<double>jetPxVec;
00469     std::vector<double>jetPyVec;
00470     std::vector<double>hltPtVec;
00471     std::vector<double>hltPhiVec;
00472     std::vector<double>hltEtaVec;
00473     std::vector<double>hltPxVec;
00474     std::vector<double>hltPyVec;
00475     
00476     //This will be used to find out punch through trigger 
00477     //bool fillL1HLT = false;
00478       
00479     //L1 and HLT indices
00480     edm::InputTag l1Tag(v->getl1Path(),"",processname_);
00481     const int l1Index = triggerObj_->filterIndex(l1Tag);
00482     edm::InputTag hltTag(v->getLabel(),"",processname_);
00483     const int hltIndex = triggerObj_->filterIndex(hltTag);
00484     //bool l1TrigBool = false;
00485     bool hltTrigBool  = false;
00486     bool diJetFire    = false;
00487     int  jetsize      = 0;
00488     
00489     if ( l1Index >= triggerObj_->sizeFilters() ) {
00490       edm::LogInfo("JetMETHLTOfflineSource") << "no index "<< l1Index << " of that name "<<l1Tag;
00491     }
00492     else {
00493       //l1TrigBool = true;
00494       const trigger::Keys & kl1 = triggerObj_->filterKeys(l1Index);
00495       //
00496       if(v->getObjectType() == trigger::TriggerJet 
00497          && v->getTriggerType().compare("SingleJet_Trigger") == 0)
00498         v->getMEhisto_N_L1()->Fill(kl1.size());
00499       //
00500       trigger::Keys::const_iterator ki = kl1.begin();
00501       for(; ki != kl1.end(); ++ki){
00502         double l1TrigEta = -100;
00503         double l1TrigPhi = -100;
00504         //
00505         if(v->getObjectType() == trigger::TriggerJet){ 
00506           l1TrigEta = toc[*ki].eta();
00507           l1TrigPhi = toc[*ki].phi();
00508           if(v->getTriggerType().compare("SingleJet_Trigger") == 0){
00509             v->getMEhisto_Pt_L1()->Fill(toc[*ki].pt());
00510             if (isBarrel(toc[*ki].eta())) v->getMEhisto_PtBarrel_L1()->Fill(toc[*ki].pt());
00511             if (isEndCap(toc[*ki].eta())) v->getMEhisto_PtEndcap_L1()->Fill(toc[*ki].pt());
00512             if (isForward(toc[*ki].eta())) v->getMEhisto_PtForward_L1()->Fill(toc[*ki].pt());
00513             v->getMEhisto_Eta_L1()->Fill(toc[*ki].eta());
00514             v->getMEhisto_Phi_L1()->Fill(toc[*ki].phi());
00515             v->getMEhisto_EtaPhi_L1()->Fill(toc[*ki].eta(),toc[*ki].phi());
00516           }
00517         }
00518         if(v->getObjectType() == trigger::TriggerMET || 
00519            v->getObjectType() == trigger::TriggerTET){
00520           v->getMEhisto_Pt_L1()->Fill(toc[*ki].pt());
00521           v->getMEhisto_Phi_L1()->Fill(toc[*ki].phi());
00522         }
00523         
00524         //-----------------------------------------------  
00525         if ( hltIndex >= triggerObj_->sizeFilters() ) {
00526           edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
00527         } 
00528         else {
00529           const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex);
00530           if(v->getObjectType() == trigger::TriggerJet 
00531              && ki == kl1.begin() 
00532              && v->getTriggerType().compare("SingleJet_Trigger") == 0)
00533             v->getMEhisto_N_HLT()->Fill(khlt.size());
00534           //
00535           trigger::Keys::const_iterator kj = khlt.begin();
00536           //Define hltTrigBool
00537           for(;kj != khlt.end(); ++kj){
00538             if(v->getObjectType() == trigger::TriggerJet){
00539               double hltTrigEta = -100;
00540               double hltTrigPhi = -100;
00541               hltTrigEta = toc[*kj].eta();
00542               hltTrigPhi = toc[*kj].phi();
00543               if((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi)) < 0.4 
00544                  && (v->getTriggerType().compare("DiJet_Trigger") == 0))
00545                 hltTrigBool = true;
00546             }  
00547           }
00548           // 
00549           kj = khlt.begin();
00550           for(;kj != khlt.end(); ++kj){
00551             double hltTrigEta = -100.;
00552             double hltTrigPhi = -100.;
00553             //fillL1HLT = true;
00554             //MET Triggers
00555             if(v->getObjectType() == trigger::TriggerMET || (v->getObjectType() == trigger::TriggerTET)){
00556               v->getMEhisto_Pt_HLT()->Fill(toc[*kj].pt());
00557               v->getMEhisto_Phi_HLT()->Fill(toc[*kj].phi());
00558               v->getMEhisto_PtCorrelation_L1HLT()->Fill(toc[*ki].pt(),toc[*kj].pt());
00559               v->getMEhisto_PhiCorrelation_L1HLT()->Fill(toc[*ki].phi(),toc[*kj].phi());
00560               v->getMEhisto_PtResolution_L1HLT()->Fill((toc[*ki].pt()-toc[*kj].pt())/(toc[*ki].pt()));
00561               v->getMEhisto_PhiResolution_L1HLT()->Fill((toc[*ki].phi()-toc[*kj].phi())/(toc[*ki].phi()));
00562             }
00563             //Jet Triggers
00564             if(v->getObjectType() == trigger::TriggerJet){
00565               hltTrigEta = toc[*kj].eta();
00566               hltTrigPhi = toc[*kj].phi();
00567               if((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi)) < 0.4){
00568                 if(v->getTriggerType().compare("SingleJet_Trigger") == 0){
00569                   v->getMEhisto_PtCorrelation_L1HLT()->Fill(toc[*ki].pt(),toc[*kj].pt());
00570                   v->getMEhisto_EtaCorrelation_L1HLT()->Fill(toc[*ki].eta(),toc[*kj].eta());
00571                   v->getMEhisto_PhiCorrelation_L1HLT()->Fill(toc[*ki].phi(),toc[*kj].phi());
00572                   v->getMEhisto_PtResolution_L1HLT()->Fill((toc[*ki].pt()-toc[*kj].pt())/(toc[*ki].pt()));
00573                   v->getMEhisto_EtaResolution_L1HLT()->Fill((toc[*ki].eta()-toc[*kj].eta())/(toc[*ki].eta()));
00574                   v->getMEhisto_PhiResolution_L1HLT()->Fill((toc[*ki].phi()-toc[*kj].phi())/(toc[*ki].phi()));
00575                 }
00576               }
00577               if(((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi) < 0.4 ) 
00578                   || ((v->getTriggerType().compare("DiJet_Trigger") == 0)  && hltTrigBool)) && !diJetFire){ 
00579                 if(v->getTriggerType().compare("SingleJet_Trigger") == 0){
00580                   v->getMEhisto_Pt_HLT()->Fill(toc[*kj].pt());
00581                   if (isBarrel(toc[*kj].eta())) v->getMEhisto_PtBarrel_HLT()->Fill(toc[*kj].pt());
00582                   if (isEndCap(toc[*kj].eta())) v->getMEhisto_PtEndcap_HLT()->Fill(toc[*kj].pt());
00583                   if (isForward(toc[*kj].eta())) v->getMEhisto_PtForward_HLT()->Fill(toc[*kj].pt());
00584                   v->getMEhisto_Eta_HLT()->Fill(toc[*kj].eta());
00585                   v->getMEhisto_Phi_HLT()->Fill(toc[*kj].phi());
00586                   v->getMEhisto_EtaPhi_HLT()->Fill(toc[*kj].eta(),toc[*kj].phi());
00587                 }
00588                 
00589                 //Calojet
00590                 if(calojetColl_.isValid() 
00591                    && (v->getObjectType() == trigger::TriggerJet)
00592                    && (v->getPath().compare("PFJet") == 0)){
00593                   //CaloJetCollection::const_iterator jet = calojet.begin();
00594                   //for(; jet != calojet.end(); ++jet) {
00595                   for(int iCalo=0; iCalo<2; iCalo++){
00596                     if(deltaR(hltTrigEta, hltTrigPhi, CaloJetEta[iCalo], CaloJetPhi[iCalo]) < 0.4){
00597                       jetsize++; 
00598                       if(v->getTriggerType().compare("SingleJet_Trigger") == 0){
00599                         v->getMEhisto_Pt()->Fill(CaloJetPt[iCalo]);
00600                         if (isBarrel(CaloJetEta[iCalo]))  v->getMEhisto_PtBarrel()->Fill(CaloJetPt[iCalo]);
00601                         if (isEndCap(CaloJetEta[iCalo]))  v->getMEhisto_PtEndcap()->Fill(CaloJetPt[iCalo]);
00602                         if (isForward(CaloJetEta[iCalo])) v->getMEhisto_PtForward()->Fill(CaloJetPt[iCalo]);
00603                         //
00604                         v->getMEhisto_Eta()->Fill(CaloJetEta[iCalo]);
00605                         v->getMEhisto_Phi()->Fill(CaloJetPhi[iCalo]);
00606                         v->getMEhisto_EtaPhi()->Fill(CaloJetEta[iCalo],CaloJetPhi[iCalo]); 
00607                         //
00608                         v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].pt(),CaloJetPt[iCalo]);
00609                         v->getMEhisto_EtaCorrelation_HLTRecObj()->Fill(toc[*kj].eta(),CaloJetEta[iCalo]);
00610                         v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(),CaloJetPhi[iCalo]);
00611                         //
00612                         v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].pt()-CaloJetPt[iCalo])/(toc[*kj].pt()));
00613                         v->getMEhisto_EtaResolution_HLTRecObj()->Fill((toc[*kj].eta()-CaloJetEta[iCalo])/(toc[*kj].eta()));
00614                         v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*kj].phi()-CaloJetPhi[iCalo])/(toc[*kj].phi()));
00615                       }
00616                       
00617                       //-------------------------------------------------------    
00618                       if((v->getTriggerType().compare("DiJet_Trigger") == 0)){
00619                         jetPhiVec.push_back(CaloJetPhi[iCalo]);
00620                         jetPtVec.push_back(CaloJetPt[iCalo]);
00621                         jetEtaVec.push_back(CaloJetEta[iCalo]);         
00622                         jetPxVec.push_back(CaloJetPx[iCalo]);
00623                         jetPyVec.push_back(CaloJetPy[iCalo]); 
00624                         //
00625                         hltPhiVec.push_back(toc[*kj].phi());
00626                         hltPtVec.push_back(toc[*kj].pt());
00627                         hltEtaVec.push_back(toc[*kj].eta());
00628                         hltPxVec.push_back(toc[*kj].px()); 
00629                         hltPyVec.push_back(toc[*kj].py());
00630                       }
00631                     }// matching jet           
00632                   }// Jet Loop
00633                 }// valid calojet collection, with calojet trigger
00634 
00635                 //PFJet trigger
00636                 if(pfjetColl_.isValid() 
00637                    && (v->getObjectType() == trigger::TriggerJet)
00638                    && (v->getPath().compare("PFJet") != 0)){
00639                   //PFJetCollection::const_iterator jet = pfjet.begin();
00640                   //for(; jet != pfjet.end(); ++jet){ 
00641                   for(int iPF=0; iPF<2; iPF++){
00642                     if(deltaR(hltTrigEta, hltTrigPhi, PFJetEta[iPF], PFJetPhi[iPF]) < 0.4){
00643                       jetsize++;
00644                       if(v->getTriggerType().compare("SingleJet_Trigger") == 0){
00645                         v->getMEhisto_Pt()->Fill(PFJetPt[iPF]);
00646                         if (isBarrel(PFJetEta[iPF]))  v->getMEhisto_PtBarrel()->Fill(PFJetPt[iPF]);
00647                         if (isEndCap(PFJetEta[iPF]))  v->getMEhisto_PtEndcap()->Fill(PFJetPt[iPF]);
00648                         if (isForward(PFJetEta[iPF])) v->getMEhisto_PtForward()->Fill(PFJetPt[iPF]);
00649                         //
00650                         v->getMEhisto_Eta()->Fill(PFJetEta[iPF]);
00651                         v->getMEhisto_Phi()->Fill(PFJetPhi[iPF]);
00652                         v->getMEhisto_EtaPhi()->Fill(PFJetEta[iPF],PFJetPhi[iPF]); 
00653                         //
00654                         v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].pt(),PFJetPt[iPF]);
00655                         v->getMEhisto_EtaCorrelation_HLTRecObj()->Fill(toc[*kj].eta(),PFJetEta[iPF]);
00656                         v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(),PFJetPhi[iPF]);
00657                         //
00658                         v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].pt()-PFJetPt[iPF])/(toc[*kj].pt()));
00659                         v->getMEhisto_EtaResolution_HLTRecObj()->Fill((toc[*kj].eta()-PFJetEta[iPF])/(toc[*kj].eta()));
00660                         v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*kj].phi()-PFJetPhi[iPF])/(toc[*kj].phi()));
00661                       }
00662                       
00663                       //-------------------------------------------------------    
00664                       if((v->getTriggerType().compare("DiJet_Trigger") == 0)){
00665                         jetPhiVec.push_back(PFJetPhi[iPF]);
00666                         jetPtVec.push_back(PFJetPt[iPF]);
00667                         jetEtaVec.push_back(PFJetEta[iPF]);         
00668                         jetPxVec.push_back(PFJetPx[iPF]);
00669                         jetPyVec.push_back(PFJetPy[iPF]); 
00670                         //
00671                         hltPhiVec.push_back(toc[*kj].phi());
00672                         hltPtVec.push_back(toc[*kj].pt());
00673                         hltEtaVec.push_back(toc[*kj].eta());
00674                         hltPxVec.push_back(toc[*kj].px()); 
00675                         hltPyVec.push_back(toc[*kj].py());
00676                       }
00677                     }// matching jet  
00678                   }//PFJet loop
00679                 }//valid pfjet collection, with pfjet trigger
00680                 //
00681               }// hlt matching with l1               
00682             }// jet trigger
00683 
00684             //------------------------------------------------------
00685             if(calometColl_.isValid() 
00686                && ((v->getObjectType() == trigger::TriggerMET) || (v->getObjectType() == trigger::TriggerTET))
00687                && (v->getPath().find("HLT_PFMET")==std::string::npos)){
00688               const CaloMETCollection *calometcol = calometColl_.product();
00689               const CaloMET met = calometcol->front();
00690               //
00691               v->getMEhisto_Pt()->Fill(met.et()); 
00692               v->getMEhisto_Phi()->Fill(met.phi());
00693               //
00694               v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].et(),met.et());
00695               v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(),met.phi());
00696               v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].et()-met.et())/(toc[*kj].et()));
00697               v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*kj].phi()-met.phi())/(toc[*kj].phi())); 
00698             }
00699             
00700             //--------------------------------------------------------
00701             if(pfmetColl_.isValid() 
00702                && ((v->getObjectType() == trigger::TriggerMET) || (v->getObjectType() == trigger::TriggerTET))
00703                && (v->getPath().find("HLT_PFMET")!=std::string::npos)){
00704               const PFMETCollection *pfmetcol = pfmetColl_.product();
00705               const PFMET pfmet = pfmetcol->front();
00706               //
00707               v->getMEhisto_Pt()->Fill(pfmet.et()); 
00708               v->getMEhisto_Phi()->Fill(pfmet.phi());
00709               //
00710               v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].et(),pfmet.et());
00711               v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(),pfmet.phi());
00712               v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].et()-pfmet.et())/(toc[*kj].et()));
00713               v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*kj].phi()-pfmet.phi())/(toc[*kj].phi())); 
00714             }
00715           }//Loop over HLT trigger candidates
00716           if((v->getTriggerType().compare("DiJet_Trigger") == 0)) diJetFire = true;
00717         }// Valid hlt trigger object
00718       }// Loop over L1 objects
00719     }// Valid L1 trigger object
00720     v->getMEhisto_N()->Fill(jetsize);
00721     
00722     //--------------------------------------------------------
00723     if((v->getTriggerType().compare("DiJet_Trigger") == 0) && jetPtVec.size() >1){
00724       double AveJetPt  = (jetPtVec[0] + jetPtVec[1])/2;
00725       double AveJetEta = (jetEtaVec[0] + jetEtaVec[1])/2;               
00726       double JetDelPhi = deltaPhi(jetPhiVec[0],jetPhiVec[1]);
00727       double AveHLTPt  = (hltPtVec[0] + hltPtVec[1])/2;
00728       double AveHLTEta = (hltEtaVec[0] + hltEtaVec[1])/2;
00729       double HLTDelPhi = deltaPhi(hltPhiVec[0],hltPhiVec[1]);
00730       v->getMEhisto_AveragePt_RecObj()->Fill(AveJetPt);
00731       v->getMEhisto_AverageEta_RecObj()->Fill(AveJetEta);
00732       v->getMEhisto_DeltaPhi_RecObj()->Fill(JetDelPhi);
00733       //
00734       v->getMEhisto_AveragePt_HLTObj()->Fill(AveHLTPt);
00735       v->getMEhisto_AverageEta_HLTObj()->Fill(AveHLTEta);
00736       v->getMEhisto_DeltaPhi_HLTObj()->Fill(HLTDelPhi);
00737     }
00738     
00739     //-----------------------------------------------------
00740     /*
00741       if(v->getPath().find("L1") != std::string::npos && !fillL1HLT){
00742       if ( l1Index >= triggerObj_->sizeFilters() ) {
00743       edm::LogInfo("JetMETHLTOfflineSource") << "no index "<< l1Index << " of that name "<<l1Tag;
00744       }
00745       else {
00746       //l1TrigBool = true;
00747       const trigger::Keys & kl1 = triggerObj_->filterKeys(l1Index);
00748       for( trigger::Keys::const_iterator ki = kl1.begin(); ki != kl1.end(); ++ki){
00749       double l1TrigEta = toc[*ki].eta();
00750       double l1TrigPhi = toc[*ki].phi();
00751       if(calojetColl_.isValid() && (v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("SingleJet_Trigger") == 0) ){
00752       for(CaloJetCollection::const_iterator jet = calojet.begin(); jet != calojet.end(); ++jet ) {
00753       double jetEta = jet->eta();
00754       double jetPhi = jet->phi();
00755       if(deltaR(l1TrigEta, l1TrigPhi, jetEta, jetPhi) < 0.4){
00756       jetsize++;
00757       v->getMEhisto_Pt()->Fill(jet->pt());
00758       if (isBarrel(jet->eta()))  v->getMEhisto_PtBarrel()->Fill(jet->pt());
00759       if (isEndCap(jet->eta()))  v->getMEhisto_PtEndcap()->Fill(jet->pt());
00760       if (isForward(jet->eta())) v->getMEhisto_PtForward()->Fill(jet->pt());
00761       //
00762       v->getMEhisto_Eta()->Fill(jet->eta());
00763       v->getMEhisto_Phi()->Fill(jet->phi());
00764       v->getMEhisto_EtaPhi()->Fill(jet->eta(),jet->phi()); 
00765       //
00766       v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*ki].pt(),jet->pt());
00767       v->getMEhisto_EtaCorrelation_HLTRecObj()->Fill(toc[*ki].eta(),jet->eta());
00768       v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*ki].phi(),jet->phi());
00769       //
00770       v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*ki].pt()-jet->pt())/(toc[*ki].pt()));
00771       v->getMEhisto_EtaResolution_HLTRecObj()->Fill((toc[*ki].eta()-jet->eta())/(toc[*ki].eta()));
00772       v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*ki].phi()-jet->phi())/(toc[*ki].phi()));
00773       }// matching jet
00774       
00775       }// Jet Loop
00776       v->getMEhisto_N()->Fill(jetsize);
00777       }// valid Jet collection
00778       
00779       if(calometColl_.isValid() && ((v->getObjectType() == trigger::TriggerMET)|| (v->getObjectType() == trigger::TriggerTET))){
00780       const CaloMETCollection *calometcol = calometColl_.product();
00781       const CaloMET met = calometcol->front();
00782       v->getMEhisto_Pt()->Fill(met.pt()); 
00783       v->getMEhisto_Phi()->Fill(met.phi());
00784       //
00785       v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*ki].pt(),met.pt());
00786       v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*ki].phi(),met.phi());
00787       v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*ki].pt()-met.pt())/(toc[*ki].pt()));
00788       v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*ki].phi()-met.phi())/(toc[*ki].phi()));
00789       }// valid MET Collection           
00790       }// Loop over keys
00791       }// valid object
00792       }// L1 is fired but not HLT
00793     */
00794   }
00795 }
00796 
00797 //-------------plots wrt Muon Trigger------------
00798 void 
00799 JetMETHLTOfflineSource::fillMEforMonAllTriggerwrtMuonTrigger(const Event & iEvent, const edm::EventSetup& iSetup)
00800 {
00801   //int npath;
00802   if(&triggerResults_) { /*npath = triggerResults_->size();*/ } 
00803   else { return; }
00804   
00805   bool muTrig = false;
00806   for(size_t i=0;i<MuonTrigPaths_.size();++i){
00807     const unsigned int nPath(hltConfig_.size());
00808     for (unsigned int j=0; j!=nPath; ++j) {
00809       std::string pathname = hltConfig_.triggerName(j);
00810       if(pathname.find(MuonTrigPaths_[i]) != std::string::npos){
00811         if(isHLTPathAccepted(pathname)){ 
00812           muTrig = true;
00813           if(verbose_) cout<<"fillMEforMonAllTriggerwrtMuonTrigger: Muon Match"<<endl;
00814         }
00815       }
00816       if(muTrig) break;
00817     }
00818     if(muTrig) break;
00819   }
00820   
00821   if(muTrig){
00822     const trigger::TriggerObjectCollection & toc(triggerObj_->getObjects());
00823     PathInfoCollection::iterator v = hltPathsAllWrtMu_.begin();
00824     for(; v!= hltPathsAllWrtMu_.end(); ++v ){
00825       if(isHLTPathAccepted(v->getPath())==false) continue;
00826       
00827       //New jet collection (after apply JEC)
00828       std::vector<double>jetPtVec;
00829       std::vector<double>jetPhiVec; 
00830       std::vector<double>jetEtaVec;
00831       std::vector<double>jetPxVec;
00832       std::vector<double>jetPyVec;
00833       std::vector<double>hltPtVec;
00834       std::vector<double>hltPhiVec;
00835       std::vector<double>hltEtaVec;
00836       std::vector<double>hltPxVec;
00837       std::vector<double>hltPyVec;
00838       
00839       //This will be used to find out punch throgh trigger 
00840       bool fillL1HLT = false;  
00841       
00842       //L1 and HLT indices
00843       edm::InputTag l1Tag(v->getl1Path(),"",processname_);
00844       const int l1Index = triggerObj_->filterIndex(l1Tag);
00845       edm::InputTag hltTag(v->getLabel(),"",processname_);
00846       const int hltIndex = triggerObj_->filterIndex(hltTag);
00847       //bool l1TrigBool = false;
00848       bool hltTrigBool = false;
00849       bool diJetFire = false;
00850       int jetsize = 0;
00851       
00852       if ( l1Index >= triggerObj_->sizeFilters() ) {
00853         edm::LogInfo("JetMETHLTOfflineSource") << "no index "<< l1Index << " of that name "<<l1Tag;
00854       }
00855       else {
00856         //l1TrigBool = true;
00857         const trigger::Keys & kl1 = triggerObj_->filterKeys(l1Index);
00858         if(v->getObjectType() == trigger::TriggerJet)v->getMEhisto_N_L1()->Fill(kl1.size());
00859         trigger::Keys::const_iterator ki = kl1.begin();
00860         for(; ki != kl1.end(); ++ki){
00861           double l1TrigEta = -100;
00862           double l1TrigPhi = -100;
00863           
00864           //-------------------------------------------
00865           if(v->getObjectType() == trigger::TriggerJet){ 
00866             l1TrigEta = toc[*ki].eta();
00867             l1TrigPhi = toc[*ki].phi();
00868             v->getMEhisto_Pt_L1()->Fill(toc[*ki].pt());
00869             if (isBarrel(toc[*ki].eta()))  v->getMEhisto_PtBarrel_L1()->Fill(toc[*ki].pt());
00870             if (isEndCap(toc[*ki].eta()))  v->getMEhisto_PtEndcap_L1()->Fill(toc[*ki].pt());
00871             if (isForward(toc[*ki].eta())) v->getMEhisto_PtForward_L1()->Fill(toc[*ki].pt());
00872             v->getMEhisto_Eta_L1()->Fill(toc[*ki].eta());
00873             v->getMEhisto_Phi_L1()->Fill(toc[*ki].phi());
00874             v->getMEhisto_EtaPhi_L1()->Fill(toc[*ki].eta(),toc[*ki].phi());
00875           }
00876           if(v->getObjectType() == trigger::TriggerMET || (v->getObjectType() == trigger::TriggerTET)){
00877             v->getMEhisto_Pt_L1()->Fill(toc[*ki].pt());
00878             v->getMEhisto_Phi_L1()->Fill(toc[*ki].phi());
00879           }
00880           
00881           //-----------------------------------------------  
00882           if ( hltIndex >= triggerObj_->sizeFilters() ) {
00883             edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
00884           } 
00885           else {
00886             const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex);
00887             if((v->getObjectType() == trigger::TriggerJet) && (ki == kl1.begin())) 
00888               v->getMEhisto_N_HLT()->Fill(khlt.size());
00889             trigger::Keys::const_iterator kj = khlt.begin();
00890             //Define hltTrigBool
00891             for(;kj != khlt.end(); ++kj){
00892               if(v->getObjectType() == trigger::TriggerJet){
00893                 double hltTrigEta = -100;
00894                 double hltTrigPhi = -100;
00895                 hltTrigEta = toc[*kj].eta();
00896                 hltTrigPhi = toc[*kj].phi();
00897                 if((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi)) < 0.4 
00898                    && (v->getTriggerType().compare("DiJet_Trigger") == 0))
00899                   hltTrigBool = true;
00900               }  
00901             }
00902             // 
00903             kj = khlt.begin();
00904             for(;kj != khlt.end(); ++kj){
00905               double hltTrigEta = -100.;
00906               double hltTrigPhi = -100.;
00907               fillL1HLT = true;
00908               //MET Triggers
00909               if(v->getObjectType() == trigger::TriggerMET || (v->getObjectType() == trigger::TriggerTET)){
00910                 v->getMEhisto_Pt_HLT()->Fill(toc[*kj].pt());
00911                 v->getMEhisto_Phi_HLT()->Fill(toc[*kj].phi());
00912                 v->getMEhisto_PtCorrelation_L1HLT()->Fill(toc[*ki].pt(),toc[*kj].pt());
00913                 v->getMEhisto_PhiCorrelation_L1HLT()->Fill(toc[*ki].phi(),toc[*kj].phi());
00914                 v->getMEhisto_PtResolution_L1HLT()->Fill((toc[*ki].pt()-toc[*kj].pt())/(toc[*ki].pt()));
00915                 v->getMEhisto_PhiResolution_L1HLT()->Fill((toc[*ki].phi()-toc[*kj].phi())/(toc[*ki].phi()));
00916               }
00917               //Jet Triggers
00918               if(v->getObjectType() == trigger::TriggerJet){
00919                 hltTrigEta = toc[*kj].eta();
00920                 hltTrigPhi = toc[*kj].phi();
00921                 if((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi)) < 0.4){
00922                   v->getMEhisto_PtCorrelation_L1HLT()->Fill(toc[*ki].pt(),toc[*kj].pt());
00923                   v->getMEhisto_EtaCorrelation_L1HLT()->Fill(toc[*ki].eta(),toc[*kj].eta());
00924                   v->getMEhisto_PhiCorrelation_L1HLT()->Fill(toc[*ki].phi(),toc[*kj].phi());
00925                   v->getMEhisto_PtResolution_L1HLT()->Fill((toc[*ki].pt()-toc[*kj].pt())/(toc[*ki].pt()));
00926                   v->getMEhisto_EtaResolution_L1HLT()->Fill((toc[*ki].eta()-toc[*kj].eta())/(toc[*ki].eta()));
00927                   v->getMEhisto_PhiResolution_L1HLT()->Fill((toc[*ki].phi()-toc[*kj].phi())/(toc[*ki].phi()));
00928                 }
00929                 if(((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi) < 0.4 ) 
00930                     || ((v->getTriggerType().compare("DiJet_Trigger") == 0)  && hltTrigBool)) && !diJetFire){
00931                   v->getMEhisto_Pt_HLT()->Fill(toc[*kj].pt());
00932                   if (isBarrel(toc[*kj].eta()))  v->getMEhisto_PtBarrel_HLT()->Fill(toc[*kj].pt());
00933                   if (isEndCap(toc[*kj].eta()))  v->getMEhisto_PtEndcap_HLT()->Fill(toc[*kj].pt());
00934                   if (isForward(toc[*kj].eta())) v->getMEhisto_PtForward_HLT()->Fill(toc[*kj].pt());
00935                   v->getMEhisto_Eta_HLT()->Fill(toc[*kj].eta());
00936                   v->getMEhisto_Phi_HLT()->Fill(toc[*kj].phi());
00937                   v->getMEhisto_EtaPhi_HLT()->Fill(toc[*kj].eta(),toc[*kj].phi());
00938 
00939                   //Calojet
00940                   if(calojetColl_.isValid() 
00941                      && (v->getObjectType() == trigger::TriggerJet)
00942                      && (v->getPath().compare("PFJet") == 0)){
00943                     //CaloJetCollection::const_iterator jet = calojet.begin();
00944                     //for(; jet != calojet.end(); ++jet) {
00945                     for(int iCalo=0; iCalo<2; iCalo++){
00946                       if(deltaR(hltTrigEta, hltTrigPhi, CaloJetEta[iCalo], CaloJetPhi[iCalo]) < 0.4){
00947                         jetsize++; 
00948                         if(v->getTriggerType().compare("SingleJet_Trigger") == 0){
00949                           v->getMEhisto_Pt()->Fill(CaloJetPt[iCalo]);
00950                           if (isBarrel(CaloJetEta[iCalo]))  v->getMEhisto_PtBarrel()->Fill(CaloJetPt[iCalo]);
00951                           if (isEndCap(CaloJetEta[iCalo]))  v->getMEhisto_PtEndcap()->Fill(CaloJetPt[iCalo]);
00952                           if (isForward(CaloJetEta[iCalo])) v->getMEhisto_PtForward()->Fill(CaloJetPt[iCalo]);
00953                           //
00954                           v->getMEhisto_Eta()->Fill(CaloJetEta[iCalo]);
00955                           v->getMEhisto_Phi()->Fill(CaloJetPhi[iCalo]);
00956                           v->getMEhisto_EtaPhi()->Fill(CaloJetEta[iCalo],CaloJetPhi[iCalo]); 
00957                           //
00958                           v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].pt(),CaloJetPt[iCalo]);
00959                           v->getMEhisto_EtaCorrelation_HLTRecObj()->Fill(toc[*kj].eta(),CaloJetEta[iCalo]);
00960                           v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(),CaloJetPhi[iCalo]);
00961                           //
00962                           v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].pt()-CaloJetPt[iCalo])/(toc[*kj].pt()));
00963                           v->getMEhisto_EtaResolution_HLTRecObj()->Fill((toc[*kj].eta()-CaloJetEta[iCalo])/(toc[*kj].eta()));
00964                           v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*kj].phi()-CaloJetPhi[iCalo])/(toc[*kj].phi()));
00965                         }
00966                         
00967                         //-------------------------------------------------------    
00968                         if((v->getTriggerType().compare("DiJet_Trigger") == 0)){
00969                           jetPhiVec.push_back(CaloJetPhi[iCalo]);
00970                           jetPtVec.push_back(CaloJetPt[iCalo]);
00971                           jetEtaVec.push_back(CaloJetEta[iCalo]);         
00972                           jetPxVec.push_back(CaloJetPx[iCalo]);
00973                           jetPyVec.push_back(CaloJetPy[iCalo]); 
00974                           //
00975                           hltPhiVec.push_back(toc[*kj].phi());
00976                           hltPtVec.push_back(toc[*kj].pt());
00977                           hltEtaVec.push_back(toc[*kj].eta());
00978                           hltPxVec.push_back(toc[*kj].px()); 
00979                           hltPyVec.push_back(toc[*kj].py());
00980                         }
00981                       }// matching jet           
00982                     }// CaloJet Loop
00983                   }// valid calojet collection, with calojet trigger
00984                   
00985                   //PFJet trigger
00986                   if(pfjetColl_.isValid() 
00987                      && (v->getObjectType() == trigger::TriggerJet)
00988                      && (v->getPath().compare("PFJet") != 0)){
00989                     //PFJetCollection::const_iterator jet = pfjet.begin();
00990                     //for(; jet != pfjet.end(); ++jet){ 
00991                     for(int iPF=0; iPF<2; iPF++){
00992                       if(deltaR(hltTrigEta, hltTrigPhi, PFJetEta[iPF], PFJetPhi[iPF]) < 0.4){
00993                         jetsize++;
00994                         if(v->getTriggerType().compare("SingleJet_Trigger") == 0){
00995                           v->getMEhisto_Pt()->Fill(PFJetPt[iPF]);
00996                           if (isBarrel(PFJetEta[iPF]))  v->getMEhisto_PtBarrel()->Fill(PFJetPt[iPF]);
00997                           if (isEndCap(PFJetEta[iPF]))  v->getMEhisto_PtEndcap()->Fill(PFJetPt[iPF]);
00998                           if (isForward(PFJetEta[iPF])) v->getMEhisto_PtForward()->Fill(PFJetPt[iPF]);
00999                           //
01000                           v->getMEhisto_Eta()->Fill(PFJetEta[iPF]);
01001                           v->getMEhisto_Phi()->Fill(PFJetPhi[iPF]);
01002                           v->getMEhisto_EtaPhi()->Fill(PFJetEta[iPF],PFJetPhi[iPF]); 
01003                           //
01004                           v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].pt(),PFJetPt[iPF]);
01005                           v->getMEhisto_EtaCorrelation_HLTRecObj()->Fill(toc[*kj].eta(),PFJetEta[iPF]);
01006                           v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(),PFJetPhi[iPF]);
01007                           //
01008                           v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].pt()-PFJetPt[iPF])/(toc[*kj].pt()));
01009                           v->getMEhisto_EtaResolution_HLTRecObj()->Fill((toc[*kj].eta()-PFJetEta[iPF])/(toc[*kj].eta()));
01010                           v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*kj].phi()-PFJetPhi[iPF])/(toc[*kj].phi()));
01011                         }
01012                         
01013                         //-------------------------------------------------------    
01014                         if((v->getTriggerType().compare("DiJet_Trigger") == 0)){
01015                           jetPhiVec.push_back(PFJetPhi[iPF]);
01016                           jetPtVec.push_back(PFJetPt[iPF]);
01017                           jetEtaVec.push_back(PFJetEta[iPF]);         
01018                           jetPxVec.push_back(PFJetPx[iPF]);
01019                           jetPyVec.push_back(PFJetPy[iPF]); 
01020                           //
01021                           hltPhiVec.push_back(toc[*kj].phi());
01022                           hltPtVec.push_back(toc[*kj].pt());
01023                           hltEtaVec.push_back(toc[*kj].eta());
01024                           hltPxVec.push_back(toc[*kj].px()); 
01025                           hltPyVec.push_back(toc[*kj].py());
01026                         }
01027                       }// matching jet  
01028                     }//PFJet loop
01029                   }//valid pfjet collection, with pfjet trigger
01030                   //
01031                 }// hlt matching with l1               
01032               }// jet trigger
01033               
01034               //------------------------------------------------------
01035               if(calometColl_.isValid() 
01036                  && ((v->getObjectType() == trigger::TriggerMET) || (v->getObjectType() == trigger::TriggerTET))
01037                  && (v->getPath().find("HLT_PFMET")==std::string::npos)){
01038                 const CaloMETCollection *calometcol = calometColl_.product();
01039                 const CaloMET met = calometcol->front();
01040                 //
01041                 v->getMEhisto_Pt()->Fill(met.et()); 
01042                 v->getMEhisto_Phi()->Fill(met.phi());
01043                 //
01044                 v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].et(),met.et());
01045                 v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(),met.phi());
01046                 v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].et()-met.et())/(toc[*kj].et()));
01047                 v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*kj].phi()-met.phi())/(toc[*kj].phi())); 
01048               }
01049               
01050               //--------------------------------------------------------
01051               if(pfmetColl_.isValid() 
01052                  && ((v->getObjectType() == trigger::TriggerMET) || (v->getObjectType() == trigger::TriggerTET))
01053                  && (v->getPath().find("HLT_PFMET")!=std::string::npos)){
01054                 const PFMETCollection *pfmetcol = pfmetColl_.product();
01055                 const PFMET pfmet = pfmetcol->front();
01056                 //
01057                 v->getMEhisto_Pt()->Fill(pfmet.et()); 
01058                 v->getMEhisto_Phi()->Fill(pfmet.phi());
01059                 //
01060                 v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].et(),pfmet.et());
01061                 v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(),pfmet.phi());
01062                 v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].et()-pfmet.et())/(toc[*kj].et()));
01063                 v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*kj].phi()-pfmet.phi())/(toc[*kj].phi())); 
01064               }
01065             }//Loop over HLT trigger candidates
01066             if((v->getTriggerType().compare("DiJet_Trigger") == 0)) diJetFire = true;
01067           }// Valid hlt trigger object
01068         }// Loop over L1 objects
01069       }// Valid L1 trigger object
01070       v->getMEhisto_N()->Fill(jetsize);
01071       
01072       //--------------------------------------------------------
01073       if((v->getTriggerType().compare("DiJet_Trigger") == 0) && jetPtVec.size() >1){
01074         double AveJetPt = (jetPtVec[0] + jetPtVec[1])/2;
01075         double AveJetEta = (jetEtaVec[0] + jetEtaVec[1])/2;               
01076         double JetDelPhi = deltaPhi(jetPhiVec[0],jetPhiVec[1]);
01077         double AveHLTPt = (hltPtVec[0] + hltPtVec[1])/2;
01078         double AveHLTEta = (hltEtaVec[0] + hltEtaVec[1])/2;
01079         double HLTDelPhi = deltaPhi(hltPhiVec[0],hltPhiVec[1]);
01080         v->getMEhisto_AveragePt_RecObj()->Fill(AveJetPt);
01081         v->getMEhisto_AverageEta_RecObj()->Fill(AveJetEta);
01082         v->getMEhisto_DeltaPhi_RecObj()->Fill(JetDelPhi);
01083         //
01084         v->getMEhisto_AveragePt_HLTObj()->Fill(AveHLTPt);
01085         v->getMEhisto_AverageEta_HLTObj()->Fill(AveHLTEta);
01086         v->getMEhisto_DeltaPhi_HLTObj()->Fill(HLTDelPhi);
01087       }
01088       
01089       //-----------------------------------------------------      
01090       if(v->getPath().find("L1") != std::string::npos && !fillL1HLT){
01091         if ( l1Index >= triggerObj_->sizeFilters() ) {
01092           edm::LogInfo("JetMETHLTOfflineSource") << "no index "<< l1Index << " of that name "<<l1Tag;
01093         }
01094         else {
01095           //l1TrigBool = true;
01096           const trigger::Keys & kl1 = triggerObj_->filterKeys(l1Index);
01097           for( trigger::Keys::const_iterator ki = kl1.begin(); ki != kl1.end(); ++ki){
01098             double l1TrigEta = toc[*ki].eta();
01099             double l1TrigPhi = toc[*ki].phi();
01100             if(calojetColl_.isValid() && (v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("SingleJet_Trigger") == 0) ){
01101               for(CaloJetCollection::const_iterator jet = calojet.begin(); jet != calojet.end(); ++jet ) {
01102                 double jetEta = jet->eta();
01103                 double jetPhi = jet->phi();
01104                 if(deltaR(l1TrigEta, l1TrigPhi, jetEta, jetPhi) < 0.4){
01105                   jetsize++;
01106                   v->getMEhisto_Pt()->Fill(jet->pt());
01107                   if (isBarrel(jet->eta()))  v->getMEhisto_PtBarrel()->Fill(jet->pt());
01108                   if (isEndCap(jet->eta()))  v->getMEhisto_PtEndcap()->Fill(jet->pt());
01109                   if (isForward(jet->eta())) v->getMEhisto_PtForward()->Fill(jet->pt());
01110                   //
01111                   v->getMEhisto_Eta()->Fill(jet->eta());
01112                   v->getMEhisto_Phi()->Fill(jet->phi());
01113                   v->getMEhisto_EtaPhi()->Fill(jet->eta(),jet->phi()); 
01114                   //
01115                   v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*ki].pt(),jet->pt());
01116                   v->getMEhisto_EtaCorrelation_HLTRecObj()->Fill(toc[*ki].eta(),jet->eta());
01117                   v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*ki].phi(),jet->phi());
01118                   //
01119                   v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*ki].pt()-jet->pt())/(toc[*ki].pt()));
01120                   v->getMEhisto_EtaResolution_HLTRecObj()->Fill((toc[*ki].eta()-jet->eta())/(toc[*ki].eta()));
01121                   v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*ki].phi()-jet->phi())/(toc[*ki].phi()));
01122                   
01123                 }// matching jet
01124                 
01125               }// Jet Loop
01126               v->getMEhisto_N()->Fill(jetsize);
01127             }// valid Jet collection
01128             
01129             if(calometColl_.isValid() && ((v->getObjectType() == trigger::TriggerMET)|| (v->getObjectType() == trigger::TriggerTET))){
01130               const CaloMETCollection *calometcol = calometColl_.product();
01131               const CaloMET met = calometcol->front();
01132               v->getMEhisto_Pt()->Fill(met.pt()); 
01133               v->getMEhisto_Phi()->Fill(met.phi());
01134               //
01135               v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*ki].pt(),met.pt());
01136               v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*ki].phi(),met.phi());
01137               v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*ki].pt()-met.pt())/(toc[*ki].pt()));
01138               v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*ki].phi()-met.phi())/(toc[*ki].phi()));
01139             }// valid MET Collection           
01140           }// Loop over keys
01141         }// valid object
01142       }// L1 is fired but not HLT       
01143     }//Loop all paths
01144   }//if(muTrig)
01145 }
01146 
01147 void 
01148 JetMETHLTOfflineSource::fillMEforEffAllTrigger(const Event & iEvent, const edm::EventSetup& iSetup)
01149 {
01150   //int npath;
01151   if(&triggerResults_){ /*npath = triggerResults_->size();*/ } 
01152   else return;
01153   
01154   int  num         = -1;
01155   int  denom       = -1;
01156   bool denompassed = false;
01157   bool numpassed   = false; 
01158   const trigger::TriggerObjectCollection & toc(triggerObj_->getObjects());
01159 
01160   for(PathInfoCollection::iterator v = hltPathsEff_.begin(); v!= hltPathsEff_.end(); ++v ){
01161     num++;
01162     denom++;
01163     denompassed = false;
01164     numpassed   = false; 
01165     
01166     unsigned indexNum = triggerNames_.triggerIndex(v->getPath());
01167     unsigned indexDenom = triggerNames_.triggerIndex(v->getDenomPath());
01168     
01169     if(indexNum   < triggerNames_.size() && triggerResults_->accept(indexNum))   numpassed   = true;
01170     if(indexDenom < triggerNames_.size() && triggerResults_->accept(indexDenom)) denompassed = true;
01171 
01172     if(denompassed==false) continue;
01173     
01174     //if(numpassed==true){
01175     edm::InputTag hltTag(v->getLabel(),"",processname_);
01176     const int hltIndex = triggerObj_->filterIndex(hltTag);
01177     edm::InputTag l1Tag(v->getl1Path(),"",processname_);
01178     const int l1Index = triggerObj_->filterIndex(l1Tag);
01179     //}
01180     
01181     //----------------------------------------------------------------------
01182     //double pTcut = 0;
01183     double trigLowpTcut = 0;
01184     double trigMedpTcut = 0;
01185     double trigHighpTcut = 0;
01186     double trigLowpTcutFwd = 0;
01187     double trigMedpTcutFwd = 0;
01188     double trigHighpTcutFwd = 0;
01189     //
01190     //double pTPFcut = 0 ;
01191     double trigLowpTPFcut = 0;
01192     double trigMedpTPFcut = 0;
01193     double trigHighpTPFcut = 0;
01194     double trigLowpTPFcutFwd = 0;
01195     double trigMedpTPFcutFwd = 0;
01196     double trigHighpTPFcutFwd = 0;
01197     //
01198     //cout<<"pre-path" << v->getPath()<<endl;
01199     size_t jetstrfound = v->getPath().find("Jet");
01200     //size_t censtrfound = v->getPath().find("Central"); //shoouldn't be needed?
01201     string tpath = v->getPath();
01202     string jetTrigVal;
01203     float jetVal = 0.;
01204     //
01205     if(jetstrfound != string::npos){// && ustrfound != string::npos ){
01206       //cout<<v->getPath()<<endl;
01207       for(int trig = int(jetstrfound)+3; trig < int(jetstrfound)+7; trig++){// int(ustrfound); trig++){
01208         if(!isdigit(tpath[trig])) break;
01209         jetTrigVal+=tpath[trig];
01210       }
01211       char *cjetTrigVal = (char*)jetTrigVal.c_str();
01212       jetVal=atof(cjetTrigVal);
01213       //
01214       if(jetVal>0.){
01215         if(jetVal<50.){
01216           //pTcut = jetVal / 2.;
01217           trigMedpTcut  = jetVal + 5.;  
01218           trigHighpTcut = jetVal + 10.;
01219           //
01220           trigLowpTcutFwd = jetVal + 9.;
01221           trigMedpTcutFwd = jetVal + 15.;
01222           trigHighpTcutFwd = jetVal + 21.;
01223         }
01224         else{
01225           //pTcut = jetVal - 20. ;
01226           trigMedpTcut = jetVal + 2.; 
01227           trigHighpTcut = jetVal + 60.;
01228           //
01229           trigLowpTcutFwd = jetVal + 22.;
01230           trigMedpTcutFwd = jetVal + 25.;
01231           trigHighpTcutFwd = jetVal + 110.;
01232         }
01233         trigLowpTcut = jetVal;
01234       }
01235       //
01236       if(jetVal>0.){
01237         if(jetVal<50.){
01238           //pTPFcut = jetVal ;
01239           trigMedpTPFcut  = jetVal + 20.;  
01240           trigHighpTPFcut = jetVal + 40.;
01241           //
01242           trigLowpTPFcutFwd = jetVal + 60.;
01243           trigMedpTPFcutFwd = jetVal + 80.;
01244           trigHighpTPFcutFwd = jetVal + 100.;
01245         }
01246         else{
01247           //pTPFcut = jetVal  ;
01248           trigMedpTPFcut = jetVal + 40.; 
01249           trigHighpTPFcut = jetVal + 140.;
01250           //
01251           trigLowpTPFcutFwd = jetVal + 110.;
01252           trigMedpTPFcutFwd = jetVal + 130.;
01253           trigHighpTPFcutFwd = jetVal + 190.;
01254         }
01255         trigLowpTPFcut = jetVal;
01256       }
01257     }
01258     //----------------------------------------------------------------------
01259     
01260     //CaloJet paths   
01261     if(verbose_) std::cout << "fillMEforEffAllTrigger: CaloJet -------------------" << std::endl;
01262     if(calojetColl_.isValid() && (v->getObjectType() == trigger::TriggerJet)){
01263       //cout<<"   - CaloJet "<<endl;
01264       //&& (v->getPath().find("HLT_PFJet")==std::string::npos)
01265       //&& (v->getPath().find("HLT_DiPFJet")==std::string::npos)){
01266       bool jetIDbool = false;
01267       double leadjpt  = CaloJetPt[0];  
01268       double leadjeta = CaloJetEta[0];
01269       double leadjphi = CaloJetPhi[0];
01270       //double ljemf    = CaloJetEMF[0];
01271       double ljfhpd   = CaloJetfHPD[0];
01272       double ljn90    = CaloJetn90[0];
01273       if((v->getTriggerType().compare("SingleJet_Trigger") == 0) && calojet.size()){ //this line stops the central jets
01274         if( (ljfhpd < _fHPD) && (ljn90 > _n90Hits )){
01275           if(verbose_) cout<<"Passed CaloJet ID -------------------" << endl;
01276           jetIDbool = true;
01277           //Denominator fill
01278           v->getMEhisto_DenominatorPt()->Fill(leadjpt);
01279           if (isBarrel(leadjeta))  v->getMEhisto_DenominatorPtBarrel()->Fill(leadjpt);
01280           if (isEndCap(leadjeta))  v->getMEhisto_DenominatorPtEndcap()->Fill(leadjpt);
01281           if (isForward(leadjeta)) v->getMEhisto_DenominatorPtForward()->Fill(leadjpt);
01282           v->getMEhisto_DenominatorEta()->Fill(leadjeta);
01283           v->getMEhisto_DenominatorPhi()->Fill(leadjphi);
01284           v->getMEhisto_DenominatorEtaPhi()->Fill(leadjeta,leadjphi);
01285           if (isBarrel(leadjeta)){
01286             v->getMEhisto_DenominatorEtaBarrel()->Fill(leadjeta);
01287             v->getMEhisto_DenominatorPhiBarrel()->Fill(leadjphi);
01288           }
01289           if (isEndCap(leadjeta)){
01290             v->getMEhisto_DenominatorEtaEndcap()->Fill(leadjeta);
01291             v->getMEhisto_DenominatorPhiEndcap()->Fill(leadjphi);
01292           }
01293           if (isForward(leadjeta)){
01294             v->getMEhisto_DenominatorEtaForward()->Fill(leadjeta);
01295             v->getMEhisto_DenominatorPhiForward()->Fill(leadjphi);
01296           }
01297           if((leadjpt > trigLowpTcut && !isForward(leadjeta)) || (leadjpt > trigLowpTcutFwd && isForward(leadjeta))){
01298             v->getMEhisto_DenominatorEta_LowpTcut()->Fill(leadjeta);
01299             v->getMEhisto_DenominatorPhi_LowpTcut()->Fill(leadjphi);
01300             v->getMEhisto_DenominatorEtaPhi_LowpTcut()->Fill(leadjeta,leadjphi);
01301           }
01302           if((leadjpt > trigMedpTcut && !isForward(leadjeta)) || (leadjpt > trigMedpTcutFwd && isForward(leadjeta))){
01303             v->getMEhisto_DenominatorEta_MedpTcut()->Fill(leadjeta);
01304             v->getMEhisto_DenominatorPhi_MedpTcut()->Fill(leadjphi);
01305             v->getMEhisto_DenominatorEtaPhi_MedpTcut()->Fill(leadjeta,leadjphi);
01306           }
01307           if((leadjpt > trigHighpTcut && !isForward(leadjeta)) || (leadjpt > trigHighpTcutFwd && isForward(leadjeta))){
01308             v->getMEhisto_DenominatorEta_HighpTcut()->Fill(leadjeta);
01309             v->getMEhisto_DenominatorPhi_HighpTcut()->Fill(leadjphi);
01310             v->getMEhisto_DenominatorEtaPhi_HighpTcut()->Fill(leadjeta,leadjphi);
01311           }
01312           
01313           //Numerator fill
01314           if(numpassed){
01315             //
01316             double dRmin = 99999.;
01317             double dPhimin = 9999.;
01318             if(v->getPath().find("L1") != std::string::npos){ 
01319               if ( l1Index >= triggerObj_->sizeFilters() ) {
01320                 edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
01321               } 
01322               else {
01323                 const trigger::Keys & kl1 = triggerObj_->filterKeys(l1Index);
01324                 for(trigger::Keys::const_iterator ki = kl1.begin();ki != kl1.end(); ++ki){
01325                   double dR = deltaR(toc[*ki].eta(), toc[*ki].phi(), leadjeta, leadjphi);
01326                   if(dR < dRmin){
01327                     dRmin = dR;
01328                   } 
01329                 } 
01330               } 
01331             } 
01332             else{
01333               if ( hltIndex >= triggerObj_->sizeFilters() ) {
01334                 edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
01335               } 
01336               else {    
01337                 const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex); 
01338                 trigger::Keys::const_iterator kj = khlt.begin();
01339                 for(;kj != khlt.end(); ++kj){
01340                   double dR = deltaR(toc[*kj].eta(), toc[*kj].phi(), 
01341                                      leadjeta, leadjphi);
01342                   if(dR < dRmin){
01343                     dRmin = dR;
01344                   }
01345                   double dPhi = deltaPhi(toc[*kj].phi(), leadjphi);
01346                   if(dPhi < dPhimin){
01347                     dPhimin = dPhi;
01348                   }
01349                 }   
01350                 //v->getMEhisto_DeltaPhi()->Fill(dPhimin);
01351                 v->getMEhisto_DeltaPhi()->Fill(dPhimin);
01352                 v->getMEhisto_DeltaR()->Fill(dRmin);
01353               }
01354             }
01355             if(dRmin < 0.1 || (v->getPath().find("L1") != std::string::npos && dRmin < 0.4)){
01356               v->getMEhisto_NumeratorPt()->Fill(leadjpt);
01357               if (isBarrel(leadjeta))  v->getMEhisto_NumeratorPtBarrel()->Fill(leadjpt);
01358               if (isEndCap(leadjeta))  v->getMEhisto_NumeratorPtEndcap()->Fill(leadjpt);
01359               if (isForward(leadjeta)) v->getMEhisto_NumeratorPtForward()->Fill(leadjpt);
01360               v->getMEhisto_NumeratorEta()->Fill(leadjeta);
01361               v->getMEhisto_NumeratorPhi()->Fill(leadjphi);
01362               v->getMEhisto_NumeratorEtaPhi()->Fill(leadjeta,leadjphi);
01363               if (isBarrel(leadjeta)){
01364                 v->getMEhisto_NumeratorEtaBarrel()->Fill(leadjeta);
01365                 v->getMEhisto_NumeratorPhiBarrel()->Fill(leadjphi);
01366               }
01367               if (isEndCap(leadjeta)){
01368                 v->getMEhisto_NumeratorEtaEndcap()->Fill(leadjeta);
01369                 v->getMEhisto_NumeratorPhiEndcap()->Fill(leadjphi);
01370               }
01371               if (isForward(leadjeta)){
01372                 v->getMEhisto_NumeratorEtaForward()->Fill(leadjeta);
01373                 v->getMEhisto_NumeratorPhiForward()->Fill(leadjphi);
01374               }
01375               if((leadjpt > trigLowpTcut && !isForward(leadjeta)) || (leadjpt > trigLowpTcutFwd && isForward(leadjeta))){
01376                 v->getMEhisto_NumeratorEta_LowpTcut()->Fill(leadjeta);
01377                 v->getMEhisto_NumeratorPhi_LowpTcut()->Fill(leadjphi);
01378                 v->getMEhisto_NumeratorEtaPhi_LowpTcut()->Fill(leadjeta,leadjphi);
01379               }
01380               if((leadjpt > trigMedpTcut && !isForward(leadjeta)) || (leadjpt > trigMedpTcutFwd && isForward(leadjeta))){
01381                 v->getMEhisto_NumeratorEta_MedpTcut()->Fill(leadjeta);
01382                 v->getMEhisto_NumeratorPhi_MedpTcut()->Fill(leadjphi);
01383                 v->getMEhisto_NumeratorEtaPhi_MedpTcut()->Fill(leadjeta,leadjphi);
01384               }
01385               if((leadjpt > trigHighpTcut && !isForward(leadjeta)) || (leadjpt > trigHighpTcutFwd && isForward(leadjeta))){
01386                 v->getMEhisto_NumeratorEta_HighpTcut()->Fill(leadjeta);
01387                 v->getMEhisto_NumeratorPhi_HighpTcut()->Fill(leadjphi);
01388                 v->getMEhisto_NumeratorEtaPhi_HighpTcut()->Fill(leadjeta,leadjphi);
01389               }
01390             }
01391           }//numpassed
01392         }//CalojetID filter
01393       }
01394       
01395       if(jetIDbool == true && (v->getTriggerType().compare("DiJet_Trigger") == 0) && calojet.size()>1){
01396         if(((CaloJetEMF[1] > _fEMF || std::abs(CaloJetEta[1]) > _feta) && 
01397             CaloJetfHPD[0] < _fHPD && CaloJetn90[0] > _n90Hits)){
01398           v->getMEhisto_DenominatorPt()->Fill((CaloJetPt[0] + CaloJetPt[1])/2.);
01399           v->getMEhisto_DenominatorEta()->Fill((CaloJetEta[0] + CaloJetEta[1])/2.); 
01400           if(numpassed==true){
01401             v->getMEhisto_NumeratorPt()->Fill((CaloJetPt[0] + CaloJetPt[1])/2.);
01402             v->getMEhisto_NumeratorEta()->Fill((CaloJetEta[0] + CaloJetEta[1])/2.);
01403           }
01404         }
01405       }
01406     }// Jet trigger and valid jet collection
01407     
01408     //PFJet paths
01409     if(verbose_) std::cout << "fillMEforEffAllTrigger: PFJet -------------------" << std::endl;
01410     if(pfjetColl_.isValid() && (v->getObjectType() == trigger::TriggerJet)){
01411       //cout<<"   - PFJet "<<endl;
01412       //&& (v->getPath().find("HLT_PFJet")!=std::string::npos)
01413       //&& (v->getPath().find("HLT_DiPFJet")!=std::string::npos)){
01414       bool jetIDbool = false;
01415       double leadjpt   = PFJetPt[0]; 
01416       double leadjeta  = PFJetEta[0];
01417       double leadjphi  = PFJetPhi[0];
01418       double ljNHEF    = PFJetNHEF[0];
01419       double ljCHEF    = PFJetCHEF[0];
01420       double ljNEMF    = PFJetNEMF[0];
01421       double ljCEMF    = PFJetCEMF[0];
01422       //double sleadjpt  = PFJetPt[1];
01423       //double sleadjeta = PFJetEta[1];
01424       //double sleadjphi = PFJetPhi[1];
01425       double sljNHEF   = PFJetNHEF[1];
01426       double sljCHEF   = PFJetCHEF[1];
01427       double sljNEMF   = PFJetNEMF[1];
01428       double sljCEMF   = PFJetCEMF[1];
01429       //
01430       double pfMHTx    = pfMHTx_All;
01431       double pfMHTy    = pfMHTy_All;
01432       //
01433       if((v->getTriggerType().compare("SingleJet_Trigger") == 0) && pfjet.size()){ //this line stops the central jets
01434         
01435         //======get pfmht
01436         _pfMHT = sqrt(pfMHTx*pfMHTx + pfMHTy*pfMHTy);
01437         v->getMEhisto_DenominatorPFMHT()->Fill(_pfMHT);
01438         
01439         if( ljNHEF >= _min_NHEF && ljNHEF <= _max_NHEF
01440             && ljCHEF >= _min_CHEF && ljCHEF <= _max_CHEF
01441             && ljNEMF >= _min_NEMF && ljNEMF <= _max_NEMF
01442             && ljCEMF >= _min_CEMF && ljCEMF <= _max_CEMF){
01443           if(verbose_) cout<<"Passed PFJet ID -------------------" << endl;
01444           jetIDbool = true;
01445           v->getMEhisto_DenominatorPFPt()->Fill(leadjpt);
01446           if (isBarrel(leadjeta))  v->getMEhisto_DenominatorPFPtBarrel()->Fill(leadjpt);
01447           if (isEndCap(leadjeta))  v->getMEhisto_DenominatorPFPtEndcap()->Fill(leadjpt);
01448           if (isForward(leadjeta)) v->getMEhisto_DenominatorPFPtForward()->Fill(leadjpt);
01449           v->getMEhisto_DenominatorPFEta()->Fill(leadjeta);
01450           v->getMEhisto_DenominatorPFPhi()->Fill(leadjphi);
01451           v->getMEhisto_DenominatorPFEtaPhi()->Fill(leadjeta,leadjphi);
01452           if(isBarrel(leadjeta)){
01453             v->getMEhisto_DenominatorPFEtaBarrel()->Fill(leadjeta);
01454             v->getMEhisto_DenominatorPFPhiBarrel()->Fill(leadjphi);
01455           }
01456           if (isEndCap(leadjeta)){
01457             v->getMEhisto_DenominatorPFEtaEndcap()->Fill(leadjeta);
01458             v->getMEhisto_DenominatorPFPhiEndcap()->Fill(leadjphi);
01459           }
01460           if (isForward(leadjeta)){
01461             v->getMEhisto_DenominatorPFEtaForward()->Fill(leadjeta);
01462             v->getMEhisto_DenominatorPFPhiForward()->Fill(leadjphi);
01463           }
01464           if((leadjpt > trigLowpTPFcut && !isForward(leadjeta)) || (leadjpt > trigLowpTPFcutFwd && isForward(leadjeta))){
01465             v->getMEhisto_DenominatorPFEta_LowpTcut()->Fill(leadjeta);
01466             v->getMEhisto_DenominatorPFPhi_LowpTcut()->Fill(leadjphi);
01467             v->getMEhisto_DenominatorPFEtaPhi_LowpTcut()->Fill(leadjeta,leadjphi);
01468           }
01469           if((leadjpt > trigMedpTPFcut && !isForward(leadjeta)) || (leadjpt > trigMedpTPFcutFwd && isForward(leadjeta))){
01470             v->getMEhisto_DenominatorPFEta_MedpTcut()->Fill(leadjeta);
01471             v->getMEhisto_DenominatorPFPhi_MedpTcut()->Fill(leadjphi);
01472             v->getMEhisto_DenominatorPFEtaPhi_MedpTcut()->Fill(leadjeta,leadjphi);
01473           }
01474           if((leadjpt > trigHighpTPFcut && !isForward(leadjeta)) || (leadjpt > trigHighpTPFcutFwd && isForward(leadjeta))){
01475             v->getMEhisto_DenominatorPFEta_HighpTcut()->Fill(leadjeta);
01476             v->getMEhisto_DenominatorPFPhi_HighpTcut()->Fill(leadjphi);
01477             v->getMEhisto_DenominatorPFEtaPhi_HighpTcut()->Fill(leadjeta,leadjphi);
01478           }
01479           
01480           //Numerator fill
01481           if(numpassed){
01482             double dRmin = 99999.;
01483             double dPhimin = 9999.;
01484             if(v->getPath().find("L1") != std::string::npos){ 
01485               if ( l1Index >= triggerObj_->sizeFilters() ) {
01486                 edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
01487               } 
01488               else{    
01489                 const trigger::Keys & kl1 = triggerObj_->filterKeys(l1Index);
01490                 for(trigger::Keys::const_iterator ki = kl1.begin();ki != kl1.end(); ++ki){      
01491                   double dR = deltaR(toc[*ki].eta(), toc[*ki].phi(), leadjeta, leadjphi);
01492                   if(dR < dRmin){
01493                     dRmin = dR;
01494                   } 
01495                 } 
01496               }                
01497             } 
01498             else{
01499               if ( hltIndex >= triggerObj_->sizeFilters() ) {
01500                 edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
01501               } 
01502               else{    
01503                 const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex); 
01504                 for(trigger::Keys::const_iterator kj = khlt.begin();kj != khlt.end(); ++kj){      
01505                   double dR = deltaR(toc[*kj].eta(), toc[*kj].phi(), leadjeta, leadjphi);
01506                   if(dR < dRmin){
01507                     dRmin = dR;
01508                   } 
01509                   double dPhi = deltaPhi(toc[*kj].phi(), leadjphi);
01510                   if(dPhi < dPhimin){
01511                     dPhimin = dPhi;
01512                   }
01513                 }  
01514                 v->getMEhisto_PFDeltaPhi()->Fill(dPhimin);
01515                 v->getMEhisto_PFDeltaR()->Fill(dRmin);
01516               }  
01517             }
01518             if(dRmin < 0.1 || (v->getPath().find("L1") != std::string::npos && dRmin < 0.4)){
01519               v->getMEhisto_NumeratorPFPt()->Fill(leadjpt);
01520               if (isBarrel(leadjeta))  v->getMEhisto_NumeratorPFPtBarrel()->Fill(leadjpt);
01521               if (isEndCap(leadjeta))  v->getMEhisto_NumeratorPFPtEndcap()->Fill(leadjpt);
01522               if (isForward(leadjeta)) v->getMEhisto_NumeratorPFPtForward()->Fill(leadjpt);
01523               v->getMEhisto_NumeratorPFEta()->Fill(leadjeta);
01524               v->getMEhisto_NumeratorPFPhi()->Fill(leadjphi);
01525               v->getMEhisto_NumeratorPFEtaPhi()->Fill(leadjeta,leadjphi);
01526               if (isBarrel(leadjeta)){
01527                 v->getMEhisto_NumeratorPFEtaBarrel()->Fill(leadjeta);
01528                 v->getMEhisto_NumeratorPFPhiBarrel()->Fill(leadjphi);
01529               }
01530               if (isEndCap(leadjeta)){
01531                 v->getMEhisto_NumeratorPFEtaEndcap()->Fill(leadjeta);
01532                 v->getMEhisto_NumeratorPFPhiEndcap()->Fill(leadjphi);
01533               }
01534               if (isForward(leadjeta)){
01535                 v->getMEhisto_NumeratorPFEtaForward()->Fill(leadjeta);
01536                 v->getMEhisto_NumeratorPFPhiForward()->Fill(leadjphi);
01537               }
01538               if((leadjpt > trigLowpTPFcut && !isForward(leadjeta)) 
01539                  || (leadjpt > trigLowpTPFcutFwd && isForward(leadjeta))){
01540                 v->getMEhisto_NumeratorPFEta_LowpTcut()->Fill(leadjeta);
01541                 v->getMEhisto_NumeratorPFPhi_LowpTcut()->Fill(leadjphi);
01542                 v->getMEhisto_NumeratorPFEtaPhi_LowpTcut()->Fill(leadjeta,leadjphi);
01543               }
01544               if((leadjpt > trigMedpTPFcut && !isForward(leadjeta)) 
01545                  || (leadjpt > trigMedpTPFcutFwd && isForward(leadjeta))){
01546                 v->getMEhisto_NumeratorPFEta_MedpTcut()->Fill(leadjeta);
01547                 v->getMEhisto_NumeratorPFPhi_MedpTcut()->Fill(leadjphi);
01548                 v->getMEhisto_NumeratorPFEtaPhi_MedpTcut()->Fill(leadjeta,leadjphi);
01549               }
01550               if((leadjpt > trigHighpTPFcut && !isForward(leadjeta)) 
01551                  || (leadjpt > trigHighpTPFcutFwd && isForward(leadjeta))){
01552                 v->getMEhisto_NumeratorPFEta_HighpTcut()->Fill(leadjeta);
01553                 v->getMEhisto_NumeratorPFPhi_HighpTcut()->Fill(leadjphi);
01554                 v->getMEhisto_NumeratorPFEtaPhi_HighpTcut()->Fill(leadjeta,leadjphi);
01555               }
01556             }
01557           }
01558         }
01559       }
01560       if(jetIDbool == true && (v->getTriggerType().compare("DiJet_Trigger") == 0) && pfjet.size()>1){
01561         if( ljNHEF     >= _min_NHEF && ljNHEF  <= _max_NHEF
01562             && ljCHEF  >= _min_CHEF && ljCHEF  <= _max_CHEF
01563             && ljNEMF  >= _min_NEMF && ljNEMF  <= _max_NEMF
01564             && ljCEMF  >= _min_CEMF && ljCEMF  <= _max_CEMF 
01565             && sljNHEF >= _min_NHEF && sljNHEF <= _max_NHEF
01566             && sljCHEF >= _min_CHEF && sljCHEF <= _max_CHEF
01567             && sljNEMF >= _min_NEMF && sljNEMF <= _max_NEMF
01568             && sljCEMF >= _min_CEMF && sljCEMF <= _max_CEMF ){
01569           v->getMEhisto_DenominatorPFPt()->Fill((PFJetPt[0] + PFJetPt[1])/2.);
01570           v->getMEhisto_DenominatorPFEta()->Fill((PFJetEta[0] + PFJetEta[1])/2.);
01571           if(numpassed){
01572             v->getMEhisto_NumeratorPFPt()->Fill((PFJetPt[0] + PFJetPt[1])/2.);
01573             v->getMEhisto_NumeratorPFEta()->Fill((PFJetEta[0] + PFJetEta[1])/2.);
01574           }
01575         }
01576       }
01577     }// PF Jet trigger and valid jet collection
01578     
01579     //CaloMET path
01580     if(verbose_) std::cout << "fillMEforEffAllTrigger: CaloMET -------------------" << std::endl;
01581     if(calometColl_.isValid() 
01582        && ((v->getObjectType() == trigger::TriggerMET) || (v->getObjectType() == trigger::TriggerTET))
01583        && (v->getPath().find("HLT_PFMET")==std::string::npos)){
01584       const CaloMETCollection *calometcol = calometColl_.product();
01585       const CaloMET met = calometcol->front();
01586       v->getMEhisto_DenominatorPt()->Fill(met.et());
01587       v->getMEhisto_DenominatorPhi()->Fill(met.phi()); 
01588       if(numpassed){
01589         v->getMEhisto_NumeratorPt()->Fill(met.et());
01590         v->getMEhisto_NumeratorPhi()->Fill(met.phi());
01591         if(hltIndex >= triggerObj_->sizeFilters()){
01592           edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
01593         } 
01594         else{
01595           double dPhimin = 9999.;//
01596           const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex); 
01597           for(trigger::Keys::const_iterator kj = khlt.begin();kj != khlt.end(); ++kj){
01598             double dPhi = deltaPhi(toc[*kj].phi(), met.phi());
01599             if(dPhi < dPhimin){
01600               dPhimin = dPhi;
01601             }
01602           }  
01603           v->getMEhisto_DeltaPhi()->Fill(dPhimin);
01604         }
01605       } 
01606     }
01607     
01608     //PFMET
01609     if(verbose_) std::cout << "fillMEforEffAllTrigger: PFMET -------------------" << std::endl;
01610     if(pfmetColl_.isValid() 
01611        && ((v->getObjectType() == trigger::TriggerMET) || (v->getObjectType() == trigger::TriggerTET))
01612        && (v->getPath().find("HLT_PFMET")!=std::string::npos)){
01613       const PFMETCollection *pfmetcol = pfmetColl_.product();
01614       const PFMET met = pfmetcol->front();
01615       v->getMEhisto_DenominatorPt()->Fill(met.et());
01616       v->getMEhisto_DenominatorPhi()->Fill(met.phi()); 
01617       if(numpassed){
01618         v->getMEhisto_NumeratorPt()->Fill(met.et());
01619         v->getMEhisto_NumeratorPhi()->Fill(met.phi());
01620         if(hltIndex >= triggerObj_->sizeFilters()){
01621           edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
01622         } 
01623         else{
01624           double dPhimin = 9999.;//
01625           const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex); 
01626           for(trigger::Keys::const_iterator kj = khlt.begin();kj != khlt.end(); ++kj){
01627             double dPhi = deltaPhi(toc[*kj].phi(), met.phi());
01628             if(dPhi < dPhimin){
01629               dPhimin = dPhi;
01630             }
01631           }  
01632           v->getMEhisto_DeltaPhi()->Fill(dPhimin);
01633         }
01634       } 
01635     }
01636     
01637     /*
01638       if(pfmhtColl_.isValid() && ((v->getObjectType() == trigger::TriggerMET)|| (v->getObjectType() == trigger::TriggerTET))){
01639       const PFMHTCollection *pfmhtcol = pfmhtColl_.product();
01640       const PFMHT met = pfmhtcol->front();
01641       v->getMEhisto_DenominatorPFPt()->Fill(met.pt());
01642       v->getMEhisto_DenominatorPFPhi()->Fill(met.phi());
01643       }// PFMHT  trigger and valid MET collection 
01644     */
01645   }// trigger under study
01646 }
01647 
01648 void 
01649 JetMETHLTOfflineSource::fillMEforEffWrtMuTrigger(const Event & iEvent, const edm::EventSetup& iSetup)
01650 { 
01651   //int npath;
01652   if(&triggerResults_){ /*npath = triggerResults_->size();*/ } 
01653   else{ return; }
01654   
01655   bool muTrig = false;
01656   bool numpassed = false;
01657   //bool denompassed = false;
01658   for(size_t i=0;i<MuonTrigPaths_.size();++i){
01659     const unsigned int nPath(hltConfig_.size());
01660     for (unsigned int j=0; j!=nPath; ++j) {
01661       std::string pathname = hltConfig_.triggerName(j);
01662       if(pathname.find(MuonTrigPaths_[i]) != std::string::npos){
01663         if(isHLTPathAccepted(pathname)){ 
01664           muTrig = true;
01665           if(verbose_) cout<<"fillMEforEffWrtMuTrigger: Muon Match"<<endl;
01666         }
01667       }
01668       if(muTrig) break;
01669     }
01670     if(muTrig) break;
01671   }
01672   
01673   if(muTrig){
01674     const trigger::TriggerObjectCollection & toc(triggerObj_->getObjects());
01675     PathInfoCollection::iterator v = hltPathsEffWrtMu_.begin();
01676     for(; v!= hltPathsEffWrtMu_.end(); ++v ){
01677       numpassed = false;
01678       
01679       unsigned indexNum = triggerNames_.triggerIndex(v->getPath());
01680       if(indexNum < triggerNames_.size() && triggerResults_->accept(indexNum)) numpassed   = true;
01681       //if(numpassed==true){
01682       edm::InputTag hltTag(v->getLabel(),"",processname_);
01683       const int hltIndex = triggerObj_->filterIndex(hltTag);
01684       edm::InputTag l1Tag(v->getl1Path(),"",processname_);
01685       const int l1Index = triggerObj_->filterIndex(l1Tag);
01686       //}
01687       
01688       //----------------------------------------------------------------------
01689       //double pTcut = 0;
01690       double trigLowpTcut = 0;
01691       double trigMedpTcut = 0;
01692       double trigHighpTcut = 0;
01693       double trigLowpTcutFwd = 0;
01694       double trigMedpTcutFwd = 0;
01695       double trigHighpTcutFwd = 0;
01696       //
01697       //double pTPFcut = 0 ;
01698       double trigLowpTPFcut = 0;
01699       double trigMedpTPFcut = 0;
01700       double trigHighpTPFcut = 0;
01701       double trigLowpTPFcutFwd = 0;
01702       double trigMedpTPFcutFwd = 0;
01703       double trigHighpTPFcutFwd = 0;
01704       //
01705       //cout<<"pre-path" << v->getPath()<<endl;
01706       size_t jetstrfound = v->getPath().find("Jet");
01707       //size_t censtrfound = v->getPath().find("Central"); //shoouldn't be needed?
01708       string tpath = v->getPath();
01709       string jetTrigVal;
01710       float jetVal = 0.;
01711       //
01712       if(jetstrfound != string::npos){// && ustrfound != string::npos ){
01713         //cout<<v->getPath()<<endl;
01714         for(int trig = int(jetstrfound)+3; trig < int(jetstrfound)+7; trig++){// int(ustrfound); trig++){
01715           if(!isdigit(tpath[trig])) break;
01716           jetTrigVal+=tpath[trig];
01717         }
01718         char *cjetTrigVal = (char*)jetTrigVal.c_str();
01719         jetVal=atof(cjetTrigVal);
01720         //cout<<jetVal<<endl;
01721         //
01722         if(jetVal>0.){
01723           if(jetVal<50.){
01724             //pTcut = jetVal / 2.;
01725             trigMedpTcut  = jetVal + 5.;  
01726             trigHighpTcut = jetVal + 10.;
01727             //
01728             trigLowpTcutFwd = jetVal + 9.;
01729             trigMedpTcutFwd = jetVal + 15.;
01730             trigHighpTcutFwd = jetVal + 21.;
01731         }
01732           else{
01733             //pTcut = jetVal - 20. ;
01734             trigMedpTcut = jetVal + 2.; 
01735             trigHighpTcut = jetVal + 60.;
01736             //
01737             trigLowpTcutFwd = jetVal + 22.;
01738             trigMedpTcutFwd = jetVal + 25.;
01739             trigHighpTcutFwd = jetVal + 110.;
01740           }
01741           trigLowpTcut = jetVal;
01742         }
01743         //
01744         if(jetVal>0.){
01745           if(jetVal<50.){
01746             //pTPFcut = jetVal ;
01747             trigMedpTPFcut  = jetVal + 20.;  
01748             trigHighpTPFcut = jetVal + 40.;
01749             //
01750             trigLowpTPFcutFwd = jetVal + 60.;
01751             trigMedpTPFcutFwd = jetVal + 80.;
01752             trigHighpTPFcutFwd = jetVal + 100.;
01753           }
01754           else{
01755             //pTPFcut = jetVal  ;
01756             trigMedpTPFcut = jetVal + 40.; 
01757             trigHighpTPFcut = jetVal + 140.;
01758             //
01759             trigLowpTPFcutFwd = jetVal + 110.;
01760             trigMedpTPFcutFwd = jetVal + 130.;
01761             trigHighpTPFcutFwd = jetVal + 190.;
01762           }
01763           trigLowpTPFcut = jetVal;
01764         }
01765       }
01766       //----------------------------------------------------------------------
01767       
01768       //CaloJet paths   
01769       if(verbose_) std::cout << "fillMEforEffWrtMuTrigger: CaloJet -------------------" << std::endl;
01770       if(calojetColl_.isValid() 
01771          && (v->getObjectType() == trigger::TriggerJet)){
01772         //cout<<"   - CaloJet "<<endl;
01773         //&& (v->getPath().find("HLT_PFJet")==std::string::npos)
01774         //&& (v->getPath().find("HLT_DiPFJet")==std::string::npos)){
01775         bool jetIDbool = false;
01776         double leadjpt  = CaloJetPt[0];  
01777         double leadjeta = CaloJetEta[0];
01778         double leadjphi = CaloJetPhi[0];
01779         //double ljemf    = CaloJetEMF[0];
01780         double ljfhpd    = CaloJetfHPD[0];
01781         double ljn90     = CaloJetn90[0];
01782         if((v->getTriggerType().compare("SingleJet_Trigger") == 0) && calojet.size()){ //this line stops the central jets  
01783           if( (ljfhpd < _fHPD) && (ljn90 > _n90Hits )){
01784             if(verbose_) cout<<"passed CaloJet ID -------------------" << endl;
01785             jetIDbool = true;
01786             
01787             //Denominator fill
01788             v->getMEhisto_DenominatorPt()->Fill(leadjpt);
01789             if (isBarrel(leadjeta))  v->getMEhisto_DenominatorPtBarrel()->Fill(leadjpt);
01790             if (isEndCap(leadjeta))  v->getMEhisto_DenominatorPtEndcap()->Fill(leadjpt);
01791             if (isForward(leadjeta)) v->getMEhisto_DenominatorPtForward()->Fill(leadjpt);
01792             v->getMEhisto_DenominatorEta()->Fill(leadjeta);
01793             v->getMEhisto_DenominatorPhi()->Fill(leadjphi);
01794             v->getMEhisto_DenominatorEtaPhi()->Fill(leadjeta,leadjphi);
01795             if (isBarrel(leadjeta)){
01796               v->getMEhisto_DenominatorEtaBarrel()->Fill(leadjeta);
01797               v->getMEhisto_DenominatorPhiBarrel()->Fill(leadjphi);
01798             }
01799             if (isEndCap(leadjeta)){
01800               v->getMEhisto_DenominatorEtaEndcap()->Fill(leadjeta);
01801               v->getMEhisto_DenominatorPhiEndcap()->Fill(leadjphi);
01802             }
01803             if (isForward(leadjeta)){
01804               v->getMEhisto_DenominatorEtaForward()->Fill(leadjeta);
01805               v->getMEhisto_DenominatorPhiForward()->Fill(leadjphi);
01806             }
01807             if((leadjpt > trigLowpTcut && !isForward(leadjeta)) || (leadjpt > trigLowpTcutFwd && isForward(leadjeta))){
01808               v->getMEhisto_DenominatorEta_LowpTcut()->Fill(leadjeta);
01809               v->getMEhisto_DenominatorPhi_LowpTcut()->Fill(leadjphi);
01810               v->getMEhisto_DenominatorEtaPhi_LowpTcut()->Fill(leadjeta,leadjphi);
01811             }
01812             if((leadjpt > trigMedpTcut && !isForward(leadjeta)) || (leadjpt > trigMedpTcutFwd && isForward(leadjeta))){
01813               v->getMEhisto_DenominatorEta_MedpTcut()->Fill(leadjeta);
01814               v->getMEhisto_DenominatorPhi_MedpTcut()->Fill(leadjphi);
01815               v->getMEhisto_DenominatorEtaPhi_MedpTcut()->Fill(leadjeta,leadjphi);
01816             }
01817             if((leadjpt > trigHighpTcut && !isForward(leadjeta)) || (leadjpt > trigHighpTcutFwd && isForward(leadjeta))){
01818               v->getMEhisto_DenominatorEta_HighpTcut()->Fill(leadjeta);
01819               v->getMEhisto_DenominatorPhi_HighpTcut()->Fill(leadjphi);
01820               v->getMEhisto_DenominatorEtaPhi_HighpTcut()->Fill(leadjeta,leadjphi);
01821             }
01822             
01823             //Numerator fill
01824             if(numpassed){
01825               //
01826               double dRmin = 99999.;
01827               double dPhimin = 9999.;
01828               if(v->getPath().find("L1") != std::string::npos){ 
01829                 if ( l1Index >= triggerObj_->sizeFilters() ) {
01830                   edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
01831                 } 
01832                 else {
01833                   const trigger::Keys & kl1 = triggerObj_->filterKeys(l1Index);
01834                   for(trigger::Keys::const_iterator ki = kl1.begin();ki != kl1.end(); ++ki){
01835                     double dR = deltaR(toc[*ki].eta(), toc[*ki].phi(), leadjeta, leadjphi);
01836                     if(dR < dRmin){
01837                       dRmin = dR;
01838                     } 
01839                   } 
01840                 } 
01841               } 
01842               else{
01843                 if ( hltIndex >= triggerObj_->sizeFilters() ) {
01844                   edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
01845                 } 
01846                 else {    
01847                   const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex); 
01848                   trigger::Keys::const_iterator kj = khlt.begin();
01849                   for(;kj != khlt.end(); ++kj){
01850                     double dR = deltaR(toc[*kj].eta(), toc[*kj].phi(), 
01851                                        leadjeta, leadjphi);
01852                     if(dR < dRmin){
01853                       dRmin = dR;
01854                     }
01855                     double dPhi = deltaPhi(toc[*kj].phi(), leadjphi);
01856                     if(dPhi < dPhimin){
01857                       dPhimin = dPhi;
01858                     }
01859                   }   
01860                   //v->getMEhisto_DeltaPhi()->Fill(dPhimin);
01861                   v->getMEhisto_DeltaPhi()->Fill(dPhimin);
01862                   v->getMEhisto_DeltaR()->Fill(dRmin);
01863                 }
01864               }
01865               if(dRmin < 0.1 || (v->getPath().find("L1") != std::string::npos && dRmin < 0.4)){
01866                 v->getMEhisto_NumeratorPt()->Fill(leadjpt);
01867                 if (isBarrel(leadjeta))  v->getMEhisto_NumeratorPtBarrel()->Fill(leadjpt);
01868                 if (isEndCap(leadjeta))  v->getMEhisto_NumeratorPtEndcap()->Fill(leadjpt);
01869                 if (isForward(leadjeta)) v->getMEhisto_NumeratorPtForward()->Fill(leadjpt);
01870                 v->getMEhisto_NumeratorEta()->Fill(leadjeta);
01871                 v->getMEhisto_NumeratorPhi()->Fill(leadjphi);
01872                 v->getMEhisto_NumeratorEtaPhi()->Fill(leadjeta,leadjphi);
01873                 if (isBarrel(leadjeta)){
01874                   v->getMEhisto_NumeratorEtaBarrel()->Fill(leadjeta);
01875                   v->getMEhisto_NumeratorPhiBarrel()->Fill(leadjphi);
01876                 }
01877                 if (isEndCap(leadjeta)){
01878                   v->getMEhisto_NumeratorEtaEndcap()->Fill(leadjeta);
01879                   v->getMEhisto_NumeratorPhiEndcap()->Fill(leadjphi);
01880                 }
01881                 if (isForward(leadjeta)){
01882                   v->getMEhisto_NumeratorEtaForward()->Fill(leadjeta);
01883                   v->getMEhisto_NumeratorPhiForward()->Fill(leadjphi);
01884                 }
01885                 if((leadjpt > trigLowpTcut && !isForward(leadjeta)) || (leadjpt > trigLowpTcutFwd && isForward(leadjeta))){
01886                   v->getMEhisto_NumeratorEta_LowpTcut()->Fill(leadjeta);
01887                   v->getMEhisto_NumeratorPhi_LowpTcut()->Fill(leadjphi);
01888                   v->getMEhisto_NumeratorEtaPhi_LowpTcut()->Fill(leadjeta,leadjphi);
01889                 }
01890                 if((leadjpt > trigMedpTcut && !isForward(leadjeta)) || (leadjpt > trigMedpTcutFwd && isForward(leadjeta))){
01891                   v->getMEhisto_NumeratorEta_MedpTcut()->Fill(leadjeta);
01892                   v->getMEhisto_NumeratorPhi_MedpTcut()->Fill(leadjphi);
01893                   v->getMEhisto_NumeratorEtaPhi_MedpTcut()->Fill(leadjeta,leadjphi);
01894                 }
01895                 if((leadjpt > trigHighpTcut && !isForward(leadjeta)) || (leadjpt > trigHighpTcutFwd && isForward(leadjeta))){
01896                   v->getMEhisto_NumeratorEta_HighpTcut()->Fill(leadjeta);
01897                   v->getMEhisto_NumeratorPhi_HighpTcut()->Fill(leadjphi);
01898                   v->getMEhisto_NumeratorEtaPhi_HighpTcut()->Fill(leadjeta,leadjphi);
01899                 }
01900               }
01901             }//numpassed
01902           }//CalojetID filter
01903         }
01904         
01905         if(jetIDbool == true && (v->getTriggerType().compare("DiJet_Trigger") == 0) && calojet.size()>1){       
01906           if(((CaloJetEMF[1] > _fEMF || std::abs(CaloJetEta[1]) > _feta) && 
01907               CaloJetfHPD[0] < _fHPD && CaloJetn90[0] > _n90Hits)){
01908             v->getMEhisto_DenominatorPt()->Fill((CaloJetPt[0] + CaloJetPt[1])/2.);
01909             v->getMEhisto_DenominatorEta()->Fill((CaloJetEta[0] + CaloJetEta[1])/2.); 
01910             if(numpassed==true){
01911               v->getMEhisto_NumeratorPt()->Fill((CaloJetPt[0] + CaloJetPt[1])/2.);
01912               v->getMEhisto_NumeratorEta()->Fill((CaloJetEta[0] + CaloJetEta[1])/2.);
01913             }
01914           }
01915         }
01916       }// Jet trigger and valid jet collection
01917       
01918       //PFJet paths
01919       if(verbose_) std::cout << "fillMEforEffWrtMuTrigger: PFJet -------------------" << std::endl;
01920       if(pfjetColl_.isValid() 
01921          && (v->getObjectType() == trigger::TriggerJet)){
01922         //cout<<"   - PFJet "<<endl;
01923         //&& (v->getPath().find("HLT_PFJet")!=std::string::npos)
01924         //&& (v->getPath().find("HLT_DiPFJet")!=std::string::npos)){
01925         bool jetIDbool = false;
01926         double leadjpt   = PFJetPt[0]; 
01927         double leadjeta  = PFJetEta[0];
01928         double leadjphi  = PFJetPhi[0];
01929         double ljNHEF    = PFJetNHEF[0];
01930         double ljCHEF    = PFJetCHEF[0];
01931         double ljNEMF    = PFJetNEMF[0];
01932         double ljCEMF    = PFJetCEMF[0];
01933         //double sleadjpt  = PFJetPt[1];
01934         //double sleadjeta = PFJetEta[1];
01935         //double sleadjphi = PFJetPhi[1];
01936         double sljNHEF   = PFJetNHEF[1];
01937         double sljCHEF   = PFJetCHEF[1];
01938         double sljNEMF   = PFJetNEMF[1];
01939         double sljCEMF   = PFJetCEMF[1];
01940         //
01941         double pfMHTx    = pfMHTx_All;
01942         double pfMHTy    = pfMHTy_All;
01943         //
01944         if((v->getTriggerType().compare("SingleJet_Trigger") == 0) && pfjet.size()){ //this line stops the central jets
01945           
01946           //======get pfmht
01947           _pfMHT = sqrt(pfMHTx*pfMHTx + pfMHTy*pfMHTy);
01948           v->getMEhisto_DenominatorPFMHT()->Fill(_pfMHT);
01949           
01950           if( ljNHEF >= _min_NHEF && ljNHEF <= _max_NHEF
01951               && ljCHEF >= _min_CHEF && ljCHEF <= _max_CHEF
01952               && ljNEMF >= _min_NEMF && ljNEMF <= _max_NEMF
01953               && ljCEMF >= _min_CEMF && ljCEMF <= _max_CEMF){
01954             if(verbose_) cout<<"passed PFJet ID -------------------" << endl;
01955             jetIDbool = true;
01956             v->getMEhisto_DenominatorPFPt()->Fill(leadjpt);
01957             if (isBarrel(leadjeta))  v->getMEhisto_DenominatorPFPtBarrel()->Fill(leadjpt);
01958             if (isEndCap(leadjeta))  v->getMEhisto_DenominatorPFPtEndcap()->Fill(leadjpt);
01959             if (isForward(leadjeta)) v->getMEhisto_DenominatorPFPtForward()->Fill(leadjpt);
01960             v->getMEhisto_DenominatorPFEta()->Fill(leadjeta);
01961             v->getMEhisto_DenominatorPFPhi()->Fill(leadjphi);
01962             v->getMEhisto_DenominatorPFEtaPhi()->Fill(leadjeta,leadjphi);
01963             if(isBarrel(leadjeta)){
01964               v->getMEhisto_DenominatorPFEtaBarrel()->Fill(leadjeta);
01965               v->getMEhisto_DenominatorPFPhiBarrel()->Fill(leadjphi);
01966             }
01967             if (isEndCap(leadjeta)){
01968               v->getMEhisto_DenominatorPFEtaEndcap()->Fill(leadjeta);
01969               v->getMEhisto_DenominatorPFPhiEndcap()->Fill(leadjphi);
01970             }
01971             if (isForward(leadjeta)){
01972               v->getMEhisto_DenominatorPFEtaForward()->Fill(leadjeta);
01973               v->getMEhisto_DenominatorPFPhiForward()->Fill(leadjphi);
01974             }
01975             if((leadjpt > trigLowpTPFcut && !isForward(leadjeta)) || (leadjpt > trigLowpTPFcutFwd && isForward(leadjeta))){
01976               v->getMEhisto_DenominatorPFEta_LowpTcut()->Fill(leadjeta);
01977               v->getMEhisto_DenominatorPFPhi_LowpTcut()->Fill(leadjphi);
01978               v->getMEhisto_DenominatorPFEtaPhi_LowpTcut()->Fill(leadjeta,leadjphi);
01979             }
01980             if((leadjpt > trigMedpTPFcut && !isForward(leadjeta)) || (leadjpt > trigMedpTPFcutFwd && isForward(leadjeta))){
01981               v->getMEhisto_DenominatorPFEta_MedpTcut()->Fill(leadjeta);
01982               v->getMEhisto_DenominatorPFPhi_MedpTcut()->Fill(leadjphi);
01983               v->getMEhisto_DenominatorPFEtaPhi_MedpTcut()->Fill(leadjeta,leadjphi);
01984             }
01985             if((leadjpt > trigHighpTPFcut && !isForward(leadjeta)) || (leadjpt > trigHighpTPFcutFwd && isForward(leadjeta))){
01986               v->getMEhisto_DenominatorPFEta_HighpTcut()->Fill(leadjeta);
01987               v->getMEhisto_DenominatorPFPhi_HighpTcut()->Fill(leadjphi);
01988               v->getMEhisto_DenominatorPFEtaPhi_HighpTcut()->Fill(leadjeta,leadjphi);
01989             }
01990             
01991             //Numerator fill
01992             if(numpassed){
01993               double dRmin = 99999.;
01994               double dPhimin = 9999.;
01995               if(v->getPath().find("L1") != std::string::npos){ 
01996                 if ( l1Index >= triggerObj_->sizeFilters() ) {
01997                   edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
01998                 } 
01999                 else{    
02000                   const trigger::Keys & kl1 = triggerObj_->filterKeys(l1Index);
02001                   for(trigger::Keys::const_iterator ki = kl1.begin();ki != kl1.end(); ++ki){      
02002                     double dR = deltaR(toc[*ki].eta(), toc[*ki].phi(), leadjeta, leadjphi);
02003                     if(dR < dRmin){
02004                       dRmin = dR;
02005                     } 
02006                   } 
02007                 }                
02008               } 
02009               else{
02010                 if ( hltIndex >= triggerObj_->sizeFilters() ) {
02011                   edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
02012                 } 
02013                 else{    
02014                   const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex); 
02015                   for(trigger::Keys::const_iterator kj = khlt.begin();kj != khlt.end(); ++kj){      
02016                     double dR = deltaR(toc[*kj].eta(), toc[*kj].phi(), leadjeta, leadjphi);
02017                     if(dR < dRmin){
02018                       dRmin = dR;
02019                     } 
02020                     double dPhi = deltaPhi(toc[*kj].phi(), leadjphi);
02021                     if(dPhi < dPhimin){ 
02022                       dPhimin = dPhi; 
02023                     }
02024                   }  
02025                   v->getMEhisto_PFDeltaPhi()->Fill(dPhimin);
02026                   v->getMEhisto_PFDeltaR()->Fill(dRmin);
02027                 }  
02028               }
02029               if(dRmin < 0.1 || (v->getPath().find("L1") != std::string::npos && dRmin < 0.4)){
02030                 v->getMEhisto_NumeratorPFPt()->Fill(leadjpt);
02031                 if (isBarrel(leadjeta))  v->getMEhisto_NumeratorPFPtBarrel()->Fill(leadjpt);
02032                 if (isEndCap(leadjeta))  v->getMEhisto_NumeratorPFPtEndcap()->Fill(leadjpt);
02033                 if (isForward(leadjeta)) v->getMEhisto_NumeratorPFPtForward()->Fill(leadjpt);
02034                 v->getMEhisto_NumeratorPFEta()->Fill(leadjeta);
02035                 v->getMEhisto_NumeratorPFPhi()->Fill(leadjphi);
02036                 v->getMEhisto_NumeratorPFEtaPhi()->Fill(leadjeta,leadjphi);
02037                 if (isBarrel(leadjeta)){
02038                   v->getMEhisto_NumeratorPFEtaBarrel()->Fill(leadjeta);
02039                   v->getMEhisto_NumeratorPFPhiBarrel()->Fill(leadjphi);
02040                 }
02041                 if (isEndCap(leadjeta)){
02042                   v->getMEhisto_NumeratorPFEtaEndcap()->Fill(leadjeta);
02043                   v->getMEhisto_NumeratorPFPhiEndcap()->Fill(leadjphi);
02044                 }
02045                 if (isForward(leadjeta)){
02046                   v->getMEhisto_NumeratorPFEtaForward()->Fill(leadjeta);
02047                   v->getMEhisto_NumeratorPFPhiForward()->Fill(leadjphi);
02048                 }
02049                 if((leadjpt > trigLowpTPFcut && !isForward(leadjeta)) 
02050                    || (leadjpt > trigLowpTPFcutFwd && isForward(leadjeta))){
02051                   v->getMEhisto_NumeratorPFEta_LowpTcut()->Fill(leadjeta);
02052                   v->getMEhisto_NumeratorPFPhi_LowpTcut()->Fill(leadjphi);
02053                   v->getMEhisto_NumeratorPFEtaPhi_LowpTcut()->Fill(leadjeta,leadjphi);
02054                 }
02055                 if((leadjpt > trigMedpTPFcut && !isForward(leadjeta)) 
02056                    || (leadjpt > trigMedpTPFcutFwd && isForward(leadjeta))){
02057                   v->getMEhisto_NumeratorPFEta_MedpTcut()->Fill(leadjeta);
02058                   v->getMEhisto_NumeratorPFPhi_MedpTcut()->Fill(leadjphi);
02059                   v->getMEhisto_NumeratorPFEtaPhi_MedpTcut()->Fill(leadjeta,leadjphi);
02060                 }
02061                 if((leadjpt > trigHighpTPFcut && !isForward(leadjeta)) 
02062                    || (leadjpt > trigHighpTPFcutFwd && isForward(leadjeta))){
02063                   v->getMEhisto_NumeratorPFEta_HighpTcut()->Fill(leadjeta);
02064                   v->getMEhisto_NumeratorPFPhi_HighpTcut()->Fill(leadjphi);
02065                   v->getMEhisto_NumeratorPFEtaPhi_HighpTcut()->Fill(leadjeta,leadjphi);
02066                 }
02067               }
02068             }
02069           }
02070         }
02071         if(jetIDbool == true && (v->getTriggerType().compare("DiJet_Trigger") == 0) && pfjet.size()>1){ 
02072           if( ljNHEF     >= _min_NHEF && ljNHEF  <= _max_NHEF
02073               && ljCHEF  >= _min_CHEF && ljCHEF  <= _max_CHEF
02074               && ljNEMF  >= _min_NEMF && ljNEMF  <= _max_NEMF
02075               && ljCEMF  >= _min_CEMF && ljCEMF  <= _max_CEMF 
02076               && sljNHEF >= _min_NHEF && sljNHEF <= _max_NHEF
02077               && sljCHEF >= _min_CHEF && sljCHEF <= _max_CHEF
02078               && sljNEMF >= _min_NEMF && sljNEMF <= _max_NEMF
02079               && sljCEMF >= _min_CEMF && sljCEMF <= _max_CEMF ){
02080             v->getMEhisto_DenominatorPFPt()->Fill((PFJetPt[0] + PFJetPt[1])/2.);
02081             v->getMEhisto_DenominatorPFEta()->Fill((PFJetEta[0] + PFJetEta[1])/2.);
02082             if(numpassed){
02083               v->getMEhisto_NumeratorPFPt()->Fill((PFJetPt[0] + PFJetPt[1])/2.);
02084               v->getMEhisto_NumeratorPFEta()->Fill((PFJetEta[0] + PFJetEta[1])/2.);
02085             }
02086           }
02087         }
02088       }// PF Jet trigger and valid jet collection
02089       
02090       //CaloMET path
02091       if(verbose_) std::cout << "fillMEforEffWrtMuTrigger: CaloMET -------------------" << std::endl;
02092       if(calometColl_.isValid() 
02093          && ((v->getObjectType() == trigger::TriggerMET) || (v->getObjectType() == trigger::TriggerTET))
02094          && (v->getPath().find("HLT_PFMET")==std::string::npos)){
02095         //cout<<"   - CaloMET "<<endl;
02096         const CaloMETCollection *calometcol = calometColl_.product();
02097         const CaloMET met = calometcol->front();
02098         v->getMEhisto_DenominatorPt()->Fill(met.et());
02099         v->getMEhisto_DenominatorPhi()->Fill(met.phi()); 
02100         if(numpassed){
02101           v->getMEhisto_NumeratorPt()->Fill(met.et());
02102           v->getMEhisto_NumeratorPhi()->Fill(met.phi());
02103           if(hltIndex >= triggerObj_->sizeFilters()){
02104             edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
02105           } 
02106           else{
02107             double dPhimin = 9999.;//
02108             const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex); 
02109             for(trigger::Keys::const_iterator kj = khlt.begin();kj != khlt.end(); ++kj){
02110               double dPhi = deltaPhi(toc[*kj].phi(), met.phi());
02111               if(dPhi < dPhimin){
02112                 dPhimin = dPhi;
02113               }
02114             }  
02115             v->getMEhisto_DeltaPhi()->Fill(dPhimin);
02116           }
02117         } 
02118       }
02119     
02120       //PFMET
02121       if(verbose_) std::cout << "fillMEforEffWrtMuTrigger: PFMET -------------------" << std::endl;
02122       if(pfmetColl_.isValid() 
02123          && ((v->getObjectType() == trigger::TriggerMET) || (v->getObjectType() == trigger::TriggerTET))
02124          && (v->getPath().find("HLT_PFMET")!=std::string::npos)){
02125         //cout<<"   - PFMET "<<endl;
02126         const PFMETCollection *pfmetcol = pfmetColl_.product();
02127         const PFMET met = pfmetcol->front();
02128         v->getMEhisto_DenominatorPt()->Fill(met.et());
02129         v->getMEhisto_DenominatorPhi()->Fill(met.phi()); 
02130         if(numpassed){
02131           v->getMEhisto_NumeratorPt()->Fill(met.et());
02132           v->getMEhisto_NumeratorPhi()->Fill(met.phi());
02133           if(hltIndex >= triggerObj_->sizeFilters()){
02134             edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
02135           } 
02136           else{
02137             double dPhimin = 9999.;//
02138             const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex); 
02139             for(trigger::Keys::const_iterator kj = khlt.begin();kj != khlt.end(); ++kj){
02140               double dPhi = deltaPhi(toc[*kj].phi(), met.phi());
02141               if(dPhi < dPhimin){
02142                 dPhimin = dPhi;
02143               }
02144             }  
02145             v->getMEhisto_DeltaPhi()->Fill(dPhimin);
02146           }
02147         } 
02148       }
02149       
02150       /*
02151         if(pfmhtColl_.isValid() && ((v->getObjectType() == trigger::TriggerMET)|| (v->getObjectType() == trigger::TriggerTET))){
02152         const PFMHTCollection *pfmhtcol = pfmhtColl_.product();
02153         const PFMHT met = pfmhtcol->front();
02154         v->getMEhisto_DenominatorPFPt()->Fill(met.pt());
02155         v->getMEhisto_DenominatorPFPhi()->Fill(met.phi());
02156         }// PFMHT  trigger and valid MET collection 
02157       */
02158     }// trigger under study
02159   }
02160 }
02161 
02162 void 
02163 JetMETHLTOfflineSource::fillMEforEffWrtMBTrigger(const Event & iEvent, const edm::EventSetup& iSetup)
02164 {
02165   //int npath;
02166   if(&triggerResults_) { /*npath = triggerResults_->size();*/ } 
02167   else { return; }
02168 
02169   bool mbTrig = false;
02170   bool numpassed = false;
02171   //bool denompassed = false;
02172   for(size_t i=0;i<MBTrigPaths_.size();++i){
02173     const unsigned int nPath(hltConfig_.size());
02174     for (unsigned int j=0; j!=nPath; ++j) {
02175       std::string pathname = hltConfig_.triggerName(j);
02176       if(pathname.find(MBTrigPaths_[i]) != std::string::npos){
02177         if(isHLTPathAccepted(pathname)){
02178           mbTrig = true;
02179           if(verbose_) cout<<"fillMEforEffWrtMBTrigger: MinBias Match"<<endl;
02180         }
02181       }
02182       if(mbTrig) break;
02183     }
02184     if(mbTrig) break;
02185   }
02186   
02187   if(mbTrig){    
02188     const trigger::TriggerObjectCollection & toc(triggerObj_->getObjects());
02189     PathInfoCollection::iterator v = hltPathsEffWrtMB_.begin();
02190     for(; v!= hltPathsEffWrtMB_.end(); ++v ){
02191       numpassed = false;
02192       
02193       unsigned indexNum = triggerNames_.triggerIndex(v->getPath());
02194       if(indexNum < triggerNames_.size() && triggerResults_->accept(indexNum)) numpassed   = true;
02195       //if(numpassed==true){
02196       edm::InputTag hltTag(v->getLabel(),"",processname_);
02197       const int hltIndex = triggerObj_->filterIndex(hltTag);
02198       edm::InputTag l1Tag(v->getl1Path(),"",processname_);
02199       const int l1Index = triggerObj_->filterIndex(l1Tag);
02200       //}
02201       
02202       //----------------------------------------------------------------------
02203       //double pTcut = 0;
02204       double trigLowpTcut = 0;
02205       double trigMedpTcut = 0;
02206       double trigHighpTcut = 0;
02207       double trigLowpTcutFwd = 0;
02208       double trigMedpTcutFwd = 0;
02209       double trigHighpTcutFwd = 0;
02210       //
02211       //double pTPFcut = 0 ;
02212       double trigLowpTPFcut = 0;
02213       double trigMedpTPFcut = 0;
02214       double trigHighpTPFcut = 0;
02215       double trigLowpTPFcutFwd = 0;
02216       double trigMedpTPFcutFwd = 0;
02217       double trigHighpTPFcutFwd = 0;
02218       //
02219       //cout<<"pre-path" << v->getPath()<<endl;
02220       size_t jetstrfound = v->getPath().find("Jet");
02221       //size_t censtrfound = v->getPath().find("Central"); //shoouldn't be needed?
02222       string tpath = v->getPath();
02223       string jetTrigVal;
02224       float jetVal = 0.;
02225       //
02226       if(jetstrfound != string::npos){// && ustrfound != string::npos ){
02227         //cout<<v->getPath()<<endl;
02228         for(int trig = int(jetstrfound)+3; trig < int(jetstrfound)+7; trig++){// int(ustrfound); trig++){
02229           if(!isdigit(tpath[trig])) break;
02230           jetTrigVal+=tpath[trig];
02231         }
02232         char *cjetTrigVal = (char*)jetTrigVal.c_str();
02233         jetVal=atof(cjetTrigVal);
02234         //cout<<jetVal<<endl;
02235         //
02236         if(jetVal>0.){
02237           if(jetVal<50.){
02238             //pTcut = jetVal / 2.;
02239             trigMedpTcut  = jetVal + 5.;  
02240             trigHighpTcut = jetVal + 10.;
02241             //
02242             trigLowpTcutFwd = jetVal + 9.;
02243             trigMedpTcutFwd = jetVal + 15.;
02244             trigHighpTcutFwd = jetVal + 21.;
02245         }
02246           else{
02247             //pTcut = jetVal - 20. ;
02248             trigMedpTcut = jetVal + 2.; 
02249             trigHighpTcut = jetVal + 60.;
02250             //
02251             trigLowpTcutFwd = jetVal + 22.;
02252             trigMedpTcutFwd = jetVal + 25.;
02253             trigHighpTcutFwd = jetVal + 110.;
02254           }
02255           trigLowpTcut = jetVal;
02256           //cout<<pTcut<<" "<<trigLowpTcut<<" "<<trigMedptcut<<" "<<trigHighpTcut<<" "<<trigLowpTcutFwd<<" "<<trigMedptcutFwd<<" "<<trigHighpTcutFwd<<endl;
02257         }
02258         //
02259         if(jetVal>0.){
02260           if(jetVal<50.){
02261             //pTPFcut = jetVal ;
02262             trigMedpTPFcut  = jetVal + 20.;  
02263             trigHighpTPFcut = jetVal + 40.;
02264             //
02265             trigLowpTPFcutFwd = jetVal + 60.;
02266             trigMedpTPFcutFwd = jetVal + 80.;
02267             trigHighpTPFcutFwd = jetVal + 100.;
02268           }
02269           else{
02270             //pTPFcut = jetVal  ;
02271             trigMedpTPFcut = jetVal + 40.; 
02272             trigHighpTPFcut = jetVal + 140.;
02273             //
02274             trigLowpTPFcutFwd = jetVal + 110.;
02275             trigMedpTPFcutFwd = jetVal + 130.;
02276             trigHighpTPFcutFwd = jetVal + 190.;
02277           }
02278           trigLowpTPFcut = jetVal;
02279           //cout<<pTcut<<" "<<trigLowpTcut<<" "<<trigMedptcut<<" "<<trigHighpTcut<<" "<<trigLowpTcutFwd<<" "<<trigMedptcutFwd<<" "<<trigHighpTcutFwd<<endl;
02280         }
02281       }
02282       //----------------------------------------------------------------------
02283       
02284       //CaloJet paths   
02285       if(verbose_) std::cout << "fillMEforEffWrtMuTrigger: CaloJet -------------------" << std::endl;
02286       if(calojetColl_.isValid() 
02287          && (v->getObjectType() == trigger::TriggerJet)){
02288         //cout<<"   - CaloJet "<<endl;
02289         //&& (v->getPath().find("HLT_PFJet")==std::string::npos)
02290         //&& (v->getPath().find("HLT_DiPFJet")==std::string::npos)){
02291         bool jetIDbool = false;
02292         double leadjpt  = CaloJetPt[0];  
02293         double leadjeta = CaloJetEta[0];
02294         double leadjphi = CaloJetPhi[0];
02295         //double ljemf    = CaloJetEMF[0];
02296         double ljfhpd    = CaloJetfHPD[0];
02297         double ljn90     = CaloJetn90[0];
02298         if((v->getTriggerType().compare("SingleJet_Trigger") == 0) && calojet.size()){ //this line stops the central jets
02299           if( (ljfhpd < _fHPD) && (ljn90 > _n90Hits )){
02300             if(verbose_) cout<<"passed CaloJet ID -------------------" << endl;
02301             jetIDbool = true;
02302             
02303             //Denominator fill
02304             v->getMEhisto_DenominatorPt()->Fill(leadjpt);
02305             if (isBarrel(leadjeta))  v->getMEhisto_DenominatorPtBarrel()->Fill(leadjpt);
02306             if (isEndCap(leadjeta))  v->getMEhisto_DenominatorPtEndcap()->Fill(leadjpt);
02307             if (isForward(leadjeta)) v->getMEhisto_DenominatorPtForward()->Fill(leadjpt);
02308             v->getMEhisto_DenominatorEta()->Fill(leadjeta);
02309             v->getMEhisto_DenominatorPhi()->Fill(leadjphi);
02310             v->getMEhisto_DenominatorEtaPhi()->Fill(leadjeta,leadjphi);
02311             if (isBarrel(leadjeta)){
02312               v->getMEhisto_DenominatorEtaBarrel()->Fill(leadjeta);
02313               v->getMEhisto_DenominatorPhiBarrel()->Fill(leadjphi);
02314             }
02315             if (isEndCap(leadjeta)){
02316               v->getMEhisto_DenominatorEtaEndcap()->Fill(leadjeta);
02317               v->getMEhisto_DenominatorPhiEndcap()->Fill(leadjphi);
02318             }
02319             if (isForward(leadjeta)){
02320               v->getMEhisto_DenominatorEtaForward()->Fill(leadjeta);
02321               v->getMEhisto_DenominatorPhiForward()->Fill(leadjphi);
02322             }
02323             if((leadjpt > trigLowpTcut && !isForward(leadjeta)) || (leadjpt > trigLowpTcutFwd && isForward(leadjeta))){
02324               v->getMEhisto_DenominatorEta_LowpTcut()->Fill(leadjeta);
02325               v->getMEhisto_DenominatorPhi_LowpTcut()->Fill(leadjphi);
02326               v->getMEhisto_DenominatorEtaPhi_LowpTcut()->Fill(leadjeta,leadjphi);
02327             }
02328             if((leadjpt > trigMedpTcut && !isForward(leadjeta)) || (leadjpt > trigMedpTcutFwd && isForward(leadjeta))){
02329               v->getMEhisto_DenominatorEta_MedpTcut()->Fill(leadjeta);
02330               v->getMEhisto_DenominatorPhi_MedpTcut()->Fill(leadjphi);
02331               v->getMEhisto_DenominatorEtaPhi_MedpTcut()->Fill(leadjeta,leadjphi);
02332             }
02333             if((leadjpt > trigHighpTcut && !isForward(leadjeta)) || (leadjpt > trigHighpTcutFwd && isForward(leadjeta))){
02334               v->getMEhisto_DenominatorEta_HighpTcut()->Fill(leadjeta);
02335               v->getMEhisto_DenominatorPhi_HighpTcut()->Fill(leadjphi);
02336               v->getMEhisto_DenominatorEtaPhi_HighpTcut()->Fill(leadjeta,leadjphi);
02337             }
02338             
02339             //Numerator fill
02340             if(numpassed){
02341               //
02342               double dRmin = 99999.;
02343               double dPhimin = 9999.;
02344               if(v->getPath().find("L1") != std::string::npos){ 
02345                 if ( l1Index >= triggerObj_->sizeFilters() ) {
02346                   edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
02347                 } 
02348                 else {
02349                   const trigger::Keys & kl1 = triggerObj_->filterKeys(l1Index);
02350                   for(trigger::Keys::const_iterator ki = kl1.begin();ki != kl1.end(); ++ki){
02351                     double dR = deltaR(toc[*ki].eta(), toc[*ki].phi(), leadjeta, leadjphi);
02352                     if(dR < dRmin){
02353                       dRmin = dR;
02354                     } 
02355                   } 
02356                 } 
02357               } 
02358               else{
02359                 if ( hltIndex >= triggerObj_->sizeFilters() ) {
02360                   edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
02361                 } 
02362                 else {    
02363                   const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex); 
02364                   trigger::Keys::const_iterator kj = khlt.begin();
02365                   for(;kj != khlt.end(); ++kj){
02366                     double dR = deltaR(toc[*kj].eta(), toc[*kj].phi(), 
02367                                        leadjeta, leadjphi);
02368                     if(dR < dRmin){
02369                       dRmin = dR;
02370                     }
02371                     double dPhi = deltaPhi(toc[*kj].phi(), leadjphi);
02372                     if(dPhi < dPhimin){
02373                       dPhimin = dPhi;
02374                     }
02375                   }   
02376                   //v->getMEhisto_DeltaPhi()->Fill(dPhimin);
02377                   v->getMEhisto_DeltaPhi()->Fill(dPhimin);
02378                   v->getMEhisto_DeltaR()->Fill(dRmin);
02379                 }
02380               }
02381               if(dRmin < 0.1 || (v->getPath().find("L1") != std::string::npos && dRmin < 0.4)){
02382                 v->getMEhisto_NumeratorPt()->Fill(leadjpt);
02383                 if (isBarrel(leadjeta))  v->getMEhisto_NumeratorPtBarrel()->Fill(leadjpt);
02384                 if (isEndCap(leadjeta))  v->getMEhisto_NumeratorPtEndcap()->Fill(leadjpt);
02385                 if (isForward(leadjeta)) v->getMEhisto_NumeratorPtForward()->Fill(leadjpt);
02386                 v->getMEhisto_NumeratorEta()->Fill(leadjeta);
02387                 v->getMEhisto_NumeratorPhi()->Fill(leadjphi);
02388                 v->getMEhisto_NumeratorEtaPhi()->Fill(leadjeta,leadjphi);
02389                 if (isBarrel(leadjeta)){
02390                   v->getMEhisto_NumeratorEtaBarrel()->Fill(leadjeta);
02391                   v->getMEhisto_NumeratorPhiBarrel()->Fill(leadjphi);
02392                 }
02393                 if (isEndCap(leadjeta)){
02394                   v->getMEhisto_NumeratorEtaEndcap()->Fill(leadjeta);
02395                   v->getMEhisto_NumeratorPhiEndcap()->Fill(leadjphi);
02396                 }
02397                 if (isForward(leadjeta)){
02398                   v->getMEhisto_NumeratorEtaForward()->Fill(leadjeta);
02399                   v->getMEhisto_NumeratorPhiForward()->Fill(leadjphi);
02400                 }
02401                 if((leadjpt > trigLowpTcut && !isForward(leadjeta)) || (leadjpt > trigLowpTcutFwd && isForward(leadjeta))){
02402                   v->getMEhisto_NumeratorEta_LowpTcut()->Fill(leadjeta);
02403                   v->getMEhisto_NumeratorPhi_LowpTcut()->Fill(leadjphi);
02404                   v->getMEhisto_NumeratorEtaPhi_LowpTcut()->Fill(leadjeta,leadjphi);
02405                 }
02406                 if((leadjpt > trigMedpTcut && !isForward(leadjeta)) || (leadjpt > trigMedpTcutFwd && isForward(leadjeta))){
02407                   v->getMEhisto_NumeratorEta_MedpTcut()->Fill(leadjeta);
02408                   v->getMEhisto_NumeratorPhi_MedpTcut()->Fill(leadjphi);
02409                   v->getMEhisto_NumeratorEtaPhi_MedpTcut()->Fill(leadjeta,leadjphi);
02410                 }
02411                 if((leadjpt > trigHighpTcut && !isForward(leadjeta)) || (leadjpt > trigHighpTcutFwd && isForward(leadjeta))){
02412                   v->getMEhisto_NumeratorEta_HighpTcut()->Fill(leadjeta);
02413                   v->getMEhisto_NumeratorPhi_HighpTcut()->Fill(leadjphi);
02414                   v->getMEhisto_NumeratorEtaPhi_HighpTcut()->Fill(leadjeta,leadjphi);
02415                 }
02416               }
02417             }//numpassed
02418           }//CalojetID filter
02419         }
02420         
02421         if(jetIDbool == true && (v->getTriggerType().compare("DiJet_Trigger") == 0) && calojet.size()>1){
02422           if(((CaloJetEMF[1] > _fEMF || std::abs(CaloJetEta[1]) > _feta) && 
02423               CaloJetfHPD[0] < _fHPD && CaloJetn90[0] > _n90Hits)){
02424             v->getMEhisto_DenominatorPt()->Fill((CaloJetPt[0] + CaloJetPt[1])/2.);
02425             v->getMEhisto_DenominatorEta()->Fill((CaloJetEta[0] + CaloJetEta[1])/2.); 
02426             if(numpassed==true){
02427               v->getMEhisto_NumeratorPt()->Fill((CaloJetPt[0] + CaloJetPt[1])/2.);
02428               v->getMEhisto_NumeratorEta()->Fill((CaloJetEta[0] + CaloJetEta[1])/2.);
02429             }
02430           }
02431         }
02432       }// Jet trigger and valid jet collection
02433       
02434       //PFJet paths
02435       if(verbose_) std::cout << "fillMEforEffWrtMuTrigger: PFJet -------------------" << std::endl;
02436       if(pfjetColl_.isValid() 
02437          && (v->getObjectType() == trigger::TriggerJet)){
02438         //cout<<"   - PFJet "<<endl;
02439         //&& (v->getPath().find("HLT_PFJet")!=std::string::npos)
02440         //&& (v->getPath().find("HLT_DiPFJet")!=std::string::npos)){
02441         bool jetIDbool = false;
02442         double leadjpt   = PFJetPt[0]; 
02443         double leadjeta  = PFJetEta[0];
02444         double leadjphi  = PFJetPhi[0];
02445         double ljNHEF    = PFJetNHEF[0];
02446         double ljCHEF    = PFJetCHEF[0];
02447         double ljNEMF    = PFJetNEMF[0];
02448         double ljCEMF    = PFJetCEMF[0];
02449         //double sleadjpt  = PFJetPt[1];
02450         //double sleadjeta = PFJetEta[1];
02451         //double sleadjphi = PFJetPhi[1];
02452         double sljNHEF   = PFJetNHEF[1];
02453         double sljCHEF   = PFJetCHEF[1];
02454         double sljNEMF   = PFJetNEMF[1];
02455         double sljCEMF   = PFJetCEMF[1];
02456         //
02457         double pfMHTx    = pfMHTx_All;
02458         double pfMHTy    = pfMHTy_All;
02459         //
02460         if((v->getTriggerType().compare("SingleJet_Trigger") == 0) && pfjet.size()){ //this line stops the central jets
02461           
02462           //======get pfmht
02463           _pfMHT = sqrt(pfMHTx*pfMHTx + pfMHTy*pfMHTy);
02464           v->getMEhisto_DenominatorPFMHT()->Fill(_pfMHT);
02465           
02466           if( ljNHEF >= _min_NHEF && ljNHEF <= _max_NHEF
02467               && ljCHEF >= _min_CHEF && ljCHEF <= _max_CHEF
02468               && ljNEMF >= _min_NEMF && ljNEMF <= _max_NEMF
02469               && ljCEMF >= _min_CEMF && ljCEMF <= _max_CEMF){
02470             if(verbose_) cout<<"passed PFJet ID -------------------" << endl;
02471             jetIDbool = true;
02472             v->getMEhisto_DenominatorPFPt()->Fill(leadjpt);
02473             if (isBarrel(leadjeta))  v->getMEhisto_DenominatorPFPtBarrel()->Fill(leadjpt);
02474             if (isEndCap(leadjeta))  v->getMEhisto_DenominatorPFPtEndcap()->Fill(leadjpt);
02475             if (isForward(leadjeta)) v->getMEhisto_DenominatorPFPtForward()->Fill(leadjpt);
02476             v->getMEhisto_DenominatorPFEta()->Fill(leadjeta);
02477             v->getMEhisto_DenominatorPFPhi()->Fill(leadjphi);
02478             v->getMEhisto_DenominatorPFEtaPhi()->Fill(leadjeta,leadjphi);
02479             if(isBarrel(leadjeta)){
02480               v->getMEhisto_DenominatorPFEtaBarrel()->Fill(leadjeta);
02481               v->getMEhisto_DenominatorPFPhiBarrel()->Fill(leadjphi);
02482             }
02483             if (isEndCap(leadjeta)){
02484               v->getMEhisto_DenominatorPFEtaEndcap()->Fill(leadjeta);
02485               v->getMEhisto_DenominatorPFPhiEndcap()->Fill(leadjphi);
02486             }
02487             if (isForward(leadjeta)){
02488               v->getMEhisto_DenominatorPFEtaForward()->Fill(leadjeta);
02489               v->getMEhisto_DenominatorPFPhiForward()->Fill(leadjphi);
02490             }
02491             if((leadjpt > trigLowpTPFcut && !isForward(leadjeta)) || (leadjpt > trigLowpTPFcutFwd && isForward(leadjeta))){
02492               v->getMEhisto_DenominatorPFEta_LowpTcut()->Fill(leadjeta);
02493               v->getMEhisto_DenominatorPFPhi_LowpTcut()->Fill(leadjphi);
02494               v->getMEhisto_DenominatorPFEtaPhi_LowpTcut()->Fill(leadjeta,leadjphi);
02495             }
02496             if((leadjpt > trigMedpTPFcut && !isForward(leadjeta)) || (leadjpt > trigMedpTPFcutFwd && isForward(leadjeta))){
02497               v->getMEhisto_DenominatorPFEta_MedpTcut()->Fill(leadjeta);
02498               v->getMEhisto_DenominatorPFPhi_MedpTcut()->Fill(leadjphi);
02499               v->getMEhisto_DenominatorPFEtaPhi_MedpTcut()->Fill(leadjeta,leadjphi);
02500             }
02501             if((leadjpt > trigHighpTPFcut && !isForward(leadjeta)) || (leadjpt > trigHighpTPFcutFwd && isForward(leadjeta))){
02502               v->getMEhisto_DenominatorPFEta_HighpTcut()->Fill(leadjeta);
02503               v->getMEhisto_DenominatorPFPhi_HighpTcut()->Fill(leadjphi);
02504               v->getMEhisto_DenominatorPFEtaPhi_HighpTcut()->Fill(leadjeta,leadjphi);
02505             }
02506             
02507             //Numerator fill
02508             if(numpassed){
02509               double dRmin = 99999.;
02510               double dPhimin = 9999.;
02511               if(v->getPath().find("L1") != std::string::npos){ 
02512                 if ( l1Index >= triggerObj_->sizeFilters() ) {
02513                   edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
02514                 } 
02515                 else{    
02516                   const trigger::Keys & kl1 = triggerObj_->filterKeys(l1Index);
02517                   for(trigger::Keys::const_iterator ki = kl1.begin();ki != kl1.end(); ++ki){      
02518                     double dR = deltaR(toc[*ki].eta(), toc[*ki].phi(), leadjeta, leadjphi);
02519                     if(dR < dRmin){
02520                       dRmin = dR;
02521                     } 
02522                   } 
02523                 }                
02524               } 
02525               else{
02526                 if ( hltIndex >= triggerObj_->sizeFilters() ) {
02527                   edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
02528                 } 
02529                 else{    
02530                   const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex); 
02531                   for(trigger::Keys::const_iterator kj = khlt.begin();kj != khlt.end(); ++kj){      
02532                     double dR = deltaR(toc[*kj].eta(), toc[*kj].phi(), leadjeta, leadjphi);
02533                     if(dR < dRmin){
02534                       dRmin = dR;
02535                     } 
02536                     double dPhi = deltaPhi(toc[*kj].phi(), leadjphi);
02537                     if(dPhi < dPhimin){ 
02538                       dPhimin = dPhi; 
02539                     }
02540                   }  
02541                   v->getMEhisto_PFDeltaPhi()->Fill(dPhimin);
02542                   v->getMEhisto_PFDeltaR()->Fill(dRmin);
02543                 }  
02544               }
02545               if(dRmin < 0.1 || (v->getPath().find("L1") != std::string::npos && dRmin < 0.4)){
02546                 v->getMEhisto_NumeratorPFPt()->Fill(leadjpt);
02547                 if (isBarrel(leadjeta))  v->getMEhisto_NumeratorPFPtBarrel()->Fill(leadjpt);
02548                 if (isEndCap(leadjeta))  v->getMEhisto_NumeratorPFPtEndcap()->Fill(leadjpt);
02549                 if (isForward(leadjeta)) v->getMEhisto_NumeratorPFPtForward()->Fill(leadjpt);
02550                 v->getMEhisto_NumeratorPFEta()->Fill(leadjeta);
02551                 v->getMEhisto_NumeratorPFPhi()->Fill(leadjphi);
02552                 v->getMEhisto_NumeratorPFEtaPhi()->Fill(leadjeta,leadjphi);
02553                 if (isBarrel(leadjeta)){
02554                   v->getMEhisto_NumeratorPFEtaBarrel()->Fill(leadjeta);
02555                   v->getMEhisto_NumeratorPFPhiBarrel()->Fill(leadjphi);
02556                 }
02557                 if (isEndCap(leadjeta)){
02558                   v->getMEhisto_NumeratorPFEtaEndcap()->Fill(leadjeta);
02559                   v->getMEhisto_NumeratorPFPhiEndcap()->Fill(leadjphi);
02560                 }
02561                 if (isForward(leadjeta)){
02562                   v->getMEhisto_NumeratorPFEtaForward()->Fill(leadjeta);
02563                   v->getMEhisto_NumeratorPFPhiForward()->Fill(leadjphi);
02564                 }
02565                 if((leadjpt > trigLowpTPFcut && !isForward(leadjeta)) 
02566                    || (leadjpt > trigLowpTPFcutFwd && isForward(leadjeta))){
02567                   v->getMEhisto_NumeratorPFEta_LowpTcut()->Fill(leadjeta);
02568                   v->getMEhisto_NumeratorPFPhi_LowpTcut()->Fill(leadjphi);
02569                   v->getMEhisto_NumeratorPFEtaPhi_LowpTcut()->Fill(leadjeta,leadjphi);
02570                 }
02571                 if((leadjpt > trigMedpTPFcut && !isForward(leadjeta)) 
02572                    || (leadjpt > trigMedpTPFcutFwd && isForward(leadjeta))){
02573                   v->getMEhisto_NumeratorPFEta_MedpTcut()->Fill(leadjeta);
02574                   v->getMEhisto_NumeratorPFPhi_MedpTcut()->Fill(leadjphi);
02575                   v->getMEhisto_NumeratorPFEtaPhi_MedpTcut()->Fill(leadjeta,leadjphi);
02576                 }
02577                 if((leadjpt > trigHighpTPFcut && !isForward(leadjeta)) 
02578                    || (leadjpt > trigHighpTPFcutFwd && isForward(leadjeta))){
02579                   v->getMEhisto_NumeratorPFEta_HighpTcut()->Fill(leadjeta);
02580                   v->getMEhisto_NumeratorPFPhi_HighpTcut()->Fill(leadjphi);
02581                   v->getMEhisto_NumeratorPFEtaPhi_HighpTcut()->Fill(leadjeta,leadjphi);
02582                 }
02583               }
02584             }
02585           }
02586         }
02587         if(jetIDbool == true && (v->getTriggerType().compare("DiJet_Trigger") == 0) && pfjet.size()>1){ 
02588           if( ljNHEF     >= _min_NHEF && ljNHEF  <= _max_NHEF
02589               && ljCHEF  >= _min_CHEF && ljCHEF  <= _max_CHEF
02590               && ljNEMF  >= _min_NEMF && ljNEMF  <= _max_NEMF
02591               && ljCEMF  >= _min_CEMF && ljCEMF  <= _max_CEMF 
02592               && sljNHEF >= _min_NHEF && sljNHEF <= _max_NHEF
02593               && sljCHEF >= _min_CHEF && sljCHEF <= _max_CHEF
02594               && sljNEMF >= _min_NEMF && sljNEMF <= _max_NEMF
02595               && sljCEMF >= _min_CEMF && sljCEMF <= _max_CEMF ){
02596             v->getMEhisto_DenominatorPFPt()->Fill((PFJetPt[0] + PFJetPt[1])/2.);
02597             v->getMEhisto_DenominatorPFEta()->Fill((PFJetEta[0] + PFJetEta[1])/2.);
02598             if(numpassed){
02599               v->getMEhisto_NumeratorPFPt()->Fill((PFJetPt[0] + PFJetPt[1])/2.);
02600               v->getMEhisto_NumeratorPFEta()->Fill((PFJetEta[0] + PFJetEta[1])/2.);
02601             }
02602           }
02603         }
02604       }// PF Jet trigger and valid jet collection
02605       
02606       //CaloMET path
02607       if(verbose_) std::cout << "fillMEforEffWrtMuTrigger: CaloMET -------------------" << std::endl;
02608       if(calometColl_.isValid() 
02609          && ((v->getObjectType() == trigger::TriggerMET) || (v->getObjectType() == trigger::TriggerTET))
02610          && (v->getPath().find("HLT_PFMET")==std::string::npos)){
02611         //cout<<"   - CaloMET "<<endl;
02612         const CaloMETCollection *calometcol = calometColl_.product();
02613         const CaloMET met = calometcol->front();
02614         v->getMEhisto_DenominatorPt()->Fill(met.et());
02615         v->getMEhisto_DenominatorPhi()->Fill(met.phi()); 
02616         if(numpassed){
02617           v->getMEhisto_NumeratorPt()->Fill(met.et());
02618           v->getMEhisto_NumeratorPhi()->Fill(met.phi());
02619           if(hltIndex >= triggerObj_->sizeFilters()){
02620             edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
02621           } 
02622           else{
02623             double dPhimin = 9999.;//
02624             const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex); 
02625             for(trigger::Keys::const_iterator kj = khlt.begin();kj != khlt.end(); ++kj){
02626               double dPhi = deltaPhi(toc[*kj].phi(), met.phi());
02627               if(dPhi < dPhimin){
02628                 dPhimin = dPhi;
02629               }
02630             }  
02631             v->getMEhisto_DeltaPhi()->Fill(dPhimin);
02632           }
02633         } 
02634       }
02635     
02636       //PFMET
02637       if(verbose_) std::cout << "fillMEforEffWrtMuTrigger: PFMET -------------------" << std::endl;
02638       if(pfmetColl_.isValid() 
02639          && ((v->getObjectType() == trigger::TriggerMET) || (v->getObjectType() == trigger::TriggerTET))
02640          && (v->getPath().find("HLT_PFMET")!=std::string::npos)){
02641         //cout<<"   - PFMET "<<endl;
02642         const PFMETCollection *pfmetcol = pfmetColl_.product();
02643         const PFMET met = pfmetcol->front();
02644         v->getMEhisto_DenominatorPt()->Fill(met.et());
02645         v->getMEhisto_DenominatorPhi()->Fill(met.phi()); 
02646         if(numpassed){
02647           v->getMEhisto_NumeratorPt()->Fill(met.et());
02648           v->getMEhisto_NumeratorPhi()->Fill(met.phi());
02649           if(hltIndex >= triggerObj_->sizeFilters()){
02650             edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
02651           } 
02652           else{
02653             double dPhimin = 9999.;//
02654             const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex); 
02655             for(trigger::Keys::const_iterator kj = khlt.begin();kj != khlt.end(); ++kj){
02656               double dPhi = deltaPhi(toc[*kj].phi(), met.phi());
02657               if(dPhi < dPhimin){
02658                 dPhimin = dPhi;
02659               }
02660             }  
02661             v->getMEhisto_DeltaPhi()->Fill(dPhimin);
02662           }
02663         } 
02664       }
02665       
02666       /*
02667         if(pfmhtColl_.isValid() && ((v->getObjectType() == trigger::TriggerMET)|| (v->getObjectType() == trigger::TriggerTET))){
02668         const PFMHTCollection *pfmhtcol = pfmhtColl_.product();
02669         const PFMHT met = pfmhtcol->front();
02670         v->getMEhisto_DenominatorPFPt()->Fill(met.pt());
02671         v->getMEhisto_DenominatorPFPhi()->Fill(met.phi());
02672         }// PFMHT  trigger and valid MET collection 
02673       */
02674     }// trigger under study
02675   }
02676 }
02677 
02678 
02679 
02680 // -- method called once each job just before starting event loop  --------
02681 void 
02682 JetMETHLTOfflineSource::beginJob()
02683 {
02684 }
02685 
02686 // BeginRun
02687 void 
02688 JetMETHLTOfflineSource::beginRun(const edm::Run& run, const edm::EventSetup& c)
02689 {
02690   if(!isSetup_){ 
02691     DQMStore *dbe = 0;
02692     dbe = Service<DQMStore>().operator->();
02693     if (dbe) {
02694       dbe->setCurrentFolder(dirname_);
02695       dbe->rmdir(dirname_);
02696     }
02697     if (dbe) {
02698       dbe->setCurrentFolder(dirname_);
02699     }
02700     
02701     //--- htlConfig_
02702     bool changed(true);
02703     if (!hltConfig_.init(run, c, processname_, changed)) {
02704       LogDebug("HLTJetMETDQMSource") << "HLTConfigProvider failed to initialize.";
02705     }
02706     
02707     /*
02708       Here we select the Single Jet, DiJet, MET trigger. SingleJet and DiJet trigger are saved under same object type "TriggerJet". We can easily separate out sing
02709       le   and di jet trigger later. For the first trigger in the list, denominator trigger is dummy (empty) whereas for other triggers denom is previous trigger o
02710       f same type. e.g. SingleJet50 has singleJet30 as denominator.
02711       For defining histos wrt muon trigger, denominator is always set "MuonTrigger". This string later can be checked and condition can be applied on muon triggers
02712       .
02713     */
02714     
02715     const unsigned int n(hltConfig_.size());
02716     int singleJet = 0;
02717     int diJet     = 0;
02718     int met       = 0;
02719     int tet       = 0;
02720     for (unsigned int i=0; i!=n; ++i) {
02721       bool denomFound = false;
02722       bool numFound   = false; 
02723       bool mbFound    = false;
02724       bool muFound    = false;
02725       bool checkPath  = false;
02726 
02727       //Look for paths if "path name fraction" is found in the pathname
02728       std::string pathname = hltConfig_.triggerName(i);
02729       //Filter only paths JetMET triggers are interested in
02730       std::vector<std::string>::const_iterator controlPathname = pathFilter_.begin();
02731       for(;controlPathname!=pathFilter_.end(); ++controlPathname){
02732         if(pathname.find((*controlPathname)) != std::string::npos){
02733           checkPath = true;
02734           break;
02735         }
02736       }
02737       if(checkPath==false) continue;
02738       
02739       //Reject if keyword(s) is found in the pathname
02740       std::vector<std::string>::const_iterator rejectPathname = pathRejectKeyword_.begin();
02741       for(; rejectPathname!=pathRejectKeyword_.end();++rejectPathname){
02742         if(pathname.find((*rejectPathname)) != std::string::npos){
02743           checkPath = false;
02744           break;
02745         }
02746       }
02747       if(checkPath==false) continue;
02748       
02749       
02750       //
02751       if(verbose_) cout<<"==pathname=="<<pathname<<endl;
02752       std::string dpathname = MuonTrigPaths_[0];
02753       std::string l1pathname = "dummy";
02754       std::string denompathname = "";
02755       unsigned int usedPrescale = 1;
02756       unsigned int objectType = 0;
02757       std::string triggerType = "";
02758       std::string filtername("dummy");
02759       std::string Denomfiltername("denomdummy");
02760   
02761       if(pathname.find("Jet")            != std::string::npos 
02762          && !(pathname.find("DoubleJet") != std::string::npos) 
02763          && !(pathname.find("DiJet")     != std::string::npos)
02764          && !(pathname.find("DiPFJet")   != std::string::npos) 
02765          && !(pathname.find("BTag")      != std::string::npos) 
02766          && !(pathname.find("Mu")        != std::string::npos) 
02767          && !(pathname.find("Fwd")       != std::string::npos)){
02768         triggerType = "SingleJet_Trigger"; 
02769         objectType = trigger::TriggerJet;
02770       }
02771       if(pathname.find("DiJet") != std::string::npos 
02772          || pathname.find("DiPFJet") != std::string::npos
02773          || pathname.find("DoubleJet") != std::string::npos){
02774         triggerType = "DiJet_Trigger";
02775         objectType = trigger::TriggerJet;
02776       }
02777       if(pathname.find("MET") != std::string::npos){
02778         triggerType = "MET_Trigger";  
02779         objectType = trigger::TriggerMET;
02780       }
02781       if(pathname.find("HT") != std::string::npos) {
02782         triggerType = "TET_Trigger";
02783         objectType = trigger::TriggerTET;
02784       }
02785       
02786       //
02787       if(objectType == trigger::TriggerJet  
02788          && !(pathname.find("DiJet") != std::string::npos)
02789          && !(pathname.find("DiPFJet") != std::string::npos) 
02790          && !(pathname.find("DoubleJet") != std::string::npos)){
02791         singleJet++;
02792         if(singleJet > 1)  dpathname = dpathname = hltConfig_.triggerName(i-1);
02793         if(singleJet == 1) dpathname = MuonTrigPaths_[0];
02794       }  
02795       if(objectType == trigger::TriggerJet  
02796          && ((pathname.find("DiJet") != std::string::npos) 
02797              || (pathname.find("DiPFJet") != std::string::npos))){
02798         diJet++;
02799         if(diJet > 1)  dpathname = dpathname = hltConfig_.triggerName(i-1);
02800         if(diJet == 1) dpathname = MuonTrigPaths_[0];
02801       } 
02802       if(objectType == trigger::TriggerMET  ){
02803         met++;
02804         if(met > 1)  dpathname = dpathname = hltConfig_.triggerName(i-1);
02805         if(met == 1) dpathname = MuonTrigPaths_[0];
02806       }
02807       if(objectType == trigger::TriggerTET  ){
02808         tet++;
02809         if(tet > 1)  dpathname = dpathname = hltConfig_.triggerName(i-1);
02810         if(tet == 1) dpathname = MuonTrigPaths_[0];
02811       }
02812       
02813       // find L1 condition for numpath with numpath objecttype 
02814       // find PSet for L1 global seed for numpath,sss 
02815       // list module labels for numpath
02816       
02817       // Checking if the trigger exist in HLT table or not
02818       for (unsigned int i=0; i!=n; ++i){
02819         std::string HLTname = hltConfig_.triggerName(i);
02820         if(HLTname == pathname)          numFound   = true;
02821         if(HLTname == dpathname)         denomFound = true;
02822         if(HLTname.find(MBTrigPaths_[0])   != std::string::npos) mbFound = true;
02823         if(HLTname.find(MuonTrigPaths_[0]) != std::string::npos) muFound = true;
02824         //if(HLTname == MBTrigPaths_[0])   mbFound    = true;
02825         //if(HLTname == MuonTrigPaths_[0]) muFound    = true; 
02826       }
02827       
02828       if(numFound){ //make trigger exist in the menu
02829         //ml needs change l1pathname
02830         l1pathname = getL1ConditionModuleName(pathname); //ml added L1conditionmodulename       
02831         //ml added
02832         std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(pathname);
02833         for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin(); numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
02834           edm::InputTag testTag(*numpathmodule,"",processname_);
02835           if ((hltConfig_.moduleType(*numpathmodule)    == "HLT1CaloJet")
02836               || (hltConfig_.moduleType(*numpathmodule) == "HLT1PFJet")
02837               || (hltConfig_.moduleType(*numpathmodule) == "HLTDiJetAveFilter")
02838               || (hltConfig_.moduleType(*numpathmodule) == "HLTDiPFJetAveFilter") 
02839               || (hltConfig_.moduleType(*numpathmodule) == "HLT1CaloMET") 
02840               || (hltConfig_.moduleType(*numpathmodule) == "HLTMhtFilter") 
02841               || (hltConfig_.moduleType(*numpathmodule) == "HLTPrescaler"))
02842             filtername = *numpathmodule;
02843         }
02844         /*
02845           std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(pathname);
02846           for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin(); numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
02847           edm::InputTag testTag(*numpathmodule,"",processname_);
02848           if ((hltConfig_.moduleType(*numpathmodule) == "HLT1CaloJet")
02849           || (hltConfig_.moduleType(*numpathmodule) == "HLTDiJetAveFilter") 
02850           || (hltConfig_.moduleType(*numpathmodule) == "HLT1CaloMET" ) 
02851           || (hltConfig_.moduleType(*numpathmodule) == "HLTPrescaler"))
02852           filtername = *numpathmodule;
02853           if (hltConfig_.moduleType(*numpathmodule) == "HLTLevel1GTSeed")l1pathname = *numpathmodule;
02854           }
02855         */
02856       }
02857 
02858       if(objectType != 0 && denomFound){
02859         std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(dpathname);
02860         for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin(); numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
02861           edm::InputTag testTag(*numpathmodule,"",processname_);
02862           if ((hltConfig_.moduleType(*numpathmodule)    == "HLT1CaloJet")
02863               || (hltConfig_.moduleType(*numpathmodule) == "HLT1PFJet")
02864               || (hltConfig_.moduleType(*numpathmodule) == "HLTDiJetAveFilter") 
02865               || (hltConfig_.moduleType(*numpathmodule) == "HLTDiPFJetAveFilter") 
02866               || (hltConfig_.moduleType(*numpathmodule) == "HLT1CaloMET" ) 
02867               || (hltConfig_.moduleType(*numpathmodule) == "HLTMhtFilter") 
02868               || (hltConfig_.moduleType(*numpathmodule) == "HLTPrescaler") )
02869             Denomfiltername = *numpathmodule;
02870         }
02871       }
02872 
02873       if(objectType != 0 && numFound){
02874         if(verbose_)
02875           cout<<"=Pathname= "<<pathname
02876               <<" | =Denompath= "<<dpathname
02877               <<" | =Filtername= "<<filtername
02878               <<" | =Denomfiltername= "<<Denomfiltername
02879               <<" | =L1pathname= "<<l1pathname
02880               <<" | =ObjectType= "<<objectType<<endl;    
02881         if(!((pathname.find("HT") != std::string::npos) || (pathname.find("Quad") != std::string::npos))){     
02882           hltPathsAll_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname, filtername, Denomfiltername, processname_, objectType, triggerType));
02883           if(muFound)hltPathsAllWrtMu_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname, 
02884                                                           filtername, Denomfiltername, processname_, objectType, triggerType));
02885           if(muFound)hltPathsEffWrtMu_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname, 
02886                                                           filtername, Denomfiltername, processname_, objectType, triggerType));
02887           if(mbFound)hltPathsEffWrtMB_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname, 
02888                                                           filtername, Denomfiltername, processname_, objectType, triggerType));
02889           if(!nameForEff_ && denomFound) hltPathsEff_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname, 
02890                                                                          filtername, Denomfiltername, processname_, objectType, triggerType));
02891         }
02892         hltPathsAllTriggerSummary_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname, 
02893                                                       filtername, Denomfiltername, processname_, objectType, triggerType));
02894       }
02895     } //Loop over paths
02896 
02897     if (verbose_) cout << "get names for efficicncy------------------"<< endl;
02898     //---------bool to pick trigger names pair from config file-------------
02899     if(nameForEff_){
02900       std::string l1pathname = "dummy";
02901       std::string denompathname = "";
02902       unsigned int usedPrescale = 1;
02903       unsigned int objectType = 0;
02904       std::string triggerType = "";
02905       std::string filtername("dummy");
02906       std::string Denomfiltername("denomdummy");
02907       for (std::vector<std::pair<std::string, std::string> >::iterator custompathnamepair = custompathnamepairs_.begin(); 
02908            custompathnamepair != custompathnamepairs_.end(); ++custompathnamepair){
02909         std::string pathname  = custompathnamepair->first;
02910         std::string dpathname = custompathnamepair->second;
02911         bool numFound = false;
02912         bool denomFound = false;
02913         // Checking if the trigger exist in HLT table or not
02914         for (unsigned int i=0; i!=n; ++i) {
02915           std::string HLTname = hltConfig_.triggerName(i);
02916           if(HLTname.find(pathname)!=std::string::npos){numFound = true; pathname = HLTname;} //changed to get versions 
02917           if(HLTname.find(dpathname)!=std::string::npos){denomFound = true; dpathname = HLTname;} //changed
02918         }
02919         if(numFound && denomFound){
02920           if (pathname.find("Jet")            != std::string::npos 
02921               && !(pathname.find("DiJet")     != std::string::npos)
02922               && !(pathname.find("DiPFJet")   != std::string::npos) 
02923               && !(pathname.find("DoubleJet") != std::string::npos) 
02924               && !(pathname.find("BTag")      != std::string::npos) 
02925               && !(pathname.find("Mu")        != std::string::npos) 
02926               && !(pathname.find("Fwd")       != std::string::npos)){
02927             triggerType = "SingleJet_Trigger";
02928             objectType = trigger::TriggerJet;
02929           }
02930           if (pathname.find("DiJet")        != std::string::npos
02931               || pathname.find("DiPFJet")   != std::string::npos
02932               || pathname.find("DoubleJet") != std::string::npos ){
02933             triggerType = "DiJet_Trigger";
02934             objectType = trigger::TriggerJet;
02935           }
02936           if (pathname.find("MET") != std::string::npos ){
02937             triggerType = "MET_Trigger";
02938             objectType = trigger::TriggerMET;
02939           }
02940           if (pathname.find("TET") != std::string::npos ){
02941             triggerType = "TET_Trigger";
02942             objectType = trigger::TriggerTET;
02943           }
02944           
02945           l1pathname = getL1ConditionModuleName(pathname); //ml added L1conditionmodulename
02946           std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(pathname);
02947           for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin(); numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
02948             edm::InputTag testTag(*numpathmodule,"",processname_);
02949             if ((hltConfig_.moduleType(*numpathmodule) == "HLT1CaloJet")
02950                 || (hltConfig_.moduleType(*numpathmodule) == "HLT1PFJet")
02951                 || (hltConfig_.moduleType(*numpathmodule) == "HLTDiJetAveFilter") 
02952                 || (hltConfig_.moduleType(*numpathmodule) == "HLTDiPFJetAveFilter") 
02953                 || (hltConfig_.moduleType(*numpathmodule) == "HLT1CaloMET" ) 
02954                 || (hltConfig_.moduleType(*numpathmodule) == "HLTMhtFilter") 
02955                 || (hltConfig_.moduleType(*numpathmodule) == "HLTPrescaler") )
02956               filtername = *numpathmodule;
02957           }
02958           
02959           if(objectType != 0){
02960             std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(dpathname);
02961             for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin(); numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
02962               edm::InputTag testTag(*numpathmodule,"",processname_);
02963               if ((hltConfig_.moduleType(*numpathmodule)    == "HLT1CaloJet")
02964                   || (hltConfig_.moduleType(*numpathmodule) == "HLT1PFJet")
02965                   || (hltConfig_.moduleType(*numpathmodule) == "HLTDiJetAveFilter")
02966                   || (hltConfig_.moduleType(*numpathmodule) == "HLTDiPFJetAveFilter")  
02967                   || (hltConfig_.moduleType(*numpathmodule) == "HLT1CaloMET" ) 
02968                   || (hltConfig_.moduleType(*numpathmodule) == "HLTMhtFilter") 
02969                   || (hltConfig_.moduleType(*numpathmodule) == "HLTPrescaler") )
02970                 Denomfiltername = *numpathmodule;
02971             }
02972      
02973             if(verbose_)cout<<"==pathname=="<<pathname
02974                             <<"==denompath=="<<dpathname
02975                             <<"==filtername=="<<filtername
02976                             <<"==denomfiltername=="<<Denomfiltername
02977                             <<"==l1pathname=="<<l1pathname
02978                             <<"==objectType=="<<objectType<<endl;
02979             hltPathsEff_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname, 
02980                                             filtername, Denomfiltername, processname_, objectType, triggerType)); 
02981           }
02982         }
02983       }
02984     }
02985     
02986     if(verbose_)cout<<"== end hltPathsEff_.push_back ======" << endl;
02987     
02988     //-----------------------------------------------------------------
02989     //---book trigger summary histos
02990     if(!isSetup_){
02991       std::string foldernm = "/TriggerSummary/";
02992       if (dbe){
02993         dbe->setCurrentFolder(dirname_ + foldernm);
02994       }
02995       int     TrigBins_ = hltPathsAllTriggerSummary_.size();
02996       double  TrigMin_ = -0.5;
02997       double  TrigMax_ = hltPathsAllTriggerSummary_.size()-0.5;
02998       
02999       std::string histonm="JetMET_TriggerRate";
03000       std::string histot="JetMET TriggerRate Summary";
03001       rate_All = dbe->book1D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_);
03002       
03003       histonm = "JetMET_TriggerRate_Correlation";
03004       histot  = "JetMET TriggerRate Correlation Summary;y&&!x;x&&y";
03005       correlation_All = dbe->book2D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_,TrigBins_,TrigMin_,TrigMax_);
03006       
03007       histonm   = "JetMET_NVertices";
03008       histot    = "No. of vertices";
03009       NVertices = dbe->book1D(histonm.c_str(),histot.c_str(),100,0,50);
03010       
03011       histonm   = "JetMET_PVZ";
03012       histot    = "Primary Vertex Z pos";
03013       PVZ       = dbe->book1D(histonm.c_str(),histot.c_str(),100,-50.,50.);
03014       
03015       if(runStandalone_){
03016         histonm="JetMET_TriggerRate_WrtMuTrigger";
03017         histot="JetMET TriggerRate Summary Wrt Muon Trigger ";    
03018         rate_AllWrtMu = dbe->book1D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_);
03019         
03020         histonm="JetMET_TriggerRate_Correlation_WrtMuTrigger";
03021         histot="JetMET TriggerRate Correlation Summary Wrt Muon Trigger;y&&!x;x&&y";
03022         correlation_AllWrtMu = dbe->book2D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_,TrigBins_,TrigMin_,TrigMax_);
03023         
03024         histonm="JetMET_TriggerRate_WrtMBTrigger";
03025         histot="JetMET TriggerRate Summary Wrt MB Trigger";
03026         rate_AllWrtMB = dbe->book1D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_);
03027       
03028         histonm="JetMET_TriggerRate_Correlation_WrtMBTrigger";
03029         histot="JetMET TriggerRate Correlation Wrt MB Trigger;y&&!x;x&&y";
03030         correlation_AllWrtMB = dbe->book2D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_,TrigBins_,TrigMin_,TrigMax_);
03031       }
03032       isSetup_ = true;
03033     }
03034     //---Set bin label
03035     
03036     for(PathInfoCollection::iterator v = hltPathsAllTriggerSummary_.begin(); v!= hltPathsAllTriggerSummary_.end(); ++v ){
03037       std::string labelnm("dummy");
03038       labelnm = v->getPath(); 
03039       int nbins = rate_All->getTH1()->GetNbinsX();
03040       for(int ibin=1; ibin<nbins+1; ibin++){
03041         const char * binLabel = rate_All->getTH1()->GetXaxis()->GetBinLabel(ibin);
03042         std::string binLabel_str = string(binLabel);
03043         if(binLabel_str.compare(labelnm)==0)break;
03044         if(binLabel[0]=='\0'){
03045           rate_All->setBinLabel(ibin,labelnm);  
03046           correlation_All->setBinLabel(ibin,labelnm,1);
03047           correlation_All->setBinLabel(ibin,labelnm,2);
03048           if(runStandalone_){
03049             rate_AllWrtMu->setBinLabel(ibin,labelnm);
03050             rate_AllWrtMB->setBinLabel(ibin,labelnm);
03051             correlation_AllWrtMu->setBinLabel(ibin,labelnm,1);
03052             correlation_AllWrtMB->setBinLabel(ibin,labelnm,1);
03053             correlation_AllWrtMu->setBinLabel(ibin,labelnm,2);
03054             correlation_AllWrtMB->setBinLabel(ibin,labelnm,2);
03055           }
03056           break; 
03057         } 
03058       }
03059     }
03060 
03061     // Now define histos for All triggers
03062     if(plotAll_){
03063       //
03064       int Nbins_       = 10;
03065       int Nmin_        = -0.5;
03066       int Nmax_        = 9.5;
03067       //
03068       int Ptbins_      = 100;
03069       if(runStandalone_) Ptbins_ = 1000;
03070       double PtMin_    = 0.;
03071       double PtMax_    = 1000.;
03072       //
03073       int Etabins_     = 50;
03074       if(runStandalone_) Etabins_ = 100;
03075       double EtaMin_   = -5.;
03076       double EtaMax_   =  5.;
03077       //
03078       int Phibins_     = 35;
03079       double PhiMin_   = -3.5;
03080       double PhiMax_   = 3.5;
03081 
03082       int Resbins_     = 30;
03083       double ResMin_   =  -1.5;
03084       double ResMax_   =   1.5;
03085       //
03086       std::string dirName = dirname_ + "/MonitorAllTriggers/";
03087       for(PathInfoCollection::iterator v = hltPathsAll_.begin(); v!= hltPathsAll_.end(); ++v ){
03088         //
03089         std::string trgPathName = HLTConfigProvider::removeVersion(v->getPath());
03090         std::string subdirName  = dirName + trgPathName;
03091         std::string trigPath    = "("+trgPathName+")";
03092         dbe->setCurrentFolder(subdirName);  
03093         
03094         std::string labelname("ME");
03095         std::string histoname(labelname+"");
03096         std::string title(labelname+"");
03097 
03098         MonitorElement *dummy;
03099         dummy =  dbe->bookFloat("dummy");  
03100         
03101         if(v->getObjectType() == trigger::TriggerJet && v->getTriggerType().compare("SingleJet_Trigger") == 0){
03102           
03103           histoname = labelname+"_recObjN";
03104           title     = labelname+"_recObjN;Reco multiplicity()"+trigPath;
03105           MonitorElement * N = dbe->book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
03106           N->getTH1();
03107           
03108           histoname = labelname+"_recObjPt";
03109           title = labelname+"_recObjPt; Reco Pt[GeV/c]"+trigPath;
03110           MonitorElement * Pt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03111           Pt->getTH1();
03112           
03113           histoname = labelname+"_recObjPtBarrel";
03114           title = labelname+"_recObjPtBarrel;Reco Pt[GeV/c]"+trigPath;
03115           MonitorElement * PtBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03116           PtBarrel->getTH1();
03117           
03118           histoname = labelname+"_recObjPtEndcap";
03119           title = labelname+"_recObjPtEndcap;Reco Pt[GeV/c]"+trigPath;
03120           MonitorElement * PtEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03121           PtEndcap->getTH1();
03122           
03123           histoname = labelname+"_recObjPtForward";
03124           title = labelname+"_recObjPtForward;Reco Pt[GeV/c]"+trigPath;
03125           MonitorElement * PtForward =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03126           PtForward->getTH1();
03127           
03128           histoname = labelname+"_recObjEta";
03129           title = labelname+"_recObjEta;Reco #eta"+trigPath;
03130           MonitorElement * Eta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
03131           Eta->getTH1();
03132           
03133           histoname = labelname+"_recObjPhi";
03134           title = labelname+"_recObjPhi;Reco #Phi"+trigPath;
03135           MonitorElement * Phi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
03136           Phi->getTH1();
03137           
03138           histoname = labelname+"_recObjEtaPhi";
03139           title = labelname+"_recObjEtaPhi;Reco #eta;Reco #Phi"+trigPath;
03140           MonitorElement * EtaPhi =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
03141           EtaPhi->getTH1();
03142           
03143           histoname = labelname+"_l1ObjPt";
03144           title = labelname+"_l1ObjPt;L1 Pt[GeV/c]"+trigPath;
03145           MonitorElement * Pt_L1 =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03146           Pt_L1->getTH1(); 
03147 
03148           histoname = labelname+"_l1ObjEta";
03149           title = labelname+"_l1ObjEta;L1 #eta"+trigPath;
03150           MonitorElement * Eta_L1 =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
03151           Eta_L1->getTH1();                                                               
03152                                                                       
03153           histoname = labelname+"_l1ObjPhi";
03154           title = labelname+"_l1ObjPhi;L1 #Phi"+trigPath;
03155           MonitorElement * Phi_L1 =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
03156           Phi_L1->getTH1();                                                               
03157                                                                       
03158           histoname = labelname+"_l1ObjEtaPhi";
03159           title = labelname+"_l1ObjEtaPhi;L1 #eta;L1 #Phi"+trigPath;
03160           MonitorElement * EtaPhi_L1 =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
03161           EtaPhi_L1->getTH1();
03162 
03163           histoname = labelname+"_l1ObjN";         
03164           title     = labelname+"_l1ObjN;L1 multiplicity"+trigPath;
03165           MonitorElement * N_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
03166           N_L1->getTH1();   
03167           
03168           histoname = labelname+"_l1ObjPtBarrel";                                    
03169           title = labelname+"_l1ObjPtBarrel;L1 Pt[GeV/c]"+trigPath;                              
03170           MonitorElement * PtBarrel_L1 =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03171           PtBarrel_L1->getTH1();                                                            
03172           
03173           histoname = labelname+"_l1ObjPtEndcap";
03174           title = labelname+"_l1ObjPtEndcap;L1 Pt[GeV/c]"+trigPath;
03175           MonitorElement * PtEndcap_L1 =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03176           PtEndcap_L1->getTH1();                                                            
03177           
03178           histoname = labelname+"_l1ObjPtForward";
03179           title = labelname+"_l1ObjPtForward;L1 Pt[GeV/c]"+trigPath;
03180           MonitorElement * PtForward_L1 =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03181           PtForward_L1->getTH1();
03182           
03183           histoname = labelname+"_hltObjN";         
03184           title     = labelname+"_hltObjN;HLT multiplicity"+trigPath;
03185           MonitorElement * N_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
03186           N_HLT->getTH1();                                                                    
03187           
03188           histoname = labelname+"_hltObjPtBarrel";                                    
03189           title = labelname+"_hltObjPtBarrel;HLT Pt[GeV/c]"+trigPath;                              
03190           MonitorElement * PtBarrel_HLT =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03191           PtBarrel_HLT->getTH1();                                                            
03192           
03193           histoname = labelname+"_hltObjPtEndcap";
03194           title = labelname+"_hltObjPtEndcap;HLT Pt[GeV/c]"+trigPath;
03195           MonitorElement * PtEndcap_HLT =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03196           PtEndcap_HLT->getTH1();                                                            
03197           
03198           histoname = labelname+"_hltObjPtForward";
03199           title = labelname+"_hltObjPtForward;HLT Pt[GeV/c]"+trigPath;
03200           MonitorElement * PtForward_HLT =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03201           PtForward_HLT->getTH1();                                                                                                        
03202           
03203           histoname = labelname+"_hltObjPt";
03204           title = labelname+"_hltObjPt;HLT Pt[GeV/c]"+trigPath;
03205           MonitorElement * Pt_HLT =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03206           Pt_HLT->getTH1(); 
03207 
03208           histoname = labelname+"_hltObjEta";
03209           title = labelname+"_hltObjEta;HLT #eta"+trigPath;
03210           MonitorElement * Eta_HLT =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
03211           Eta_HLT->getTH1();                                                               
03212                                                                       
03213           histoname = labelname+"_hltObjPhi";
03214           title = labelname+"_hltObjPhi;HLT #Phi"+trigPath;
03215           MonitorElement *  Phi_HLT =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
03216           Phi_HLT->getTH1();                                                               
03217                                                                       
03218           histoname = labelname+"_hltObjEtaPhi";
03219           title = labelname+"_hltObjEtaPhi;HLT #eta;HLT #Phi"+trigPath;
03220           MonitorElement * EtaPhi_HLT =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
03221           EtaPhi_HLT->getTH1();                                                                                        
03222                                       
03223           histoname = labelname+"_l1HLTPtResolution";
03224           title = labelname+"_l1HLTPtResolution;(Pt(L1)-Pt(HLT))/Pt(L1)"+trigPath;
03225           MonitorElement * PtResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03226           PtResolution_L1HLT->getTH1();
03227           
03228           histoname = labelname+"_l1HLTEtaResolution";
03229           title = labelname+"_l1HLTEtaResolution;(#eta(L1)-#eta(HLT))/#eta(L1)"+trigPath;
03230           MonitorElement * EtaResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03231           EtaResolution_L1HLT->getTH1();
03232           
03233           histoname = labelname+"_l1HLTPhiResolution";
03234           title = labelname+"_l1HLTPhiResolution;(#Phi(L1)-#Phi(HLT))/#Phi(L1)"+trigPath;
03235           MonitorElement * PhiResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03236           PhiResolution_L1HLT->getTH1();
03237           
03238           histoname = labelname+"_l1HLTPtCorrelation";
03239           title = labelname+"_l1HLTPtCorrelation;Pt(L1)[GeV/c];Pt(HLT)[GeV/c]"+trigPath;
03240           MonitorElement * PtCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
03241           PtCorrelation_L1HLT->getTH1();
03242           
03243           histoname = labelname+"_l1HLTEtaCorrelation";
03244           title = labelname+"_l1HLTEtaCorrelation;#eta(L1);#eta(HLT)"+trigPath;
03245           MonitorElement * EtaCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Etabins_,EtaMin_,EtaMax_);
03246           EtaCorrelation_L1HLT->getTH1();
03247           
03248           histoname = labelname+"_l1HLTPhiCorrelation";
03249           title = labelname+"_l1HLTPhiCorrelation;#Phi(L1);#Phi(HLT)"+trigPath;
03250           MonitorElement * PhiCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
03251           PhiCorrelation_L1HLT->getTH1();
03252           
03253           histoname = labelname+"_hltRecObjPtResolution";
03254           title = labelname+"_hltRecObjPtResolution;(Pt(HLT)-Pt(Reco))/Pt(HLT)"+trigPath;
03255           MonitorElement * PtResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03256           PtResolution_HLTRecObj->getTH1();
03257           
03258           histoname = labelname+"_hltRecObjEtaResolution";
03259           title = labelname+"_hltRecObjEtaResolution;(#eta(HLT)-#eta(Reco))/#eta(HLT)"+trigPath;
03260           MonitorElement * EtaResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03261           EtaResolution_HLTRecObj->getTH1();
03262           
03263           histoname = labelname+"_hltRecObjPhiResolution";
03264           title = labelname+"_hltRecObjPhiResolution;(#Phi(HLT)-#Phi(Reco))/#Phi(HLT)"+trigPath;
03265           MonitorElement * PhiResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03266           PhiResolution_HLTRecObj->getTH1();
03267           
03268           histoname = labelname+"_hltRecObjPtCorrelation";
03269           title = labelname+"_hltRecObjPtCorrelation;Pt(HLT)[GeV/c];Pt(Reco)[GeV/c]"+trigPath;
03270           MonitorElement * PtCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
03271           PtCorrelation_HLTRecObj->getTH1();
03272           
03273           histoname = labelname+"_hltRecObjEtaCorrelation";
03274           title = labelname+"_hltRecObjEtaCorrelation;#eta(HLT);#eta(Reco)"+trigPath;
03275           MonitorElement * EtaCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Etabins_,EtaMin_,EtaMax_);
03276           EtaCorrelation_HLTRecObj->getTH1();
03277           
03278           histoname = labelname+"_hltRecObjPhiCorrelation";
03279           title = labelname+"_hltRecObjPhiCorrelation;#Phi(HLT);#Phi(Reco)"+trigPath;
03280           MonitorElement * PhiCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
03281           PhiCorrelation_HLTRecObj->getTH1();
03282           
03283           v->setHistos(N, 
03284                        Pt,  
03285                        PtBarrel, 
03286                        PtEndcap, 
03287                        PtForward, 
03288                        Eta, 
03289                        Phi, 
03290                        EtaPhi,
03291                        N_L1, 
03292                        Pt_L1,  
03293                        PtBarrel_L1, 
03294                        PtEndcap_L1, 
03295                        PtForward_L1, 
03296                        Eta_L1, 
03297                        Phi_L1, 
03298                        EtaPhi_L1,
03299                        N_HLT, 
03300                        Pt_HLT,  
03301                        PtBarrel_HLT, 
03302                        PtEndcap_HLT, 
03303                        PtForward_HLT, 
03304                        Eta_HLT, 
03305                        Phi_HLT, 
03306                        EtaPhi_HLT,
03307                        PtResolution_L1HLT, 
03308                        EtaResolution_L1HLT,
03309                        PhiResolution_L1HLT,
03310                        PtResolution_HLTRecObj,
03311                        EtaResolution_HLTRecObj,
03312                        PhiResolution_HLTRecObj,
03313                        PtCorrelation_L1HLT,
03314                        EtaCorrelation_L1HLT,
03315                        PhiCorrelation_L1HLT,
03316                        PtCorrelation_HLTRecObj,
03317                        EtaCorrelation_HLTRecObj,
03318                        PhiCorrelation_HLTRecObj,
03319                        dummy, 
03320                        dummy, 
03321                        dummy, 
03322                        dummy, 
03323                        dummy, 
03324                        dummy,
03325                        dummy, 
03326                        dummy, 
03327                        dummy 
03328                        );
03329         }// histos for SingleJet Triggers
03330 
03331         if(v->getObjectType() == trigger::TriggerJet && v->getTriggerType().compare("DiJet_Trigger") == 0){
03332           
03333           histoname = labelname+"_RecObjAveragePt";
03334           title     = labelname+"_RecObjAveragePt;Reco Average Pt[GeV/c]"+trigPath;
03335           MonitorElement * jetAveragePt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03336           jetAveragePt->getTH1();
03337           
03338           histoname = labelname+"_RecObjAverageEta";
03339           title     = labelname+"_RecObjAverageEta;Reco Average #eta"+trigPath;
03340           MonitorElement * jetAverageEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
03341           jetAverageEta->getTH1();
03342           
03343           histoname = labelname+"_RecObjPhiDifference";
03344           title     = labelname+"_RecObjPhiDifference;Reco #Delta#Phi"+trigPath;
03345           MonitorElement * jetPhiDifference = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
03346           jetPhiDifference->getTH1();
03347           
03348           histoname = labelname+"_hltObjAveragePt";
03349           title     = labelname+"_hltObjAveragePt;HLT Average Pt[GeV/c]"+trigPath;
03350           MonitorElement * hltAveragePt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03351           hltAveragePt->getTH1();
03352           
03353           histoname = labelname+"_hltObjAverageEta";
03354           title     = labelname+"_hltObjAverageEta;HLT Average #eta"+trigPath;
03355           MonitorElement * hltAverageEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
03356           hltAverageEta->getTH1();
03357           
03358           histoname = labelname+"_hltObjPhiDifference";
03359           title     = labelname+"_hltObjPhiDifference;Reco #Delta#Phi"+trigPath;
03360           MonitorElement * hltPhiDifference = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
03361           hltPhiDifference->getTH1();
03362 
03363           v->setHistos(dummy, 
03364                        dummy,  
03365                        dummy, 
03366                        dummy, 
03367                        dummy, 
03368                        dummy, 
03369                        dummy, 
03370                        dummy,
03371                        dummy, 
03372                        dummy,  
03373                        dummy, 
03374                        dummy, 
03375                        dummy, 
03376                        dummy, 
03377                        dummy, 
03378                        dummy,
03379                        dummy, 
03380                        dummy,  
03381                        dummy, 
03382                        dummy, 
03383                        dummy, 
03384                        dummy, 
03385                        dummy, 
03386                        dummy,
03387                        dummy, 
03388                        dummy,
03389                        dummy,
03390                        dummy,
03391                        dummy,
03392                        dummy,
03393                        dummy,
03394                        dummy,
03395                        dummy,
03396                        dummy,
03397                        dummy,
03398                        dummy,
03399                        jetAveragePt, 
03400                        jetAverageEta, 
03401                        jetPhiDifference, 
03402                        hltAveragePt, 
03403                        hltAverageEta, 
03404                        hltPhiDifference,
03405                        dummy, 
03406                        dummy, 
03407                        dummy 
03408                        );  
03409         }// histos for DiJet Triggers
03410 
03411         if(v->getObjectType() == trigger::TriggerMET || (v->getObjectType() == trigger::TriggerTET)){ 
03412           
03413           histoname = labelname+"_recObjPt";
03414           title = labelname+"_recObjPt;Reco Pt[GeV/c]"+trigPath;
03415           MonitorElement * Pt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03416           Pt->getTH1();
03417            
03418           histoname = labelname+"_recObjPhi";
03419           title = labelname+"_recObjPhi;Reco #Phi"+trigPath;
03420           MonitorElement * Phi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
03421           Phi->getTH1();
03422           
03423           histoname = labelname+"_l1ObjPt";
03424           title = labelname+"_l1ObjPt;L1 Pt[GeV/c]"+trigPath;
03425           MonitorElement * Pt_L1 =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03426           Pt_L1->getTH1();                                                            
03427                                                                   
03428           histoname = labelname+"_l1ObjPhi";
03429           title = labelname+"_l1ObjPhi;L1 #Phi"+trigPath;
03430           MonitorElement * Phi_L1 =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
03431           Phi_L1->getTH1();                                                               
03432                                                                       
03433           histoname = labelname+"_hltObjPt";
03434           title = labelname+"_hltObjPt;HLT Pt[GeV/c]"+trigPath;
03435           MonitorElement *  Pt_HLT =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03436           Pt_HLT->getTH1();                                                            
03437           
03438           histoname = labelname+"_hltObjPhi";
03439           title = labelname+"_hltObjPhi;HLT #Phi"+trigPath;
03440           MonitorElement * Phi_HLT =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
03441           Phi_HLT->getTH1();                                                               
03442           
03443           histoname = labelname+"_l1HLTPtResolution";
03444           title = labelname+"_l1HLTPtResolution;(Pt(L1)-Pt(HLT))/Pt(L1)"+trigPath;
03445           MonitorElement * PtResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03446           PtResolution_L1HLT->getTH1();
03447           
03448           histoname = labelname+"_l1HLTPhiResolution";
03449           title = labelname+"_l1HLTPhiResolution;(#Phi(L1)-#Phi(HLT))/#Phi(L1)"+trigPath;
03450           MonitorElement * PhiResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03451           PhiResolution_L1HLT->getTH1();
03452           
03453           histoname = labelname+"_l1HLTPtCorrelation";
03454           title = labelname+"_l1HLTPtCorrelation;Pt(L1)[GeV/c];Pt(HLT)[GeV/c]"+trigPath;
03455           MonitorElement * PtCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
03456           PtCorrelation_L1HLT->getTH1();
03457           
03458           histoname = labelname+"_l1HLTPhiCorrelation";
03459           title = labelname+"_l1HLTPhiCorrelation;#Phi(L1);#Phi(HLT)"+trigPath;
03460           MonitorElement * PhiCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
03461           PhiCorrelation_L1HLT->getTH1();
03462           
03463           histoname = labelname+"_hltRecObjPtResolution";
03464           title = labelname+"_hltRecObjPtResolution;(Pt(HLT)-Pt(Reco))/Pt(HLT)"+trigPath;
03465           MonitorElement * PtResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03466           PtResolution_HLTRecObj->getTH1();
03467           
03468           histoname = labelname+"_hltRecObjPhiResolution";
03469           title = labelname+"_hltRecObjPhiResolution;(#Phi(HLT)-#Phi(Reco))/#Phi(HLT)"+trigPath;
03470           MonitorElement * PhiResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03471           PhiResolution_HLTRecObj->getTH1();
03472           
03473           histoname = labelname+"_hltRecObjPtCorrelation";
03474           title = labelname+"_hltRecObjPtCorrelation;Pt(HLT)[GeV/c];Pt(Reco)[GeV/c]"+trigPath;
03475           MonitorElement * PtCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
03476           PtCorrelation_HLTRecObj->getTH1();
03477           
03478           histoname = labelname+"_hltRecObjPhiCorrelation";
03479           title = labelname+"_hltRecObjPhiCorrelation;#Phi(HLT);#Phi(Reco)"+trigPath;
03480           MonitorElement * PhiCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
03481           PhiCorrelation_HLTRecObj->getTH1();
03482           
03483           v->setHistos(dummy, 
03484                        Pt,  
03485                        dummy, 
03486                        dummy, 
03487                        dummy, 
03488                        dummy, 
03489                        Phi, 
03490                        dummy,
03491                        dummy, 
03492                        Pt_L1,  
03493                        dummy, 
03494                        dummy, 
03495                        dummy, 
03496                        dummy, 
03497                        Phi_L1, 
03498                        dummy,
03499                        dummy, 
03500                        Pt_HLT,  
03501                        dummy, 
03502                        dummy, 
03503                        dummy, 
03504                        dummy, 
03505                        Phi_HLT, 
03506                        dummy,
03507                        PtResolution_L1HLT, 
03508                        dummy,
03509                        PhiResolution_L1HLT,
03510                        PtResolution_HLTRecObj,
03511                        dummy,
03512                        PhiResolution_HLTRecObj,
03513                        PtCorrelation_L1HLT,
03514                        dummy,
03515                        PhiCorrelation_L1HLT,
03516                        PtCorrelation_HLTRecObj,
03517                        dummy,
03518                        PhiCorrelation_HLTRecObj,
03519                        dummy, 
03520                        dummy, 
03521                        dummy, 
03522                        dummy, 
03523                        dummy, 
03524                        dummy,
03525                        dummy, 
03526                        dummy, 
03527                        dummy 
03528                        );
03529         }// histos for MET Triggers 
03530       }
03531     }
03532     
03533     if(plotAllwrtMu_){
03534       int Nbins_       = 10;
03535       int Nmin_        = -0.5;
03536       int Nmax_        = 9.5;
03537       //
03538       int Ptbins_      = 100;
03539       if(runStandalone_) Ptbins_ = 1000;
03540       double PtMin_    = 0.;
03541       double PtMax_    = 1000.;
03542       //
03543       int Etabins_     = 50;
03544       double EtaMin_   = -5.;
03545       double EtaMax_   =  5.;
03546       //
03547       int Phibins_     = 35;
03548       double PhiMin_   = -3.5;
03549       double PhiMax_   = 3.5;
03550       //
03551       int Resbins_     = 30;
03552       double ResMin_   = -1.5;
03553       double ResMax_   = 1.5;
03554       
03555       // Now define histos wrt Muon trigger
03556       std::string dirName = dirname_ + "/MonitorAllTriggersWrtMuonTrigger/";
03557       for(PathInfoCollection::iterator v = hltPathsAllWrtMu_.begin(); v!= hltPathsAllWrtMu_.end(); ++v ){       
03558         //
03559         std::string trgPathName    = HLTConfigProvider::removeVersion(v->getPath());
03560         std::string subdirName = dirName + trgPathName;
03561         std::string trigPath = "("+trgPathName+")";
03562         dbe->setCurrentFolder(subdirName); 
03563         //
03564         MonitorElement * dummy;
03565         dummy =  dbe->bookFloat("dummy");            
03566         //
03567         std::string labelname("ME");
03568         std::string histoname(labelname+"");
03569         std::string title(labelname+"");
03570         //
03571         if(v->getObjectType() == trigger::TriggerJet && v->getTriggerType().compare("SingleJet_Trigger") == 0){  
03572           
03573           histoname = labelname+"_recObjN";
03574           title     = labelname+"_recObjN;Reco multiplicity()"+trigPath;
03575           MonitorElement * N = dbe->book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
03576           N->getTH1();
03577           
03578           histoname = labelname+"_recObjPt";
03579           title = labelname+"_recObjPt; Reco Pt[GeV/c]"+trigPath;
03580           MonitorElement * Pt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03581           Pt->getTH1();
03582           
03583           histoname = labelname+"_recObjPtBarrel";
03584           title = labelname+"_recObjPtBarrel;Reco Pt[GeV/c]"+trigPath;
03585           MonitorElement * PtBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03586           PtBarrel->getTH1();
03587           
03588           histoname = labelname+"_recObjPtEndcap";
03589           title = labelname+"_recObjPtEndcap;Reco Pt[GeV/c]"+trigPath;
03590           MonitorElement * PtEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03591           PtEndcap->getTH1();
03592           
03593           histoname = labelname+"_recObjPtForward";
03594           title = labelname+"_recObjPtForward;Reco Pt[GeV/c]"+trigPath;
03595           MonitorElement * PtForward =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03596           PtForward->getTH1();
03597           
03598           histoname = labelname+"_recObjEta";
03599           title = labelname+"_recObjEta;Reco #eta"+trigPath;
03600           MonitorElement * Eta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
03601           Eta->getTH1();
03602           
03603           histoname = labelname+"_recObjPhi";
03604           title = labelname+"_recObjPhi;Reco #Phi"+trigPath;
03605           MonitorElement * Phi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
03606           Phi->getTH1();
03607           
03608           histoname = labelname+"_recObjEtaPhi";
03609           title = labelname+"_recObjEtaPhi;Reco #eta;Reco #Phi"+trigPath;
03610           MonitorElement * EtaPhi =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
03611           EtaPhi->getTH1();
03612           
03613           histoname = labelname+"_l1ObjN";         
03614           title     = labelname+"_l1ObjN;L1 multiplicity"+trigPath;
03615           MonitorElement * N_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
03616           N_L1->getTH1();                                              
03617                                                      
03618           histoname = labelname+"_l1ObjPt";
03619           title = labelname+"_l1ObjPt;L1 Pt[GeV/c]"+trigPath;
03620           MonitorElement * Pt_L1 =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03621           Pt_L1->getTH1();                                                            
03622           
03623           histoname = labelname+"_l1ObjPtBarrel";                                 
03624           title = labelname+"_l1ObjPtBarrel;L1 Pt[GeV/c]"+trigPath;                              
03625           MonitorElement * PtBarrel_L1 =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03626           PtBarrel_L1->getTH1();                                                            
03627           
03628           histoname = labelname+"_l1ObjPtEndcap";
03629           title = labelname+"_l1ObjPtEndcap;L1 Pt[GeV/c]"+trigPath;
03630           MonitorElement * PtEndcap_L1 =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03631           PtEndcap_L1->getTH1();                                                            
03632           
03633           histoname = labelname+"_l1ObjPtForward";
03634           title = labelname+"_l1ObjPtForward;L1 Pt[GeV/c]"+trigPath;
03635           MonitorElement * PtForward_L1 =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03636           PtForward_L1->getTH1();                                                            
03637           
03638           histoname = labelname+"_l1ObjEta";
03639           title = labelname+"_l1ObjEta;L1 #eta"+trigPath;
03640           MonitorElement * Eta_L1 =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
03641           Eta_L1->getTH1();                                                               
03642           
03643           histoname = labelname+"_l1ObjPhi";
03644           title = labelname+"_l1ObjPhi;L1 #Phi"+trigPath;
03645           MonitorElement * Phi_L1 =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
03646           Phi_L1->getTH1();                                                               
03647           
03648           histoname = labelname+"_l1ObjEtaPhi";
03649           title = labelname+"_l1ObjEtaPhi;L1 #eta;L1 #Phi"+trigPath;
03650           MonitorElement * EtaPhi_L1 =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
03651           EtaPhi_L1->getTH1();                                                                                        
03652           
03653           histoname = labelname+"_hltObjN";         
03654           title     = labelname+"_hltObjN;HLT multiplicity"+trigPath;
03655           MonitorElement * N_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
03656           N_HLT->getTH1();                                              
03657           
03658           histoname = labelname+"_hltObjPt";
03659           title = labelname+"_hltObjPt;HLT Pt[GeV/c]"+trigPath;
03660           MonitorElement * Pt_HLT =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03661           Pt_HLT->getTH1();                                                            
03662           
03663           histoname = labelname+"_hltObjPtBarrel";                                    
03664           title = labelname+"_hltObjPtBarrel;HLT Pt[GeV/c]"+trigPath;                              
03665           MonitorElement * PtBarrel_HLT =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03666           PtBarrel_HLT->getTH1();                                                            
03667           
03668           histoname = labelname+"_hltObjPtEndcap";
03669           title = labelname+"_hltObjPtEndcap;HLT Pt[GeV/c]"+trigPath;
03670           MonitorElement * PtEndcap_HLT =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03671           PtEndcap_HLT->getTH1();                                                            
03672           
03673           histoname = labelname+"_hltObjPtForward";
03674           title = labelname+"_hltObjPtForward;HLT Pt[GeV/c]"+trigPath;
03675           MonitorElement * PtForward_HLT =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03676           PtForward_HLT->getTH1();                                                            
03677           
03678           histoname = labelname+"_hltObjEta";
03679           title = labelname+"_hltObjEta;HLT #eta"+trigPath;
03680           MonitorElement * Eta_HLT =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
03681           Eta_HLT->getTH1();                                                               
03682           
03683           histoname = labelname+"_hltObjPhi";
03684           title = labelname+"_hltObjPhi;HLT #Phi"+trigPath;
03685           MonitorElement * Phi_HLT =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
03686           Phi_HLT->getTH1();                                                               
03687           
03688           histoname = labelname+"_hltObjEtaPhi";
03689           title = labelname+"_hltObjEtaPhi;HLT #eta;HLT #Phi"+trigPath;
03690           MonitorElement * EtaPhi_HLT =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
03691           EtaPhi_HLT->getTH1();                                                                                        
03692           
03693           histoname = labelname+"_l1HLTPtResolution";
03694           title = labelname+"_l1HLTPtResolution;(Pt(L1)-Pt(HLT))/Pt(L1)"+trigPath;
03695           MonitorElement * PtResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03696           PtResolution_L1HLT->getTH1();
03697           
03698           histoname = labelname+"_l1HLTEtaResolution";
03699           title = labelname+"_l1HLTEtaResolution;(#eta(L1)-#eta(HLT))/#eta(L1)"+trigPath;
03700           MonitorElement * EtaResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03701           EtaResolution_L1HLT->getTH1();
03702           
03703           histoname = labelname+"_l1HLTPhiResolution";
03704           title = labelname+"_l1HLTPhiResolution;(#Phi(L1)-#Phi(HLT))/#Phi(L1)"+trigPath;
03705           MonitorElement * PhiResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03706           PhiResolution_L1HLT->getTH1();
03707           
03708           histoname = labelname+"_l1HLTPtCorrelation";
03709           title = labelname+"_l1HLTPtCorrelation;Pt(L1)[GeV/c];Pt(HLT)[GeV/c]"+trigPath;
03710           MonitorElement * PtCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
03711           PtCorrelation_L1HLT->getTH1();
03712           
03713           histoname = labelname+"_l1HLTEtaCorrelation";
03714           title = labelname+"_l1HLTEtaCorrelation;#eta(L1);#eta(HLT)"+trigPath;
03715           MonitorElement * EtaCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Etabins_,EtaMin_,EtaMax_);
03716           EtaCorrelation_L1HLT->getTH1();
03717           
03718           histoname = labelname+"_l1HLTPhiCorrelation";
03719           title = labelname+"_l1HLTPhiCorrelation;#Phi(L1);#Phi(HLT)"+trigPath;
03720           MonitorElement * PhiCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
03721           PhiCorrelation_L1HLT->getTH1();
03722           
03723           histoname = labelname+"_hltRecObjPtResolution";
03724           title = labelname+"_hltRecObjPtResolution;(Pt(HLT)-Pt(Reco))/Pt(HLT)"+trigPath;
03725           MonitorElement * PtResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03726           PtResolution_HLTRecObj->getTH1();
03727           
03728           histoname = labelname+"_hltRecObjEtaResolution";
03729           title = labelname+"_hltRecObjEtaResolution;(#eta(HLT)-#eta(Reco))/#eta(HLT)"+trigPath;
03730           MonitorElement * EtaResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03731           EtaResolution_HLTRecObj->getTH1();
03732           
03733           histoname = labelname+"_hltRecObjPhiResolution";
03734           title = labelname+"_hltRecObjPhiResolution;(#Phi(HLT)-#Phi(Reco))/#Phi(HLT)"+trigPath;
03735           MonitorElement * PhiResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03736           PhiResolution_HLTRecObj->getTH1();
03737           
03738           histoname = labelname+"_hltRecObjPtCorrelation";
03739           title = labelname+"_hltRecObjPtCorrelation;Pt(HLT)[GeV/c];Pt(Reco)[GeV/c]"+trigPath;
03740           MonitorElement * PtCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
03741           PtCorrelation_HLTRecObj->getTH1();
03742           
03743           histoname = labelname+"_hltRecObjEtaCorrelation";
03744           title = labelname+"_hltRecObjEtaCorrelation;#eta(HLT);#eta(Reco)"+trigPath;
03745           MonitorElement * EtaCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Etabins_,EtaMin_,EtaMax_);
03746           EtaCorrelation_HLTRecObj->getTH1();
03747           
03748           histoname = labelname+"_hltRecObjPhiCorrelation";
03749           title = labelname+"_hltRecObjPhiCorrelation;#Phi(HLT);#Phi(Reco)"+trigPath;
03750           MonitorElement * PhiCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
03751           PhiCorrelation_HLTRecObj->getTH1();
03752 
03753           v->setHistos(N, 
03754                        Pt,  
03755                        PtBarrel, 
03756                        PtEndcap, 
03757                        PtForward, 
03758                        Eta, 
03759                        Phi, 
03760                        EtaPhi,
03761                        N_L1, 
03762                        Pt_L1,  
03763                        PtBarrel_L1, 
03764                        PtEndcap_L1, 
03765                        PtForward_L1, 
03766                        Eta_L1, 
03767                        Phi_L1, 
03768                        EtaPhi_L1,
03769                        N_HLT, 
03770                        Pt_HLT,  
03771                        PtBarrel_HLT, 
03772                        PtEndcap_HLT, 
03773                        PtForward_HLT, 
03774                        Eta_HLT, 
03775                        Phi_HLT, 
03776                        EtaPhi_HLT,
03777                        PtResolution_L1HLT, 
03778                        EtaResolution_L1HLT,
03779                        PhiResolution_L1HLT,
03780                        PtResolution_HLTRecObj,
03781                        EtaResolution_HLTRecObj,
03782                        PhiResolution_HLTRecObj,
03783                        PtCorrelation_L1HLT,
03784                        EtaCorrelation_L1HLT,
03785                        PhiCorrelation_L1HLT,
03786                        PtCorrelation_HLTRecObj,
03787                        EtaCorrelation_HLTRecObj,
03788                        PhiCorrelation_HLTRecObj,
03789                        dummy, 
03790                        dummy, 
03791                        dummy, 
03792                        dummy, 
03793                        dummy, 
03794                        dummy,
03795                        dummy, 
03796                        dummy, 
03797                        dummy 
03798                        );
03799         }// histos for SingleJet Triggers
03800           
03801         if(v->getObjectType() == trigger::TriggerJet && v->getTriggerType().compare("DiJet_Trigger") == 0){
03802           
03803           histoname = labelname+"_RecObjAveragePt";
03804           title     = labelname+"_RecObjAveragePt;Reco Average Pt[GeV/c]"+trigPath;
03805           MonitorElement * jetAveragePt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03806           jetAveragePt->getTH1();
03807           
03808           histoname = labelname+"_RecObjAverageEta";
03809           title     = labelname+"_RecObjAverageEta;Reco Average #eta"+trigPath;
03810           MonitorElement *  jetAverageEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
03811           jetAverageEta->getTH1();
03812           
03813           histoname = labelname+"_RecObjPhiDifference";
03814           title     = labelname+"_RecObjPhiDifference;Reco #Delta#Phi"+trigPath;
03815           MonitorElement * jetPhiDifference = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
03816           jetPhiDifference->getTH1();
03817           
03818           histoname = labelname+"_hltObjAveragePt";
03819           title     = labelname+"_hltObjAveragePt;HLT Average Pt[GeV/c]"+trigPath;
03820           MonitorElement * hltAveragePt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03821           hltAveragePt->getTH1();
03822           
03823           histoname = labelname+"_hltObjAverageEta";
03824           title     = labelname+"_hltObjAverageEta;HLT Average #eta"+trigPath;
03825           MonitorElement * hltAverageEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
03826           hltAverageEta->getTH1();
03827           
03828           histoname = labelname+"_hltObjPhiDifference";
03829           title     = labelname+"_hltObjPhiDifference;Reco #Delta#Phi"+trigPath;
03830           MonitorElement * hltPhiDifference = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
03831           hltPhiDifference->getTH1();
03832         
03833           v->setHistos(dummy, 
03834                        dummy,  
03835                        dummy, 
03836                        dummy, 
03837                        dummy, 
03838                        dummy, 
03839                        dummy, 
03840                        dummy,
03841                        dummy, 
03842                        dummy,  
03843                        dummy, 
03844                        dummy, 
03845                        dummy, 
03846                        dummy, 
03847                        dummy, 
03848                        dummy,
03849                        dummy, 
03850                        dummy,  
03851                        dummy, 
03852                        dummy, 
03853                        dummy, 
03854                        dummy, 
03855                        dummy, 
03856                        dummy,
03857                        dummy, 
03858                        dummy,
03859                        dummy,
03860                        dummy,
03861                        dummy,
03862                        dummy,
03863                        dummy,
03864                        dummy,
03865                        dummy,
03866                        dummy,
03867                        dummy,
03868                        dummy,
03869                        jetAveragePt, 
03870                        jetAverageEta, 
03871                        jetPhiDifference, 
03872                        hltAveragePt, 
03873                        hltAverageEta, 
03874                        hltPhiDifference,
03875                        dummy, 
03876                        dummy, 
03877                        dummy 
03878                        );  
03879         }// histos for DiJet Triggers
03880         
03881         if(v->getObjectType() == trigger::TriggerMET || (v->getObjectType() == trigger::TriggerTET)){   
03882           
03883           histoname = labelname+"_recObjPt";
03884           title = labelname+"_recObjPt;Reco Pt[GeV/c]"+trigPath;
03885           MonitorElement * Pt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03886           Pt->getTH1();
03887           
03888           histoname = labelname+"_recObjPhi";
03889           title = labelname+"_recObjPhi;Reco #Phi"+trigPath;
03890           MonitorElement * Phi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
03891           Phi->getTH1();
03892           
03893           histoname = labelname+"_l1ObjPt";
03894           title = labelname+"_l1ObjPt;L1 Pt[GeV/c]"+trigPath;
03895           MonitorElement * Pt_L1 =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03896           Pt_L1->getTH1();                                                            
03897                                                                    
03898           histoname = labelname+"_l1ObjPhi";
03899           title = labelname+"_l1ObjPhi;L1 #Phi"+trigPath;
03900           MonitorElement * Phi_L1 =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
03901           Phi_L1->getTH1();                                                               
03902                                                                       
03903           histoname = labelname+"_hltObjPt";
03904           title = labelname+"_hltObjPt;HLT Pt[GeV/c]"+trigPath;
03905           MonitorElement * Pt_HLT =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03906           Pt_HLT->getTH1();                                                            
03907           
03908           histoname = labelname+"_hltObjPhi";
03909           title = labelname+"_hltObjPhi;HLT #Phi"+trigPath;
03910           MonitorElement * Phi_HLT =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
03911           Phi_HLT->getTH1();                                                            
03912           
03913           histoname = labelname+"_l1HLTPtResolution";
03914           title = labelname+"_l1HLTPtResolution;(Pt(L1)-Pt(HLT))/Pt(L1)"+trigPath;
03915           MonitorElement * PtResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03916           PtResolution_L1HLT->getTH1();
03917           
03918           histoname = labelname+"_l1HLTPhiResolution";
03919           title = labelname+"_l1HLTPhiResolution;(#Phi(L1)-#Phi(HLT))/#Phi(L1)"+trigPath;
03920           MonitorElement * PhiResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03921           PhiResolution_L1HLT->getTH1();
03922           
03923           histoname = labelname+"_l1HLTPtCorrelation";
03924           title = labelname+"_l1HLTPtCorrelation;Pt(L1)[GeV/c];Pt(HLT)[GeV/c]"+trigPath;
03925           MonitorElement * PtCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
03926           PtCorrelation_L1HLT->getTH1();
03927           
03928           histoname = labelname+"_l1HLTPhiCorrelation";
03929           title = labelname+"_l1HLTPhiCorrelation;#Phi(L1);#Phi(HLT)"+trigPath;
03930           MonitorElement * PhiCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
03931           PhiCorrelation_L1HLT->getTH1();
03932           
03933           histoname = labelname+"_hltRecObjPtResolution";
03934           title = labelname+"_hltRecObjPtResolution;(Pt(HLT)-Pt(Reco))/Pt(HLT)"+trigPath;
03935           MonitorElement * PtResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03936           PtResolution_HLTRecObj->getTH1();
03937           
03938           histoname = labelname+"_hltRecObjPhiResolution";
03939           title = labelname+"_hltRecObjPhiResolution;(#Phi(HLT)-#Phi(Reco))/#Phi(HLT)"+trigPath;
03940           MonitorElement * PhiResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
03941           PhiResolution_HLTRecObj->getTH1();
03942           
03943           histoname = labelname+"_hltRecObjPtCorrelation";
03944           title = labelname+"_hltRecObjPtCorrelation;Pt(HLT)[GeV/c];Pt(Reco)[GeV/c]"+trigPath;
03945           MonitorElement * PtCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
03946           PtCorrelation_HLTRecObj->getTH1();
03947           
03948           histoname = labelname+"_hltRecObjPhiCorrelation";
03949           title = labelname+"_hltRecObjPhiCorrelation;#Phi(HLT);#Phi(Reco)"+trigPath;
03950           MonitorElement * PhiCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
03951           PhiCorrelation_HLTRecObj->getTH1(); 
03952 
03953           v->setHistos(dummy, 
03954                        Pt,  
03955                        dummy, 
03956                        dummy, 
03957                        dummy, 
03958                        dummy, 
03959                        Phi, 
03960                        dummy,
03961                        dummy, 
03962                        Pt_L1,  
03963                        dummy, 
03964                        dummy, 
03965                        dummy, 
03966                        dummy, 
03967                        Phi_L1, 
03968                        dummy,
03969                        dummy, 
03970                        Pt_HLT,  
03971                        dummy, 
03972                        dummy, 
03973                        dummy, 
03974                        dummy, 
03975                        Phi_HLT, 
03976                        dummy,
03977                        PtResolution_L1HLT, 
03978                        dummy,
03979                        PhiResolution_L1HLT,
03980                        PtResolution_HLTRecObj,
03981                        dummy,
03982                        PhiResolution_HLTRecObj,
03983                        PtCorrelation_L1HLT,
03984                        dummy,
03985                        PhiCorrelation_L1HLT,
03986                        PtCorrelation_HLTRecObj,
03987                        dummy,
03988                        PhiCorrelation_HLTRecObj,
03989                        dummy, 
03990                        dummy, 
03991                        dummy, 
03992                        dummy, 
03993                        dummy, 
03994                        dummy,
03995                        dummy, 
03996                        dummy, 
03997                        dummy 
03998                        );
03999         }// histos for MET Triggers
04000       }
04001     }
04002     
04003     //-------Now Efficiency histos--------
04004     if(plotEff_){ 
04005       int Ptbins_      = 100;
04006       if(runStandalone_) Ptbins_ = 1000;
04007       double PtMin_    = 0.;
04008       double PtMax_    = 1000.;
04009       //
04010       int Etabins_     = 50;
04011       double EtaMin_   = -5.;
04012       double EtaMax_   = 5.;
04013       //
04014       int Phibins_     = 35;
04015       double PhiMin_   = -3.5;
04016       double PhiMax_   = 3.5;
04017       // Now define histos wrt lower threshold trigger
04018       std::string dirName1 = dirname_ + "/RelativeTriggerEff/";
04019       for(PathInfoCollection::iterator v = hltPathsEff_.begin(); v!= hltPathsEff_.end(); ++v ){
04020         //
04021         std::string trgPathName    = HLTConfigProvider::removeVersion(v->getPath());
04022         std::string trgPathNameD   = HLTConfigProvider::removeVersion(v->getDenomPath());
04023         //
04024         std::string labelname("ME") ;
04025         std::string subdirName = dirName1 + trgPathName + "_wrt_" + trgPathNameD;
04026         dbe->setCurrentFolder(subdirName);
04027         std::string histoname(labelname+"");
04028         std::string title(labelname+"");
04029 
04030         MonitorElement *dummy;
04031         dummy =  dbe->bookFloat("dummy");   
04032     
04033         if((v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("SingleJet_Trigger") == 0)){   
04034           
04035           histoname = labelname+"_NumeratorPt";
04036           title     = labelname+"NumeratorPt;Calo Pt[GeV/c]";
04037           MonitorElement * NumeratorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04038           NumeratorPt->getTH1();
04039           
04040           histoname = labelname+"_NumeratorPtBarrel";
04041           title     = labelname+"NumeratorPtBarrel;Calo Pt[GeV/c] ";
04042           MonitorElement * NumeratorPtBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04043           NumeratorPtBarrel->getTH1();
04044           
04045           histoname = labelname+"_NumeratorPtEndcap";
04046           title     = labelname+"NumeratorPtEndcap;Calo Pt[GeV/c]";
04047           MonitorElement * NumeratorPtEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04048           NumeratorPtEndcap->getTH1();
04049           
04050           histoname = labelname+"_NumeratorPtForward";
04051           title     = labelname+"NumeratorPtForward;Calo Pt[GeV/c]";
04052           MonitorElement * NumeratorPtForward =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04053           NumeratorPtForward->getTH1();
04054           
04055           histoname = labelname+"_NumeratorEta";
04056           title     = labelname+"NumeratorEta;Calo #eta ";
04057           MonitorElement * NumeratorEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04058           NumeratorEta->getTH1();
04059           
04060           histoname = labelname+"_NumeratorPhi";
04061           title     = labelname+"NumeratorPhi;Calo #Phi";
04062           MonitorElement * NumeratorPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04063           NumeratorPhi->getTH1();
04064           
04065           histoname = labelname+"_NumeratorEtaPhi";
04066           title     = labelname+"NumeratorEtaPhi;Calo #eta;Calo #Phi";
04067           MonitorElement * NumeratorEtaPhi =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04068           NumeratorEtaPhi->getTH1();
04069           
04070           histoname = labelname+"_NumeratorEtaBarrel";
04071           title     = labelname+"NumeratorEtaBarrel;Calo #eta ";
04072           MonitorElement * NumeratorEtaBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04073           NumeratorEtaBarrel->getTH1();
04074           
04075           histoname = labelname+"_NumeratorPhiBarrel";
04076           title     = labelname+"NumeratorPhiBarrel;Calo #Phi";
04077           MonitorElement * NumeratorPhiBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04078           NumeratorPhiBarrel->getTH1();
04079           
04080           histoname = labelname+"_NumeratorEtaEndcap";
04081           title     = labelname+"NumeratorEtaEndcap;Calo #eta ";
04082           MonitorElement * NumeratorEtaEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04083           NumeratorEtaEndcap->getTH1();
04084           
04085           histoname = labelname+"_NumeratorPhiEndcap";
04086           title     = labelname+"NumeratorPhiEndcap;Calo #Phi";
04087           MonitorElement * NumeratorPhiEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04088           NumeratorPhiEndcap->getTH1();
04089           
04090           histoname = labelname+"_NumeratorEtaForward";
04091           title     = labelname+"NumeratorEtaForward;Calo #eta ";
04092           MonitorElement * NumeratorEtaForward =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04093           NumeratorEtaForward->getTH1();
04094           
04095           histoname = labelname+"_NumeratorPhiForward";
04096           title     = labelname+"NumeratorPhiForward;Calo #Phi";
04097           MonitorElement * NumeratorPhiForward =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04098           NumeratorPhiForward->getTH1();
04099           
04100           histoname = labelname+"_NumeratorEta_LowpTcut";
04101           title     = labelname+"NumeratorEta_LowpTcut;Calo #eta ";
04102           MonitorElement * NumeratorEta_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04103           NumeratorEta_LowpTcut->getTH1();
04104           
04105           histoname = labelname+"_NumeratorPhi_LowpTcut";
04106           title     = labelname+"NumeratorPhi_LowpTcut;Calo #Phi";
04107           MonitorElement * NumeratorPhi_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04108           NumeratorPhi_LowpTcut->getTH1();
04109           
04110           histoname = labelname+"_NumeratorEtaPhi_LowpTcut";
04111           title     = labelname+"NumeratorEtaPhi_LowpTcut;Calo #eta;Calo #Phi";
04112           MonitorElement * NumeratorEtaPhi_LowpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04113           NumeratorEtaPhi_LowpTcut->getTH1();
04114           
04115           histoname = labelname+"_NumeratorEta_MedpTcut";
04116           title     = labelname+"NumeratorEta_MedpTcut;Calo #eta ";
04117           MonitorElement * NumeratorEta_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04118           NumeratorEta_MedpTcut->getTH1();
04119           
04120           histoname = labelname+"_NumeratorPhi_MedpTcut";
04121           title     = labelname+"NumeratorPhi_MedpTcut;Calo #Phi";
04122           MonitorElement * NumeratorPhi_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04123           NumeratorPhi_MedpTcut->getTH1();
04124           
04125           histoname = labelname+"_NumeratorEtaPhi_MedpTcut";
04126           title     = labelname+"NumeratorEtaPhi_MedpTcut;Calo #eta;Calo #Phi";
04127           MonitorElement * NumeratorEtaPhi_MedpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04128           NumeratorEtaPhi_MedpTcut->getTH1();
04129           
04130           histoname = labelname+"_NumeratorEta_HighpTcut";
04131           title     = labelname+"NumeratorEta_HighpTcut;Calo #eta ";
04132           MonitorElement * NumeratorEta_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04133           NumeratorEta_HighpTcut->getTH1();
04134           
04135           histoname = labelname+"_NumeratorPhi_HighpTcut";
04136           title     = labelname+"NumeratorPhi_HighpTcut;Calo #Phi";
04137           MonitorElement * NumeratorPhi_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04138           NumeratorPhi_HighpTcut->getTH1();
04139           
04140           histoname = labelname+"_NumeratorEtaPhi_HighpTcut";
04141           title     = labelname+"NumeratorEtaPhi_HighpTcut;Calo #eta;Calo #Phi";
04142           MonitorElement * NumeratorEtaPhi_HighpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04143           NumeratorEtaPhi_HighpTcut->getTH1();
04144           
04145           histoname = labelname+"_DenominatorPt";
04146           title     = labelname+"DenominatorPt;Calo Pt[GeV/c]";
04147           MonitorElement * DenominatorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04148           DenominatorPt->getTH1();
04149           
04150           histoname = labelname+"_DenominatorPtBarrel";
04151           title     = labelname+"DenominatorPtBarrel;Calo Pt[GeV/c]";
04152           MonitorElement * DenominatorPtBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04153           DenominatorPtBarrel->getTH1();
04154           
04155           histoname = labelname+"_DenominatorPtEndcap";
04156           title     = labelname+"DenominatorPtEndcap;Calo Pt[GeV/c]";
04157           MonitorElement * DenominatorPtEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04158           DenominatorPtEndcap->getTH1();
04159           
04160           histoname = labelname+"_DenominatorPtForward";
04161           title     = labelname+"DenominatorPtForward;Calo Pt[GeV/c] ";
04162           MonitorElement * DenominatorPtForward =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04163           DenominatorPtForward->getTH1();
04164           
04165           histoname = labelname+"_DenominatorEta";
04166           title     = labelname+"DenominatorEta;Calo #eta ";
04167           MonitorElement * DenominatorEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04168           DenominatorEta->getTH1();
04169           
04170           histoname = labelname+"_DenominatorPhi";
04171           title     = labelname+"DenominatorPhi;Calo #Phi";
04172           MonitorElement * DenominatorPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04173           DenominatorPhi->getTH1();
04174           
04175           histoname = labelname+"_DenominatorEtaPhi";
04176           title     = labelname+"DenominatorEtaPhi;Calo #eta; Calo #Phi";
04177           MonitorElement * DenominatorEtaPhi =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04178           DenominatorEtaPhi->getTH1();
04179           
04180           histoname = labelname+"_DenominatorEtaBarrel";
04181           title     = labelname+"DenominatorEtaBarrel;Calo #eta ";
04182           MonitorElement * DenominatorEtaBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04183           DenominatorEtaBarrel->getTH1();
04184           
04185           histoname = labelname+"_DenominatorPhiBarrel";
04186           title     = labelname+"DenominatorPhiBarrel;Calo #Phi";
04187           MonitorElement * DenominatorPhiBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04188           DenominatorPhiBarrel->getTH1();
04189           
04190           histoname = labelname+"_DenominatorEtaEndcap";
04191           title     = labelname+"DenominatorEtaEndcap;Calo #eta ";
04192           MonitorElement * DenominatorEtaEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04193           DenominatorEtaEndcap->getTH1();
04194           
04195           histoname = labelname+"_DenominatorPhiEndcap";
04196           title     = labelname+"DenominatorPhiEndcap;Calo #Phi";
04197           MonitorElement * DenominatorPhiEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04198           DenominatorPhiEndcap->getTH1();
04199           
04200           histoname = labelname+"_DenominatorEtaForward";
04201           title     = labelname+"DenominatorEtaForward;Calo #eta ";
04202           MonitorElement * DenominatorEtaForward =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04203           DenominatorEtaForward->getTH1();
04204           
04205           histoname = labelname+"_DenominatorPhiForward";
04206           title     = labelname+"DenominatorPhiForward;Calo #Phi";
04207           MonitorElement * DenominatorPhiForward =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04208           DenominatorPhiForward->getTH1();
04209           
04210           histoname = labelname+"_DenominatorEta_LowpTcut";
04211           title     = labelname+"DenominatorEta_LowpTcut;Calo #eta ";
04212           MonitorElement * DenominatorEta_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04213           DenominatorEta_LowpTcut->getTH1();
04214           
04215           histoname = labelname+"_DenominatorPhi_LowpTcut";
04216           title     = labelname+"DenominatorPhi_LowpTcut;Calo #Phi";
04217           MonitorElement * DenominatorPhi_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04218           DenominatorPhi_LowpTcut->getTH1();
04219           
04220           histoname = labelname+"_DenominatorEtaPhi_LowpTcut";
04221           title     = labelname+"DenominatorEtaPhi_LowpTcut;Calo #eta;Calo #Phi";
04222           MonitorElement * DenominatorEtaPhi_LowpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04223           DenominatorEtaPhi_LowpTcut->getTH1();
04224           
04225           histoname = labelname+"_DenominatorEta_MedpTcut";
04226           title     = labelname+"DenominatorEta_MedpTcut;Calo #eta ";
04227           MonitorElement * DenominatorEta_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04228           DenominatorEta_MedpTcut->getTH1();
04229           
04230           histoname = labelname+"_DenominatorPhi_MedpTcut";
04231           title     = labelname+"DenominatorPhi_MedpTcut;Calo #Phi";
04232           MonitorElement * DenominatorPhi_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04233           DenominatorPhi_MedpTcut->getTH1();
04234           
04235           histoname = labelname+"_DenominatorEtaPhi_MedpTcut";
04236           title     = labelname+"DenominatorEtaPhi_MedpTcut;Calo #eta;Calo #Phi";
04237           MonitorElement * DenominatorEtaPhi_MedpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04238           DenominatorEtaPhi_MedpTcut->getTH1();
04239           
04240           histoname = labelname+"_DenominatorEta_HighpTcut";
04241           title     = labelname+"DenominatorEta_HighpTcut;Calo #eta ";
04242           MonitorElement * DenominatorEta_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04243           DenominatorEta_HighpTcut->getTH1();
04244           
04245           histoname = labelname+"_DenominatorPhi_HighpTcut";
04246           title     = labelname+"DenominatorPhi_HighpTcut;Calo #Phi";
04247           MonitorElement * DenominatorPhi_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04248           DenominatorPhi_HighpTcut->getTH1();
04249           
04250           histoname = labelname+"_DenominatorEtaPhi_HighpTcut";
04251           title     = labelname+"DenominatorEtaPhi_HighpTcut;Calo #eta;Calo #Phi";
04252           MonitorElement * DenominatorEtaPhi_HighpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04253           DenominatorEtaPhi_HighpTcut->getTH1();
04254           
04255           histoname = labelname+"_DeltaR";
04256           title     = labelname+"DeltaR;";
04257           MonitorElement * DeltaR =  dbe->book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
04258           DeltaR->getTH1();
04259           
04260           histoname = labelname+"_DeltaPhi";
04261           title     = labelname+"DeltaPhi;";
04262           MonitorElement * DeltaPhi =  dbe->book1D(histoname.c_str(),title.c_str(),500,-5.0,5.0);
04263           DeltaPhi->getTH1();
04264           
04265           histoname = labelname+"_NumeratorPFMHT";
04266           title     = labelname+"NumeratorPFMHT;PFMHT[GeV/c]";
04267           MonitorElement * NumeratorPFMHT =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04268           NumeratorPFMHT->getTH1();
04269           
04270           histoname = labelname+"_NumeratorPFPt";
04271           title     = labelname+"NumeratorPFPt;PF Pt[GeV/c]";
04272           MonitorElement * NumeratorPFPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04273           NumeratorPFPt->getTH1();
04274           
04275           histoname = labelname+"_NumeratorPFPtBarrel";
04276           title     = labelname+"NumeratorPFPtBarrel;PF Pt[GeV/c] ";
04277           MonitorElement * NumeratorPFPtBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04278           NumeratorPFPtBarrel->getTH1();
04279           
04280           histoname = labelname+"_NumeratorPFPtEndcap";
04281           title     = labelname+"NumeratorPFPtEndcap;PF Pt[GeV/c]";
04282           MonitorElement * NumeratorPFPtEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04283           NumeratorPFPtEndcap->getTH1();
04284           
04285           histoname = labelname+"_NumeratorPFPtForward";
04286           title     = labelname+"NumeratorPFPtForward;PF Pt[GeV/c]";
04287           MonitorElement * NumeratorPFPtForward =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04288           NumeratorPFPtForward->getTH1();
04289           
04290           histoname = labelname+"_NumeratorPFEta";
04291           title     = labelname+"NumeratorPFEta;PF #eta ";
04292           MonitorElement * NumeratorPFEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04293           NumeratorPFEta->getTH1();
04294           
04295           histoname = labelname+"_NumeratorPFPhi";
04296           title     = labelname+"NumeratorPFPhi;Calo #Phi";
04297           MonitorElement * NumeratorPFPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04298           NumeratorPFPhi->getTH1();
04299           
04300           histoname = labelname+"_NumeratorPFEtaPhi";
04301           title     = labelname+"NumeratorPFEtaPhi;PF #eta;Calo #Phi";
04302           MonitorElement * NumeratorPFEtaPhi =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04303           NumeratorPFEtaPhi->getTH1();
04304           
04305           histoname = labelname+"_NumeratorPFEtaBarrel";
04306           title     = labelname+"NumeratorPFEtaBarrel;PF #eta ";
04307           MonitorElement * NumeratorPFEtaBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04308           NumeratorPFEtaBarrel->getTH1();
04309           
04310           histoname = labelname+"_NumeratorPFPhiBarrel";
04311           title     = labelname+"NumeratorPFPhiBarrel;PF #Phi";
04312           MonitorElement * NumeratorPFPhiBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04313           NumeratorPFPhiBarrel->getTH1();
04314           
04315           histoname = labelname+"_NumeratorPFEtaEndcap";
04316           title     = labelname+"NumeratorPFEtaEndcap;Calo #eta ";
04317           MonitorElement * NumeratorPFEtaEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04318           NumeratorPFEtaEndcap->getTH1();
04319           
04320           histoname = labelname+"_NumeratorPFPhiEndcap";
04321           title     = labelname+"NumeratorPFPhiEndcap;PF #Phi";
04322           MonitorElement * NumeratorPFPhiEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04323           NumeratorPFPhiEndcap->getTH1();
04324           
04325           histoname = labelname+"_NumeratorPFEtaForward";
04326           title     = labelname+"NumeratorPFEtaForward;Calo #eta ";
04327           MonitorElement * NumeratorPFEtaForward =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04328           NumeratorPFEtaForward->getTH1();
04329           
04330           histoname = labelname+"_NumeratorPFPhiForward";
04331           title     = labelname+"NumeratorPFPhiForward;PF #Phi";
04332           MonitorElement * NumeratorPFPhiForward =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04333           NumeratorPFPhiForward->getTH1();
04334           
04335           histoname = labelname+"_NumeratorPFEta_LowpTcut";
04336           title     = labelname+"NumeratorPFEta_LowpTcut;PF #eta ";
04337           MonitorElement * NumeratorPFEta_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04338           NumeratorPFEta_LowpTcut->getTH1();
04339           
04340           histoname = labelname+"_NumeratorPFPhi_LowpTcut";
04341           title     = labelname+"NumeratorPFPhi_LowpTcut;PF #Phi";
04342           MonitorElement * NumeratorPFPhi_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04343           NumeratorPFPhi_LowpTcut->getTH1();
04344           
04345           histoname = labelname+"_NumeratorPFEtaPhi_LowpTcut";
04346           title     = labelname+"NumeratorPFEtaPhi_LowpTcut;PF #eta;Calo #Phi";
04347           MonitorElement * NumeratorPFEtaPhi_LowpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04348           NumeratorPFEtaPhi_LowpTcut->getTH1();
04349           
04350           histoname = labelname+"_NumeratorPFEta_MedpTcut";
04351           title     = labelname+"NumeratorPFEta_MedpTcut;PF #eta ";
04352           MonitorElement * NumeratorPFEta_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04353           NumeratorPFEta_MedpTcut->getTH1();
04354           
04355           histoname = labelname+"_NumeratorPFPhi_MedpTcut";
04356           title     = labelname+"NumeratorPFPhi_MedpTcut;PF #Phi";
04357           MonitorElement * NumeratorPFPhi_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04358           NumeratorPFPhi_MedpTcut->getTH1();
04359           
04360           histoname = labelname+"_NumeratorPFEtaPhi_MedpTcut";
04361           title     = labelname+"NumeratorPFEtaPhi_MedpTcut;PF #eta;PF #Phi";
04362           MonitorElement * NumeratorPFEtaPhi_MedpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04363           NumeratorPFEtaPhi_MedpTcut->getTH1();
04364           
04365           histoname = labelname+"_NumeratorPFEta_HighpTcut";
04366           title     = labelname+"NumeratorPFEta_HighpTcut;Calo #eta ";
04367           MonitorElement * NumeratorPFEta_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04368           NumeratorPFEta_HighpTcut->getTH1();
04369           
04370           histoname = labelname+"_NumeratorPFPhi_HighpTcut";
04371           title     = labelname+"NumeratorPFPhi_HighpTcut;PF #Phi";
04372           MonitorElement * NumeratorPFPhi_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04373           NumeratorPFPhi_HighpTcut->getTH1();
04374           
04375           histoname = labelname+"_NumeratorPFEtaPhi_HighpTcut";
04376           title     = labelname+"NumeratorPFEtaPhi_HighpTcut;PF #eta;PF #Phi";
04377           MonitorElement * NumeratorPFEtaPhi_HighpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04378           NumeratorPFEtaPhi_HighpTcut->getTH1();
04379                   
04380           histoname = labelname+"_DenominatorPFMHT";
04381           title     = labelname+"DenominatorPFMHT;PF Pt[GeV/c]";
04382           MonitorElement * DenominatorPFMHT =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04383           DenominatorPFMHT->getTH1();
04384           
04385           histoname = labelname+"_DenominatorPFPt";
04386           title     = labelname+"DenominatorPFPt;PF Pt[GeV/c]";
04387           MonitorElement * DenominatorPFPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04388           DenominatorPFPt->getTH1();
04389           
04390           histoname = labelname+"_DenominatorPFPtBarrel";
04391           title     = labelname+"DenominatorPFPtBarrel;Calo Pt[GeV/c]";
04392           MonitorElement * DenominatorPFPtBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04393           DenominatorPFPtBarrel->getTH1();
04394           
04395           histoname = labelname+"_DenominatorPFPtEndcap";
04396           title     = labelname+"DenominatorPFPtEndcap;PF Pt[GeV/c]";
04397           MonitorElement * DenominatorPFPtEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04398           DenominatorPFPtEndcap->getTH1();
04399           
04400           histoname = labelname+"_DenominatorPFPtForward";
04401           title     = labelname+"DenominatorPFPtForward;PF Pt[GeV/c] ";
04402           MonitorElement * DenominatorPFPtForward =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04403           DenominatorPFPtForward->getTH1();
04404           
04405           histoname = labelname+"_DenominatorPFEta";
04406           title     = labelname+"DenominatorPFEta;PF #eta ";
04407           MonitorElement * DenominatorPFEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04408           DenominatorPFEta->getTH1();
04409           
04410           histoname = labelname+"_DenominatorPFPhi";
04411           title     = labelname+"DenominatorPFPhi;PF #Phi";
04412           MonitorElement * DenominatorPFPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04413           DenominatorPFPhi->getTH1();
04414           
04415           histoname = labelname+"_DenominatorPFEtaPhi";
04416           title     = labelname+"DenominatorPFEtaPhi;PF #eta; Calo #Phi";
04417           MonitorElement * DenominatorPFEtaPhi =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04418           DenominatorPFEtaPhi->getTH1();
04419           
04420           histoname = labelname+"_DenominatorPFEtaBarrel";
04421           title     = labelname+"DenominatorPFEtaBarrel;Calo #eta ";
04422           MonitorElement * DenominatorPFEtaBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04423           DenominatorPFEtaBarrel->getTH1();
04424           
04425           histoname = labelname+"_DenominatorPFPhiBarrel";
04426           title     = labelname+"DenominatorPFPhiBarrel;PF #Phi";
04427           MonitorElement * DenominatorPFPhiBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04428           DenominatorPFPhiBarrel->getTH1();
04429           
04430           histoname = labelname+"_DenominatorPFEtaEndcap";
04431           title     = labelname+"DenominatorPFEtaEndcap;PF #eta ";
04432           MonitorElement * DenominatorPFEtaEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04433           DenominatorPFEtaEndcap->getTH1();
04434           
04435           histoname = labelname+"_DenominatorPFPhiEndcap";
04436           title     = labelname+"DenominatorPFPhiEndcap;Calo #Phi";
04437           MonitorElement * DenominatorPFPhiEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04438           DenominatorPFPhiEndcap->getTH1();
04439           
04440           histoname = labelname+"_DenominatorPFEtaForward";
04441           title     = labelname+"DenominatorPFEtaForward;PF #eta ";
04442           MonitorElement * DenominatorPFEtaForward =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04443           DenominatorPFEtaForward->getTH1();
04444           
04445           histoname = labelname+"_DenominatorPFPhiForward";
04446           title     = labelname+"DenominatorPFPhiForward;PF #Phi";
04447           MonitorElement * DenominatorPFPhiForward =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04448           DenominatorPFPhiForward->getTH1();
04449           
04450           histoname = labelname+"_DenominatorPFEta_LowpTcut";
04451           title     = labelname+"DenominatorPFEta_LowpTcut;PF #eta ";
04452           MonitorElement * DenominatorPFEta_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04453           DenominatorPFEta_LowpTcut->getTH1();
04454           
04455           histoname = labelname+"_DenominatorPFPhi_LowpTcut";
04456           title     = labelname+"DenominatorPFPhi_LowpTcut;PF #Phi";
04457           MonitorElement * DenominatorPFPhi_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04458           DenominatorPFPhi_LowpTcut->getTH1();
04459           
04460           histoname = labelname+"_DenominatorPFEtaPhi_LowpTcut";
04461           title     = labelname+"DenominatorPFEtaPhi_LowpTcut;PF #eta;Calo #Phi";
04462           MonitorElement * DenominatorPFEtaPhi_LowpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04463           DenominatorPFEtaPhi_LowpTcut->getTH1();
04464           
04465           histoname = labelname+"_DenominatorPFEta_MedpTcut";
04466           title     = labelname+"DenominatorPFEta_MedpTcut;PF #eta ";
04467           MonitorElement * DenominatorPFEta_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04468           DenominatorPFEta_MedpTcut->getTH1();
04469           
04470           histoname = labelname+"_DenominatorPFPhi_MedpTcut";
04471           title     = labelname+"DenominatorPFPhi_MedpTcut;PF #Phi";
04472           MonitorElement * DenominatorPFPhi_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04473           DenominatorPFPhi_MedpTcut->getTH1();
04474           
04475           histoname = labelname+"_DenominatorPFEtaPhi_MedpTcut";
04476           title     = labelname+"DenominatorPFEtaPhi_MedpTcut;PF #eta;Calo #Phi";
04477           MonitorElement * DenominatorPFEtaPhi_MedpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04478           DenominatorPFEtaPhi_MedpTcut->getTH1();
04479           
04480           histoname = labelname+"_DenominatorPFEta_HighpTcut";
04481           title     = labelname+"DenominatorPFEta_HighpTcut;PF #eta ";
04482           MonitorElement * DenominatorPFEta_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04483           DenominatorPFEta_HighpTcut->getTH1();
04484           
04485           histoname = labelname+"_DenominatorPFPhi_HighpTcut";
04486           title     = labelname+"DenominatorPFPhi_HighpTcut;PF #Phi";
04487           MonitorElement * DenominatorPFPhi_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04488           DenominatorPFPhi_HighpTcut->getTH1();
04489           
04490           histoname = labelname+"_DenominatorPFEtaPhi_HighpTcut";
04491           title     = labelname+"DenominatorPFEtaPhi_HighpTcut;PF #eta;Calo #Phi";
04492           MonitorElement * DenominatorPFEtaPhi_HighpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04493           DenominatorPFEtaPhi_HighpTcut->getTH1();
04494           
04495           histoname = labelname+"_PFDeltaR";
04496           title     = labelname+"PFDeltaR;";
04497           MonitorElement * PFDeltaR =  dbe->book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
04498           PFDeltaR->getTH1();
04499           
04500           histoname = labelname+"_PFDeltaPhi";
04501           title     = labelname+"PFDeltaPhi;";
04502           MonitorElement * PFDeltaPhi =  dbe->book1D(histoname.c_str(),title.c_str(),500,-5.0,5.0);
04503           PFDeltaPhi->getTH1();
04504           
04505           v->setEffHistos(NumeratorPt,
04506                           NumeratorPtBarrel,
04507                           NumeratorPtEndcap,
04508                           NumeratorPtForward,
04509                           NumeratorEta,
04510                           NumeratorPhi,
04511                           NumeratorEtaPhi,
04512                           //
04513                           NumeratorEtaBarrel,
04514                           NumeratorPhiBarrel,
04515                           NumeratorEtaEndcap,
04516                           NumeratorPhiEndcap,
04517                           NumeratorEtaForward,
04518                           NumeratorPhiForward,
04519                           NumeratorEta_LowpTcut,
04520                           NumeratorPhi_LowpTcut,
04521                           NumeratorEtaPhi_LowpTcut,
04522                           NumeratorEta_MedpTcut,
04523                           NumeratorPhi_MedpTcut,
04524                           NumeratorEtaPhi_MedpTcut,
04525                           NumeratorEta_HighpTcut,
04526                           NumeratorPhi_HighpTcut,
04527                           NumeratorEtaPhi_HighpTcut,      
04528                           //
04529                           DenominatorPt,
04530                           DenominatorPtBarrel,
04531                           DenominatorPtEndcap,
04532                           DenominatorPtForward,
04533                           DenominatorEta,
04534                           DenominatorPhi,
04535                           DenominatorEtaPhi,
04536                           //
04537                           DenominatorEtaBarrel,
04538                           DenominatorPhiBarrel,
04539                           DenominatorEtaEndcap,
04540                           DenominatorPhiEndcap,
04541                           DenominatorEtaForward,
04542                           DenominatorPhiForward,
04543                           DenominatorEta_LowpTcut,
04544                           DenominatorPhi_LowpTcut,
04545                           DenominatorEtaPhi_LowpTcut,
04546                           DenominatorEta_MedpTcut,
04547                           DenominatorPhi_MedpTcut,
04548                           DenominatorEtaPhi_MedpTcut,
04549                           DenominatorEta_HighpTcut,
04550                           DenominatorPhi_HighpTcut,
04551                           DenominatorEtaPhi_HighpTcut,
04552                           DeltaR,
04553                           DeltaPhi,
04554                           //
04555                           NumeratorPFPt,
04556                           NumeratorPFMHT,
04557                           NumeratorPFPtBarrel,
04558                           NumeratorPFPtEndcap,
04559                           NumeratorPFPtForward,
04560                           NumeratorPFEta,
04561                           NumeratorPFPhi,
04562                           NumeratorPFEtaPhi,
04563                           NumeratorPFEtaBarrel,
04564                           NumeratorPFPhiBarrel,
04565                           NumeratorPFEtaEndcap,
04566                           NumeratorPFPhiEndcap,
04567                           NumeratorPFEtaForward,
04568                           NumeratorPFPhiForward,
04569                           NumeratorPFEta_LowpTcut,
04570                           NumeratorPFPhi_LowpTcut,
04571                           NumeratorPFEtaPhi_LowpTcut,
04572                           NumeratorPFEta_MedpTcut,
04573                           NumeratorPFPhi_MedpTcut,
04574                           NumeratorPFEtaPhi_MedpTcut,
04575                           NumeratorPFEta_HighpTcut,
04576                           NumeratorPFPhi_HighpTcut,
04577                           NumeratorPFEtaPhi_HighpTcut,      
04578                           DenominatorPFPt,
04579                           DenominatorPFMHT,
04580                           DenominatorPFPtBarrel,
04581                           DenominatorPFPtEndcap,
04582                           DenominatorPFPtForward,
04583                           DenominatorPFEta,
04584                           DenominatorPFPhi,
04585                           DenominatorPFEtaPhi,
04586                           DenominatorPFEtaBarrel,
04587                           DenominatorPFPhiBarrel,
04588                           DenominatorPFEtaEndcap,
04589                           DenominatorPFPhiEndcap,
04590                           DenominatorPFEtaForward,
04591                           DenominatorPFPhiForward,
04592                           DenominatorPFEta_LowpTcut,
04593                           DenominatorPFPhi_LowpTcut,
04594                           DenominatorPFEtaPhi_LowpTcut,
04595                           DenominatorPFEta_MedpTcut,
04596                           DenominatorPFPhi_MedpTcut,
04597                           DenominatorPFEtaPhi_MedpTcut,
04598                           DenominatorPFEta_HighpTcut,
04599                           DenominatorPFPhi_HighpTcut,
04600                           DenominatorPFEtaPhi_HighpTcut,
04601                           PFDeltaR,
04602                           PFDeltaPhi
04603                           );
04604           
04605         }// Loop over Jet Trigger
04606         
04607         if((v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("DiJet_Trigger") == 0)){
04608           
04609           histoname = labelname+"_NumeratorAvrgPt";
04610           title     = labelname+"NumeratorAvrgPt;Calo Pt[GeV/c]";
04611           MonitorElement * NumeratorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04612           NumeratorPt->getTH1();
04613           
04614           histoname = labelname+"_NumeratorAvrgEta";
04615           title     = labelname+"NumeratorAvrgEta;Calo #eta";
04616           MonitorElement * NumeratorEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04617           NumeratorEta->getTH1();
04618           
04619           histoname = labelname+"_DenominatorAvrgPt";
04620           title     = labelname+"DenominatorAvrgPt;Calo Pt[GeV/c] ";
04621           MonitorElement * DenominatorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04622           DenominatorPt->getTH1();
04623           
04624           histoname = labelname+"_DenominatorAvrgEta";
04625           title     = labelname+"DenominatorAvrgEta;Calo #eta";
04626           MonitorElement * DenominatorEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04627           DenominatorEta->getTH1();
04628           
04629           histoname = labelname+"_DeltaR";
04630           title     = labelname+"DeltaR;";
04631           MonitorElement * DeltaR =  dbe->book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
04632           DeltaR->getTH1();
04633           
04634           histoname = labelname+"_DeltaPhi";
04635           title     = labelname+"DeltaPhi;";
04636           MonitorElement * DeltaPhi =  dbe->book1D(histoname.c_str(),title.c_str(),500,-5.,5.);
04637           DeltaPhi->getTH1();
04638           
04639           //add PF histo: SJ
04640           histoname = labelname+"_NumeratorAvrgPFPt";
04641           title     = labelname+"NumeratorAvrgPFPt;PF Pt[GeV/c]";
04642           MonitorElement * NumeratorPFPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04643           NumeratorPFPt->getTH1();
04644           
04645           histoname = labelname+"_NumeratorAvrgPFEta";
04646           title     = labelname+"NumeratorAvrgPFEta;PF #eta";
04647           MonitorElement * NumeratorPFEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04648           NumeratorPFEta->getTH1();
04649           
04650           histoname = labelname+"_DenominatorAvrgPFPt";
04651           title     = labelname+"DenominatorAvrgPFPt;PF Pt[GeV/c] ";
04652           MonitorElement * DenominatorPFPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04653           DenominatorPFPt->getTH1();
04654           
04655           histoname = labelname+"_DenominatorAvrgPFEta";
04656           title     = labelname+"DenominatorAvrgPFEta;PF #eta";
04657           MonitorElement * DenominatorPFEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04658           DenominatorPFEta->getTH1();
04659           
04660           histoname = labelname+"_PFDeltaR";
04661           title     = labelname+"PFDeltaR;";
04662           MonitorElement * PFDeltaR =  dbe->book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
04663           PFDeltaR->getTH1();
04664           
04665           histoname = labelname+"_PFDeltaPhi";
04666           title     = labelname+"PFDeltaPhi;";
04667           MonitorElement * PFDeltaPhi =  dbe->book1D(histoname.c_str(),title.c_str(),500,-5.,5.);
04668           PFDeltaPhi->getTH1();
04669           
04670           v->setEffHistos(  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
04671                             dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
04672                             dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, 
04673                             dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
04674                             dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
04675                             dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
04676                             dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
04677                             dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, 
04678                             dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
04679                             dummy, dummy, dummy, dummy 
04680                             );
04681         }
04682         
04683         if(v->getObjectType() == trigger::TriggerMET || (v->getObjectType() == trigger::TriggerTET)){
04684           
04685           histoname = labelname+"_NumeratorPt";
04686           if(v->getPath().find("HLT_PFMET")==std::string::npos)
04687             title     = labelname+"NumeratorPt; CaloMET[GeV/c]";
04688           else
04689             title     = labelname+"NumeratorPt; PFMET[GeV/c]"; 
04690           MonitorElement * NumeratorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04691           NumeratorPt->getTH1();
04692           
04693           histoname = labelname+"_NumeratorPhi";
04694           title     = labelname+"NumeratorPhi; #Phi";
04695           MonitorElement * NumeratorPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04696           NumeratorPhi->getTH1();
04697           
04698           histoname = labelname+"_DenominatorPt";
04699           if(v->getPath().find("HLT_PFMET")==std::string::npos)
04700             title     = labelname+"DenominatorPt; CaloMET[GeV/c]";
04701           else
04702             title     = labelname+"DenominatorPt; PFMET[GeV/c]"; 
04703           MonitorElement * DenominatorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04704           DenominatorPt->getTH1();
04705           
04706           histoname = labelname+"_DenominatorPhi";
04707           title     = labelname+"DenominatorPhi; #Phi";
04708           MonitorElement * DenominatorPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04709           DenominatorPhi->getTH1();
04710           
04711           v->setEffHistos(  NumeratorPt, dummy, dummy, dummy, dummy, NumeratorPhi, dummy, dummy, dummy, dummy,
04712                             dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
04713                             dummy, dummy, DenominatorPt, dummy, dummy, dummy, dummy, DenominatorPhi, dummy, dummy, 
04714                             dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
04715                             dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
04716                             dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
04717                             dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
04718                             dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, 
04719                             dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
04720                             dummy, dummy, dummy, dummy
04721                             );
04722         }// Loop over MET trigger
04723       }
04724       
04725       //------Efficiency wrt Muon trigger-----------------------
04726       if(plotEffwrtMu_){
04727         std::string dirName2 = dirname_ + "/EffWrtMuonTrigger/";
04728         for(PathInfoCollection::iterator v = hltPathsEffWrtMu_.begin(); v!= hltPathsEffWrtMu_.end(); ++v ){
04729           //
04730           std::string trgPathName    = HLTConfigProvider::removeVersion(v->getPath());
04731           //
04732           std::string labelname("ME") ;
04733           std::string subdirName = dirName2 + trgPathName;
04734           std::string histoname(labelname+"");
04735           std::string title(labelname+"");
04736           dbe->setCurrentFolder(subdirName);
04737 
04738           MonitorElement *dummy;
04739           dummy =  dbe->bookFloat("dummy");   
04740           
04741           if((v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("SingleJet_Trigger") == 0)){ 
04742             
04743             histoname = labelname+"_NumeratorPt";
04744             title     = labelname+"NumeratorPt;Pt[GeV/c]";
04745             MonitorElement * NumeratorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04746             NumeratorPt->getTH1();
04747             
04748             histoname = labelname+"_NumeratorPtBarrel";
04749             title     = labelname+"NumeratorPtBarrel;Calo Pt[GeV/c]";
04750             MonitorElement * NumeratorPtBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04751             NumeratorPtBarrel->getTH1();
04752             
04753             histoname = labelname+"_NumeratorPtEndcap";
04754             title     = labelname+"NumeratorPtEndcap;Calo Pt[GeV/c]";
04755             MonitorElement * NumeratorPtEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04756             NumeratorPtEndcap->getTH1();
04757             
04758             histoname = labelname+"_NumeratorPtForward";
04759             title     = labelname+"NumeratorPtForward;Calo Pt[GeV/c]";
04760             MonitorElement * NumeratorPtForward =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04761             NumeratorPtForward->getTH1();
04762             
04763             histoname = labelname+"_NumeratorEta";
04764             title     = labelname+"NumeratorEta;Calo #eta ";
04765             MonitorElement * NumeratorEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04766             NumeratorEta->getTH1();
04767             
04768             histoname = labelname+"_NumeratorPhi";
04769             title     = labelname+"NumeratorPhi;Calo #Phi";
04770             MonitorElement * NumeratorPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04771             NumeratorPhi->getTH1();
04772             
04773             histoname = labelname+"_NumeratorEtaPhi";
04774             title     = labelname+"NumeratorEtaPhi;Calo #eta;Calo #Phi";
04775             MonitorElement * NumeratorEtaPhi =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04776             NumeratorEtaPhi->getTH1();
04777             
04778             histoname = labelname+"_NumeratorEtaBarrel";
04779             title     = labelname+"NumeratorEtaBarrel;Calo #eta ";
04780             MonitorElement * NumeratorEtaBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04781             NumeratorEtaBarrel->getTH1();
04782             
04783             histoname = labelname+"_NumeratorPhiBarrel";
04784             title     = labelname+"NumeratorPhiBarrel;Calo #Phi";
04785             MonitorElement * NumeratorPhiBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04786             NumeratorPhiBarrel->getTH1();
04787             
04788             histoname = labelname+"_NumeratorEtaEndcap";
04789             title     = labelname+"NumeratorEtaEndcap;Calo #eta ";
04790             MonitorElement * NumeratorEtaEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04791             NumeratorEtaEndcap->getTH1();
04792             
04793             histoname = labelname+"_NumeratorPhiEndcap";
04794             title     = labelname+"NumeratorPhiEndcap;Calo #Phi";
04795             MonitorElement * NumeratorPhiEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04796             NumeratorPhiEndcap->getTH1();
04797             
04798             histoname = labelname+"_NumeratorEtaForward";
04799             title     = labelname+"NumeratorEtaForward;Calo #eta ";
04800             MonitorElement * NumeratorEtaForward =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04801             NumeratorEtaForward->getTH1();
04802             
04803             histoname = labelname+"_NumeratorPhiForward";
04804             title     = labelname+"NumeratorPhiForward;Calo #Phi";
04805             MonitorElement * NumeratorPhiForward =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04806             NumeratorPhiForward->getTH1();
04807             
04808             histoname = labelname+"_NumeratorEta_LowpTcut";
04809             title     = labelname+"NumeratorEta_LowpTcut;Calo #eta ";
04810             MonitorElement * NumeratorEta_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04811             NumeratorEta_LowpTcut->getTH1();
04812             
04813             histoname = labelname+"_NumeratorPhi_LowpTcut";
04814             title     = labelname+"NumeratorPhi_LowpTcut;Calo #Phi";
04815             MonitorElement * NumeratorPhi_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04816             NumeratorPhi_LowpTcut->getTH1();
04817             
04818             histoname = labelname+"_NumeratorEtaPhi_LowpTcut";
04819             title     = labelname+"NumeratorEtaPhi_LowpTcut;Calo #eta;Calo #Phi";
04820             MonitorElement * NumeratorEtaPhi_LowpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04821             NumeratorEtaPhi_LowpTcut->getTH1();
04822             
04823             histoname = labelname+"_NumeratorEta_MedpTcut";
04824             title     = labelname+"NumeratorEta_MedpTcut;Calo #eta ";
04825             MonitorElement * NumeratorEta_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04826             NumeratorEta_MedpTcut->getTH1();
04827             
04828             histoname = labelname+"_NumeratorPhi_MedpTcut";
04829             title     = labelname+"NumeratorPhi_MedpTcut;Calo #Phi";
04830             MonitorElement * NumeratorPhi_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04831             NumeratorPhi_MedpTcut->getTH1();
04832             
04833             histoname = labelname+"_NumeratorEtaPhi_MedpTcut";
04834             title     = labelname+"NumeratorEtaPhi_MedpTcut;Calo #eta;Calo #Phi";
04835             MonitorElement * NumeratorEtaPhi_MedpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04836             NumeratorEtaPhi_MedpTcut->getTH1();
04837             
04838             histoname = labelname+"_NumeratorEta_HighpTcut";
04839             title     = labelname+"NumeratorEta_HighpTcut;Calo #eta ";
04840             MonitorElement * NumeratorEta_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04841             NumeratorEta_HighpTcut->getTH1();
04842             
04843             histoname = labelname+"_NumeratorPhi_HighpTcut";
04844             title     = labelname+"NumeratorPhi_HighpTcut;Calo #Phi";
04845             MonitorElement * NumeratorPhi_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04846             NumeratorPhi_HighpTcut->getTH1();
04847             
04848             histoname = labelname+"_NumeratorEtaPhi_HighpTcut";
04849             title     = labelname+"NumeratorEtaPhi_HighpTcut;Calo #eta;Calo #Phi";
04850             MonitorElement * NumeratorEtaPhi_HighpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04851             NumeratorEtaPhi_HighpTcut->getTH1();
04852             
04853             histoname = labelname+"_DenominatorPt";
04854             title     = labelname+"DenominatorPt;Calo Pt[GeV/c]";
04855             MonitorElement * DenominatorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04856             DenominatorPt->getTH1();
04857             
04858             histoname = labelname+"_DenominatorPtBarrel";
04859             title     = labelname+"DenominatorPtBarrel;Calo Pt[GeV/c]";
04860             MonitorElement * DenominatorPtBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04861             DenominatorPtBarrel->getTH1();
04862             
04863             histoname = labelname+"_DenominatorPtEndcap";
04864             title     = labelname+"DenominatorPtEndcap;Calo Pt[GeV/c]";
04865             MonitorElement * DenominatorPtEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04866             DenominatorPtEndcap->getTH1();
04867             
04868             histoname = labelname+"_DenominatorPtForward";
04869             title     = labelname+"DenominatorPtForward;Calo Pt[GeV/c] ";
04870             MonitorElement * DenominatorPtForward =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04871             DenominatorPtForward->getTH1();
04872             
04873             histoname = labelname+"_DenominatorEta";
04874             title     = labelname+"DenominatorEta;Calo #eta";
04875             MonitorElement * DenominatorEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04876             DenominatorEta->getTH1();
04877             
04878             histoname = labelname+"_DenominatorPhi";
04879             title     = labelname+"DenominatorPhi;Calo #Phi";
04880             MonitorElement * DenominatorPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04881             DenominatorPhi->getTH1();
04882             
04883             histoname = labelname+"_DenominatorEtaPhi";
04884             title     = labelname+"DenominatorEtaPhi;Calo #eta (IC5);Calo #Phi ";
04885             MonitorElement * DenominatorEtaPhi =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04886             DenominatorEtaPhi->getTH1();
04887             
04888             histoname = labelname+"_DenominatorEtaBarrel";
04889             title     = labelname+"DenominatorEtaBarrel;Calo #eta ";
04890             MonitorElement * DenominatorEtaBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04891             DenominatorEtaBarrel->getTH1();
04892             
04893             histoname = labelname+"_DenominatorPhiBarrel";
04894             title     = labelname+"DenominatorPhiBarrel;Calo #Phi";
04895             MonitorElement * DenominatorPhiBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04896             DenominatorPhiBarrel->getTH1();
04897             
04898             histoname = labelname+"_DenominatorEtaEndcap";
04899             title     = labelname+"DenominatorEtaEndcap;Calo #eta ";
04900             MonitorElement * DenominatorEtaEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04901             DenominatorEtaEndcap->getTH1();
04902             
04903             histoname = labelname+"_DenominatorPhiEndcap";
04904             title     = labelname+"DenominatorPhiEndcap;Calo #Phi";
04905             MonitorElement * DenominatorPhiEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04906             DenominatorPhiEndcap->getTH1();
04907             
04908             histoname = labelname+"_DenominatorEtaForward";
04909             title     = labelname+"DenominatorEtaForward;Calo #eta ";
04910             MonitorElement * DenominatorEtaForward =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04911             DenominatorEtaForward->getTH1();
04912             
04913             histoname = labelname+"_DenominatorPhiForward";
04914             title     = labelname+"DenominatorPhiForward;Calo #Phi";
04915             MonitorElement * DenominatorPhiForward =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04916             DenominatorPhiForward->getTH1();
04917             
04918             histoname = labelname+"_DenominatorEta_LowpTcut";
04919             title     = labelname+"DenominatorEta_LowpTcut;Calo #eta ";
04920             MonitorElement * DenominatorEta_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04921             DenominatorEta_LowpTcut->getTH1();
04922           
04923             histoname = labelname+"_DenominatorPhi_LowpTcut";
04924             title     = labelname+"DenominatorPhi_LowpTcut;Calo #Phi";
04925             MonitorElement * DenominatorPhi_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04926             DenominatorPhi_LowpTcut->getTH1();
04927             
04928             histoname = labelname+"_DenominatorEtaPhi_LowpTcut";
04929             title     = labelname+"DenominatorEtaPhi_LowpTcut;Calo #eta;Calo #Phi";
04930             MonitorElement * DenominatorEtaPhi_LowpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04931             DenominatorEtaPhi_LowpTcut->getTH1();
04932             
04933             histoname = labelname+"_DenominatorEta_MedpTcut";
04934             title     = labelname+"DenominatorEta_MedpTcut;Calo #eta ";
04935             MonitorElement * DenominatorEta_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04936             DenominatorEta_MedpTcut->getTH1();
04937             
04938             histoname = labelname+"_DenominatorPhi_MedpTcut";
04939             title     = labelname+"DenominatorPhi_MedpTcut;Calo #Phi";
04940             MonitorElement * DenominatorPhi_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04941             DenominatorPhi_MedpTcut->getTH1();
04942             
04943             histoname = labelname+"_DenominatorEtaPhi_MedpTcut";
04944             title     = labelname+"DenominatorEtaPhi_MedpTcut;Calo #eta;Calo #Phi";
04945             MonitorElement * DenominatorEtaPhi_MedpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04946             DenominatorEtaPhi_MedpTcut->getTH1();
04947             
04948             histoname = labelname+"_DenominatorEta_HighpTcut";
04949             title     = labelname+"DenominatorEta_HighpTcut;Calo #eta ";
04950             MonitorElement * DenominatorEta_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
04951             DenominatorEta_HighpTcut->getTH1();
04952             
04953             histoname = labelname+"_DenominatorPhi_HighpTcut";
04954             title     = labelname+"DenominatorPhi_HighpTcut;Calo #Phi";
04955             MonitorElement * DenominatorPhi_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
04956             DenominatorPhi_HighpTcut->getTH1();
04957             
04958             histoname = labelname+"_DenominatorEtaPhi_HighpTcut";
04959             title     = labelname+"DenominatorEtaPhi_HighpTcut;Calo #eta;Calo #Phi";
04960             MonitorElement * DenominatorEtaPhi_HighpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
04961             DenominatorEtaPhi_HighpTcut->getTH1();
04962             
04963             histoname = labelname+"_DeltaR";
04964             title     = labelname+"DeltaR;";
04965             MonitorElement * DeltaR =  dbe->book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
04966             DeltaR->getTH1();
04967             
04968             histoname = labelname+"_DeltaPhi";
04969             title     = labelname+"DeltaPhi;";
04970             MonitorElement * DeltaPhi =  dbe->book1D(histoname.c_str(),title.c_str(),500,-5.0,5.0);
04971             DeltaPhi->getTH1();
04972             
04973             histoname = labelname+"_NumeratorPFPt";
04974             title     = labelname+"NumeratorPFPt;PFPt[GeV/c]";
04975             MonitorElement * NumeratorPFPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04976             NumeratorPFPt->getTH1();
04977             
04978             histoname = labelname+"_NumeratorPFMHT";
04979             title     = labelname+"NumeratorPFMHT;PFMHT[GeV/c]";
04980             MonitorElement * NumeratorPFMHT =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04981             NumeratorPFMHT->getTH1();
04982             
04983             histoname = labelname+"_NumeratorPFPtBarrel";
04984             title     = labelname+"NumeratorPFPtBarrel;PF Pt[GeV/c]";
04985             MonitorElement * NumeratorPFPtBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04986             NumeratorPFPtBarrel->getTH1();
04987             
04988             histoname = labelname+"_NumeratorPFPtEndcap";
04989             title     = labelname+"NumeratorPFPtEndcap;PF Pt[GeV/c]";
04990             MonitorElement * NumeratorPFPtEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04991             NumeratorPFPtEndcap->getTH1();
04992             
04993             histoname = labelname+"_NumeratorPFPtForward";
04994             title     = labelname+"NumeratorPFPtForward;PF Pt[GeV/c]";
04995             MonitorElement * NumeratorPFPtForward =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
04996             NumeratorPFPtForward->getTH1();
04997             
04998             histoname = labelname+"_NumeratorPFEta";
04999             title     = labelname+"NumeratorPFEta;PF #eta ";
05000             MonitorElement * NumeratorPFEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05001             NumeratorPFEta->getTH1();
05002             
05003             histoname = labelname+"_NumeratorPFPhi";
05004             title     = labelname+"NumeratorPFPhi;PF #Phi";
05005             MonitorElement * NumeratorPFPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05006             NumeratorPFPhi->getTH1();
05007             
05008             histoname = labelname+"_NumeratorPFEtaPhi";
05009             title     = labelname+"NumeratorPFEtaPhi;PF #eta;PF #Phi";
05010             MonitorElement * NumeratorPFEtaPhi =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05011             NumeratorPFEtaPhi->getTH1();
05012             
05013             histoname = labelname+"_NumeratorPFEtaBarrel";
05014             title     = labelname+"NumeratorPFEtaBarrel;PF #eta ";
05015             MonitorElement * NumeratorPFEtaBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05016             NumeratorPFEtaBarrel->getTH1();
05017             
05018             histoname = labelname+"_NumeratorPFPhiBarrel";
05019             title     = labelname+"NumeratorPFPhiBarrel;PF #Phi";
05020             MonitorElement * NumeratorPFPhiBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05021             NumeratorPFPhiBarrel->getTH1();
05022             
05023             histoname = labelname+"_NumeratorPFEtaEndcap";
05024             title     = labelname+"NumeratorPFEtaEndcap;PF #eta ";
05025             MonitorElement * NumeratorPFEtaEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05026             NumeratorPFEtaEndcap->getTH1();
05027             
05028             histoname = labelname+"_NumeratorPFPhiEndcap";
05029             title     = labelname+"NumeratorPFPhiEndcap;PF #Phi";
05030             MonitorElement * NumeratorPFPhiEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05031             NumeratorPFPhiEndcap->getTH1();
05032             
05033             histoname = labelname+"_NumeratorPFEtaForward";
05034             title     = labelname+"NumeratorPFEtaForward;PF #eta ";
05035             MonitorElement * NumeratorPFEtaForward =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05036             NumeratorPFEtaForward->getTH1();
05037             
05038             histoname = labelname+"_NumeratorPFPhiForward";
05039             title     = labelname+"NumeratorPFPhiForward;PF #Phi";
05040             MonitorElement * NumeratorPFPhiForward =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05041             NumeratorPFPhiForward->getTH1();
05042             
05043             histoname = labelname+"_NumeratorPFEta_LowpTcut";
05044             title     = labelname+"NumeratorPFEta_LowpTcut;PF #eta ";
05045             MonitorElement * NumeratorPFEta_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05046             NumeratorPFEta_LowpTcut->getTH1();
05047             
05048             histoname = labelname+"_NumeratorPFPhi_LowpTcut";
05049             title     = labelname+"NumeratorPFPhi_LowpTcut;PF #Phi";
05050             MonitorElement * NumeratorPFPhi_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05051             NumeratorPFPhi_LowpTcut->getTH1();
05052             
05053             histoname = labelname+"_NumeratorPFEtaPhi_LowpTcut";
05054             title     = labelname+"NumeratorPFEtaPhi_LowpTcut;PF #eta;PF #Phi";
05055             MonitorElement * NumeratorPFEtaPhi_LowpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05056             NumeratorPFEtaPhi_LowpTcut->getTH1();
05057             
05058             histoname = labelname+"_NumeratorPFEta_MedpTcut";
05059             title     = labelname+"NumeratorPFEta_MedpTcut;PF #eta ";
05060             MonitorElement * NumeratorPFEta_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05061             NumeratorPFEta_MedpTcut->getTH1();
05062             
05063             histoname = labelname+"_NumeratorPFPhi_MedpTcut";
05064             title     = labelname+"NumeratorPFPhi_MedpTcut;PF #Phi";
05065             MonitorElement * NumeratorPFPhi_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05066             NumeratorPFPhi_MedpTcut->getTH1();
05067             
05068             histoname = labelname+"_NumeratorPFEtaPhi_MedpTcut";
05069             title     = labelname+"NumeratorPFEtaPhi_MedpTcut;PF #eta;PF #Phi";
05070             MonitorElement * NumeratorPFEtaPhi_MedpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05071             NumeratorPFEtaPhi_MedpTcut->getTH1();
05072             
05073             histoname = labelname+"_NumeratorPFEta_HighpTcut";
05074             title     = labelname+"NumeratorPFEta_HighpTcut;PF #eta ";
05075             MonitorElement * NumeratorPFEta_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05076             NumeratorPFEta_HighpTcut->getTH1();
05077             
05078             histoname = labelname+"_NumeratorPFPhi_HighpTcut";
05079             title     = labelname+"NumeratorPFPhi_HighpTcut;PF #Phi";
05080             MonitorElement * NumeratorPFPhi_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05081             NumeratorPFPhi_HighpTcut->getTH1();
05082             
05083             histoname = labelname+"_NumeratorPFEtaPhi_HighpTcut";
05084             title     = labelname+"NumeratorPFEtaPhi_HighpTcut;PF #eta;PF #Phi";
05085             MonitorElement * NumeratorPFEtaPhi_HighpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05086             NumeratorPFEtaPhi_HighpTcut->getTH1();
05087             
05088             histoname = labelname+"_DenominatorPFMHT";
05089             title     = labelname+"DenominatorPFMHT;PF Pt[GeV/c]";
05090             MonitorElement * DenominatorPFMHT =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05091             DenominatorPFMHT->getTH1();
05092             
05093             histoname = labelname+"_DenominatorPFPt";
05094             title     = labelname+"DenominatorPFPt;PF Pt[GeV/c]";
05095             MonitorElement * DenominatorPFPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05096             DenominatorPFPt->getTH1();
05097             
05098             histoname = labelname+"_DenominatorPFPtBarrel";
05099             title     = labelname+"DenominatorPFPtBarrel;PF Pt[GeV/c]";
05100             MonitorElement * DenominatorPFPtBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05101             DenominatorPFPtBarrel->getTH1();
05102             
05103             histoname = labelname+"_DenominatorPFPtEndcap";
05104             title     = labelname+"DenominatorPFPtEndcap;PF Pt[GeV/c]";
05105             MonitorElement * DenominatorPFPtEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05106             DenominatorPFPtEndcap->getTH1();
05107             
05108             histoname = labelname+"_DenominatorPFPtForward";
05109             title     = labelname+"DenominatorPFPtForward;PF Pt[GeV/c] ";
05110             MonitorElement * DenominatorPFPtForward =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05111             DenominatorPFPtForward->getTH1();
05112             
05113             histoname = labelname+"_DenominatorPFEta";
05114             title     = labelname+"DenominatorPFEta;PF #eta";
05115             MonitorElement * DenominatorPFEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05116             DenominatorPFEta->getTH1();
05117             
05118             histoname = labelname+"_DenominatorPFPhi";
05119             title     = labelname+"DenominatorPFPhi;PF #Phi";
05120             MonitorElement * DenominatorPFPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05121             DenominatorPFPhi->getTH1();
05122             
05123             histoname = labelname+"_DenominatorPFEtaPhi";
05124             title     = labelname+"DenominatorPFEtaPhi;PF #eta (IC5);PF #Phi ";
05125             MonitorElement * DenominatorPFEtaPhi =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05126             DenominatorPFEtaPhi->getTH1();
05127             
05128             histoname = labelname+"_DenominatorPFEtaBarrel";
05129             title     = labelname+"DenominatorPFEtaBarrel;PF #eta ";
05130             MonitorElement * DenominatorPFEtaBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05131             DenominatorPFEtaBarrel->getTH1();
05132             
05133             histoname = labelname+"_DenominatorPFPhiBarrel";
05134             title     = labelname+"DenominatorPFPhiBarrel;PF #Phi";
05135             MonitorElement * DenominatorPFPhiBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05136             DenominatorPFPhiBarrel->getTH1();
05137             
05138             histoname = labelname+"_DenominatorPFEtaEndcap";
05139             title     = labelname+"DenominatorPFEtaEndcap;PF #eta ";
05140             MonitorElement * DenominatorPFEtaEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05141             DenominatorPFEtaEndcap->getTH1();
05142             
05143             histoname = labelname+"_DenominatorPFPhiEndcap";
05144             title     = labelname+"DenominatorPFPhiEndcap;PF #Phi";
05145             MonitorElement * DenominatorPFPhiEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05146             DenominatorPFPhiEndcap->getTH1();
05147             
05148             histoname = labelname+"_DenominatorPFEtaForward";
05149             title     = labelname+"DenominatorPFEtaForward;PF #eta ";
05150             MonitorElement * DenominatorPFEtaForward =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05151             DenominatorPFEtaForward->getTH1();
05152             
05153             histoname = labelname+"_DenominatorPFPhiForward";
05154             title     = labelname+"DenominatorPFPhiForward;PF #Phi";
05155             MonitorElement * DenominatorPFPhiForward =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05156             DenominatorPFPhiForward->getTH1();
05157             
05158             histoname = labelname+"_DenominatorPFEta_LowpTcut";
05159             title     = labelname+"DenominatorPFEta_LowpTcut;PF #eta ";
05160             MonitorElement * DenominatorPFEta_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05161             DenominatorPFEta_LowpTcut->getTH1();
05162             
05163             histoname = labelname+"_DenominatorPFPhi_LowpTcut";
05164             title     = labelname+"DenominatorPFPhi_LowpTcut;PF #Phi";
05165             MonitorElement * DenominatorPFPhi_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05166             DenominatorPFPhi_LowpTcut->getTH1();
05167             
05168             histoname = labelname+"_DenominatorPFEtaPhi_LowpTcut";
05169             title     = labelname+"DenominatorPFEtaPhi_LowpTcut;PF #eta;PF #Phi";
05170             MonitorElement * DenominatorPFEtaPhi_LowpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05171             DenominatorPFEtaPhi_LowpTcut->getTH1();
05172             
05173             histoname = labelname+"_DenominatorPFEta_MedpTcut";
05174             title     = labelname+"DenominatorPFEta_MedpTcut;PF #eta ";
05175             MonitorElement * DenominatorPFEta_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05176             DenominatorPFEta_MedpTcut->getTH1();
05177             
05178             histoname = labelname+"_DenominatorPFPhi_MedpTcut";
05179             title     = labelname+"DenominatorPFPhi_MedpTcut;PF #Phi";
05180             MonitorElement * DenominatorPFPhi_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05181             DenominatorPFPhi_MedpTcut->getTH1();
05182             
05183             histoname = labelname+"_DenominatorPFEtaPhi_MedpTcut";
05184             title     = labelname+"DenominatorPFEtaPhi_MedpTcut;PF #eta;PF #Phi";
05185             MonitorElement * DenominatorPFEtaPhi_MedpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05186             DenominatorPFEtaPhi_MedpTcut->getTH1();
05187             
05188             histoname = labelname+"_DenominatorPFEta_HighpTcut";
05189             title     = labelname+"DenominatorPFEta_HighpTcut;PF #eta ";
05190             MonitorElement * DenominatorPFEta_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05191             DenominatorPFEta_HighpTcut->getTH1();
05192           
05193             histoname = labelname+"_DenominatorPFPhi_HighpTcut";
05194             title     = labelname+"DenominatorPFPhi_HighpTcut;PF #Phi";
05195             MonitorElement * DenominatorPFPhi_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05196             DenominatorPFPhi_HighpTcut->getTH1();
05197             
05198             histoname = labelname+"_DenominatorPFEtaPhi_HighpTcut";
05199             title     = labelname+"DenominatorPFEtaPhi_HighpTcut;PF #eta;PF #Phi";
05200             MonitorElement * DenominatorPFEtaPhi_HighpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05201             DenominatorPFEtaPhi_HighpTcut->getTH1();
05202             
05203             histoname = labelname+"_PFDeltaR";
05204             title     = labelname+"PFDeltaR;";
05205             MonitorElement * PFDeltaR =  dbe->book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
05206             PFDeltaR->getTH1();
05207             
05208             histoname = labelname+"_PFDeltaPhi";
05209             title     = labelname+"PFDeltaPhi;";
05210             MonitorElement * PFDeltaPhi =  dbe->book1D(histoname.c_str(),title.c_str(),500,-5.0,5.0);
05211             PFDeltaPhi->getTH1();
05212           
05213             v->setEffHistos(NumeratorPt,
05214                             NumeratorPtBarrel,
05215                             NumeratorPtEndcap,
05216                             NumeratorPtForward,
05217                             NumeratorEta,
05218                             NumeratorPhi,
05219                             NumeratorEtaPhi,
05220                             //ml Additional Phi and Eta histos
05221                             NumeratorEtaBarrel,
05222                             NumeratorPhiBarrel,
05223                             NumeratorEtaEndcap,
05224                             NumeratorPhiEndcap,
05225                             NumeratorEtaForward,
05226                             NumeratorPhiForward,
05227                             NumeratorEta_LowpTcut,
05228                             NumeratorPhi_LowpTcut,
05229                             NumeratorEtaPhi_LowpTcut,
05230                             NumeratorEta_MedpTcut,
05231                             NumeratorPhi_MedpTcut,
05232                             NumeratorEtaPhi_MedpTcut,
05233                             NumeratorEta_HighpTcut,
05234                             NumeratorPhi_HighpTcut,
05235                             NumeratorEtaPhi_HighpTcut,      
05236                             //ml 15 new numerator histograms.
05237                             DenominatorPt,
05238                             DenominatorPtBarrel,
05239                             DenominatorPtEndcap,
05240                             DenominatorPtForward,
05241                             DenominatorEta,
05242                             DenominatorPhi,
05243                             DenominatorEtaPhi,
05244                             //ml new denom histos
05245                             DenominatorEtaBarrel,
05246                             DenominatorPhiBarrel,
05247                             DenominatorEtaEndcap,
05248                             DenominatorPhiEndcap,
05249                             DenominatorEtaForward,
05250                             DenominatorPhiForward,
05251                             DenominatorEta_LowpTcut,
05252                             DenominatorPhi_LowpTcut,
05253                             DenominatorEtaPhi_LowpTcut,
05254                             DenominatorEta_MedpTcut,
05255                             DenominatorPhi_MedpTcut,
05256                             DenominatorEtaPhi_MedpTcut,
05257                             DenominatorEta_HighpTcut,
05258                             DenominatorPhi_HighpTcut,
05259                             DenominatorEtaPhi_HighpTcut,
05260                             DeltaR,
05261                             DeltaPhi,
05262                             //ml
05263                             //adding PF histograms  SJ:
05264                             NumeratorPFPt,
05265                             NumeratorPFMHT,
05266                             NumeratorPFPtBarrel,
05267                             NumeratorPFPtEndcap,
05268                             NumeratorPFPtForward,
05269                             NumeratorPFEta,
05270                             NumeratorPFPhi,
05271                             NumeratorPFEtaPhi,
05272                             NumeratorPFEtaBarrel,
05273                             NumeratorPFPhiBarrel,
05274                             NumeratorPFEtaEndcap,
05275                             NumeratorPFPhiEndcap,
05276                             NumeratorPFEtaForward,
05277                             NumeratorPFPhiForward,
05278                             NumeratorPFEta_LowpTcut,
05279                             NumeratorPFPhi_LowpTcut,
05280                             NumeratorPFEtaPhi_LowpTcut,
05281                             NumeratorPFEta_MedpTcut,
05282                             NumeratorPFPhi_MedpTcut,
05283                             NumeratorPFEtaPhi_MedpTcut,
05284                             NumeratorPFEta_HighpTcut,
05285                             NumeratorPFPhi_HighpTcut,
05286                             NumeratorPFEtaPhi_HighpTcut,      
05287                             DenominatorPFPt,
05288                             DenominatorPFMHT,
05289                             DenominatorPFPtBarrel,
05290                             DenominatorPFPtEndcap,
05291                             DenominatorPFPtForward,
05292                             DenominatorPFEta,
05293                             DenominatorPFPhi,
05294                             DenominatorPFEtaPhi,
05295                             DenominatorPFEtaBarrel,
05296                             DenominatorPFPhiBarrel,
05297                             DenominatorPFEtaEndcap,
05298                             DenominatorPFPhiEndcap,
05299                             DenominatorPFEtaForward,
05300                             DenominatorPFPhiForward,
05301                             DenominatorPFEta_LowpTcut,
05302                             DenominatorPFPhi_LowpTcut,
05303                             DenominatorPFEtaPhi_LowpTcut,
05304                             DenominatorPFEta_MedpTcut,
05305                             DenominatorPFPhi_MedpTcut,
05306                             DenominatorPFEtaPhi_MedpTcut,
05307                             DenominatorPFEta_HighpTcut,
05308                             DenominatorPFPhi_HighpTcut,
05309                             DenominatorPFEtaPhi_HighpTcut,
05310                             PFDeltaR,
05311                             PFDeltaPhi
05312                             ); 
05313           }
05314           
05315           if((v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("DiJet_Trigger") == 0)){
05316             
05317             histoname = labelname+"_NumeratorAvrgPt";
05318             title     = labelname+"NumeratorAvrgPt;Calo Pt[GeV/c] ";
05319             MonitorElement * NumeratorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05320             NumeratorPt->getTH1();
05321             
05322             histoname = labelname+"_NumeratorAvrgEta";
05323             title     = labelname+"NumeratorAvrgEta;Calo #eta";
05324             MonitorElement * NumeratorEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05325             NumeratorEta->getTH1();
05326             
05327             histoname = labelname+"_DenominatorAvrgPt";
05328             title     = labelname+"DenominatorAvrgPt;Calo Pt[GeV/c]";
05329             MonitorElement * DenominatorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05330             DenominatorPt->getTH1();
05331             
05332             histoname = labelname+"_DenominatorAvrgEta";
05333             title     = labelname+"DenominatorAvrgEta;Calo #eta ";
05334             MonitorElement * DenominatorEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05335             DenominatorEta->getTH1();
05336             
05337             histoname = labelname+"_DeltaR";
05338             title     = labelname+"DeltaR;";
05339             MonitorElement * DeltaR =  dbe->book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
05340             DeltaR->getTH1();
05341             
05342             histoname = labelname+"_DeltaPhi";
05343             title     = labelname+"DeltaPhi;";
05344             MonitorElement * DeltaPhi =  dbe->book1D(histoname.c_str(),title.c_str(),500,-5.,5.);
05345             DeltaPhi->getTH1();
05346             
05347             histoname = labelname+"_NumeratorAvrgPFPt";
05348             title     = labelname+"NumeratorAvrgPFPt;PF Pt[GeV/c] ";
05349             MonitorElement * NumeratorPFPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05350             NumeratorPFPt->getTH1();
05351             
05352             histoname = labelname+"_NumeratorAvrgPFEta";
05353             title     = labelname+"NumeratorAvrgPFEta;PF #eta";
05354             MonitorElement * NumeratorPFEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05355             NumeratorPFEta->getTH1();
05356             
05357             histoname = labelname+"_DenominatorAvrgPFPt";
05358             title     = labelname+"DenominatorAvrgPFPt;PF Pt[GeV/c]";
05359             MonitorElement * DenominatorPFPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05360             DenominatorPFPt->getTH1();
05361             
05362             histoname = labelname+"_DenominatorAvrgPFEta";
05363             title     = labelname+"DenominatorAvrgPFEta;PF #eta ";
05364             MonitorElement * DenominatorPFEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05365             DenominatorPFEta->getTH1();
05366             
05367             histoname = labelname+"_PFDeltaR";
05368             title     = labelname+"PFDeltaR;";
05369             MonitorElement * PFDeltaR =  dbe->book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
05370             PFDeltaR->getTH1();
05371             
05372             histoname = labelname+"_PFDeltaPhi";
05373             title     = labelname+"PFDeltaPhi;";
05374             MonitorElement * PFDeltaPhi =  dbe->book1D(histoname.c_str(),title.c_str(),500,-5.,5.);
05375             PFDeltaPhi->getTH1();
05376 
05377             v->setEffHistos(  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
05378                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
05379                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, 
05380                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
05381                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
05382                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
05383                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
05384                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, 
05385                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
05386                               dummy, dummy, dummy, dummy
05387                               );  
05388           }
05389           
05390           if(v->getObjectType() == trigger::TriggerMET || (v->getObjectType() == trigger::TriggerTET)){
05391             
05392             histoname = labelname+"_NumeratorPt";
05393             if(v->getPath().find("HLT_PFMET")==std::string::npos)
05394               title     = labelname+"NumeratorPt; CaloMET[GeV/c]";
05395             else
05396               title     = labelname+"NumeratorPt; PFMET[GeV/c]";
05397             MonitorElement * NumeratorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05398             NumeratorPt->getTH1();
05399             
05400             histoname = labelname+"_NumeratorPhi";
05401             title     = labelname+"NumeratorPhi; #Phi";
05402             MonitorElement * NumeratorPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05403             NumeratorPhi->getTH1();
05404             
05405             histoname = labelname+"_DenominatorPt";
05406             if(v->getPath().find("HLT_PFMET")==std::string::npos)
05407               title     = labelname+"DenominatorPt; CaloMET[GeV/c]";
05408             else
05409               title     = labelname+"DenominatorPt; PFMET[GeV/c]";
05410             MonitorElement * DenominatorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05411             DenominatorPt->getTH1();
05412             
05413             histoname = labelname+"_DenominatorPhi";
05414             title     = labelname+"DenominatorPhi; #Phi";
05415             MonitorElement * DenominatorPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05416             DenominatorPhi->getTH1();
05417 
05418             v->setEffHistos(  NumeratorPt, dummy, dummy, dummy, dummy, NumeratorPhi, dummy, dummy, dummy, dummy,
05419                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
05420                               dummy, dummy, DenominatorPt, dummy, dummy, dummy, dummy, DenominatorPhi, dummy, dummy, 
05421                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
05422                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
05423                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
05424                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
05425                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, 
05426                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
05427                               dummy, dummy, dummy, dummy
05428                               );
05429           }// Loop over MET trigger 
05430         }
05431       }
05432       
05433       //--------Efficiency  wrt MiniBias trigger---------
05434       if(plotEffwrtMB_){
05435         std::string dirName3  = dirname_ + "/EffWrtMBTrigger/";
05436         for(PathInfoCollection::iterator v = hltPathsEffWrtMB_.begin(); v!= hltPathsEffWrtMB_.end(); ++v ){
05437           //
05438           std::string trgPathName    = HLTConfigProvider::removeVersion(v->getPath());
05439           //
05440           std::string labelname("ME") ;
05441           std::string subdirName = dirName3 + trgPathName ;
05442           std::string histoname(labelname+"");
05443           std::string title(labelname+"");
05444           dbe->setCurrentFolder(subdirName);
05445           
05446           MonitorElement *dummy;
05447           dummy =  dbe->bookFloat("dummy"); 
05448           
05449           if((v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("SingleJet_Trigger") == 0)){ 
05450             
05451             histoname = labelname+"_NumeratorPt";
05452             title     = labelname+"NumeratorPt;Calo Pt[GeV/c] ";
05453             MonitorElement * NumeratorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05454             NumeratorPt->getTH1();
05455             
05456             histoname = labelname+"_NumeratorPtBarrel";
05457             title     = labelname+"NumeratorPtBarrel;Calo Pt[GeV/c]";
05458             MonitorElement * NumeratorPtBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05459             NumeratorPtBarrel->getTH1();
05460             
05461             histoname = labelname+"_NumeratorPtEndcap";
05462             title     = labelname+"NumeratorPtEndcap; Calo Pt[GeV/c] ";
05463             MonitorElement * NumeratorPtEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05464             NumeratorPtEndcap->getTH1();
05465             
05466             histoname = labelname+"_NumeratorPtForward";
05467             title     = labelname+"NumeratorPtForward;Calo Pt[GeV/c]";
05468             MonitorElement * NumeratorPtForward =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05469             NumeratorPtForward->getTH1();
05470             
05471             histoname = labelname+"_NumeratorEta";
05472             title     = labelname+"NumeratorEta;Calo #eta ";
05473             MonitorElement * NumeratorEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05474             NumeratorEta->getTH1();
05475             
05476             histoname = labelname+"_NumeratorPhi";
05477             title     = labelname+"NumeratorPhi;Calo #Phi";
05478             MonitorElement * NumeratorPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05479             NumeratorPhi->getTH1();
05480             
05481             histoname = labelname+"_NumeratorEtaPhi";
05482             title     = labelname+"NumeratorEtaPhi;Calo #eta;Calo #Phi ";
05483             MonitorElement * NumeratorEtaPhi =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05484             NumeratorEtaPhi->getTH1();
05485             
05486             histoname = labelname+"_NumeratorEtaBarrel";
05487             title     = labelname+"NumeratorEtaBarrel;Calo #eta ";
05488             MonitorElement * NumeratorEtaBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05489             NumeratorEtaBarrel->getTH1();
05490             
05491             histoname = labelname+"_NumeratorPhiBarrel";
05492             title     = labelname+"NumeratorPhiBarrel;Calo #Phi";
05493             MonitorElement * NumeratorPhiBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05494             NumeratorPhiBarrel->getTH1();
05495             
05496             histoname = labelname+"_NumeratorEtaEndcap";
05497             title     = labelname+"NumeratorEtaEndcap;Calo #eta ";
05498             MonitorElement * NumeratorEtaEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05499             NumeratorEtaEndcap->getTH1();
05500             
05501             histoname = labelname+"_NumeratorPhiEndcap";
05502             title     = labelname+"NumeratorPhiEndcap;Calo #Phi";
05503             MonitorElement * NumeratorPhiEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05504             NumeratorPhiEndcap->getTH1();
05505             
05506             histoname = labelname+"_NumeratorEtaForward";
05507             title     = labelname+"NumeratorEtaForward;Calo #eta ";
05508             MonitorElement * NumeratorEtaForward =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05509             NumeratorEtaForward->getTH1();
05510             
05511             histoname = labelname+"_NumeratorPhiForward";
05512             title     = labelname+"NumeratorPhiForward;Calo #Phi";
05513             MonitorElement * NumeratorPhiForward =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05514             NumeratorPhiForward->getTH1();
05515             
05516             histoname = labelname+"_NumeratorEta_LowpTcut";
05517             title     = labelname+"NumeratorEta_LowpTcut;Calo #eta ";
05518             MonitorElement * NumeratorEta_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05519             NumeratorEta_LowpTcut->getTH1();
05520             
05521             histoname = labelname+"_NumeratorPhi_LowpTcut";
05522             title     = labelname+"NumeratorPhi_LowpTcut;Calo #Phi";
05523             MonitorElement * NumeratorPhi_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05524             NumeratorPhi_LowpTcut->getTH1();
05525             
05526             histoname = labelname+"_NumeratorEtaPhi_LowpTcut";
05527             title     = labelname+"NumeratorEtaPhi_LowpTcut;Calo #eta;Calo #Phi";
05528             MonitorElement * NumeratorEtaPhi_LowpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05529             NumeratorEtaPhi_LowpTcut->getTH1();
05530             
05531             histoname = labelname+"_NumeratorEta_MedpTcut";
05532             title     = labelname+"NumeratorEta_MedpTcut;Calo #eta ";
05533             MonitorElement * NumeratorEta_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05534             NumeratorEta_MedpTcut->getTH1();
05535             
05536             histoname = labelname+"_NumeratorPhi_MedpTcut";
05537             title     = labelname+"NumeratorPhi_MedpTcut;Calo #Phi";
05538             MonitorElement * NumeratorPhi_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05539             NumeratorPhi_MedpTcut->getTH1();
05540             
05541             histoname = labelname+"_NumeratorEtaPhi_MedpTcut";
05542             title     = labelname+"NumeratorEtaPhi_MedpTcut;Calo #eta;Calo #Phi";
05543             MonitorElement * NumeratorEtaPhi_MedpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05544             NumeratorEtaPhi_MedpTcut->getTH1();
05545             
05546             histoname = labelname+"_NumeratorEta_HighpTcut";
05547             title     = labelname+"NumeratorEta_HighpTcut;Calo #eta ";
05548             MonitorElement * NumeratorEta_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05549             NumeratorEta_HighpTcut->getTH1();
05550             
05551             histoname = labelname+"_NumeratorPhi_HighpTcut";
05552             title     = labelname+"NumeratorPhi_HighpTcut;Calo #Phi";
05553             MonitorElement * NumeratorPhi_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05554             NumeratorPhi_HighpTcut->getTH1();
05555             
05556             histoname = labelname+"_NumeratorEtaPhi_HighpTcut";
05557             title     = labelname+"NumeratorEtaPhi_HighpTcut;Calo #eta;Calo #Phi";
05558             MonitorElement * NumeratorEtaPhi_HighpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05559             NumeratorEtaPhi_HighpTcut->getTH1();
05560             
05561             histoname = labelname+"_DenominatorPt";
05562             title     = labelname+"DenominatorPt;Calo Pt[GeV/c]";
05563             MonitorElement * DenominatorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05564             DenominatorPt->getTH1();
05565             
05566             histoname = labelname+"_DenominatorPtBarrel";
05567             title     = labelname+"DenominatorPtBarrel;Calo Pt[GeV/c]";
05568             MonitorElement * DenominatorPtBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05569             DenominatorPtBarrel->getTH1();
05570             
05571             histoname = labelname+"_DenominatorPtEndcap";
05572             title     = labelname+"DenominatorPtEndcap;Calo Pt[GeV/c]";
05573             MonitorElement * DenominatorPtEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05574             DenominatorPtEndcap->getTH1();
05575             
05576             histoname = labelname+"_DenominatorPtForward";
05577             title     = labelname+"DenominatorPtForward;Calo Pt[GeV/c]";
05578             MonitorElement * DenominatorPtForward =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05579             DenominatorPtForward->getTH1();
05580             
05581             histoname = labelname+"_DenominatorEta";
05582             title     = labelname+"DenominatorEta;Calo #eta ";
05583             MonitorElement * DenominatorEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05584             DenominatorEta->getTH1();
05585             
05586             histoname = labelname+"_DenominatorPhi";
05587             title     = labelname+"DenominatorPhi;Calo #Phi";
05588             MonitorElement * DenominatorPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05589             DenominatorPhi->getTH1();
05590             
05591             histoname = labelname+"_DenominatorEtaPhi";
05592             title     = labelname+"DenominatorEtaPhi;Calo #eta ;Calo #Phi ";
05593             MonitorElement * DenominatorEtaPhi =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05594             DenominatorEtaPhi->getTH1();
05595             
05596             histoname = labelname+"_DenominatorEtaBarrel";
05597             title     = labelname+"DenominatorEtaBarrel;Calo #eta ";
05598             MonitorElement * DenominatorEtaBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05599             DenominatorEtaBarrel->getTH1();
05600             
05601             histoname = labelname+"_DenominatorPhiBarrel";
05602             title     = labelname+"DenominatorPhiBarrel;Calo #Phi";
05603             MonitorElement * DenominatorPhiBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05604             DenominatorPhiBarrel->getTH1();
05605             
05606             histoname = labelname+"_DenominatorEtaEndcap";
05607             title     = labelname+"DenominatorEtaEndcap;Calo #eta ";
05608             MonitorElement * DenominatorEtaEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05609             DenominatorEtaEndcap->getTH1();
05610             
05611             histoname = labelname+"_DenominatorPhiEndcap";
05612             title     = labelname+"DenominatorPhiEndcap;Calo #Phi";
05613             MonitorElement * DenominatorPhiEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05614             DenominatorPhiEndcap->getTH1();
05615             
05616             histoname = labelname+"_DenominatorEtaForward";
05617             title     = labelname+"DenominatorEtaForward;Calo #eta ";
05618             MonitorElement * DenominatorEtaForward =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05619             DenominatorEtaForward->getTH1();
05620             
05621             histoname = labelname+"_DenominatorPhiForward";
05622             title     = labelname+"DenominatorPhiForward;Calo #Phi";
05623             MonitorElement * DenominatorPhiForward =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05624             DenominatorPhiForward->getTH1();
05625             
05626             histoname = labelname+"_DenominatorEta_LowpTcut";
05627             title     = labelname+"DenominatorEta_LowpTcut;Calo #eta ";
05628             MonitorElement * DenominatorEta_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05629             DenominatorEta_LowpTcut->getTH1();
05630             
05631             histoname = labelname+"_DenominatorPhi_LowpTcut";
05632             title     = labelname+"DenominatorPhi_LowpTcut;Calo #Phi";
05633             MonitorElement * DenominatorPhi_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05634             DenominatorPhi_LowpTcut->getTH1();
05635             
05636             histoname = labelname+"_DenominatorEtaPhi_LowpTcut";
05637             title     = labelname+"DenominatorEtaPhi_LowpTcut;Calo #eta;Calo #Phi";
05638             MonitorElement * DenominatorEtaPhi_LowpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05639             DenominatorEtaPhi_LowpTcut->getTH1();
05640             
05641             histoname = labelname+"_DenominatorEta_MedpTcut";
05642             title     = labelname+"DenominatorEta_MedpTcut;Calo #eta ";
05643             MonitorElement * DenominatorEta_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05644             DenominatorEta_MedpTcut->getTH1();
05645             
05646             histoname = labelname+"_DenominatorPhi_MedpTcut";
05647             title     = labelname+"DenominatorPhi_MedpTcut;Calo #Phi";
05648             MonitorElement * DenominatorPhi_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05649             DenominatorPhi_MedpTcut->getTH1();
05650             
05651             histoname = labelname+"_DenominatorEtaPhi_MedpTcut";
05652             title     = labelname+"DenominatorEtaPhi_MedpTcut;Calo #eta;Calo #Phi";
05653             MonitorElement * DenominatorEtaPhi_MedpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05654             DenominatorEtaPhi_MedpTcut->getTH1();
05655             
05656             histoname = labelname+"_DenominatorEta_HighpTcut";
05657             title     = labelname+"DenominatorEta_HighpTcut;Calo #eta ";
05658             MonitorElement * DenominatorEta_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05659             DenominatorEta_HighpTcut->getTH1();
05660             
05661             histoname = labelname+"_DenominatorPhi_HighpTcut";
05662             title     = labelname+"DenominatorPhi_HighpTcut;Calo #Phi";
05663             MonitorElement * DenominatorPhi_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05664             DenominatorPhi_HighpTcut->getTH1();
05665             
05666             histoname = labelname+"_DenominatorEtaPhi_HighpTcut";
05667             title     = labelname+"DenominatorEtaPhi_HighpTcut;Calo #eta;Calo #Phi";
05668             MonitorElement * DenominatorEtaPhi_HighpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05669             DenominatorEtaPhi_HighpTcut->getTH1();
05670             
05671             histoname = labelname+"_DeltaR";
05672             title     = labelname+"DeltaR;";
05673             MonitorElement * DeltaR =  dbe->book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
05674             DeltaR->getTH1();
05675             
05676             histoname = labelname+"_DeltaPhi";
05677             title     = labelname+"DeltaPhi;";
05678             MonitorElement * DeltaPhi =  dbe->book1D(histoname.c_str(),title.c_str(),500,-5.,5.);
05679             DeltaPhi->getTH1();
05680             
05681             histoname = labelname+"_NumeratorPFPt";
05682             title     = labelname+"NumeratorPFPt;PF Pt[GeV/c] ";
05683             MonitorElement * NumeratorPFPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05684             NumeratorPFPt->getTH1();
05685             
05686             histoname = labelname+"_NumeratorPFMHT";
05687             title     = labelname+"NumeratorPFPt;PFMHT[GeV/c] ";
05688             MonitorElement * NumeratorPFMHT =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05689             NumeratorPFMHT->getTH1();
05690             
05691             histoname = labelname+"_NumeratorPFPtBarrel";
05692             title     = labelname+"NumeratorPFPtBarrel;PF Pt[GeV/c]";
05693             MonitorElement * NumeratorPFPtBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05694             NumeratorPFPtBarrel->getTH1();
05695             
05696             histoname = labelname+"_NumeratorPFPtEndcap";
05697             title     = labelname+"NumeratorPFPtEndcap; PF Pt[GeV/c] ";
05698             MonitorElement * NumeratorPFPtEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05699             NumeratorPFPtEndcap->getTH1();
05700             
05701             histoname = labelname+"_NumeratorPFPtForward";
05702             title     = labelname+"NumeratorPFPtForward;PF Pt[GeV/c]";
05703             MonitorElement * NumeratorPFPtForward =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05704             NumeratorPFPtForward->getTH1();
05705             
05706             histoname = labelname+"_NumeratorPFEta";
05707             title     = labelname+"NumeratorPFEta;PF #eta ";
05708             MonitorElement * NumeratorPFEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05709             NumeratorPFEta->getTH1();
05710             
05711             histoname = labelname+"_NumeratorPFPhi";
05712             title     = labelname+"NumeratorPFPhi;PF #Phi";
05713             MonitorElement * NumeratorPFPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05714             NumeratorPFPhi->getTH1();
05715             
05716             histoname = labelname+"_NumeratorPFEtaPhi";
05717             title     = labelname+"NumeratorPFEtaPhi;PF #eta;PF #Phi ";
05718             MonitorElement * NumeratorPFEtaPhi =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05719             NumeratorPFEtaPhi->getTH1();
05720             
05721             histoname = labelname+"_NumeratorPFEtaBarrel";
05722             title     = labelname+"NumeratorPFEtaBarrel;PF #eta ";
05723             MonitorElement * NumeratorPFEtaBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05724             NumeratorPFEtaBarrel->getTH1();
05725             
05726             histoname = labelname+"_NumeratorPFPhiBarrel";
05727             title     = labelname+"NumeratorPFPhiBarrel;PF #Phi";
05728             MonitorElement * NumeratorPFPhiBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05729             NumeratorPFPhiBarrel->getTH1();
05730             
05731             histoname = labelname+"_NumeratorPFEtaEndcap";
05732             title     = labelname+"NumeratorPFEtaEndcap;PF #eta ";
05733             MonitorElement * NumeratorPFEtaEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05734             NumeratorPFEtaEndcap->getTH1();
05735             
05736             histoname = labelname+"_NumeratorPFPhiEndcap";
05737             title     = labelname+"NumeratorPFPhiEndcap;PF #Phi";
05738             MonitorElement * NumeratorPFPhiEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05739             NumeratorPFPhiEndcap->getTH1();
05740             
05741             histoname = labelname+"_NumeratorPFEtaForward";
05742             title     = labelname+"NumeratorPFEtaForward;PF #eta ";
05743             MonitorElement * NumeratorPFEtaForward =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05744             NumeratorPFEtaForward->getTH1();
05745             
05746             histoname = labelname+"_NumeratorPFPhiForward";
05747             title     = labelname+"NumeratorPFPhiForward;PF #Phi";
05748             MonitorElement * NumeratorPFPhiForward =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05749             NumeratorPFPhiForward->getTH1();
05750             
05751             histoname = labelname+"_NumeratorPFEta_LowpTcut";
05752             title     = labelname+"NumeratorPFEta_LowpTcut;PF #eta ";
05753             MonitorElement * NumeratorPFEta_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05754             NumeratorPFEta_LowpTcut->getTH1();
05755             
05756             histoname = labelname+"_NumeratorPFPhi_LowpTcut";
05757             title     = labelname+"NumeratorPFPhi_LowpTcut;PF #Phi";
05758             MonitorElement * NumeratorPFPhi_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05759             NumeratorPFPhi_LowpTcut->getTH1();
05760             
05761             histoname = labelname+"_NumeratorPFEtaPhi_LowpTcut";
05762             title     = labelname+"NumeratorPFEtaPhi_LowpTcut;PF #eta;PF #Phi";
05763             MonitorElement * NumeratorPFEtaPhi_LowpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05764             NumeratorPFEtaPhi_LowpTcut->getTH1();
05765             
05766             histoname = labelname+"_NumeratorPFEta_MedpTcut";
05767             title     = labelname+"NumeratorPFEta_MedpTcut;PF #eta ";
05768             MonitorElement * NumeratorPFEta_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05769             NumeratorPFEta_MedpTcut->getTH1();
05770             
05771             histoname = labelname+"_NumeratorPFPhi_MedpTcut";
05772             title     = labelname+"NumeratorPFPhi_MedpTcut;PF #Phi";
05773             MonitorElement * NumeratorPFPhi_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05774             NumeratorPFPhi_MedpTcut->getTH1();
05775             
05776             histoname = labelname+"_NumeratorPFEtaPhi_MedpTcut";
05777             title     = labelname+"NumeratorPFEtaPhi_MedpTcut;PF #eta;PF #Phi";
05778             MonitorElement * NumeratorPFEtaPhi_MedpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05779             NumeratorPFEtaPhi_MedpTcut->getTH1();
05780             
05781             histoname = labelname+"_NumeratorPFEta_HighpTcut";
05782             title     = labelname+"NumeratorPFEta_HighpTcut;PF #eta ";
05783             MonitorElement * NumeratorPFEta_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05784             NumeratorPFEta_HighpTcut->getTH1();
05785             
05786             histoname = labelname+"_NumeratorPFPhi_HighpTcut";
05787             title     = labelname+"NumeratorPFPhi_HighpTcut;PF #Phi";
05788             MonitorElement * NumeratorPFPhi_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05789             NumeratorPFPhi_HighpTcut->getTH1();
05790             
05791             histoname = labelname+"_NumeratorPFEtaPhi_HighpTcut";
05792             title     = labelname+"NumeratorPFEtaPhi_HighpTcut;PF #eta;PF #Phi";
05793             MonitorElement * NumeratorPFEtaPhi_HighpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05794             NumeratorPFEtaPhi_HighpTcut->getTH1();
05795             
05796             histoname = labelname+"_DenominatorPFMHT";
05797             title     = labelname+"DenominatorPFMHT;PFMHT[GeV/c]";
05798             MonitorElement * DenominatorPFMHT =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05799             DenominatorPFMHT->getTH1();
05800             
05801             histoname = labelname+"_DenominatorPFPt";
05802             title     = labelname+"DenominatorPFPt;PF Pt[GeV/c]";
05803             MonitorElement * DenominatorPFPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05804             DenominatorPFPt->getTH1();
05805             
05806             histoname = labelname+"_DenominatorPFPtBarrel";
05807             title     = labelname+"DenominatorPFPtBarrel;PF Pt[GeV/c]";
05808             MonitorElement * DenominatorPFPtBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05809             DenominatorPFPtBarrel->getTH1();
05810             
05811             histoname = labelname+"_DenominatorPFPtEndcap";
05812             title     = labelname+"DenominatorPFPtEndcap;PF Pt[GeV/c]";
05813             MonitorElement * DenominatorPFPtEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05814             DenominatorPFPtEndcap->getTH1();
05815             
05816             histoname = labelname+"_DenominatorPFPtForward";
05817             title     = labelname+"DenominatorPFPtForward;PF Pt[GeV/c]";
05818             MonitorElement * DenominatorPFPtForward =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
05819             DenominatorPFPtForward->getTH1();
05820             
05821             histoname = labelname+"_DenominatorPFEta";
05822             title     = labelname+"DenominatorPFEta;PF #eta ";
05823             MonitorElement * DenominatorPFEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05824             DenominatorPFEta->getTH1();
05825             
05826             histoname = labelname+"_DenominatorPFPhi";
05827             title     = labelname+"DenominatorPFPhi;PF #Phi";
05828             MonitorElement * DenominatorPFPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05829             DenominatorPFPhi->getTH1();
05830             
05831             histoname = labelname+"_DenominatorPFEtaPhi";
05832             title     = labelname+"DenominatorPFEtaPhi;PF #eta ;PF #Phi ";
05833             MonitorElement * DenominatorPFEtaPhi =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05834             DenominatorPFEtaPhi->getTH1();
05835             
05836             histoname = labelname+"_DenominatorPFEtaBarrel";
05837             title     = labelname+"DenominatorPFEtaBarrel;PF #eta ";
05838             MonitorElement * DenominatorPFEtaBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05839             DenominatorPFEtaBarrel->getTH1();
05840             
05841             histoname = labelname+"_DenominatorPFPhiBarrel";
05842             title     = labelname+"DenominatorPFPhiBarrel;PF #Phi";
05843             MonitorElement * DenominatorPFPhiBarrel =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05844             DenominatorPFPhiBarrel->getTH1();
05845             
05846             histoname = labelname+"_DenominatorPFEtaEndcap";
05847             title     = labelname+"DenominatorPFEtaEndcap;PF #eta ";
05848             MonitorElement * DenominatorPFEtaEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05849             DenominatorPFEtaEndcap->getTH1();
05850             
05851             histoname = labelname+"_DenominatorPFPhiEndcap";
05852             title     = labelname+"DenominatorPFPhiEndcap;PF #Phi";
05853             MonitorElement * DenominatorPFPhiEndcap =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05854             DenominatorPFPhiEndcap->getTH1();
05855             
05856             histoname = labelname+"_DenominatorPFEtaForward";
05857             title     = labelname+"DenominatorPFEtaForward;PF #eta ";
05858             MonitorElement * DenominatorPFEtaForward =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05859             DenominatorPFEtaForward->getTH1();
05860             
05861             histoname = labelname+"_DenominatorPFPhiForward";
05862             title     = labelname+"DenominatorPFPhiForward;PF #Phi";
05863             MonitorElement * DenominatorPFPhiForward =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05864             DenominatorPFPhiForward->getTH1();
05865             
05866             histoname = labelname+"_DenominatorPFEta_LowpTcut";
05867             title     = labelname+"DenominatorPFEta_LowpTcut;PF #eta ";
05868             MonitorElement * DenominatorPFEta_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05869             DenominatorPFEta_LowpTcut->getTH1();
05870             
05871             histoname = labelname+"_DenominatorPFPhi_LowpTcut";
05872             title     = labelname+"DenominatorPFPhi_LowpTcut;PF #Phi";
05873             MonitorElement * DenominatorPFPhi_LowpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05874             DenominatorPFPhi_LowpTcut->getTH1();
05875             
05876             histoname = labelname+"_DenominatorPFEtaPhi_LowpTcut";
05877             title     = labelname+"DenominatorPFEtaPhi_LowpTcut;PF #eta;PF #Phi";
05878             MonitorElement * DenominatorPFEtaPhi_LowpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05879             DenominatorPFEtaPhi_LowpTcut->getTH1();
05880             
05881             histoname = labelname+"_DenominatorPFEta_MedpTcut";
05882             title     = labelname+"DenominatorPFEta_MedpTcut;PF #eta ";
05883             MonitorElement * DenominatorPFEta_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05884             DenominatorPFEta_MedpTcut->getTH1();
05885             
05886             histoname = labelname+"_DenominatorPFPhi_MedpTcut";
05887             title     = labelname+"DenominatorPFPhi_MedpTcut;PF #Phi";
05888             MonitorElement * DenominatorPFPhi_MedpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05889             DenominatorPFPhi_MedpTcut->getTH1();
05890             
05891             histoname = labelname+"_DenominatorPFEtaPhi_MedpTcut";
05892             title     = labelname+"DenominatorPFEtaPhi_MedpTcut;PF #eta;PF #Phi";
05893             MonitorElement * DenominatorPFEtaPhi_MedpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05894             DenominatorPFEtaPhi_MedpTcut->getTH1();
05895             
05896             histoname = labelname+"_DenominatorPFEta_HighpTcut";
05897             title     = labelname+"DenominatorPFEta_HighpTcut;PF #eta ";
05898             MonitorElement * DenominatorPFEta_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
05899             DenominatorPFEta_HighpTcut->getTH1();
05900             
05901             histoname = labelname+"_DenominatorPFPhi_HighpTcut";
05902             title     = labelname+"DenominatorPFPhi_HighpTcut;PF #Phi";
05903             MonitorElement * DenominatorPFPhi_HighpTcut =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
05904             DenominatorPFPhi_HighpTcut->getTH1();
05905             
05906             histoname = labelname+"_DenominatorPFEtaPhi_HighpTcut";
05907             title     = labelname+"DenominatorPFEtaPhi_HighpTcut;PF #eta;PF #Phi";
05908             MonitorElement * DenominatorPFEtaPhi_HighpTcut =  dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
05909             DenominatorPFEtaPhi_HighpTcut->getTH1();
05910             
05911             histoname = labelname+"_PFDeltaR";
05912             title     = labelname+"PFDeltaR;";
05913             MonitorElement * PFDeltaR =  dbe->book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
05914             PFDeltaR->getTH1();
05915             
05916             histoname = labelname+"_PFDeltaPhi";
05917             title     = labelname+"PFDeltaPhi;";
05918             MonitorElement * PFDeltaPhi =  dbe->book1D(histoname.c_str(),title.c_str(),500,-5.,5.);
05919             PFDeltaPhi->getTH1();
05920             
05921             v->setEffHistos(NumeratorPt,
05922                             NumeratorPtBarrel,
05923                             NumeratorPtEndcap,
05924                             NumeratorPtForward,
05925                             NumeratorEta,
05926                             NumeratorPhi,
05927                             NumeratorEtaPhi,
05928                             //
05929                             NumeratorEtaBarrel,
05930                             NumeratorPhiBarrel,
05931                             NumeratorEtaEndcap,
05932                             NumeratorPhiEndcap,
05933                             NumeratorEtaForward,
05934                             NumeratorPhiForward,
05935                             NumeratorEta_LowpTcut,
05936                             NumeratorPhi_LowpTcut,
05937                             NumeratorEtaPhi_LowpTcut,
05938                             NumeratorEta_MedpTcut,
05939                             NumeratorPhi_MedpTcut,
05940                             NumeratorEtaPhi_MedpTcut,
05941                             NumeratorEta_HighpTcut,
05942                             NumeratorPhi_HighpTcut,
05943                             NumeratorEtaPhi_HighpTcut,      
05944                             //
05945                             DenominatorPt,
05946                             DenominatorPtBarrel,
05947                             DenominatorPtEndcap,
05948                             DenominatorPtForward,
05949                             DenominatorEta,
05950                             DenominatorPhi,
05951                             DenominatorEtaPhi,
05952                             //
05953                             DenominatorEtaBarrel,
05954                             DenominatorPhiBarrel,
05955                             DenominatorEtaEndcap,
05956                             DenominatorPhiEndcap,
05957                             DenominatorEtaForward,
05958                             DenominatorPhiForward,
05959                             DenominatorEta_LowpTcut,
05960                             DenominatorPhi_LowpTcut,
05961                             DenominatorEtaPhi_LowpTcut,
05962                             DenominatorEta_MedpTcut,
05963                             DenominatorPhi_MedpTcut,
05964                             DenominatorEtaPhi_MedpTcut,
05965                             DenominatorEta_HighpTcut,
05966                             DenominatorPhi_HighpTcut,
05967                             DenominatorEtaPhi_HighpTcut,
05968                             DeltaR,
05969                             DeltaPhi,
05970                             //
05971                             NumeratorPFPt,
05972                             NumeratorPFMHT,
05973                             NumeratorPFPtBarrel,
05974                             NumeratorPFPtEndcap,
05975                             NumeratorPFPtForward,
05976                             NumeratorPFEta,
05977                             NumeratorPFPhi,
05978                             NumeratorPFEtaPhi,
05979                             NumeratorPFEtaBarrel,
05980                             NumeratorPFPhiBarrel,
05981                             NumeratorPFEtaEndcap,
05982                             NumeratorPFPhiEndcap,
05983                             NumeratorPFEtaForward,
05984                             NumeratorPFPhiForward,
05985                             NumeratorPFEta_LowpTcut,
05986                             NumeratorPFPhi_LowpTcut,
05987                             NumeratorPFEtaPhi_LowpTcut,
05988                             NumeratorPFEta_MedpTcut,
05989                             NumeratorPFPhi_MedpTcut,
05990                             NumeratorPFEtaPhi_MedpTcut,
05991                             NumeratorPFEta_HighpTcut,
05992                             NumeratorPFPhi_HighpTcut,
05993                             NumeratorPFEtaPhi_HighpTcut,      
05994                             DenominatorPFPt,
05995                             DenominatorPFMHT,
05996                             DenominatorPFPtBarrel,
05997                             DenominatorPFPtEndcap,
05998                             DenominatorPFPtForward,
05999                             DenominatorPFEta,
06000                             DenominatorPFPhi,
06001                             DenominatorPFEtaPhi,
06002                             DenominatorPFEtaBarrel,
06003                             DenominatorPFPhiBarrel,
06004                             DenominatorPFEtaEndcap,
06005                             DenominatorPFPhiEndcap,
06006                             DenominatorPFEtaForward,
06007                             DenominatorPFPhiForward,
06008                             DenominatorPFEta_LowpTcut,
06009                             DenominatorPFPhi_LowpTcut,
06010                             DenominatorPFEtaPhi_LowpTcut,
06011                             DenominatorPFEta_MedpTcut,
06012                             DenominatorPFPhi_MedpTcut,
06013                             DenominatorPFEtaPhi_MedpTcut,
06014                             DenominatorPFEta_HighpTcut,
06015                             DenominatorPFPhi_HighpTcut,
06016                             DenominatorPFEtaPhi_HighpTcut,
06017                             PFDeltaR,
06018                             PFDeltaPhi
06019                             );
06020             
06021           }// Loop over Jet Trigger
06022           
06023           if((v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("DiJet_Trigger") == 0)){
06024             
06025             histoname = labelname+"_NumeratorAvrgPt";
06026             title     = labelname+"NumeratorAvrgPt;Calo Pt[GeV/c] ";
06027             MonitorElement * NumeratorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
06028             NumeratorPt->getTH1();
06029             
06030             histoname = labelname+"_NumeratorAvrgEta";
06031             title     = labelname+"NumeratorAvrgEta;Calo #eta ";
06032             MonitorElement * NumeratorEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
06033             NumeratorEta->getTH1();
06034             
06035             histoname = labelname+"_DenominatorAvrgPt";
06036             title     = labelname+"DenominatorAvrgPt;Calo Pt[GeV/c] ";
06037             MonitorElement * DenominatorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
06038             DenominatorPt->getTH1();
06039             
06040             histoname = labelname+"_DenominatorAvrgEta";
06041             title     = labelname+"DenominatorAvrgEta;Calo #eta ";
06042             MonitorElement * DenominatorEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
06043             DenominatorEta->getTH1();
06044             
06045             histoname = labelname+"_DeltaR";
06046             title     = labelname+"DeltaR;";
06047             MonitorElement * DeltaR =  dbe->book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
06048             DeltaR->getTH1();
06049             
06050             histoname = labelname+"_DeltaPhi";
06051             title     = labelname+"DeltaPhi;";
06052             MonitorElement * DeltaPhi =  dbe->book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
06053             DeltaPhi->getTH1();
06054             
06055             histoname = labelname+"_NumeratorAvrgPFPt";
06056             title     = labelname+"NumeratorAvrgPFPt;PF pT [GeV/c] ";
06057             MonitorElement * NumeratorPFPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
06058             NumeratorPFPt->getTH1();
06059             
06060             histoname = labelname+"_NumeratorAvrgPFEta";
06061             title     = labelname+"NumeratorAvrgPFEta;PF #eta ";
06062             MonitorElement * NumeratorPFEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
06063             NumeratorPFEta->getTH1();
06064             
06065             histoname = labelname+"_DenominatorAvrgPFPt";
06066             title     = labelname+"DenominatorAvrgPFPt;PF Pt[GeV/c] ";
06067             MonitorElement * DenominatorPFPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
06068             DenominatorPFPt->getTH1();
06069             
06070             histoname = labelname+"_DenominatorAvrgPFEta";
06071             title     = labelname+"DenominatorAvrgPFEta;PF #eta ";
06072             MonitorElement * DenominatorPFEta =  dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
06073             DenominatorPFEta->getTH1();
06074             
06075             histoname = labelname+"_PFDeltaR";
06076             title     = labelname+"PFDeltaR;";
06077             MonitorElement * PFDeltaR =  dbe->book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
06078             PFDeltaR->getTH1();
06079             
06080             histoname = labelname+"_PFDeltaPhi";
06081             title     = labelname+"PFDeltaPhi;";
06082             MonitorElement * PFDeltaPhi =  dbe->book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
06083             PFDeltaPhi->getTH1();
06084             
06085             v->setEffHistos(  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
06086                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
06087                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, 
06088                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
06089                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
06090                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
06091                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
06092                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, 
06093                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
06094                               dummy, dummy, dummy, dummy
06095                               );
06096           }
06097           
06098           if(v->getObjectType() == trigger::TriggerMET || (v->getObjectType() == trigger::TriggerTET)){
06099             
06100             histoname = labelname+"_NumeratorPt";
06101             if(v->getPath().find("HLT_PFMET")==std::string::npos)
06102               title     = labelname+"NumeratorPt;CaloMET[GeV/c]";
06103             else
06104               title     = labelname+"NumeratorPt;PFMET[GeV/c]";
06105             MonitorElement * NumeratorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
06106             NumeratorPt->getTH1();
06107             
06108             histoname = labelname+"_NumeratorPhi";
06109             title     = labelname+"NumeratorPhi;#Phi";
06110             MonitorElement * NumeratorPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
06111             NumeratorPhi->getTH1();
06112             
06113             histoname = labelname+"_DenominatorPt"; 
06114             if(v->getPath().find("HLT_PFMET")==std::string::npos)
06115               title     = labelname+"DenominatorPt;CaloMET[GeV/c]";
06116             else
06117               title     = labelname+"DenominatorPt;PFMET[GeV/c]";
06118             MonitorElement * DenominatorPt =  dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
06119             DenominatorPt->getTH1();
06120             
06121             histoname = labelname+"_DenominatorPhi";
06122             title     = labelname+"DenominatorPhi;#Phi";
06123             MonitorElement * DenominatorPhi =  dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
06124             DenominatorPhi->getTH1();
06125 
06126             v->setEffHistos(  NumeratorPt, dummy, dummy, dummy, dummy, NumeratorPhi, dummy, dummy, dummy, dummy,
06127                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
06128                               dummy, dummy, DenominatorPt, dummy, dummy, dummy, dummy, DenominatorPhi, dummy, dummy, 
06129                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
06130                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
06131                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
06132                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
06133                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, 
06134                               dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
06135                               dummy, dummy, dummy, dummy
06136                               );
06137           }// Loop over MET trigger
06138         }
06139       }
06140       
06141     }// This is loop over all efficiency plots
06142     
06143     
06144     if(runStandalone_){
06145       //--------Histos to see WHY trigger is NOT fired----------
06146       int Nbins_       = 10;
06147       int Nmin_        = 0;
06148       int Nmax_        = 10;
06149       int Ptbins_      = 1000;
06150       int Etabins_     = 40;
06151       int Phibins_     = 35;
06152       double PtMin_    = 0.;
06153       double PtMax_    = 1000.;
06154       double EtaMin_   = -5.;
06155       double EtaMax_   =  5.;
06156       double PhiMin_   = -3.14159;
06157       double PhiMax_   =  3.14159;
06158       
06159       std::string dirName4_ = dirname_ + "/TriggerNotFired/";
06160       for(PathInfoCollection::iterator v = hltPathsAll_.begin(); v!= hltPathsAll_.end(); ++v ){
06161         
06162         MonitorElement *dummy;
06163         dummy =  dbe->bookFloat("dummy");
06164         
06165         std::string labelname("ME") ;
06166         std::string histoname(labelname+"");
06167         std::string title(labelname+"");
06168         dbe->setCurrentFolder(dirName4_ + v->getPath());
06169         
06170         histoname = labelname+"_TriggerSummary";
06171         title     = labelname+"Summary of trigger levels"; 
06172         MonitorElement * TriggerSummary = dbe->book1D(histoname.c_str(),title.c_str(),7, -0.5,6.5);
06173         
06174         std::vector<std::string> trigger;
06175         trigger.push_back("Nevt");
06176         trigger.push_back("L1 failed");
06177         trigger.push_back("L1 & HLT failed");
06178         trigger.push_back("L1 failed but not HLT");
06179         trigger.push_back("L1 passed");
06180         trigger.push_back("L1 & HLT passed");
06181         trigger.push_back("L1 passed but not HLT");
06182         
06183         for(unsigned int i =0; i < trigger.size(); i++)
06184           TriggerSummary->setBinLabel(i+1, trigger[i]);
06185         
06186         if((v->getTriggerType().compare("SingleJet_Trigger") == 0)){
06187           histoname = labelname+"_JetPt"; 
06188           title     = labelname+"Leading jet pT;Pt[GeV/c]";
06189           MonitorElement * JetPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
06190           JetPt->getTH1();
06191           
06192           histoname = labelname+"_JetEtaVsPt";
06193           title     = labelname+"Leading jet #eta vs pT;#eta;Pt[GeV/c]";
06194           MonitorElement * JetEtaVsPt = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Ptbins_,PtMin_,PtMax_);
06195           JetEtaVsPt->getTH1();
06196           
06197           histoname = labelname+"_JetPhiVsPt";
06198           title     = labelname+"Leading jet #Phi vs pT;#Phi;Pt[GeV/c]";
06199           MonitorElement * JetPhiVsPt = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Ptbins_,PtMin_,PtMax_);
06200           JetPhiVsPt->getTH1();
06201           
06202           v->setDgnsHistos( TriggerSummary, dummy, JetPt, JetEtaVsPt, JetPhiVsPt, dummy, dummy, dummy, dummy, dummy, dummy); 
06203         }// single Jet trigger  
06204         
06205         if((v->getTriggerType().compare("DiJet_Trigger") == 0)){
06206           histoname = labelname+"_JetSize"; 
06207           title     = labelname+"Jet Size;multiplicity";
06208           MonitorElement * JetSize = dbe->book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
06209           JetSize->getTH1();
06210         
06211           histoname = labelname+"_AvergPt";
06212           title     = labelname+"Average Pt;Pt[GeV/c]";
06213           MonitorElement * Pt12 = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
06214           Pt12->getTH1();
06215           
06216           histoname = labelname+"_AvergEta";
06217           title     = labelname+"Average Eta;#eta";
06218           MonitorElement * Eta12 = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
06219           Eta12->getTH1();
06220           
06221           histoname = labelname+"_PhiDifference";
06222           title     = labelname+"#Delta#Phi;#Delta#Phi";
06223           MonitorElement * Phi12 = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
06224           Phi12->getTH1();
06225           
06226           histoname = labelname+"_Pt3Jet";
06227           title     = labelname+"Pt of 3rd Jet;Pt[GeV/c]";
06228           MonitorElement * Pt3 = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
06229           Pt3->getTH1();
06230           
06231           histoname = labelname+"_Pt12VsPt3Jet";
06232           title     = labelname+"Pt of 3rd Jet vs Average Pt of leading jets;Avergage Pt[GeV/c]; Pt of 3rd Jet [GeV/c]";
06233           MonitorElement * Pt12Pt3 = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
06234           Pt12Pt3->getTH1();
06235           
06236           histoname = labelname+"_Pt12VsPhi12";
06237           title     = labelname+"Average Pt of leading jets vs #Delta#Phi between leading jets;Avergage Pt[GeV/c]; #Delta#Phi";
06238           MonitorElement * Pt12Phi12 = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Phibins_,PhiMin_,PhiMax_);
06239           Pt12Phi12->getTH1();
06240           
06241           v->setDgnsHistos( TriggerSummary, JetSize, dummy, dummy, dummy, Pt12, Eta12, Phi12, Pt3, Pt12Pt3, Pt12Phi12);
06242         }// Dijet Jet trigger
06243         
06244         if((v->getTriggerType().compare("MET_Trigger") == 0)){
06245           histoname = labelname+"_MET";
06246           title     = labelname+"MET;Pt[GeV/c]";
06247           MonitorElement * MET = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
06248           MET->getTH1();
06249           
06250           v->setDgnsHistos(TriggerSummary, dummy, MET, dummy, dummy, dummy, dummy, dummy,dummy,dummy,dummy);
06251         } // MET trigger  
06252         
06253         if((v->getTriggerType().compare("TET_Trigger") == 0)){
06254           histoname = labelname+"_TET";
06255           title     = labelname+"TET;Pt[GeV/c]";
06256           MonitorElement * TET = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
06257           TET->getTH1();
06258           
06259           v->setDgnsHistos(TriggerSummary, dummy, TET, dummy, dummy, dummy, dummy, dummy,dummy,dummy,dummy);
06260         } // TET trigger  
06261       }
06262     }//runStandalone
06263   }  
06264 }
06265 
06266 //--------------------------------------------------------
06267 void JetMETHLTOfflineSource::beginLuminosityBlock(const LuminosityBlock& lumiSeg, 
06268                                                   const EventSetup& context) {
06269 }
06270 
06271 //--------------------------------------------------------
06272 void JetMETHLTOfflineSource::endLuminosityBlock(const LuminosityBlock& lumiSeg, 
06273                                                 const EventSetup& context) {
06274 }
06275 
06276 //ml added method to get L1PathName
06277 const std::string JetMETHLTOfflineSource::getL1ConditionModuleName(const std::string& pathname)
06278 {
06279   
06280   // find L1 condition for numpath with numpath objecttype 
06281   // find PSet for L1 global seed for numpath, 
06282   // list module labels for numpath
06283   std::string l1pathname = "dummy";
06284   
06285   std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(pathname);
06286   
06287   for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin();
06288       numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
06289     
06290     if (hltConfig_.moduleType(*numpathmodule) == "HLTLevel1GTSeed") {
06291       l1pathname = *numpathmodule;
06292       break; 
06293     }
06294   }
06295   return l1pathname;
06296 }
06297 
06298 // - method called once each job just after ending the event loop  ------------
06299 void 
06300 JetMETHLTOfflineSource::endJob() {
06301   delete jetID;
06302 }
06303 
06304 // EndRun
06305 void JetMETHLTOfflineSource::endRun(const edm::Run& run, const edm::EventSetup& c){
06306   if (verbose_) std::cout << "endRun, run " << run.id() << std::endl;
06307 }
06308 
06309 //
06310 bool JetMETHLTOfflineSource::isBarrel(double eta){
06311   bool output = false;
06312   if (fabs(eta)<=1.3) output=true;
06313   return output;
06314 }
06315 
06316 //
06317 bool JetMETHLTOfflineSource::isEndCap(double eta){
06318   bool output = false;
06319   if (fabs(eta)<=3.0 && fabs(eta)>1.3) output=true;
06320   return output;
06321 }
06322 
06323 //
06324 bool JetMETHLTOfflineSource::isForward(double eta){
06325   bool output = false;
06326   if (fabs(eta)>3.0) output=true;
06327   return output;
06328 }
06329 
06330 //
06331 bool JetMETHLTOfflineSource::validPathHLT(std::string pathname){
06332   // hltConfig_ has to be defined first before calling this method
06333   bool output=false;
06334   for (unsigned int j=0; j!=hltConfig_.size(); ++j) {
06335     if (hltConfig_.triggerName(j) == pathname )
06336       output=true;
06337   }
06338   return output;
06339 }
06340 
06341 //
06342 bool JetMETHLTOfflineSource::isHLTPathAccepted(std::string pathName){
06343   // triggerResults_, triggerNames_ has to be defined first before calling this method
06344   bool output=false;
06345   if(&triggerResults_) {
06346     unsigned index = triggerNames_.triggerIndex(pathName);
06347     if(index < triggerNames_.size() && triggerResults_->accept(index)) output = true;
06348   }
06349   return output;
06350 }
06351 
06352 // This returns the position of trigger name defined in summary histograms
06353 double JetMETHLTOfflineSource::TriggerPosition(std::string trigName){
06354   int nbins = rate_All->getTH1()->GetNbinsX();
06355   double binVal = -100;
06356   for(int ibin=1; ibin<nbins+1; ibin++)
06357   {
06358     const char * binLabel = rate_All->getTH1()->GetXaxis()->GetBinLabel(ibin);
06359     if(binLabel[0]=='\0')continue;
06360     //       std::string binLabel_str = string(binLabel);
06361     //       if(binLabel_str.compare(trigName)!=0)continue;
06362     if(trigName.compare(binLabel)!=0)continue;
06363 
06364     if(trigName.compare(binLabel)==0){
06365       binVal = rate_All->getTH1()->GetBinCenter(ibin);
06366       break;
06367     }
06368   }
06369   return binVal;
06370 }
06371 
06372 //
06373 bool JetMETHLTOfflineSource::isTriggerObjectFound(std::string objectName){
06374   // processname_, triggerObj_ has to be defined before calling this method
06375   bool output=false;
06376   edm::InputTag testTag(objectName,"",processname_);
06377   const int index = triggerObj_->filterIndex(testTag);
06378   if ( index >= triggerObj_->sizeFilters() ) {    
06379     edm::LogInfo("JetMETHLTOfflineSource") << "no index "<< index << " of that name ";
06380   } else {       
06381     const trigger::Keys & k = triggerObj_->filterKeys(index);
06382     if (k.size()) output=true;
06383   }
06384   return output;
06385 }