diff --git a/DPGAnalysis/Skims/python/IsoPhotonEBSkim_cff.py b/DPGAnalysis/Skims/python/IsoPhotonEBSkim_cff.py index 6846ada22d0b4..b0e8ec8f110b5 100644 --- a/DPGAnalysis/Skims/python/IsoPhotonEBSkim_cff.py +++ b/DPGAnalysis/Skims/python/IsoPhotonEBSkim_cff.py @@ -1,9 +1,9 @@ import FWCore.ParameterSet.Config as cms -import copy -from HLTrigger.HLTfilters.hltHighLevel_cfi import * -IsoPhotonEBHLTFilter = copy.deepcopy(hltHighLevel) -IsoPhotonEBHLTFilter.throw = cms.bool(False) -IsoPhotonEBHLTFilter.HLTPaths = ["HLT_Photon110EB_TightID_TightIso_v*"] +from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel +IsoPhotonEBHLTFilter = hltHighLevel.clone( + throw = False, + HLTPaths = ["HLT_Photon110EB_TightID_TightIso_v*"] +) # run on MIONAOD RUN_ON_MINIAOD = False diff --git a/DPGAnalysis/Skims/src/IsoPhotonEBSelector.cc b/DPGAnalysis/Skims/src/IsoPhotonEBSelector.cc index d871888bf8453..001f9be48265f 100644 --- a/DPGAnalysis/Skims/src/IsoPhotonEBSelector.cc +++ b/DPGAnalysis/Skims/src/IsoPhotonEBSelector.cc @@ -27,9 +27,6 @@ #include "DataFormats/EgammaCandidates/interface/Photon.h" #include "DataFormats/EgammaCandidates/interface/PhotonFwd.h" -#include "DataFormats/GsfTrackReco/interface/GsfTrack.h" -#include "DataFormats/JetReco/interface/PFJetCollection.h" -#include "CommonTools/UtilAlgos/interface/SingleObjectSelector.h" // #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Framework/interface/ConsumesCollector.h" @@ -50,19 +47,18 @@ class IsoPhotonEBSelector { const float getEffectiveArea(float eta) const; void printEffectiveAreas() const; - edm::EDGetTokenT theRhoToken; - edm::EDGetTokenT thePhotonToken; - edm::Handle _rhoHandle; + const edm::EDGetTokenT theRhoToken_; + edm::Handle rhoHandle_; - std::vector absEtaMin_; // low limit of the eta range - std::vector absEtaMax_; // upper limit of the eta range - std::vector effectiveAreaValues_; // effective area for this eta range + const std::vector absEtaMin_; // low limit of the eta range + const std::vector absEtaMax_; // upper limit of the eta range + const std::vector effectiveAreaValues_; // effective area for this eta range - edm::ParameterSet phIDWP; + const edm::ParameterSet phIDWP_; - vector sigmaIEtaIEtaCut; - vector hOverECut; - vector relCombIso; + const vector sigmaIEtaIEtaCut_; + const vector hOverECut_; + const vector relCombIso_; }; void IsoPhotonEBSelector::printEffectiveAreas() const { @@ -86,20 +82,19 @@ const float IsoPhotonEBSelector::getEffectiveArea(float eta) const { } IsoPhotonEBSelector::IsoPhotonEBSelector(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC) - : theRhoToken(iC.consumes(cfg.getParameter("rho"))) { - absEtaMin_ = cfg.getParameter >("absEtaMin"); - absEtaMax_ = cfg.getParameter >("absEtaMax"); - effectiveAreaValues_ = cfg.getParameter >("effectiveAreaValues"); + : theRhoToken_(iC.consumes(cfg.getParameter("rho"))), + absEtaMin_(cfg.getParameter >("absEtaMin")), + absEtaMax_(cfg.getParameter >("absEtaMax")), + effectiveAreaValues_(cfg.getParameter >("effectiveAreaValues")), + phIDWP_(cfg.getParameter("phID")), + sigmaIEtaIEtaCut_(phIDWP_.getParameter >("full5x5_sigmaIEtaIEtaCut")), + hOverECut_(phIDWP_.getParameter >("hOverECut")), + relCombIso_(phIDWP_.getParameter >("relCombIsolationWithEACut")) { //printEffectiveAreas(); - phIDWP = cfg.getParameter("phID"); - - sigmaIEtaIEtaCut = phIDWP.getParameter >("full5x5_sigmaIEtaIEtaCut"); - hOverECut = phIDWP.getParameter >("hOverECut"); - relCombIso = phIDWP.getParameter >("relCombIsolationWithEACut"); } void IsoPhotonEBSelector::newEvent(const edm::Event& ev, const edm::EventSetup&) { - ev.getByToken(theRhoToken, _rhoHandle); + ev.getByToken(theRhoToken_, rhoHandle_); } bool IsoPhotonEBSelector::operator()(const reco::Photon& ph) const { @@ -113,22 +108,20 @@ bool IsoPhotonEBSelector::operator()(const reco::Photon& ph) const { } if (ph.isEE()) { ind = 1; - if (abseta < 1.479) - return false; // check if it is really needed - if (abseta >= 2.5) + if (abseta <= 1.479 || abseta >= 2.5) return false; // check if it is really needed } - if (ph.full5x5_sigmaIetaIeta() > sigmaIEtaIEtaCut[ind]) + if (ph.full5x5_sigmaIetaIeta() > sigmaIEtaIEtaCut_[ind]) return false; - if (ph.hadronicOverEm() > hOverECut[ind]) + if (ph.hadronicOverEm() > hOverECut_[ind]) return false; const float eA = getEffectiveArea(abseta); - const float rho = _rhoHandle.isValid() ? (float)(*_rhoHandle.product()) : 0; + const float rho = rhoHandle_.isValid() ? (float)(*rhoHandle_.product()) : 0; if ((ph.getPflowIsolationVariables().chargedHadronIso + std::max(float(0.0), ph.getPflowIsolationVariables().neutralHadronIso + ph.getPflowIsolationVariables().photonIso - - eA * rho)) > relCombIso[ind] * pt_e) + eA * rho)) > relCombIso_[ind] * pt_e) return false; return true;