CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Static Private Member Functions | Private Attributes
GsfEleEcalDrivenCut Class Reference
Inheritance diagram for GsfEleEcalDrivenCut:
CutApplicatorBase candidate_functions::CandidateCut

Public Member Functions

CandidateType candidateType () const final
 
 GsfEleEcalDrivenCut (const edm::ParameterSet &c)
 
result_type operator() (const reco::GsfElectronPtr &) const final
 
double value (const reco::CandidatePtr &cand) const final
 
- 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 Types

enum  EcalDrivenCode { IGNORE =-1, FAIL =0, PASS =1 }
 

Static Private Member Functions

static bool isValidCutVal (int val)
 

Private Attributes

const double barrelCutOff_
 
const int ecalDrivenEB_
 
const int ecalDrivenEE_
 

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
 

Detailed Description

Definition at line 5 of file GsfEleEcalDrivenCut.cc.

Member Enumeration Documentation

Constructor & Destructor Documentation

GsfEleEcalDrivenCut::GsfEleEcalDrivenCut ( const edm::ParameterSet c)

Definition at line 33 of file GsfEleEcalDrivenCut.cc.

References edm::errors::Configuration, ecalDrivenEB_, ecalDrivenEE_, Exception, FAIL, IGNORE, isValidCutVal(), operator()(), and PASS.

33  :
35  ecalDrivenEB_(static_cast<EcalDrivenCode>(c.getParameter<int>("ecalDrivenEB"))),
36  ecalDrivenEE_(static_cast<EcalDrivenCode>(c.getParameter<int>("ecalDrivenEE"))),
37  barrelCutOff_(c.getParameter<double>("barrelCutOff"))
38 {
41  <<"error in constructing GsfEleEcalDrivenCut"<<std::endl
42  <<"values of ecalDrivenEB: "<<ecalDrivenEB_<<" and/or ecalDrivenEE: "<<ecalDrivenEE_<<" are invalid "<<std::endl
43  <<"allowed values are IGNORE:"<<IGNORE<<" FAIL:"<<FAIL<<" PASS:"<<PASS;
44  }
45 }
T getParameter(std::string const &) const
static bool isValidCutVal(int val)

Member Function Documentation

CandidateType GsfEleEcalDrivenCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 13 of file GsfEleEcalDrivenCut.cc.

References CutApplicatorBase::ELECTRON, isValidCutVal(), and heppy_batch::val.

13  {
14  return ELECTRON;
15  }
bool GsfEleEcalDrivenCut::isValidCutVal ( int  val)
staticprivate

Definition at line 67 of file GsfEleEcalDrivenCut.cc.

References FAIL, IGNORE, and PASS.

Referenced by candidateType(), and GsfEleEcalDrivenCut().

68 {
69  if(val==IGNORE) return true;
70  if(val==FAIL) return true;
71  if(val==PASS) return true;
72  return false;
73 }
CutApplicatorBase::result_type GsfEleEcalDrivenCut::operator() ( const reco::GsfElectronPtr cand) const
finalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 49 of file GsfEleEcalDrivenCut.cc.

References funct::abs(), barrelCutOff_, reco::GsfElectron::ecalDriven(), ecalDrivenEB_, ecalDrivenEE_, Exception, FAIL, IGNORE, edm::errors::LogicError, PASS, and reco::GsfElectron::superCluster().

Referenced by GsfEleEcalDrivenCut().

49  {
50  const auto ecalDrivenRequirement = std::abs(cand->superCluster()->position().eta()) < barrelCutOff_ ?
52  if(ecalDrivenRequirement==IGNORE) return true;
53  else if(ecalDrivenRequirement==FAIL) return !cand->ecalDriven();
54  else if(ecalDrivenRequirement==PASS) return cand->ecalDriven();
55  else{
57  <<"error in "<<__FILE__<<" line "<<__LINE__<<std::endl
58  <<"default option should not be reached, code has been updated without changing the logic, this needs to be fixed";
59  }
60 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:185
bool ecalDriven() const
Definition: GsfElectron.cc:174
double GsfEleEcalDrivenCut::value ( const reco::CandidatePtr cand) const
finalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 62 of file GsfEleEcalDrivenCut.cc.

References reco::GsfElectron::ecalDriven().

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

Member Data Documentation

const double GsfEleEcalDrivenCut::barrelCutOff_
private

Definition at line 23 of file GsfEleEcalDrivenCut.cc.

Referenced by operator()().

const int GsfEleEcalDrivenCut::ecalDrivenEB_
private

Definition at line 22 of file GsfEleEcalDrivenCut.cc.

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

const int GsfEleEcalDrivenCut::ecalDrivenEE_
private

Definition at line 22 of file GsfEleEcalDrivenCut.cc.

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