CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
GsfEleEffAreaPFIsoCut Class Reference
Inheritance diagram for GsfEleEffAreaPFIsoCut:
CutApplicatorWithEventContentBase CutApplicatorBase candidate_functions::CandidateCut

Public Member Functions

CandidateType candidateType () const final
 
void getEventContent (const edm::EventBase &) final
 
 GsfEleEffAreaPFIsoCut (const edm::ParameterSet &c)
 
result_type operator() (const reco::GsfElectronPtr &) const final
 
void setConsumes (edm::ConsumesCollector &) final
 
double value (const reco::CandidatePtr &cand) const final
 
- Public Member Functions inherited from CutApplicatorWithEventContentBase
 CutApplicatorWithEventContentBase ()
 
 CutApplicatorWithEventContentBase (const CutApplicatorWithEventContentBase &)=delete
 
 CutApplicatorWithEventContentBase (const edm::ParameterSet &c)
 
CutApplicatorWithEventContentBaseoperator= (const CutApplicatorWithEventContentBase &)=delete
 
 ~CutApplicatorWithEventContentBase () override
 Destructor. More...
 
- Public Member Functions inherited from CutApplicatorBase
virtual result_type asCandidate (const argument_type &) const
 
 CutApplicatorBase ()
 
 CutApplicatorBase (const CutApplicatorBase &)=delete
 
 CutApplicatorBase (const edm::ParameterSet &c)
 
const std::string & name () const override
 
result_type operator() (const argument_type &) const final
 
virtual result_type operator() (const pat::ElectronPtr &) const
 
virtual result_type operator() (const pat::MuonPtr &) const
 
virtual result_type operator() (const pat::PhotonPtr &) const
 
virtual result_type operator() (const pat::TauPtr &) const
 
virtual result_type operator() (const reco::MuonPtr &) const
 
virtual result_type operator() (const reco::PFTauPtr &) const
 
virtual result_type operator() (const reco::PhotonPtr &) const
 
CutApplicatorBaseoperator= (const CutApplicatorBase &)=delete
 
 ~CutApplicatorBase () override
 Destructor. More...
 
- Public Member Functions inherited from candidate_functions::CandidateCut
 CandidateCut ()
 
virtual ~CandidateCut ()
 

Private Attributes

const float _barrelCutOff
 
EffectiveAreas _effectiveAreas
 
const float _isoCutEBHighPt
 
const float _isoCutEBLowPt
 
const float _isoCutEEHighPt
 
const float _isoCutEELowPt
 
bool _isRelativeIso
 
const float _ptCutOff
 
edm::Handle< double > _rhoHandle
 

Static Private Attributes

constexpr static char rhoString_ [] = "rho"
 

Additional Inherited Members

- Public Types inherited from CutApplicatorBase
enum  CandidateType {
  NONE, ELECTRON, MUON, PHOTON,
  TAU, PATELECTRON, PATMUON, PATPHOTON,
  PATTAU
}
 
- Public Types inherited from candidate_functions::CandidateCut
using argument_type = reco::CandidatePtr
 
using result_type = bool
 
- Protected Attributes inherited from CutApplicatorWithEventContentBase
std::unordered_map< std::string, edm::InputTagcontentTags_
 
std::unordered_map< std::string, edm::EDGetTokencontentTokens_
 

Detailed Description

Definition at line 5 of file GsfEleEffAreaPFIsoCut.cc.

Constructor & Destructor Documentation

◆ GsfEleEffAreaPFIsoCut()

GsfEleEffAreaPFIsoCut::GsfEleEffAreaPFIsoCut ( const edm::ParameterSet c)

Definition at line 37 of file GsfEleEffAreaPFIsoCut.cc.

39  _isoCutEBLowPt(c.getParameter<double>("isoCutEBLowPt")),
40  _isoCutEBHighPt(c.getParameter<double>("isoCutEBHighPt")),
41  _isoCutEELowPt(c.getParameter<double>("isoCutEELowPt")),
42  _isoCutEEHighPt(c.getParameter<double>("isoCutEEHighPt")),
43  _ptCutOff(c.getParameter<double>("ptCutOff")),
44  _barrelCutOff(c.getParameter<double>("barrelCutOff")),
45  _isRelativeIso(c.getParameter<bool>("isRelativeIso")),
46  _effectiveAreas((c.getParameter<edm::FileInPath>("effAreasConfigFile")).fullPath()) {
47  edm::InputTag rhoTag = c.getParameter<edm::InputTag>("rho");
48  contentTags_.emplace(rhoString_, rhoTag);
49 }

