CMS 3D CMS Logo

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

Public Member Functions

CandidateType candidateType () const final
 
void getEventContent (const edm::EventBase &) final
 
 GsfEleValueMapIsoRhoCut (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 Member Functions

float getRhoCorr (const reco::GsfElectronPtr &cand) const
 

Private Attributes

EBEECutValues constTerm_
 
EBEECutValues rhoEA_
 
EBEECutValues rhoEtStart_
 
edm::Handle< double > rhoHandle_
 
EBEECutValues slopeStart_
 
EBEECutValues slopeTerm_
 
bool useRho_
 
edm::Handle< edm::ValueMap< float > > valueHandle_
 

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

Constructor & Destructor Documentation

◆ GsfEleValueMapIsoRhoCut()

GsfEleValueMapIsoRhoCut::GsfEleValueMapIsoRhoCut ( const edm::ParameterSet c)

Definition at line 36 of file GsfEleValueMapIsoRhoCut.cc.

38  slopeTerm_(params, "slopeTerm"),
39  slopeStart_(params, "slopeStart"),
40  constTerm_(params, "constTerm"),
41  rhoEtStart_(params, "rhoEtStart"),
42  rhoEA_(params, "rhoEA") {
43  auto rho = params.getParameter<edm::InputTag>("rho");
44  if (!rho.label().empty()) {
45  useRho_ = true;
46  contentTags_.emplace("rho", rho);
47  } else
48  useRho_ = false;
49 
50  contentTags_.emplace("value", params.getParameter<edm::InputTag>("value"));
51 }

References CutApplicatorWithEventContentBase::contentTags_, CalibrationSummaryClient_cfi::params, rho, and useRho_.

Member Function Documentation

◆ candidateType()

CandidateType GsfEleValueMapIsoRhoCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 17 of file GsfEleValueMapIsoRhoCut.cc.

17 { return ELECTRON; }

References CutApplicatorBase::ELECTRON.

◆ getEventContent()

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

Implements CutApplicatorWithEventContentBase.

Definition at line 59 of file GsfEleValueMapIsoRhoCut.cc.

59  {
60  if (useRho_)
61  ev.getByLabel(contentTags_["rho"], rhoHandle_);
62  ev.getByLabel(contentTags_["value"], valueHandle_);
63 }

References CutApplicatorWithEventContentBase::contentTags_, ev, rhoHandle_, useRho_, and valueHandle_.

◆ getRhoCorr()

float GsfEleValueMapIsoRhoCut::getRhoCorr ( const reco::GsfElectronPtr cand) const
private

Definition at line 81 of file GsfEleValueMapIsoRhoCut.cc.

81  {
82  if (!useRho_)
83  return 0.;
84  else {
85  const double rho = (*rhoHandle_);
86  return cand->et() >= rhoEtStart_(cand) ? rhoEA_(cand) * rho : 0.;
87  }
88 }

References rho, rhoEA_, rhoEtStart_, and useRho_.

Referenced by operator()().

◆ operator()()

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

Reimplemented from CutApplicatorBase.

Definition at line 65 of file GsfEleValueMapIsoRhoCut.cc.

65  {
66  const float val = (*valueHandle_)[cand];
67 
68  const float et = cand->et();
69  const float cutValue =
71  const float rhoCutValue = getRhoCorr(cand);
72 
73  return val < cutValue + rhoCutValue;
74 }

References constTerm_, EgHLTOffHistBins_cfi::et, getRhoCorr(), slopeStart_, slopeTerm_, and heppy_batch::val.

◆ setConsumes()

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

Implements CutApplicatorWithEventContentBase.

Definition at line 53 of file GsfEleValueMapIsoRhoCut.cc.

53  {
54  if (useRho_)
55  contentTokens_.emplace("rho", cc.consumes<double>(contentTags_["rho"]));
56  contentTokens_.emplace("value", cc.consumes<edm::ValueMap<float> >(contentTags_["value"]));
57 }

References CutApplicatorWithEventContentBase::contentTags_, CutApplicatorWithEventContentBase::contentTokens_, and useRho_.

◆ value()

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

Implements candidate_functions::CandidateCut.

Definition at line 76 of file GsfEleValueMapIsoRhoCut.cc.

76  {
78  return (*valueHandle_)[cand];
79 }

References valueHandle_.

Member Data Documentation

◆ constTerm_

EBEECutValues GsfEleValueMapIsoRhoCut::constTerm_
private

Definition at line 24 of file GsfEleValueMapIsoRhoCut.cc.

Referenced by operator()().

◆ rhoEA_

EBEECutValues GsfEleValueMapIsoRhoCut::rhoEA_
private

Definition at line 26 of file GsfEleValueMapIsoRhoCut.cc.

Referenced by getRhoCorr().

◆ rhoEtStart_

EBEECutValues GsfEleValueMapIsoRhoCut::rhoEtStart_
private

Definition at line 25 of file GsfEleValueMapIsoRhoCut.cc.

Referenced by getRhoCorr().

◆ rhoHandle_

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

Definition at line 30 of file GsfEleValueMapIsoRhoCut.cc.

Referenced by getEventContent().

◆ slopeStart_

EBEECutValues GsfEleValueMapIsoRhoCut::slopeStart_
private

Definition at line 23 of file GsfEleValueMapIsoRhoCut.cc.

Referenced by operator()().

◆ slopeTerm_

EBEECutValues GsfEleValueMapIsoRhoCut::slopeTerm_
private

Definition at line 22 of file GsfEleValueMapIsoRhoCut.cc.

Referenced by operator()().

◆ useRho_

bool GsfEleValueMapIsoRhoCut::useRho_
private

◆ valueHandle_

edm::Handle<edm::ValueMap<float> > GsfEleValueMapIsoRhoCut::valueHandle_
private

Definition at line 31 of file GsfEleValueMapIsoRhoCut.cc.

Referenced by getEventContent(), and value().

GsfEleValueMapIsoRhoCut::valueHandle_
edm::Handle< edm::ValueMap< float > > valueHandle_
Definition: GsfEleValueMapIsoRhoCut.cc:31
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
GsfEleValueMapIsoRhoCut::rhoEA_
EBEECutValues rhoEA_
Definition: GsfEleValueMapIsoRhoCut.cc:26
GsfEleValueMapIsoRhoCut::useRho_
bool useRho_
Definition: GsfEleValueMapIsoRhoCut.cc:28
CutApplicatorWithEventContentBase::contentTags_
std::unordered_map< std::string, edm::InputTag > contentTags_
Definition: CutApplicatorWithEventContentBase.h:35
GsfEleValueMapIsoRhoCut::getRhoCorr
float getRhoCorr(const reco::GsfElectronPtr &cand) const
Definition: GsfEleValueMapIsoRhoCut.cc:81
GsfEleValueMapIsoRhoCut::slopeStart_
EBEECutValues slopeStart_
Definition: GsfEleValueMapIsoRhoCut.cc:23
DDAxes::rho
CutApplicatorWithEventContentBase::CutApplicatorWithEventContentBase
CutApplicatorWithEventContentBase()
Definition: CutApplicatorWithEventContentBase.h:21
cand
Definition: decayParser.h:32
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
cc
GsfEleValueMapIsoRhoCut::rhoEtStart_
EBEECutValues rhoEtStart_
Definition: GsfEleValueMapIsoRhoCut.cc:25
edm::Ptr< reco::GsfElectron >
heppy_batch.val
val
Definition: heppy_batch.py:351
GsfEleValueMapIsoRhoCut::rhoHandle_
edm::Handle< double > rhoHandle_
Definition: GsfEleValueMapIsoRhoCut.cc:30
GsfEleValueMapIsoRhoCut::constTerm_
EBEECutValues constTerm_
Definition: GsfEleValueMapIsoRhoCut.cc:24
edm::ValueMap< float >
ev
bool ev
Definition: Hydjet2Hadronizer.cc:97
CutApplicatorWithEventContentBase::contentTokens_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
Definition: CutApplicatorWithEventContentBase.h:40
GsfEleValueMapIsoRhoCut::slopeTerm_
EBEECutValues slopeTerm_
Definition: GsfEleValueMapIsoRhoCut.cc:22
CutApplicatorBase::ELECTRON
Definition: CutApplicatorBase.h:47
edm::InputTag
Definition: InputTag.h:15