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 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::MinPtCutInEtaRanges ( const edm::ParameterSet c)
inline

Definition at line 5 of file MinPtCutInEtaRanges.cc.

References _minPt, _ranges, DummyCfis::c, razorScouting_cff::maxEta, EgHLTOffEleSelection_cfi::minEta, PV_cfg::minPt, FastTimerService_cff::range, and diffTwoXMLs::ranges.

5  : CutApplicatorBase(c), _absEta(c.getParameter<bool>("useAbsEta")) {
6  const std::vector<edm::ParameterSet>& ranges = c.getParameterSetVector("allowedEtaRanges");
7  for (const auto& range : ranges) {
8  const double minEta = range.getParameter<double>("minEta");
9  const double maxEta = range.getParameter<double>("maxEta");
10  const double minPt = range.getParameter<double>("minPt");
11  _ranges.emplace_back(minEta, maxEta);
12  _minPt.push_back(minPt);
13  }
14  }
std::vector< double > _minPt
minPt
Definition: PV_cfg.py:223
std::vector< std::pair< double, double > > _ranges
string ranges
Definition: diffTwoXMLs.py:79

Member Function Documentation

◆ asCandidate()

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

Reimplemented from CutApplicatorBase.

Definition at line 28 of file MinPtCutInEtaRanges.cc.

References _absEta, _minPt, _ranges, funct::abs(), mps_fire::i, DiDispStaMuonMonitor_cfi::pt, FastTimerService_cff::range, and mps_fire::result.

28  {
29  const double the_eta = (_absEta ? std::abs(cand->eta()) : cand->eta());
30  bool result = false;
31  for (unsigned i = 0; i < _ranges.size(); ++i) {
32  const auto& range = _ranges[i];
33  if (the_eta >= range.first && the_eta < range.second && cand->pt() > _minPt[i]) {
34  result = true;
35  break;
36  }
37  }
38  return result;
39 }
std::vector< double > _minPt
std::vector< std::pair< double, double > > _ranges
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ value()

double MinPtCutInEtaRanges::value ( const reco::CandidatePtr cand) const
inlinefinalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 16 of file MinPtCutInEtaRanges.cc.

16 { return cand->pt(); }

Member Data Documentation

◆ _absEta

const bool MinPtCutInEtaRanges::_absEta
private

Definition at line 21 of file MinPtCutInEtaRanges.cc.

Referenced by asCandidate().

◆ _minPt

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

Definition at line 23 of file MinPtCutInEtaRanges.cc.

Referenced by asCandidate(), and MinPtCutInEtaRanges().

◆ _ranges

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

Definition at line 22 of file MinPtCutInEtaRanges.cc.

Referenced by asCandidate(), and MinPtCutInEtaRanges().