References HltBtagPostValidation_cff::c, CutApplicatorWithEventContentBase::contentTags_, rhoString_, and HLT_2018_cff::rhoTag.

Member Function Documentation

◆ candidateType()

CandidateType GsfEleEffAreaPFIsoCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 16 of file GsfEleEffAreaPFIsoCut.cc.

16 { return ELECTRON; }

References CutApplicatorBase::ELECTRON.

◆ getEventContent()

void GsfEleEffAreaPFIsoCut::getEventContent ( const edm::EventBase ev)
finalvirtual

◆ operator()()

CutApplicatorBase::result_type GsfEleEffAreaPFIsoCut::operator() ( const reco::GsfElectronPtr cand) const
finalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 60 of file GsfEleEffAreaPFIsoCut.cc.

60  {
61  // Establish the cut value
62  double absEta = std::abs(cand->superCluster()->eta());
63  const float isoCut = (cand->pt() < _ptCutOff ? (absEta < _barrelCutOff ? _isoCutEBLowPt : _isoCutEELowPt)
65 
66  // Compute the combined isolation with effective area correction
67  const reco::GsfElectron::PflowIsolationVariables& pfIso = cand->pfIsolationVariables();
68  const float chad = pfIso.sumChargedHadronPt;
69  const float nhad = pfIso.sumNeutralHadronEt;
70  const float pho = pfIso.sumPhotonEt;
71  const float eA = _effectiveAreas.getEffectiveArea(absEta);
72  const float rho = _rhoHandle.isValid() ? (float)(*_rhoHandle) : 0; // std::max likes float arguments
73  const float iso = chad + std::max(0.0f, nhad + pho - rho * eA);
74 
75  // Apply the cut and return the result
76  // Scale by pT if the relative isolation is requested but avoid division by 0
77  return iso < isoCut * (_isRelativeIso ? cand->pt() : 1.);
78 }

References _barrelCutOff, _effectiveAreas, _isoCutEBHighPt, _isoCutEBLowPt, _isoCutEEHighPt, _isoCutEELowPt, _isRelativeIso, _ptCutOff, _rhoHandle, funct::abs(), f, dqmMemoryStats::float, EffectiveAreas::getEffectiveArea(), zSelection_cfi::isoCut, edm::HandleBase::isValid(), SiStripPI::max, rho, reco::GsfElectron::PflowIsolationVariables::sumChargedHadronPt, reco::GsfElectron::PflowIsolationVariables::sumNeutralHadronEt, and reco::GsfElectron::PflowIsolationVariables::sumPhotonEt.

◆ setConsumes()

void GsfEleEffAreaPFIsoCut::setConsumes ( edm::ConsumesCollector cc)
finalvirtual

◆ value()

double GsfEleEffAreaPFIsoCut::value ( const reco::CandidatePtr cand) const
finalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 80 of file GsfEleEffAreaPFIsoCut.cc.

80  {
82  // Establish the cut value
83  double absEta = std::abs(ele->superCluster()->eta());
84 
85  // Compute the combined isolation with effective area correction
86  const reco::GsfElectron::PflowIsolationVariables& pfIso = ele->pfIsolationVariables();
87  const float chad = pfIso.sumChargedHadronPt;
88  const float nhad = pfIso.sumNeutralHadronEt;
89  const float pho = pfIso.sumPhotonEt;
90  float eA = _effectiveAreas.getEffectiveArea(absEta);
91  float rho = (float)(*_rhoHandle); // std::max likes float arguments
92  float iso = chad + std::max(0.0f, nhad + pho - rho * eA);
93 
94  // Divide by pT if the relative isolation is requested
95  if (_isRelativeIso)
96  iso /= ele->pt();
97 
98  // Apply the cut and return the result
99  return iso;
100 }

References _effectiveAreas, _isRelativeIso, _rhoHandle, funct::abs(), f, dqmMemoryStats::float, EffectiveAreas::getEffectiveArea(), SiStripPI::max, reco::GsfElectron::pfIsolationVariables(), reco::LeafCandidate::pt(), rho, reco::GsfElectron::PflowIsolationVariables::sumChargedHadronPt, and reco::GsfElectron::superCluster().

Member Data Documentation

◆ _barrelCutOff

const float GsfEleEffAreaPFIsoCut::_barrelCutOff
private

Definition at line 23 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

◆ _effectiveAreas

EffectiveAreas GsfEleEffAreaPFIsoCut::_effectiveAreas
private

Definition at line 26 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()(), and value().

◆ _isoCutEBHighPt

const float GsfEleEffAreaPFIsoCut::_isoCutEBHighPt
private

Definition at line 20 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

◆ _isoCutEBLowPt

const float GsfEleEffAreaPFIsoCut::_isoCutEBLowPt
private

Definition at line 20 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

◆ _isoCutEEHighPt

const float GsfEleEffAreaPFIsoCut::_isoCutEEHighPt
private

Definition at line 20 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

◆ _isoCutEELowPt

const float GsfEleEffAreaPFIsoCut::_isoCutEELowPt
private

Definition at line 20 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

◆ _isRelativeIso

bool GsfEleEffAreaPFIsoCut::_isRelativeIso
private

Definition at line 24 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()(), and value().

◆ _ptCutOff

const float GsfEleEffAreaPFIsoCut::_ptCutOff
private

Definition at line 22 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

◆ _rhoHandle

edm::Handle<double> GsfEleEffAreaPFIsoCut::_rhoHandle
private

Definition at line 28 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by getEventContent(), operator()(), and value().

◆ rhoString_

constexpr char GsfEleEffAreaPFIsoCut::rhoString_ = "rho"
staticconstexprprivate

Definition at line 30 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by getEventContent(), GsfEleEffAreaPFIsoCut(), and setConsumes().

dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
GsfEleEffAreaPFIsoCut::_isoCutEBLowPt
const float _isoCutEBLowPt
Definition: GsfEleEffAreaPFIsoCut.cc:20
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
GsfEleEffAreaPFIsoCut::_isoCutEELowPt
const float _isoCutEELowPt
Definition: GsfEleEffAreaPFIsoCut.cc:20
reco::GsfElectron::PflowIsolationVariables
Definition: GsfElectron.h:606
HLT_2018_cff.rhoTag
rhoTag
Definition: HLT_2018_cff.py:13606
CutApplicatorWithEventContentBase::contentTags_
std::unordered_map< std::string, edm::InputTag > contentTags_
Definition: CutApplicatorWithEventContentBase.h:35
edm::FileInPath
Definition: FileInPath.h:64
reco::GsfElectron::PflowIsolationVariables::sumPhotonEt
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
Definition: GsfElectron.h:610
zSelection_cfi.isoCut
isoCut
Definition: zSelection_cfi.py:5
GsfEleEffAreaPFIsoCut::_isoCutEEHighPt
const float _isoCutEEHighPt
Definition: GsfEleEffAreaPFIsoCut.cc:20
DDAxes::rho
GsfEleEffAreaPFIsoCut::_barrelCutOff
const float _barrelCutOff
Definition: GsfEleEffAreaPFIsoCut.cc:23
CutApplicatorWithEventContentBase::CutApplicatorWithEventContentBase
CutApplicatorWithEventContentBase()
Definition: CutApplicatorWithEventContentBase.h:21
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
GsfEleEffAreaPFIsoCut::rhoString_
constexpr static char rhoString_[]
Definition: GsfEleEffAreaPFIsoCut.cc:30
cand
Definition: decayParser.h:34
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
cc
reco::GsfElectron::PflowIsolationVariables::sumNeutralHadronEt
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
Definition: GsfElectron.h:609
edm::Ptr< reco::GsfElectron >
GsfEleEffAreaPFIsoCut::_effectiveAreas
EffectiveAreas _effectiveAreas
Definition: GsfEleEffAreaPFIsoCut.cc:26
GsfEleEffAreaPFIsoCut::_rhoHandle
edm::Handle< double > _rhoHandle
Definition: GsfEleEffAreaPFIsoCut.cc:28
GsfEleEffAreaPFIsoCut::_ptCutOff
const float _ptCutOff
Definition: GsfEleEffAreaPFIsoCut.cc:22
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
CutApplicatorWithEventContentBase::contentTokens_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
Definition: CutApplicatorWithEventContentBase.h:40
EffectiveAreas::getEffectiveArea
const float getEffectiveArea(float eta) const
Definition: EffectiveAreas.cc:44
GsfEleEffAreaPFIsoCut::_isoCutEBHighPt
const float _isoCutEBHighPt
Definition: GsfEleEffAreaPFIsoCut.cc:20
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
CutApplicatorBase::ELECTRON
Definition: CutApplicatorBase.h:47
GsfEleEffAreaPFIsoCut::_isRelativeIso
bool _isRelativeIso
Definition: GsfEleEffAreaPFIsoCut.cc:24
edm::InputTag
Definition: InputTag.h:15
reco::GsfElectron::PflowIsolationVariables::sumChargedHadronPt
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
Definition: GsfElectron.h:608