CMS 3D CMS Logo

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

Public Member Functions

CandidateType candidateType () const final
 
 GsfEleSCEtaMultiRangeCut (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 Attributes

const bool _absEta
 
std::vector< std::pair< double, double > > _ranges
 

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 4 of file GsfEleSCEtaMultiRangeCut.cc.

Constructor & Destructor Documentation

◆ GsfEleSCEtaMultiRangeCut()

GsfEleSCEtaMultiRangeCut::GsfEleSCEtaMultiRangeCut ( const edm::ParameterSet c)
inline

Definition at line 6 of file GsfEleSCEtaMultiRangeCut.cc.

7  : CutApplicatorBase(c), _absEta(c.getParameter<bool>("useAbsEta")) {
8  const std::vector<edm::ParameterSet>& ranges = c.getParameterSetVector("allowedEtaRanges");
9  for (const auto& range : ranges) {
10  const double min = range.getParameter<double>("minEta");
11  const double max = range.getParameter<double>("maxEta");
12  _ranges.emplace_back(min, max);
13  }
14  }

References _ranges, c, SiStripPI::max, min(), FastTimerService_cff::range, and diffTwoXMLs::ranges.

Member Function Documentation

◆ candidateType()

CandidateType GsfEleSCEtaMultiRangeCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 20 of file GsfEleSCEtaMultiRangeCut.cc.

20 { return ELECTRON; }

References CutApplicatorBase::ELECTRON.

◆ operator()()

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

Reimplemented from CutApplicatorBase.

Definition at line 29 of file GsfEleSCEtaMultiRangeCut.cc.

29  {
30  const reco::SuperClusterRef& scref = cand->superCluster();
31  const double the_eta = (_absEta ? std::abs(scref->eta()) : scref->eta());
32  bool result = false;
33  for (const auto& range : _ranges) {
34  if (the_eta >= range.first && the_eta < range.second) {
35  result = true;
36  break;
37  }
38  }
39  return result;
40 }

References _absEta, _ranges, funct::abs(), FastTimerService_cff::range, and mps_fire::result.

◆ value()

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

Implements candidate_functions::CandidateCut.

Definition at line 42 of file GsfEleSCEtaMultiRangeCut.cc.

42  {
44  const reco::SuperClusterRef& scref = ele->superCluster();
45  return (_absEta ? std::abs(scref->eta()) : scref->eta());
46 }

References _absEta, funct::abs(), and reco::GsfElectron::superCluster().

Member Data Documentation

◆ _absEta

const bool GsfEleSCEtaMultiRangeCut::_absEta
private

Definition at line 23 of file GsfEleSCEtaMultiRangeCut.cc.

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

◆ _ranges

std::vector<std::pair<double, double> > GsfEleSCEtaMultiRangeCut::_ranges
private

Definition at line 24 of file GsfEleSCEtaMultiRangeCut.cc.

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

diffTwoXMLs.ranges
string ranges
Definition: diffTwoXMLs.py:79
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
min
T min(T a, T b)
Definition: MathUtil.h:58
CutApplicatorBase::CutApplicatorBase
CutApplicatorBase()
Definition: CutApplicatorBase.h:49
GsfEleSCEtaMultiRangeCut::_absEta
const bool _absEta
Definition: GsfEleSCEtaMultiRangeCut.cc:23
edm::Ref< SuperClusterCollection >
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
cand
Definition: decayParser.h:32
edm::Ptr< reco::GsfElectron >
GsfEleSCEtaMultiRangeCut::_ranges
std::vector< std::pair< double, double > > _ranges
Definition: GsfEleSCEtaMultiRangeCut.cc:24
mps_fire.result
result
Definition: mps_fire.py:311
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