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

Definition at line 5 of file EtaMultiRangeCut.cc.

References _ranges, c, SiStripPI::max, SiStripPI::min, 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 min = range.getParameter<double>("minEta");
9  const double max = range.getParameter<double>("maxEta");
10  _ranges.emplace_back(min, max);
11  }
12  }
string ranges
Definition: diffTwoXMLs.py:79
std::vector< std::pair< double, double > > _ranges

Member Function Documentation

◆ asCandidate()

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

Reimplemented from CutApplicatorBase.

Definition at line 25 of file EtaMultiRangeCut.cc.

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

25  {
26  const double the_eta = (_absEta ? std::abs(cand->eta()) : cand->eta());
27  bool result = false;
28  for (const auto& range : _ranges) {
29  if (the_eta >= range.first && the_eta < range.second) {
30  result = true;
31  break;
32  }
33  }
34  return result;
35 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< std::pair< double, double > > _ranges

◆ value()

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

Implements candidate_functions::CandidateCut.

Definition at line 14 of file EtaMultiRangeCut.cc.

References _absEta, and funct::abs().

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

Member Data Documentation

◆ _absEta

const bool EtaMultiRangeCut::_absEta
private

Definition at line 19 of file EtaMultiRangeCut.cc.

Referenced by asCandidate(), and value().

◆ _ranges

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

Definition at line 20 of file EtaMultiRangeCut.cc.

Referenced by asCandidate(), and EtaMultiRangeCut().