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 edm::ParameterSet &c)
 
 CutApplicatorWithEventContentBase (const CutApplicatorWithEventContentBase &)=delete
 
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 edm::ParameterSet &c)
 
 CutApplicatorBase (const CutApplicatorBase &)=delete
 
const std::string & name () const override
 
result_type operator() (const argument_type &) const override final
 
virtual result_type operator() (const pat::ElectronPtr &) const
 
virtual result_type operator() (const reco::PhotonPtr &) const
 
virtual result_type operator() (const pat::PhotonPtr &) const
 
virtual result_type operator() (const reco::MuonPtr &) const
 
virtual result_type operator() (const pat::MuonPtr &) const
 
virtual result_type operator() (const reco::PFTauPtr &) const
 
virtual result_type operator() (const pat::TauPtr &) 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

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 6 of file GsfEleEffAreaPFIsoCut.cc.

Constructor & Destructor Documentation

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

Definition at line 42 of file GsfEleEffAreaPFIsoCut.cc.

References CutApplicatorWithEventContentBase::contentTags_, edm::ParameterSet::getParameter(), rhoString_, and lowPtGsfElectrons_cff::rhoTag.

42  :
44  _isoCutEBLowPt(c.getParameter<double>("isoCutEBLowPt")),
45  _isoCutEBHighPt(c.getParameter<double>("isoCutEBHighPt")),
46  _isoCutEELowPt(c.getParameter<double>("isoCutEELowPt")),
47  _isoCutEEHighPt(c.getParameter<double>("isoCutEEHighPt")),
48  _ptCutOff(c.getParameter<double>("ptCutOff")),
49  _barrelCutOff(c.getParameter<double>("barrelCutOff")),
50  _isRelativeIso(c.getParameter<bool>("isRelativeIso")),
51  _effectiveAreas( (c.getParameter<edm::FileInPath>("effAreasConfigFile")).fullPath())
52 {
53 
55  contentTags_.emplace(rhoString_,rhoTag);
56 
57 }
T getParameter(std::string const &) const
std::unordered_map< std::string, edm::InputTag > contentTags_

Member Function Documentation

CandidateType GsfEleEffAreaPFIsoCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 17 of file GsfEleEffAreaPFIsoCut.cc.

References CutApplicatorBase::ELECTRON.

17  {
18  return ELECTRON;
19  }
void GsfEleEffAreaPFIsoCut::getEventContent ( const edm::EventBase ev)
finalvirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 65 of file GsfEleEffAreaPFIsoCut.cc.

References _rhoHandle, CutApplicatorWithEventContentBase::contentTags_, edm::EventBase::getByLabel(), operator()(), and rhoString_.

65  {
66 
68 }
std::unordered_map< std::string, edm::InputTag > contentTags_
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:92
edm::Handle< double > _rhoHandle
CutApplicatorBase::result_type GsfEleEffAreaPFIsoCut::operator() ( const reco::GsfElectronPtr cand) const
finalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 72 of file GsfEleEffAreaPFIsoCut.cc.

References _barrelCutOff, _effectiveAreas, _isoCutEBHighPt, _isoCutEBLowPt, _isoCutEEHighPt, _isoCutEELowPt, _isRelativeIso, _ptCutOff, _rhoHandle, funct::abs(), f, objects.autophobj::float, EffectiveAreas::getEffectiveArea(), edm::HandleBase::isValid(), SiStripPI::max, reco::GsfElectron::pfIsolationVariables(), reco::LeafCandidate::pt(), rho, reco::GsfElectron::PflowIsolationVariables::sumChargedHadronPt, reco::GsfElectron::PflowIsolationVariables::sumNeutralHadronEt, reco::GsfElectron::PflowIsolationVariables::sumPhotonEt, and reco::GsfElectron::superCluster().

Referenced by getEventContent().

