CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 overridefinal
 
 EtaMultiRangeCut (const edm::ParameterSet &c)
 
double value (const reco::CandidatePtr &cand) const overridefinal
 
- Public Member Functions inherited from CutApplicatorBase
virtual CandidateType candidateType () const
 
 CutApplicatorBase ()
 
 CutApplicatorBase (const edm::ParameterSet &c)
 
 CutApplicatorBase (const CutApplicatorBase &)=delete
 
virtual const std::string & name () const
 
virtual 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
 
virtual ~CutApplicatorBase ()
 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
}
 

Detailed Description

Definition at line 3 of file EtaMultiRangeCut.cc.

Constructor & Destructor Documentation

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

Definition at line 5 of file EtaMultiRangeCut.cc.

References _ranges, edm::ParameterSet::getParameterSetVector(), bookConverter::max, min(), 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 min = range.getParameter<double>("minEta");
12  const double max = range.getParameter<double>("maxEta");
13  _ranges.emplace_back(min,max);
14  }
15  }
T getParameter(std::string const &) const
VParameterSet const & getParameterSetVector(std::string const &name) const
std::vector< std::pair< double, double > > _ranges
T min(T a, T b)
Definition: MathUtil.h:58
string ranges
Definition: diffTwoXMLs.py:78

Member Function Documentation

CutApplicatorBase::result_type EtaMultiRangeCut::asCandidate ( const argument_type &  cand) const
finaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 32 of file EtaMultiRangeCut.cc.

References funct::abs(), and mps_fire::result.

32  {
33  const double the_eta = ( _absEta ? std::abs(cand->eta()) : cand->eta() );
34  bool result = false;
35  for(const auto& range : _ranges ) {
36  if( the_eta >= range.first && the_eta < range.second ) {
37  result = true; break;
38  }
39  }
40  return result;
41 }
std::vector< std::pair< double, double > > _ranges
tuple result
Definition: mps_fire.py:84
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double EtaMultiRangeCut::value ( const reco::CandidatePtr cand) const
inlinefinaloverridevirtual

Implements candidate_functions::CandidateCut.

Definition at line 17 of file EtaMultiRangeCut.cc.

References _absEta, and funct::abs().

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

Member Data Documentation

const bool EtaMultiRangeCut::_absEta
private

Definition at line 24 of file EtaMultiRangeCut.cc.

Referenced by value().

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

Definition at line 25 of file EtaMultiRangeCut.cc.

Referenced by EtaMultiRangeCut().