CMS 3D CMS Logo

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

Public Member Functions

CandidateType candidateType () const final
 
void getEventContent (const edm::EventBase &) final
 
 GsfEleHadronicOverEMEnergyScaledCut (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 barrelCE_
 
const float barrelCr_
 
const float barrelCutOff_
 
const float endcapC0_
 
const float endcapCE_
 
const float endcapCr_
 
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 4 of file GsfEleHadronicOverEMEnergyScaledCut.cc.

Constructor & Destructor Documentation

GsfEleHadronicOverEMEnergyScaledCut::GsfEleHadronicOverEMEnergyScaledCut ( const edm::ParameterSet c)
inline

Definition at line 6 of file GsfEleHadronicOverEMEnergyScaledCut.cc.

References CutApplicatorWithEventContentBase::contentTags_, getEventContent(), edm::ParameterSet::getParameter(), operator()(), lowPtGsfElectrons_cff::rhoTag, setConsumes(), and value().

6  :
8  barrelC0_(c.getParameter<double>("barrelC0")),
9  barrelCE_(c.getParameter<double>("barrelCE")),
10  barrelCr_(c.getParameter<double>("barrelCr")),
11  endcapC0_(c.getParameter<double>("endcapC0")),
12  endcapCE_(c.getParameter<double>("endcapCE")),
13  endcapCr_(c.getParameter<double>("endcapCr")),
14  barrelCutOff_(c.getParameter<double>("barrelCutOff"))
15  {
17  contentTags_.emplace("rho",rhoTag);
18 
19  }
T getParameter(std::string const &) const
std::unordered_map< std::string, edm::InputTag > contentTags_

Member Function Documentation

CandidateType GsfEleHadronicOverEMEnergyScaledCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 28 of file GsfEleHadronicOverEMEnergyScaledCut.cc.

References CutApplicatorBase::ELECTRON.

28  {
29  return ELECTRON;
30  }
void GsfEleHadronicOverEMEnergyScaledCut::getEventContent ( const edm::EventBase ev)
finalvirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 46 of file GsfEleHadronicOverEMEnergyScaledCut.cc.

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

Referenced by GsfEleHadronicOverEMEnergyScaledCut().

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

Reimplemented from CutApplicatorBase.

Definition at line 51 of file GsfEleHadronicOverEMEnergyScaledCut.cc.

References funct::abs(), barrelC0_, barrelCE_, barrelCr_, barrelCutOff_, fftjetpileupestimator_calo_uncalib_cfi::c0, endcapC0_, endcapCE_, endcapCr_, objects.autophobj::float, reco::GsfElectron::hadronicOverEm(), edm::HandleBase::isValid(), rho, rhoHandle_, and reco::GsfElectron::superCluster().

Referenced by GsfEleHadronicOverEMEnergyScaledCut().

51  {
52 
53  const double rho = rhoHandle_.isValid() ? (float)(*rhoHandle_) : 0;
54  const float energy = cand->superCluster()->energy();
55  const float c0 = (std::abs(cand->superCluster()->position().eta()) < barrelCutOff_ ? barrelC0_ : endcapC0_);
56  const float cE = (std::abs(cand->superCluster()->position().eta()) < barrelCutOff_ ? barrelCE_ : endcapCE_);
57  const float cR = (std::abs(cand->superCluster()->position().eta()) < barrelCutOff_ ? barrelCr_ : endcapCr_);
58  return cand->hadronicOverEm() < c0 + cE/energy + cR*rho/energy;
59 }
float hadronicOverEm() const
Definition: GsfElectron.h:495
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:74
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:185
void GsfEleHadronicOverEMEnergyScaledCut::setConsumes ( edm::ConsumesCollector cc)
finalvirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 41 of file GsfEleHadronicOverEMEnergyScaledCut.cc.

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

Referenced by GsfEleHadronicOverEMEnergyScaledCut().

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

Implements candidate_functions::CandidateCut.

Definition at line 61 of file GsfEleHadronicOverEMEnergyScaledCut.cc.

References reco::GsfElectron::hadronicOverEm().

Referenced by GsfEleHadronicOverEMEnergyScaledCut().

61  {
62  reco::GsfElectronPtr ele(cand);
63  return ele->hadronicOverEm();
64 }

Member Data Documentation

const float GsfEleHadronicOverEMEnergyScaledCut::barrelC0_
private

Definition at line 33 of file GsfEleHadronicOverEMEnergyScaledCut.cc.

Referenced by operator()().

const float GsfEleHadronicOverEMEnergyScaledCut::barrelCE_
private

Definition at line 33 of file GsfEleHadronicOverEMEnergyScaledCut.cc.

Referenced by operator()().

const float GsfEleHadronicOverEMEnergyScaledCut::barrelCr_
private

Definition at line 33 of file GsfEleHadronicOverEMEnergyScaledCut.cc.

Referenced by operator()().

const float GsfEleHadronicOverEMEnergyScaledCut::barrelCutOff_
private

Definition at line 33 of file GsfEleHadronicOverEMEnergyScaledCut.cc.

Referenced by operator()().

const float GsfEleHadronicOverEMEnergyScaledCut::endcapC0_
private

Definition at line 33 of file GsfEleHadronicOverEMEnergyScaledCut.cc.

Referenced by operator()().

const float GsfEleHadronicOverEMEnergyScaledCut::endcapCE_
private

Definition at line 33 of file GsfEleHadronicOverEMEnergyScaledCut.cc.

Referenced by operator()().

const float GsfEleHadronicOverEMEnergyScaledCut::endcapCr_
private

Definition at line 33 of file GsfEleHadronicOverEMEnergyScaledCut.cc.

Referenced by operator()().

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

Definition at line 34 of file GsfEleHadronicOverEMEnergyScaledCut.cc.

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