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

Public Member Functions

CandidateType candidateType () const overridefinal
 
void getEventContent (const edm::EventBase &) overridefinal
 
 GsfEleDeltaBetaIsoCut (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
 
edm::Handle< edm::ValueMap
< float > > 
_chad_iso
 
const float _deltaBetaConstant
 
const float _isoCutEBHighPt
 
const float _isoCutEBLowPt
 
const float _isoCutEEHighPt
 
const float _isoCutEELowPt
 
edm::Handle< edm::ValueMap
< float > > 
_nhad_iso
 
edm::Handle< edm::ValueMap
< float > > 
_ph_iso
 
const float _ptCutOff
 
edm::Handle< edm::ValueMap
< float > > 
_PUchad_iso
 
bool _relativeIso
 

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 8 of file GsfEleDeltaBetaIsoCut.cc.

Constructor & Destructor Documentation

GsfEleDeltaBetaIsoCut::GsfEleDeltaBetaIsoCut ( const edm::ParameterSet c)

Definition at line 32 of file GsfEleDeltaBetaIsoCut.cc.

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

32  :
34  _isoCutEBLowPt(c.getParameter<double>("isoCutEBLowPt")),
35  _isoCutEBHighPt(c.getParameter<double>("isoCutEBHighPt")),
36  _isoCutEELowPt(c.getParameter<double>("isoCutEELowPt")),
37  _isoCutEEHighPt(c.getParameter<double>("isoCutEEHighPt")),
38  _deltaBetaConstant(c.getParameter<double>("deltaBetaConstant")),
39  _ptCutOff(c.getParameter<double>("ptCutOff")),
40  _barrelCutOff(c.getParameter<double>("barrelCutOff")),
41  _relativeIso(c.getParameter<bool>("isRelativeIso")) {
42  edm::InputTag chadtag = c.getParameter<edm::InputTag>("chargedHadronIsoDR03Src");
43  edm::InputTag nhadtag = c.getParameter<edm::InputTag>("neutralHadronIsoDR03Src");
44  edm::InputTag phtag = c.getParameter<edm::InputTag>("photonIsoDR03Src");
45  edm::InputTag PUchadtag = c.getParameter<edm::InputTag>("puChargedHadronIsoDR03Src");
46  contentTags_.emplace("chad",chadtag);
47  contentTags_.emplace("nhad",nhadtag);
48  contentTags_.emplace("pho",phtag);
49  contentTags_.emplace("puchad",PUchadtag);
50 }
T getParameter(std::string const &) const
CutApplicatorWithEventContentBase(const edm::ParameterSet &c)
std::unordered_map< std::string, edm::InputTag > contentTags_

Member Function Documentation

CandidateType GsfEleDeltaBetaIsoCut::candidateType ( ) const
inlinefinaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 17 of file GsfEleDeltaBetaIsoCut.cc.

References CutApplicatorBase::ELECTRON.

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

Implements CutApplicatorWithEventContentBase.

Definition at line 67 of file GsfEleDeltaBetaIsoCut.cc.

References _chad_iso, _nhad_iso, _ph_iso, _PUchad_iso, CutApplicatorWithEventContentBase::contentTags_, and edm::EventBase::getByLabel().

67  {
68  ev.getByLabel(contentTags_["chad"],_chad_iso);
69  ev.getByLabel(contentTags_["nhad"],_nhad_iso);
70  ev.getByLabel(contentTags_["pho"],_ph_iso);
71  ev.getByLabel(contentTags_["puchad"],_PUchad_iso);
72 }
edm::Handle< edm::ValueMap< float > > _nhad_iso
edm::Handle< edm::ValueMap< float > > _chad_iso
edm::Handle< edm::ValueMap< float > > _ph_iso
std::unordered_map< std::string, edm::InputTag > contentTags_
edm::Handle< edm::ValueMap< float > > _PUchad_iso
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:87
CutApplicatorBase::result_type GsfEleDeltaBetaIsoCut::operator() ( const reco::GsfElectronPtr cand) const
finaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 76 of file GsfEleDeltaBetaIsoCut.cc.

References _barrelCutOff, _deltaBetaConstant, _isoCutEBHighPt, _isoCutEBLowPt, _isoCutEEHighPt, _isoCutEELowPt, _ptCutOff, _relativeIso, funct::abs(), f, and bookConverter::max.

76  {
77  const float isoCut =
78  ( cand->p4().pt() < _ptCutOff ?
79  ( std::abs(cand->superCluster()->position().eta()) < _barrelCutOff ?
81  ( std::abs(cand->superCluster()->position().eta()) < _barrelCutOff ?
83  const float chad = (*_chad_iso)[cand];
84  const float nhad = (*_nhad_iso)[cand];
85  const float pho = (*_ph_iso)[cand];
86  const float puchad = (*_PUchad_iso)[cand];
87  float iso = chad + std::max(0.0f, nhad + pho - _deltaBetaConstant*puchad);
88  if( _relativeIso ) iso /= cand->p4().pt();
89  return iso < isoCut;
90 }
T eta() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
static int position[264][3]
Definition: ReadPGInfo.cc:509
void GsfEleDeltaBetaIsoCut::setConsumes ( edm::ConsumesCollector cc)
finaloverridevirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 52 of file GsfEleDeltaBetaIsoCut.cc.

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

52  {
53  auto chad =
55  contentTokens_.emplace("chad",chad);
56  auto nhad =
58  contentTokens_.emplace("nhad",nhad);
59  auto pho =
61  contentTokens_.emplace("pho",pho);
62  auto puchad =
64  contentTokens_.emplace("puchad",puchad);
65 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
std::unordered_map< std::string, edm::InputTag > contentTags_

Member Data Documentation

const float GsfEleDeltaBetaIsoCut::_barrelCutOff
private

Definition at line 23 of file GsfEleDeltaBetaIsoCut.cc.

Referenced by operator()().

edm::Handle<edm::ValueMap<float> > GsfEleDeltaBetaIsoCut::_chad_iso
private

Definition at line 25 of file GsfEleDeltaBetaIsoCut.cc.

Referenced by getEventContent().

const float GsfEleDeltaBetaIsoCut::_deltaBetaConstant
private

Definition at line 23 of file GsfEleDeltaBetaIsoCut.cc.

Referenced by operator()().

const float GsfEleDeltaBetaIsoCut::_isoCutEBHighPt
private

Definition at line 22 of file GsfEleDeltaBetaIsoCut.cc.

Referenced by operator()().

const float GsfEleDeltaBetaIsoCut::_isoCutEBLowPt
private

Definition at line 22 of file GsfEleDeltaBetaIsoCut.cc.

Referenced by operator()().

const float GsfEleDeltaBetaIsoCut::_isoCutEEHighPt
private

Definition at line 22 of file GsfEleDeltaBetaIsoCut.cc.

Referenced by operator()().

const float GsfEleDeltaBetaIsoCut::_isoCutEELowPt
private

Definition at line 22 of file GsfEleDeltaBetaIsoCut.cc.

Referenced by operator()().

edm::Handle<edm::ValueMap<float> > GsfEleDeltaBetaIsoCut::_nhad_iso
private

Definition at line 25 of file GsfEleDeltaBetaIsoCut.cc.

Referenced by getEventContent().

edm::Handle<edm::ValueMap<float> > GsfEleDeltaBetaIsoCut::_ph_iso
private

Definition at line 25 of file GsfEleDeltaBetaIsoCut.cc.

Referenced by getEventContent().

const float GsfEleDeltaBetaIsoCut::_ptCutOff
private

Definition at line 23 of file GsfEleDeltaBetaIsoCut.cc.

Referenced by operator()().

edm::Handle<edm::ValueMap<float> > GsfEleDeltaBetaIsoCut::_PUchad_iso
private

Definition at line 25 of file GsfEleDeltaBetaIsoCut.cc.

Referenced by getEventContent().

bool GsfEleDeltaBetaIsoCut::_relativeIso
private

Definition at line 24 of file GsfEleDeltaBetaIsoCut.cc.

Referenced by operator()().