CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 overridefinal
 
void getEventContent (const edm::EventBase &) overridefinal
 
 GsfEleEffAreaPFIsoCut (const edm::ParameterSet &c)
 
result_type operator() (const reco::GsfElectronPtr &) const overridefinal
 
void setConsumes (edm::ConsumesCollector &) overridefinal
 
- Public Member Functions inherited from CutApplicatorWithEventContentBase
 CutApplicatorWithEventContentBase (const edm::ParameterSet &c)
 
 CutApplicatorWithEventContentBase (const CutApplicatorWithEventContentBase &)=delete
 
CutApplicatorWithEventContentBaseoperator= (const CutApplicatorWithEventContentBase &)=delete
 
virtual ~CutApplicatorWithEventContentBase ()
 Destructor. More...
 
- Public Member Functions inherited from CutApplicatorBase
virtual result_type asCandidate (const argument_type &) const
 
 CutApplicatorBase (const edm::ParameterSet &c)
 
 CutApplicatorBase (const CutApplicatorBase &)=delete
 
const std::string & name () const
 
virtual result_type operator() (const argument_type &) const 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
 
virtual ~CutApplicatorBase ()
 Destructor. More...
 
- Public Member Functions inherited from candidate_functions::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
}
 
- Protected Attributes inherited from CutApplicatorWithEventContentBase
std::unordered_map
< std::string, edm::InputTag
contentTags_
 
std::unordered_map
< std::string, edm::EDGetToken
contentTokens_
 

Detailed Description

Definition at line 6 of file GsfEleEffAreaPFIsoCut.cc.

Constructor & Destructor Documentation

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

Definition at line 40 of file GsfEleEffAreaPFIsoCut.cc.

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

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

Member Function Documentation

CandidateType GsfEleEffAreaPFIsoCut::candidateType ( ) const
inlinefinaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 15 of file GsfEleEffAreaPFIsoCut.cc.

References CutApplicatorBase::ELECTRON.

15  {
16  return ELECTRON;
17  }
void GsfEleEffAreaPFIsoCut::getEventContent ( const edm::EventBase ev)
finaloverridevirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 63 of file GsfEleEffAreaPFIsoCut.cc.

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

63  {
64 
66 }
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
finaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 70 of file GsfEleEffAreaPFIsoCut.cc.

References _barrelCutOff, _effectiveAreas, _isoCutEBHighPt, _isoCutEBLowPt, _isoCutEEHighPt, _isoCutEELowPt, _isRelativeIso, _ptCutOff, _rhoHandle, funct::abs(), f, EffectiveAreas::getEffectiveArea(), bookConverter::max, rho, reco::GsfElectron::PflowIsolationVariables::sumChargedHadronPt, reco::GsfElectron::PflowIsolationVariables::sumNeutralHadronEt, and reco::GsfElectron::PflowIsolationVariables::sumPhotonEt.

70  {
71 
72  // Establish the cut value
73  double absEta = std::abs(cand->superCluster()->eta());
74  const float isoCut =
75  ( cand->pt() < _ptCutOff ?
77  :
79 
80  // Compute the combined isolation with effective area correction
82  cand->pfIsolationVariables();
83  const float chad = pfIso.sumChargedHadronPt;
84  const float nhad = pfIso.sumNeutralHadronEt;
85  const float pho = pfIso.sumPhotonEt;
86  float eA = _effectiveAreas.getEffectiveArea( absEta );
87  float rho = (float)(*_rhoHandle); // std::max likes float arguments
88  float iso = chad + std::max(0.0f, nhad + pho - rho*eA);
89 
90  // Divide by pT if the relative isolation is requested
91  if( _isRelativeIso )
92  iso /= cand->pt();
93 
94  // Apply the cut and return the result
95  return iso < isoCut;
96 }
Definition: DDAxes.h:10
const float getEffectiveArea(float eta) const
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
Definition: GsfElectron.h:561
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:560
edm::Handle< double > _rhoHandle
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
Definition: GsfElectron.h:559
void GsfEleEffAreaPFIsoCut::setConsumes ( edm::ConsumesCollector cc)
finaloverridevirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 57 of file GsfEleEffAreaPFIsoCut.cc.

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

57  {
58 
59  auto rho = cc.consumes<double>(contentTags_[rhoString_]);
60  contentTokens_.emplace(rhoString_, rho);
61 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
Definition: DDAxes.h:10
std::unordered_map< std::string, edm::InputTag > contentTags_

Member Data Documentation

const float GsfEleEffAreaPFIsoCut::_barrelCutOff
private

Definition at line 24 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

EffectiveAreas GsfEleEffAreaPFIsoCut::_effectiveAreas
private

Definition at line 27 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

const float GsfEleEffAreaPFIsoCut::_isoCutEBHighPt
private

Definition at line 21 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

const float GsfEleEffAreaPFIsoCut::_isoCutEBLowPt
private

Definition at line 21 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

const float GsfEleEffAreaPFIsoCut::_isoCutEEHighPt
private

Definition at line 21 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

const float GsfEleEffAreaPFIsoCut::_isoCutEELowPt
private

Definition at line 21 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

bool GsfEleEffAreaPFIsoCut::_isRelativeIso
private

Definition at line 25 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

const float GsfEleEffAreaPFIsoCut::_ptCutOff
private

Definition at line 23 of file GsfEleEffAreaPFIsoCut.cc.

Referenced by operator()().

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

Definition at line 29 of file GsfEleEffAreaPFIsoCut.cc.

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

char GsfEleEffAreaPFIsoCut::rhoString_ = "rho"
staticprivate

Definition at line 31 of file GsfEleEffAreaPFIsoCut.cc.

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