Skip to content

Commit

Permalink
Complying with class member syntax, dropping unused includes ...
Browse files Browse the repository at this point in the history
  • Loading branch information
lathomas committed Jul 8, 2023
1 parent 5cbed8d commit cf85b32
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 35 deletions.
10 changes: 5 additions & 5 deletions DPGAnalysis/Skims/python/IsoPhotonEBSkim_cff.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
53 changes: 23 additions & 30 deletions DPGAnalysis/Skims/src/IsoPhotonEBSelector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -50,19 +47,18 @@ class IsoPhotonEBSelector {
const float getEffectiveArea(float eta) const;
void printEffectiveAreas() const;

edm::EDGetTokenT<double> theRhoToken;
edm::EDGetTokenT<reco::PhotonCollection> thePhotonToken;
edm::Handle<double> _rhoHandle;
const edm::EDGetTokenT<double> theRhoToken_;
edm::Handle<double> rhoHandle_;

std::vector<double> absEtaMin_; // low limit of the eta range
std::vector<double> absEtaMax_; // upper limit of the eta range
std::vector<double> effectiveAreaValues_; // effective area for this eta range
const std::vector<double> absEtaMin_; // low limit of the eta range
const std::vector<double> absEtaMax_; // upper limit of the eta range
const std::vector<double> effectiveAreaValues_; // effective area for this eta range

edm::ParameterSet phIDWP;
const edm::ParameterSet phIDWP_;

vector<double> sigmaIEtaIEtaCut;
vector<double> hOverECut;
vector<double> relCombIso;
const vector<double> sigmaIEtaIEtaCut_;
const vector<double> hOverECut_;
const vector<double> relCombIso_;
};

void IsoPhotonEBSelector::printEffectiveAreas() const {
Expand All @@ -86,20 +82,19 @@ const float IsoPhotonEBSelector::getEffectiveArea(float eta) const {
}

IsoPhotonEBSelector::IsoPhotonEBSelector(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC)
: theRhoToken(iC.consumes<double>(cfg.getParameter<edm::InputTag>("rho"))) {
absEtaMin_ = cfg.getParameter<std::vector<double> >("absEtaMin");
absEtaMax_ = cfg.getParameter<std::vector<double> >("absEtaMax");
effectiveAreaValues_ = cfg.getParameter<std::vector<double> >("effectiveAreaValues");
: theRhoToken_(iC.consumes<double>(cfg.getParameter<edm::InputTag>("rho"))),
absEtaMin_(cfg.getParameter<std::vector<double> >("absEtaMin")),
absEtaMax_(cfg.getParameter<std::vector<double> >("absEtaMax")),
effectiveAreaValues_(cfg.getParameter<std::vector<double> >("effectiveAreaValues")),
phIDWP_(cfg.getParameter<edm::ParameterSet>("phID")),
sigmaIEtaIEtaCut_(phIDWP_.getParameter<std::vector<double> >("full5x5_sigmaIEtaIEtaCut")),
hOverECut_(phIDWP_.getParameter<std::vector<double> >("hOverECut")),
relCombIso_(phIDWP_.getParameter<std::vector<double> >("relCombIsolationWithEACut")) {
//printEffectiveAreas();
phIDWP = cfg.getParameter<edm::ParameterSet>("phID");

sigmaIEtaIEtaCut = phIDWP.getParameter<std::vector<double> >("full5x5_sigmaIEtaIEtaCut");
hOverECut = phIDWP.getParameter<std::vector<double> >("hOverECut");
relCombIso = phIDWP.getParameter<std::vector<double> >("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 {
Expand All @@ -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;
Expand Down

0 comments on commit cf85b32

Please sign in to comment.