CMS 3D CMS Logo

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

Public Member Functions

result_type asCandidate (const argument_type &) const final
 
 EtaMultiRangeCut (const edm::ParameterSet &c)
 
double value (const reco::CandidatePtr &cand) const final
 
- Public Member Functions inherited from CutApplicatorBase
virtual CandidateType candidateType () 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 reco::GsfElectronPtr &) const
 
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
}
 
- Public Types inherited from candidate_functions::CandidateCut
using argument_type = reco::CandidatePtr
 
using result_type = bool
 

Detailed Description

Definition at line 3 of file EtaMultiRangeCut.cc.

Constructor & Destructor Documentation

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

Definition at line 5 of file EtaMultiRangeCut.cc.

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

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

Member Function Documentation

CutApplicatorBase::result_type EtaMultiRangeCut::asCandidate ( const argument_type cand) const
finalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 32 of file EtaMultiRangeCut.cc.

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

Referenced by value().

32  {
33  const double the_eta = ( _absEta ? std::abs(cand->eta()) : cand->eta() );
34  bool result = false;
35  for(const auto& range : _ranges ) {
36  if( the_eta >= range.first && the_eta < range.second ) {
37  result = true; break;
38  }
39  }
40  return result;
41 }
std::vector< std::pair< double, double > > _ranges
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double EtaMultiRangeCut::value ( const reco::CandidatePtr cand) const
inlinefinalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 17 of file EtaMultiRangeCut.cc.

References _absEta, funct::abs(), and asCandidate().

17  {
18  return ( _absEta ? std::abs(cand->eta()) : cand->eta() );
19  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

const bool EtaMultiRangeCut::_absEta
private

Definition at line 24 of file EtaMultiRangeCut.cc.

Referenced by asCandidate(), and value().

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

Definition at line 25 of file EtaMultiRangeCut.cc.

Referenced by asCandidate(), and EtaMultiRangeCut().