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 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 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
}
 
- 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 ( const edm::ParameterSet c)

Definition at line 40 of file GsfEleValueMapIsoRhoCut.cc.

References CutApplicatorWithEventContentBase::contentTags_, edm::ParameterSet::getParameter(), rho, and useRho_.

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

Member Function Documentation

CandidateType GsfEleValueMapIsoRhoCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 17 of file GsfEleValueMapIsoRhoCut.cc.

References CutApplicatorBase::ELECTRON, and getRhoCorr().

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

Implements CutApplicatorWithEventContentBase.

Definition at line 63 of file GsfEleValueMapIsoRhoCut.cc.

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

63  {
66 }
edm::Handle< edm::ValueMap< float > > valueHandle_
std::unordered_map< std::string, edm::InputTag > contentTags_
edm::Handle< double > rhoHandle_
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:94
float GsfEleValueMapIsoRhoCut::getRhoCorr ( const reco::GsfElectronPtr cand) const
private

Definition at line 88 of file GsfEleValueMapIsoRhoCut.cc.

References reco::LeafCandidate::et(), rho, rhoEA_, rhoEtStart_, and useRho_.

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

88  {
89  if(!useRho_) return 0.;
90  else{
91  const double rho = (*rhoHandle_);
92  return cand->et() >= rhoEtStart_(cand) ? rhoEA_(cand)*rho : 0.;
93  }
94 }
double et() const final
transverse energy
CutApplicatorBase::result_type GsfEleValueMapIsoRhoCut::operator() ( const reco::GsfElectronPtr cand) const
finalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 70 of file GsfEleValueMapIsoRhoCut.cc.

References constTerm_, stringResolutionProvider_cfi::et, reco::LeafCandidate::et(), getRhoCorr(), slopeStart_, slopeTerm_, heppy_batch::val, and value().

Referenced by getEventContent().

70  {
71 
72  const float val = (*valueHandle_)[cand];
73 
74  const float et = cand->et();
75  const float cutValue = et > slopeStart_(cand) ? slopeTerm_(cand)*(et-slopeStart_(cand)) + constTerm_(cand) : constTerm_(cand);
76  const float rhoCutValue = getRhoCorr(cand);
77 
78  return val < cutValue+rhoCutValue;
79 }
double et() const final
transverse energy
et
define resolution functions of each parameter
float getRhoCorr(const reco::GsfElectronPtr &cand) const
void GsfEleValueMapIsoRhoCut::setConsumes ( edm::ConsumesCollector cc)
finalvirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 58 of file GsfEleValueMapIsoRhoCut.cc.

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

58  {
59  if(useRho_) contentTokens_.emplace("rho",cc.consumes<double>(contentTags_["rho"]));
60  contentTokens_.emplace("value",cc.consumes<edm::ValueMap<float> >(contentTags_["value"]));
61 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
std::unordered_map< std::string, edm::InputTag > contentTags_
double GsfEleValueMapIsoRhoCut::value ( const reco::CandidatePtr cand) const
finalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 83 of file GsfEleValueMapIsoRhoCut.cc.

References valueHandle_.

Referenced by operator()().

83  {
84  reco::GsfElectronPtr ele(cand);
85  return (*valueHandle_)[cand];
86 }
edm::Handle< edm::ValueMap< float > > valueHandle_

Member Data Documentation

EBEECutValues GsfEleValueMapIsoRhoCut::constTerm_
private

Definition at line 26 of file GsfEleValueMapIsoRhoCut.cc.

Referenced by operator()().

EBEECutValues GsfEleValueMapIsoRhoCut::rhoEA_
private

Definition at line 28 of file GsfEleValueMapIsoRhoCut.cc.

Referenced by getRhoCorr().

EBEECutValues GsfEleValueMapIsoRhoCut::rhoEtStart_
private

Definition at line 27 of file GsfEleValueMapIsoRhoCut.cc.

Referenced by getRhoCorr().

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

Definition at line 32 of file GsfEleValueMapIsoRhoCut.cc.

Referenced by getEventContent().

EBEECutValues GsfEleValueMapIsoRhoCut::slopeStart_
private

Definition at line 25 of file GsfEleValueMapIsoRhoCut.cc.

Referenced by operator()().

EBEECutValues GsfEleValueMapIsoRhoCut::slopeTerm_
private

Definition at line 24 of file GsfEleValueMapIsoRhoCut.cc.

Referenced by operator()().

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

Definition at line 33 of file GsfEleValueMapIsoRhoCut.cc.

Referenced by getEventContent(), and value().