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 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< 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.

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  }

References _ranges, c, SiStripPI::max, min(), FastTimerService_cff::range, and diffTwoXMLs::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.

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 }

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

◆ value()

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

Implements candidate_functions::CandidateCut.

Definition at line 14 of file EtaMultiRangeCut.cc.

14 { return (_absEta ? std::abs(cand->eta()) : cand->eta()); }

References _absEta, and funct::abs().

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

diffTwoXMLs.ranges
string ranges
Definition: diffTwoXMLs.py:79
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
min
T min(T a, T b)
Definition: MathUtil.h:58
CutApplicatorBase::CutApplicatorBase
CutApplicatorBase()
Definition: CutApplicatorBase.h:49
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
EtaMultiRangeCut::_absEta
const bool _absEta
Definition: EtaMultiRangeCut.cc:19
cand
Definition: decayParser.h:32
mps_fire.result
result
Definition: mps_fire.py:311
EtaMultiRangeCut::_ranges
std::vector< std::pair< double, double > > _ranges
Definition: EtaMultiRangeCut.cc:20
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46