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

Detailed Description

Definition at line 4 of file GsfEleSCEtaMultiRangeCut.cc.

Constructor & Destructor Documentation

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

Definition at line 6 of file GsfEleSCEtaMultiRangeCut.cc.

References _ranges, edm::ParameterSet::getParameterSetVector(), SiStripPI::max, min(), operator()(), diffTwoXMLs::ranges, and value().

6  :
8  _absEta(c.getParameter<bool>("useAbsEta")) {
9  const std::vector<edm::ParameterSet>& ranges =
10  c.getParameterSetVector("allowedEtaRanges");
11  for( const auto& range : ranges ) {
12  const double min = range.getParameter<double>("minEta");
13  const double max = range.getParameter<double>("maxEta");
14  _ranges.emplace_back(min,max);
15  }
16  }
T getParameter(std::string const &) const
VParameterSet const & getParameterSetVector(std::string const &name) const
std::vector< std::pair< double, double > > _ranges
T min(T a, T b)
Definition: MathUtil.h:58
string ranges
Definition: diffTwoXMLs.py:78

Member Function Documentation

CandidateType GsfEleSCEtaMultiRangeCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 22 of file GsfEleSCEtaMultiRangeCut.cc.

References CutApplicatorBase::ELECTRON.

22  {
23  return ELECTRON;
24  }
CutApplicatorBase::result_type GsfEleSCEtaMultiRangeCut::operator() ( const reco::GsfElectronPtr cand) const
finalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 37 of file GsfEleSCEtaMultiRangeCut.cc.

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

Referenced by GsfEleSCEtaMultiRangeCut().

37  {
38  const reco::SuperClusterRef& scref = cand->superCluster();
39  const double the_eta = ( _absEta ? std::abs(scref->eta()) : scref->eta() );
40  bool result = false;
41  for(const auto& range : _ranges ) {
42  if( the_eta >= range.first && the_eta < range.second ) {
43  result = true; break;
44  }
45  }
46  return result;
47 }
std::vector< std::pair< double, double > > _ranges
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:184
double GsfEleSCEtaMultiRangeCut::value ( const reco::CandidatePtr cand) const
finalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 49 of file GsfEleSCEtaMultiRangeCut.cc.

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

Referenced by GsfEleSCEtaMultiRangeCut().

49  {
50  reco::GsfElectronPtr ele(cand);
51  const reco::SuperClusterRef& scref = ele->superCluster();
52  return ( _absEta ? std::abs(scref->eta()) : scref->eta() );
53 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

const bool GsfEleSCEtaMultiRangeCut::_absEta
private

Definition at line 27 of file GsfEleSCEtaMultiRangeCut.cc.

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

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

Definition at line 28 of file GsfEleSCEtaMultiRangeCut.cc.

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