CMS 3D CMS Logo

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

Public Types

enum  IsoType { UNDEF = -1, ISO_ECAL = 0, ISO_HCAL = 1 }
 
- 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
 

Public Member Functions

CandidateType candidateType () const final
 
void getEventContent (const edm::EventBase &) final
 
 GsfEleCalPFClusterIsoCut (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_
 
const int isoType_
 
bool isRelativeIso_
 
const float ptCutOff_
 
edm::Handle< double > rhoHandle_
 

Static Private Attributes

constexpr static char rhoString_ [] = "rho"
 

Additional Inherited Members

- 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 GsfEleCalPFClusterIsoCut.cc.

Member Enumeration Documentation

◆ IsoType

Enumerator
UNDEF 
ISO_ECAL 
ISO_HCAL 

Definition at line 7 of file GsfEleCalPFClusterIsoCut.cc.

7 { UNDEF = -1, ISO_ECAL = 0, ISO_HCAL = 1 };

Constructor & Destructor Documentation

◆ GsfEleCalPFClusterIsoCut()

GsfEleCalPFClusterIsoCut::GsfEleCalPFClusterIsoCut ( const edm::ParameterSet c)

Definition at line 40 of file GsfEleCalPFClusterIsoCut.cc.

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  isoType_(c.getParameter<int>("isoType")),
47  ptCutOff_(c.getParameter<double>("ptCutOff")),
48  barrelCutOff_(c.getParameter<double>("barrelCutOff")),
49  isRelativeIso_(c.getParameter<bool>("isRelativeIso")),
50  effectiveAreas_((c.getParameter<edm::FileInPath>("effAreasConfigFile")).fullPath()) {
51  edm::InputTag rhoTag = c.getParameter<edm::InputTag>("rho");
52  contentTags_.emplace(rhoString_, rhoTag);
53 }

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

Member Function Documentation

◆ candidateType()

CandidateType GsfEleCalPFClusterIsoCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 18 of file GsfEleCalPFClusterIsoCut.cc.

18 { return ELECTRON; }

References CutApplicatorBase::ELECTRON.

◆ getEventContent()

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

◆ operator()()

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

Reimplemented from CutApplicatorBase.

Definition at line 64 of file GsfEleCalPFClusterIsoCut.cc.

64  {
65  // Establish the cut value
66  double absEta = std::abs(cand->superCluster()->eta());
67 
68  const pat::Electron* elPat = dynamic_cast<const pat::Electron*>(cand.get());
69  if (!elPat) {
70  throw cms::Exception("ERROR: this VID selection is meant to be run on miniAOD/PAT only")
71  << std::endl
72  << "Change input format to PAT/miniAOD or contact Egamma experts" << std::endl
73  << std::endl;
74  }
75 
76  const float isoCut = (cand->pt() < ptCutOff_ ? (absEta < barrelCutOff_ ? isoCutEBLowPt_ : isoCutEELowPt_)
78 
79  const float eA = effectiveAreas_.getEffectiveArea(absEta);
80  const float rho = rhoHandle_.isValid() ? (float)(*rhoHandle_) : 0; // std::max likes float arguments
81 
82  float isoValue = -999;
83  if (isoType_ == ISO_ECAL) {
84  isoValue = elPat->ecalPFClusterIso();
85  } else if (isoType_ == ISO_HCAL) {
86  isoValue = elPat->hcalPFClusterIso();
87  } else {
88  throw cms::Exception("ERROR: unknown type requested for PF cluster isolation.")
89  << std::endl
90  << "Check VID configuration." << std::endl;
91  }
92  float isoValueCorr = std::max(0.0f, isoValue - rho * eA);
93 
94  // Apply the cut and return the result
95  // Scale by pT if the relative isolation is requested but avoid division by 0
96  return isoValueCorr < isoCut * (isRelativeIso_ ? cand->pt() : 1.);
97 }

References funct::abs(), barrelCutOff_, effectiveAreas_, Exception, f, dqmMemoryStats::float, EffectiveAreas::getEffectiveArea(), ISO_ECAL, ISO_HCAL, zSelection_cfi::isoCut, isoCutEBHighPt_, isoCutEBLowPt_, isoCutEEHighPt_, isoCutEELowPt_, isoType_, isRelativeIso_, edm::HandleBase::isValid(), SiStripPI::max, ptCutOff_, rho, and rhoHandle_.

◆ setConsumes()

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

◆ value()

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

Implements candidate_functions::CandidateCut.

Definition at line 99 of file GsfEleCalPFClusterIsoCut.cc.

99  {
101  // Establish the cut value
102  double absEta = std::abs(ele->superCluster()->eta());
103 
104  const pat::Electron* elPat = dynamic_cast<const pat::Electron*>(ele.get());
105  if (!elPat) {
106  throw cms::Exception("ERROR: this VID selection is meant to be run on miniAOD/PAT only")
107  << std::endl
108  << "Change input format to PAT/miniAOD or contact Egamma experts" << std::endl
109  << std::endl;
110  }
111 
112  const float eA = effectiveAreas_.getEffectiveArea(absEta);
113  const float rho = rhoHandle_.isValid() ? (float)(*rhoHandle_) : 0; // std::max likes float arguments
114 
115  float isoValue = -999;
116  if (isoType_ == ISO_ECAL) {
117  isoValue = elPat->ecalPFClusterIso();
118  } else if (isoType_ == ISO_HCAL) {
119  isoValue = elPat->hcalPFClusterIso();
120  } else {
121  throw cms::Exception("ERROR: unknown type requested for PF cluster isolation.")
122  << std::endl
123  << "Check VID configuration." << std::endl;
124  }
125  float isoValueCorr = std::max(0.0f, isoValue - rho * eA);
126 
127  // Divide by pT if the relative isolation is requested
128  if (isRelativeIso_)
129  isoValueCorr /= ele->pt();
130 
131  // Apply the cut and return the result
132  return isoValueCorr;
133 }

References funct::abs(), effectiveAreas_, Exception, f, dqmMemoryStats::float, edm::Ptr< T >::get(), EffectiveAreas::getEffectiveArea(), ISO_ECAL, ISO_HCAL, isoType_, isRelativeIso_, edm::HandleBase::isValid(), SiStripPI::max, reco::LeafCandidate::pt(), rho, rhoHandle_, and reco::GsfElectron::superCluster().

Member Data Documentation

◆ barrelCutOff_

const float GsfEleCalPFClusterIsoCut::barrelCutOff_
private

Definition at line 26 of file GsfEleCalPFClusterIsoCut.cc.

Referenced by operator()().

◆ effectiveAreas_

EffectiveAreas GsfEleCalPFClusterIsoCut::effectiveAreas_
private

Definition at line 29 of file GsfEleCalPFClusterIsoCut.cc.

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

◆ isoCutEBHighPt_

const float GsfEleCalPFClusterIsoCut::isoCutEBHighPt_
private

Definition at line 22 of file GsfEleCalPFClusterIsoCut.cc.

Referenced by operator()().

◆ isoCutEBLowPt_

const float GsfEleCalPFClusterIsoCut::isoCutEBLowPt_
private

Definition at line 22 of file GsfEleCalPFClusterIsoCut.cc.

Referenced by operator()().

◆ isoCutEEHighPt_

const float GsfEleCalPFClusterIsoCut::isoCutEEHighPt_
private

Definition at line 22 of file GsfEleCalPFClusterIsoCut.cc.

Referenced by operator()().

◆ isoCutEELowPt_

const float GsfEleCalPFClusterIsoCut::isoCutEELowPt_
private

Definition at line 22 of file GsfEleCalPFClusterIsoCut.cc.

Referenced by operator()().

◆ isoType_

const int GsfEleCalPFClusterIsoCut::isoType_
private

Definition at line 24 of file GsfEleCalPFClusterIsoCut.cc.

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

◆ isRelativeIso_

bool GsfEleCalPFClusterIsoCut::isRelativeIso_
private

Definition at line 27 of file GsfEleCalPFClusterIsoCut.cc.

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

◆ ptCutOff_

const float GsfEleCalPFClusterIsoCut::ptCutOff_
private

Definition at line 25 of file GsfEleCalPFClusterIsoCut.cc.

Referenced by operator()().

◆ rhoHandle_

edm::Handle<double> GsfEleCalPFClusterIsoCut::rhoHandle_
private

Definition at line 31 of file GsfEleCalPFClusterIsoCut.cc.

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

◆ rhoString_

constexpr char GsfEleCalPFClusterIsoCut::rhoString_ = "rho"
staticconstexprprivate
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
GsfEleCalPFClusterIsoCut::isoCutEBLowPt_
const float isoCutEBLowPt_
Definition: GsfEleCalPFClusterIsoCut.cc:22
GsfEleCalPFClusterIsoCut::isoCutEEHighPt_
const float isoCutEEHighPt_
Definition: GsfEleCalPFClusterIsoCut.cc:22
GsfEleCalPFClusterIsoCut::isoType_
const int isoType_
Definition: GsfEleCalPFClusterIsoCut.cc:24
GsfEleCalPFClusterIsoCut::isoCutEBHighPt_
const float isoCutEBHighPt_
Definition: GsfEleCalPFClusterIsoCut.cc:22
CutApplicatorWithEventContentBase::contentTags_
std::unordered_map< std::string, edm::InputTag > contentTags_
Definition: CutApplicatorWithEventContentBase.h:35
HLT_FULL_cff.rhoTag
rhoTag
Definition: HLT_FULL_cff.py:15049
edm::FileInPath
Definition: FileInPath.h:64
GsfEleCalPFClusterIsoCut::barrelCutOff_
const float barrelCutOff_
Definition: GsfEleCalPFClusterIsoCut.cc:26
zSelection_cfi.isoCut
isoCut
Definition: zSelection_cfi.py:5
GsfEleCalPFClusterIsoCut::isRelativeIso_
bool isRelativeIso_
Definition: GsfEleCalPFClusterIsoCut.cc:27
DDAxes::rho
GsfEleCalPFClusterIsoCut::rhoHandle_
edm::Handle< double > rhoHandle_
Definition: GsfEleCalPFClusterIsoCut.cc:31
CutApplicatorWithEventContentBase::CutApplicatorWithEventContentBase
CutApplicatorWithEventContentBase()
Definition: CutApplicatorWithEventContentBase.h:21
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
cand
Definition: decayParser.h:32
GsfEleCalPFClusterIsoCut::UNDEF
Definition: GsfEleCalPFClusterIsoCut.cc:7
GsfEleCalPFClusterIsoCut::effectiveAreas_
EffectiveAreas effectiveAreas_
Definition: GsfEleCalPFClusterIsoCut.cc:29
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
cc
edm::Ptr< reco::GsfElectron >
GsfEleCalPFClusterIsoCut::isoCutEELowPt_
const float isoCutEELowPt_
Definition: GsfEleCalPFClusterIsoCut.cc:22
GsfEleCalPFClusterIsoCut::ptCutOff_
const float ptCutOff_
Definition: GsfEleCalPFClusterIsoCut.cc:25
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
CutApplicatorWithEventContentBase::contentTokens_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
Definition: CutApplicatorWithEventContentBase.h:40
Exception
Definition: hltDiff.cc:246
EffectiveAreas::getEffectiveArea
const float getEffectiveArea(float eta) const
Definition: EffectiveAreas.cc:44
pat::Electron
Analysis-level electron class.
Definition: Electron.h:51
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GsfEleCalPFClusterIsoCut::ISO_HCAL
Definition: GsfEleCalPFClusterIsoCut.cc:7
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
GsfEleCalPFClusterIsoCut::ISO_ECAL
Definition: GsfEleCalPFClusterIsoCut.cc:7
CutApplicatorBase::ELECTRON
Definition: CutApplicatorBase.h:47
edm::InputTag
Definition: InputTag.h:15
GsfEleCalPFClusterIsoCut::rhoString_
constexpr static char rhoString_[]
Definition: GsfEleCalPFClusterIsoCut.cc:33