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

◆ EcalDrivenCode

Enumerator
IGNORE 
FAIL 
PASS 

Definition at line 19 of file GsfEleEcalDrivenCut.cc.

19 { IGNORE = -1, FAIL = 0, PASS = 1 };

Constructor & Destructor Documentation

◆ GsfEleEcalDrivenCut()

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

Definition at line 26 of file GsfEleEcalDrivenCut.cc.

28  ecalDrivenEB_(static_cast<EcalDrivenCode>(c.getParameter<int>("ecalDrivenEB"))),
29  ecalDrivenEE_(static_cast<EcalDrivenCode>(c.getParameter<int>("ecalDrivenEE"))),
30  barrelCutOff_(c.getParameter<double>("barrelCutOff")) {
33  << "error in constructing GsfEleEcalDrivenCut" << std::endl
34  << "values of ecalDrivenEB: " << ecalDrivenEB_ << " and/or ecalDrivenEE: " << ecalDrivenEE_ << " are invalid "
35  << std::endl
36  << "allowed values are IGNORE:" << IGNORE << " FAIL:" << FAIL << " PASS:" << PASS;
37  }
38 }

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

Member Function Documentation

◆ candidateType()

CandidateType GsfEleEcalDrivenCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 13 of file GsfEleEcalDrivenCut.cc.

13 { return ELECTRON; }

References CutApplicatorBase::ELECTRON.

◆ isValidCutVal()

bool GsfEleEcalDrivenCut::isValidCutVal ( int  val)
staticprivate

Definition at line 61 of file GsfEleEcalDrivenCut.cc.

61  {
62  if (val == IGNORE)
63  return true;
64  if (val == FAIL)
65  return true;
66  if (val == PASS)
67  return true;
68  return false;
69 }

References FAIL, IGNORE, PASS, and heppy_batch::val.

Referenced by GsfEleEcalDrivenCut().

◆ operator()()

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

Reimplemented from CutApplicatorBase.

Definition at line 40 of file GsfEleEcalDrivenCut.cc.

40  {
41  const auto ecalDrivenRequirement =
42  std::abs(cand->superCluster()->position().eta()) < barrelCutOff_ ? ecalDrivenEB_ : ecalDrivenEE_;
43  if (ecalDrivenRequirement == IGNORE)
44  return true;
45  else if (ecalDrivenRequirement == FAIL)
46  return !cand->ecalDriven();
47  else if (ecalDrivenRequirement == PASS)
48  return cand->ecalDriven();
49  else {
50  throw edm::Exception(edm::errors::LogicError) << "error in " << __FILE__ << " line " << __LINE__ << std::endl
51  << "default option should not be reached, code has been updated "
52  "without changing the logic, this needs to be fixed";
53  }
54 }

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

◆ value()

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

Implements candidate_functions::CandidateCut.

Definition at line 56 of file GsfEleEcalDrivenCut.cc.

56  {
58  return ele->ecalDriven();
59 }

References reco::GsfElectron::ecalDriven().

Member Data Documentation

◆ barrelCutOff_

const double GsfEleEcalDrivenCut::barrelCutOff_
private

Definition at line 21 of file GsfEleEcalDrivenCut.cc.

Referenced by operator()().

◆ ecalDrivenEB_

const int GsfEleEcalDrivenCut::ecalDrivenEB_
private

Definition at line 20 of file GsfEleEcalDrivenCut.cc.

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

◆ ecalDrivenEE_

const int GsfEleEcalDrivenCut::ecalDrivenEE_
private

Definition at line 20 of file GsfEleEcalDrivenCut.cc.

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

GsfEleEcalDrivenCut::FAIL
Definition: GsfEleEcalDrivenCut.cc:19
GsfEleEcalDrivenCut::IGNORE
Definition: GsfEleEcalDrivenCut.cc:19
GsfEleEcalDrivenCut::barrelCutOff_
const double barrelCutOff_
Definition: GsfEleEcalDrivenCut.cc:21
edm::errors::LogicError
Definition: EDMException.h:37
CutApplicatorBase::CutApplicatorBase
CutApplicatorBase()
Definition: CutApplicatorBase.h:49
GsfEleEcalDrivenCut::PASS
Definition: GsfEleEcalDrivenCut.cc:19
GsfEleEcalDrivenCut::isValidCutVal
static bool isValidCutVal(int val)
Definition: GsfEleEcalDrivenCut.cc:61
cand
Definition: decayParser.h:32
edm::Ptr< reco::GsfElectron >
GsfEleEcalDrivenCut::ecalDrivenEE_
const int ecalDrivenEE_
Definition: GsfEleEcalDrivenCut.cc:20
heppy_batch.val
val
Definition: heppy_batch.py:351
Exception
Definition: hltDiff.cc:245
GsfEleEcalDrivenCut::ecalDrivenEB_
const int ecalDrivenEB_
Definition: GsfEleEcalDrivenCut.cc:20
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
CutApplicatorBase::ELECTRON
Definition: CutApplicatorBase.h:47
edm::errors::Configuration
Definition: EDMException.h:36