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

Constructor & Destructor Documentation

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

Definition at line 29 of file GsfEleRelPFIsoScaledCut.cc.

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

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

Member Function Documentation

CandidateType GsfEleRelPFIsoScaledCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 17 of file GsfEleRelPFIsoScaledCut.cc.

References CutApplicatorBase::ELECTRON.

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

Implements CutApplicatorWithEventContentBase.

Definition at line 47 of file GsfEleRelPFIsoScaledCut.cc.

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

47  {
49 }
std::unordered_map< std::string, edm::InputTag > contentTags_
edm::Handle< double > rhoHandle_
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:92
CutApplicatorBase::result_type GsfEleRelPFIsoScaledCut::operator() ( const reco::GsfElectronPtr cand) const
finalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 51 of file GsfEleRelPFIsoScaledCut.cc.

References funct::abs(), barrelC0_, barrelCpt_, barrelCutOff_, endcapC0_, endcapCpt_, reco::LeafCandidate::pt(), reco::GsfElectron::superCluster(), and value().

51  {
52  // Establish the cut value
53  double absEta = std::abs(cand->superCluster()->eta());
54 
55  const float C0 = (absEta < barrelCutOff_ ? barrelC0_ : endcapC0_);
56  const float Cpt = (absEta < barrelCutOff_ ? barrelCpt_ : endcapCpt_);
57  const float isoCut = C0+Cpt/cand->pt();
58 
59  return value(cand) < isoCut;
60 }
double pt() const final
transverse momentum
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double value(const reco::CandidatePtr &cand) const final
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:185
void GsfEleRelPFIsoScaledCut::setConsumes ( edm::ConsumesCollector cc)
finalvirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 42 of file GsfEleRelPFIsoScaledCut.cc.

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

42  {
43  auto rho = cc.consumes<double>(contentTags_["rho"]);
44  contentTokens_.emplace("rho", rho);
45 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
std::unordered_map< std::string, edm::InputTag > contentTags_
double GsfEleRelPFIsoScaledCut::value ( const reco::CandidatePtr cand) const
finalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 62 of file GsfEleRelPFIsoScaledCut.cc.

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

Referenced by operator()().

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

Member Data Documentation

const float GsfEleRelPFIsoScaledCut::barrelC0_
private

Definition at line 22 of file GsfEleRelPFIsoScaledCut.cc.

Referenced by operator()().

const float GsfEleRelPFIsoScaledCut::barrelCpt_
private

Definition at line 22 of file GsfEleRelPFIsoScaledCut.cc.

Referenced by operator()().

const float GsfEleRelPFIsoScaledCut::barrelCutOff_
private

Definition at line 22 of file GsfEleRelPFIsoScaledCut.cc.

Referenced by operator()().

EffectiveAreas GsfEleRelPFIsoScaledCut::effectiveAreas_
private

Definition at line 23 of file GsfEleRelPFIsoScaledCut.cc.

Referenced by value().

const float GsfEleRelPFIsoScaledCut::endcapC0_
private

Definition at line 22 of file GsfEleRelPFIsoScaledCut.cc.

Referenced by operator()().

const float GsfEleRelPFIsoScaledCut::endcapCpt_
private

Definition at line 22 of file GsfEleRelPFIsoScaledCut.cc.

Referenced by operator()().

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

Definition at line 24 of file GsfEleRelPFIsoScaledCut.cc.

Referenced by getEventContent(), and value().