CMS 3D CMS Logo

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

Public Member Functions

CandidateType candidateType () const final
 
void getEventContent (const edm::EventBase &) final
 
 GsfEleRelPFIsoScaledCut (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 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 barrelC0_
 
const float barrelCpt_
 
const float barrelCutOff_
 
EffectiveAreas effectiveAreas_
 
const float endcapC0_
 
const float endcapCpt_
 
edm::Handle< double > rhoHandle_
 

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 5 of file GsfEleRelPFIsoScaledCut.cc.

Constructor & Destructor Documentation

◆ GsfEleRelPFIsoScaledCut()

GsfEleRelPFIsoScaledCut::GsfEleRelPFIsoScaledCut ( const edm::ParameterSet c)

Definition at line 26 of file GsfEleRelPFIsoScaledCut.cc.

References c, CutApplicatorWithEventContentBase::contentTags_, and HLT_2022v15_cff::rhoTag.

28  barrelC0_(c.getParameter<double>("barrelC0")),
29  endcapC0_(c.getParameter<double>("endcapC0")),
30  barrelCpt_(c.getParameter<double>("barrelCpt")),
31  endcapCpt_(c.getParameter<double>("endcapCpt")),
32  barrelCutOff_(c.getParameter<double>("barrelCutOff")),
33  effectiveAreas_((c.getParameter<edm::FileInPath>("effAreasConfigFile")).fullPath()) {
34  edm::InputTag rhoTag = c.getParameter<edm::InputTag>("rho");
35  contentTags_.emplace("rho", rhoTag);
36 }
std::unordered_map< std::string, edm::InputTag > contentTags_

Member Function Documentation

◆ candidateType()

CandidateType GsfEleRelPFIsoScaledCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 16 of file GsfEleRelPFIsoScaledCut.cc.

References CutApplicatorBase::ELECTRON.

◆ getEventContent()

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

◆ operator()()

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

Reimplemented from CutApplicatorBase.

Definition at line 47 of file GsfEleRelPFIsoScaledCut.cc.

References funct::abs(), barrelC0_, barrelCpt_, barrelCutOff_, endcapC0_, endcapCpt_, and value().

47  {
48  // Establish the cut value
49  double absEta = std::abs(cand->superCluster()->eta());
50 
51  const float C0 = (absEta < barrelCutOff_ ? barrelC0_ : endcapC0_);
52  const float Cpt = (absEta < barrelCutOff_ ? barrelCpt_ : endcapCpt_);
53  const float isoCut = C0 + Cpt / cand->pt();
54 
55  return value(cand) < isoCut;
56 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double value(const reco::CandidatePtr &cand) const final

◆ setConsumes()

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

Implements CutApplicatorWithEventContentBase.

Definition at line 38 of file GsfEleRelPFIsoScaledCut.cc.

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

38  {
39  auto rho = cc.consumes<double>(contentTags_["rho"]);
40  contentTokens_.emplace("rho", rho);
41 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::unordered_map< std::string, edm::InputTag > contentTags_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_

◆ value()

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

Implements candidate_functions::CandidateCut.

Definition at line 58 of file GsfEleRelPFIsoScaledCut.cc.

References funct::abs(), effectiveAreas_, f, dqmMemoryStats::float, EffectiveAreas::getEffectiveArea(), edm::HandleBase::isValid(), SiStripPI::max, reco::GsfElectron::pfIsolationVariables(), rho, rhoHandle_, reco::GsfElectron::PflowIsolationVariables::sumChargedHadronPt, and reco::GsfElectron::superCluster().

Referenced by operator()().

58  {
59  // Establish the cut value
61  double absEta = std::abs(ele->superCluster()->eta());
62 
63  // Compute the combined isolation with effective area correction
64  auto pfIso = ele->pfIsolationVariables();
65  const float chad = pfIso.sumChargedHadronPt;
66  const float nhad = pfIso.sumNeutralHadronEt;
67  const float pho = pfIso.sumPhotonEt;
68  const float eA = effectiveAreas_.getEffectiveArea(absEta);
69  const float rho = rhoHandle_.isValid() ? (float)(*rhoHandle_) : 0; // std::max likes float arguments
70  const float iso = chad + std::max(0.0f, nhad + pho - rho * eA);
71  return iso / cand->pt();
72 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
edm::Handle< double > rhoHandle_
const float getEffectiveArea(float eta) const
bool isValid() const
Definition: HandleBase.h:70

Member Data Documentation

◆ barrelC0_

const float GsfEleRelPFIsoScaledCut::barrelC0_
private

Definition at line 19 of file GsfEleRelPFIsoScaledCut.cc.

Referenced by operator()().

◆ barrelCpt_

const float GsfEleRelPFIsoScaledCut::barrelCpt_
private

Definition at line 19 of file GsfEleRelPFIsoScaledCut.cc.

Referenced by operator()().

◆ barrelCutOff_

const float GsfEleRelPFIsoScaledCut::barrelCutOff_
private

Definition at line 19 of file GsfEleRelPFIsoScaledCut.cc.

Referenced by operator()().

◆ effectiveAreas_

EffectiveAreas GsfEleRelPFIsoScaledCut::effectiveAreas_
private

Definition at line 20 of file GsfEleRelPFIsoScaledCut.cc.

Referenced by value().

◆ endcapC0_

const float GsfEleRelPFIsoScaledCut::endcapC0_
private

Definition at line 19 of file GsfEleRelPFIsoScaledCut.cc.

Referenced by operator()().

◆ endcapCpt_

const float GsfEleRelPFIsoScaledCut::endcapCpt_
private

Definition at line 19 of file GsfEleRelPFIsoScaledCut.cc.

Referenced by operator()().

◆ rhoHandle_

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

Definition at line 21 of file GsfEleRelPFIsoScaledCut.cc.

Referenced by getEventContent(), and value().