72  {
73 
74  // Establish the cut value
75  double absEta = std::abs(cand->superCluster()->eta());
76  const float isoCut =
77  ( cand->pt() < _ptCutOff ?
79  :
81 
82  // Compute the combined isolation with effective area correction
84  cand->pfIsolationVariables();
85  const float chad = pfIso.sumChargedHadronPt;
86  const float nhad = pfIso.sumNeutralHadronEt;
87  const float pho = pfIso.sumPhotonEt;
88  const float eA = _effectiveAreas.getEffectiveArea( absEta );
89  const float rho = _rhoHandle.isValid() ? (float)(*_rhoHandle) : 0; // std::max likes float arguments
90  const float iso = chad + std::max(0.0f, nhad + pho - rho*eA);
91 
92  // Apply the cut and return the result
93  // Scale by pT if the relative isolation is requested but avoid division by 0
94  return iso < isoCut*(_isRelativeIso ? cand->pt() : 1.);
95 }
const PflowIsolationVariables & pfIsolationVariables() const
Definition: GsfElectron.h:687
double pt() const final
transverse momentum
const float getEffectiveArea(float eta) const
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
Definition: GsfElectron.h:641
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
Definition: GsfElectron.h:640
bool isValid() const
Definition: HandleBase.h:74
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:185
edm::Handle< double > _rhoHandle
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
Definition: GsfElectron.h:639
void GsfEleEffAreaPFIsoCut::setConsumes ( edm::ConsumesCollector cc)
finalvirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 59 of file GsfEleEffAreaPFIsoCut.cc.

References edm::ConsumesCollector::consumes(), CutApplicatorWithEventContentBase::contentTags_, CutApplicatorWithEventContentBase::contentTokens_, rho, and rhoString_.

59  {
60 
61  auto rho = cc.consumes<double>(contentTags_[rhoString_]);
62  contentTokens_.emplace(rhoString_, rho);
63 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
std::unordered_map< std::string, edm::InputTag > contentTags_
double GsfEleEffAreaPFIsoCut::value ( const reco::CandidatePtr cand) const
finalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 97 of file GsfEleEffAreaPFIsoCut.cc.

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

97  {
98  reco::GsfElectronPtr ele(cand);
99  // Establish the cut value
100  double absEta = std::abs(ele->superCluster()->eta());
101 
102  // Compute the combined isolation with effective area correction
104  ele->pfIsolationVariables();
105  const float chad = pfIso.sumChargedHadronPt;
106  const float nhad = pfIso.sumNeutralHadronEt;
107  const float pho = pfIso.sumPhotonEt;
108  float eA = _effectiveAreas.getEffectiveArea( absEta );
109  float rho = (float)(*_rhoHandle); // std::max likes float arguments
110  float iso = chad + std::max(0.0f, nhad + pho - rho*eA);
111 
112  // Divide by pT if the relative isolation is requested
113  if( _isRelativeIso )
114  iso /= ele->pt();
115 
116  // Apply the cut and return the result
117  return iso;
118 }
const float getEffectiveArea(float eta) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
edm::Handle< double > _rhoHandle
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
Definition: GsfElectron.h:639

Member Data Documentation

const float GsfEleEffAreaPFIsoCut::_barrelCutOff
private

Definition at line 26 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

EffectiveAreas GsfEleEffAreaPFIsoCut::_effectiveAreas
private

Definition at line 29 of file GsfEleEffAreaPFIsoCut.cc.

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

const float GsfEleEffAreaPFIsoCut::_isoCutEBHighPt
private

Definition at line 23 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

const float GsfEleEffAreaPFIsoCut::_isoCutEBLowPt
private

Definition at line 23 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

const float GsfEleEffAreaPFIsoCut::_isoCutEEHighPt
private

Definition at line 23 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

const float GsfEleEffAreaPFIsoCut::_isoCutEELowPt
private

Definition at line 23 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

bool GsfEleEffAreaPFIsoCut::_isRelativeIso
private

Definition at line 27 of file GsfEleEffAreaPFIsoCut.cc.

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

const float GsfEleEffAreaPFIsoCut::_ptCutOff
private

Definition at line 25 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

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

Definition at line 31 of file GsfEleEffAreaPFIsoCut.cc.

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

char GsfEleEffAreaPFIsoCut::rhoString_ = "rho"
staticprivate

Definition at line 33 of file GsfEleEffAreaPFIsoCut.cc.

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