CMS 3D CMS Logo

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