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

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

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 }
std::unordered_map< std::string, edm::InputTag > contentTags_

Member Function Documentation

◆ candidateType()

CandidateType GsfEleValueMapIsoRhoCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 17 of file GsfEleValueMapIsoRhoCut.cc.

References CutApplicatorBase::ELECTRON.

◆ getEventContent()

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

Implements CutApplicatorWithEventContentBase.

Definition at line 59 of file GsfEleValueMapIsoRhoCut.cc.

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

59  {
60  if (useRho_)
61  ev.getByLabel(contentTags_["rho"], rhoHandle_);
62  ev.getByLabel(contentTags_["value"], valueHandle_);
63 }
edm::Handle< edm::ValueMap< float > > valueHandle_
std::unordered_map< std::string, edm::InputTag > contentTags_
edm::Handle< double > rhoHandle_

◆ getRhoCorr()

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

Definition at line 81 of file GsfEleValueMapIsoRhoCut.cc.

References rho, rhoEA_, rhoEtStart_, and useRho_.

Referenced by operator()().

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 }

◆ operator()()

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

Reimplemented from CutApplicatorBase.

Definition at line 65 of file GsfEleValueMapIsoRhoCut.cc.

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

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 }
float getRhoCorr(const reco::GsfElectronPtr &cand) const

◆ setConsumes()

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

Implements CutApplicatorWithEventContentBase.

Definition at line 53 of file GsfEleValueMapIsoRhoCut.cc.

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

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 }
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 GsfEleValueMapIsoRhoCut::value ( const reco::CandidatePtr cand) const
finalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 76 of file GsfEleValueMapIsoRhoCut.cc.

References valueHandle_.

76  {
78  return (*valueHandle_)[cand];
79 }
edm::Handle< edm::ValueMap< float > > 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().