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 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::GsfElectronPtr &) 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< 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.

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  }

References _minPt, _ranges, c, maxEta, EgHLTOffEleSelection_cfi::minEta, beam_dqm_sourceclient-live_cfg::minPt, FastTimerService_cff::range, and diffTwoXMLs::ranges.

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.

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 }

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

◆ 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().

diffTwoXMLs.ranges
string ranges
Definition: diffTwoXMLs.py:79
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
MinPtCutInEtaRanges::_ranges
std::vector< std::pair< double, double > > _ranges
Definition: MinPtCutInEtaRanges.cc:22
mps_fire.i
i
Definition: mps_fire.py:428
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
CutApplicatorBase::CutApplicatorBase
CutApplicatorBase()
Definition: CutApplicatorBase.h:49
maxEta
double maxEta
Definition: PFJetBenchmarkAnalyzer.cc:76
cand
Definition: decayParser.h:32
beam_dqm_sourceclient-live_cfg.minPt
minPt
Definition: beam_dqm_sourceclient-live_cfg.py:322
MinPtCutInEtaRanges::_minPt
std::vector< double > _minPt
Definition: MinPtCutInEtaRanges.cc:23
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:56
EgHLTOffEleSelection_cfi.minEta
minEta
Definition: EgHLTOffEleSelection_cfi.py:11
MinPtCutInEtaRanges::_absEta
const bool _absEta
Definition: MinPtCutInEtaRanges.cc:21