CMS 3D CMS Logo

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

Public Member Functions

result_type asCandidate (const argument_type &) const final
 
 MinPtCutInEtaRanges (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< double > _minPt
 
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 MinPtCutInEtaRanges.cc.

Constructor & Destructor Documentation

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

Definition at line 5 of file MinPtCutInEtaRanges.cc.

References _minPt, _ranges, edm::ParameterSet::getParameterSetVector(), maxEta, trackingPOGFilters_cfi::minEta, lostTracks_cfi::minPt, 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 minEta = range.getParameter<double>("minEta");
12  const double maxEta = range.getParameter<double>("maxEta");
13  const double minPt = range.getParameter<double>("minPt");
14  _ranges.emplace_back(minEta,maxEta);
15  _minPt.push_back(minPt);
16  }
17  }
T getParameter(std::string const &) const
VParameterSet const & getParameterSetVector(std::string const &name) const
double maxEta
std::vector< double > _minPt
string ranges
Definition: diffTwoXMLs.py:79
std::vector< std::pair< double, double > > _ranges

Member Function Documentation

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

Reimplemented from CutApplicatorBase.

Definition at line 36 of file MinPtCutInEtaRanges.cc.

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

Referenced by value().

36  {
37  const double the_eta = ( _absEta ? std::abs(cand->eta()) : cand->eta() );
38  bool result = false;
39  for( unsigned i = 0; i < _ranges.size(); ++i ) {
40  const auto& range = _ranges[i];
41  if( the_eta >= range.first && the_eta < range.second &&
42  cand->pt() > _minPt[i] ) {
43  result = true; break;
44  }
45  }
46  return result;
47 }
std::vector< double > _minPt
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< std::pair< double, double > > _ranges
double MinPtCutInEtaRanges::value ( const reco::CandidatePtr cand) const
inlinefinalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 19 of file MinPtCutInEtaRanges.cc.

References asCandidate().

19  {
20  return cand->pt();
21  }

Member Data Documentation

const bool MinPtCutInEtaRanges::_absEta
private

Definition at line 26 of file MinPtCutInEtaRanges.cc.

Referenced by asCandidate().

std::vector<double> MinPtCutInEtaRanges::_minPt
private

Definition at line 28 of file MinPtCutInEtaRanges.cc.

Referenced by asCandidate(), and MinPtCutInEtaRanges().

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

Definition at line 27 of file MinPtCutInEtaRanges.cc.

Referenced by asCandidate(), and MinPtCutInEtaRanges().