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
PhoAnyPFIsoWithEACut Class Reference
Inheritance diagram for PhoAnyPFIsoWithEACut:
CutApplicatorWithEventContentBase CutApplicatorBase candidate_functions::CandidateCut

Public Member Functions

CandidateType candidateType () const overridefinal
 
void getEventContent (const edm::EventBase &) overridefinal
 
result_type operator() (const reco::PhotonPtr &) const overridefinal
 
 PhoAnyPFIsoWithEACut (const edm::ParameterSet &c)
 
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 reco::GsfElectronPtr &) const
 
virtual result_type operator() (const pat::ElectronPtr &) 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

edm::Handle< edm::ValueMap
< float > > 
_anyPFIsoMap
 
float _barrelCutOff
 
float _C1_EB
 
float _C1_EE
 
float _C2_EB
 
float _C2_EE
 
EffectiveAreas _effectiveAreas
 
edm::Handle< double > _rhoHandle
 
bool _useRelativeIso
 

Static Private Attributes

static char anyPFIsoWithEA_ [] = "anyPFIsoWithEA"
 
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 PhoAnyPFIsoWithEACut.cc.

Constructor & Destructor Documentation

PhoAnyPFIsoWithEACut::PhoAnyPFIsoWithEACut ( const edm::ParameterSet c)

Definition at line 46 of file PhoAnyPFIsoWithEACut.cc.

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

46  :
48  _C1_EB(c.getParameter<double>("C1_EB")),
49  _C2_EB(c.getParameter<double>("C2_EB")),
50  _C1_EE(c.getParameter<double>("C1_EE")),
51  _C2_EE(c.getParameter<double>("C2_EE")),
52  _barrelCutOff(c.getParameter<double>("barrelCutOff")),
53  _useRelativeIso(c.getParameter<bool>("useRelativeIso")),
54  _effectiveAreas( (c.getParameter<edm::FileInPath>("effAreasConfigFile")).fullPath())
55 {
56 
57  edm::InputTag maptag = c.getParameter<edm::InputTag>("anyPFIsoMap");
58  contentTags_.emplace(anyPFIsoWithEA_,maptag);
59 
60  edm::InputTag rhoTag = c.getParameter<edm::InputTag>("rho");
61  contentTags_.emplace(rhoString_,rhoTag);
62 
63 }
T getParameter(std::string const &) const
CutApplicatorWithEventContentBase(const edm::ParameterSet &c)
std::unordered_map< std::string, edm::InputTag > contentTags_
EffectiveAreas _effectiveAreas

Member Function Documentation

CandidateType PhoAnyPFIsoWithEACut::candidateType ( ) const
inlinefinaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 15 of file PhoAnyPFIsoWithEACut.cc.

References CutApplicatorBase::PHOTON.

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

Implements CutApplicatorWithEventContentBase.

Definition at line 74 of file PhoAnyPFIsoWithEACut.cc.

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

74  {
77 }
std::unordered_map< std::string, edm::InputTag > contentTags_
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:92
edm::Handle< edm::ValueMap< float > > _anyPFIsoMap
edm::Handle< double > _rhoHandle
CutApplicatorBase::result_type PhoAnyPFIsoWithEACut::operator() ( const reco::PhotonPtr cand) const
finaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 81 of file PhoAnyPFIsoWithEACut.cc.

References _barrelCutOff, _C1_EB, _C1_EE, _C2_EB, _C2_EE, _effectiveAreas, _rhoHandle, _useRelativeIso, funct::abs(), EffectiveAreas::getEffectiveArea(), bookConverter::max, and rho.

81  {
82 
83  // Figure out the cut value
84  // The value is generally pt-dependent: C1 + pt * C2
85  double absEta = std::abs(cand->superCluster()->eta());
86  const float anyPFIsoWithEACutValue =
87  ( absEta < _barrelCutOff ?
88  _C1_EB + cand->pt() * _C2_EB
89  :
90  _C1_EE + cand->pt() * _C2_EE
91  );
92 
93  // Retrieve the variable value for this particle
94  float anyPFIso = (*_anyPFIsoMap)[cand];
95 
96  // Apply pile-up correction
97  double eA = _effectiveAreas.getEffectiveArea( absEta );
98  double rho = *_rhoHandle;
99  float anyPFIsoWithEA = std::max(0.0, anyPFIso - rho * eA);
100 
101  // Divide by pT if the relative isolation is requested
102  if( _useRelativeIso )
103  anyPFIsoWithEA /= cand->pt();
104 
105  // Apply the cut and return the result
106  return anyPFIsoWithEA < anyPFIsoWithEACutValue;
107 }
Definition: DDAxes.h:10
const float getEffectiveArea(float eta) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::Handle< double > _rhoHandle
EffectiveAreas _effectiveAreas
void PhoAnyPFIsoWithEACut::setConsumes ( edm::ConsumesCollector cc)
finaloverridevirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 65 of file PhoAnyPFIsoWithEACut.cc.

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

65  {
66  auto anyPFIsoWithEA =
68  contentTokens_.emplace(anyPFIsoWithEA_,anyPFIsoWithEA);
69 
70  auto rho = cc.consumes<double>(contentTags_[rhoString_]);
71  contentTokens_.emplace(rhoString_, rho);
72 }
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

edm::Handle<edm::ValueMap<float> > PhoAnyPFIsoWithEACut::_anyPFIsoMap
private

Definition at line 31 of file PhoAnyPFIsoWithEACut.cc.

Referenced by getEventContent().

float PhoAnyPFIsoWithEACut::_barrelCutOff
private

Definition at line 26 of file PhoAnyPFIsoWithEACut.cc.

Referenced by operator()().

float PhoAnyPFIsoWithEACut::_C1_EB
private

Definition at line 21 of file PhoAnyPFIsoWithEACut.cc.

Referenced by operator()().

float PhoAnyPFIsoWithEACut::_C1_EE
private

Definition at line 23 of file PhoAnyPFIsoWithEACut.cc.

Referenced by operator()().

float PhoAnyPFIsoWithEACut::_C2_EB
private

Definition at line 22 of file PhoAnyPFIsoWithEACut.cc.

Referenced by operator()().

float PhoAnyPFIsoWithEACut::_C2_EE
private

Definition at line 24 of file PhoAnyPFIsoWithEACut.cc.

Referenced by operator()().

EffectiveAreas PhoAnyPFIsoWithEACut::_effectiveAreas
private

Definition at line 29 of file PhoAnyPFIsoWithEACut.cc.

Referenced by operator()().

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

Definition at line 33 of file PhoAnyPFIsoWithEACut.cc.

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

bool PhoAnyPFIsoWithEACut::_useRelativeIso
private

Definition at line 27 of file PhoAnyPFIsoWithEACut.cc.

Referenced by operator()().

char PhoAnyPFIsoWithEACut::anyPFIsoWithEA_ = "anyPFIsoWithEA"
staticprivate

Definition at line 35 of file PhoAnyPFIsoWithEACut.cc.

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

char PhoAnyPFIsoWithEACut::rhoString_ = "rho"
staticprivate

Definition at line 36 of file PhoAnyPFIsoWithEACut.cc.

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