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
MinPtCutInEtaRanges Class Reference
Inheritance diagram for MinPtCutInEtaRanges:
CutApplicatorBase candidate_functions::CandidateCut

Public Member Functions

result_type asCandidate (const argument_type &) const overridefinal
 
 MinPtCutInEtaRanges (const edm::ParameterSet &c)
 
- Public Member Functions inherited from CutApplicatorBase
virtual CandidateType candidateType () const
 
 CutApplicatorBase (const edm::ParameterSet &c)
 
 CutApplicatorBase (const CutApplicatorBase &)=delete
 
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
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
}
 

Detailed Description

Definition at line 3 of file MinPtCutInEtaRanges.cc.

Constructor & Destructor Documentation

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

Definition at line 5 of file MinPtCutInEtaRanges.cc.

References _minPt, _ranges, edm::ParameterSet::getParameterSetVector(), maxEta, benchmark_cfg::minEta, HLT_25ns14e33_v1_cff::minPt, 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 minEta = range.getParameter<double>("minEta");
12  const double maxEta = range.getParameter<double>("maxEta");
13  const double minPt = range.getParameter<double>("minPt");
14  _ranges.emplace_back(minEta,maxEta);
15  _minPt.push_back(minPt);
16  }
17  }
T getParameter(std::string const &) const
VParameterSet const & getParameterSetVector(std::string const &name) const
double maxEta
std::vector< double > _minPt
string ranges
Definition: diffTwoXMLs.py:78
CutApplicatorBase(const edm::ParameterSet &c)
std::vector< std::pair< double, double > > _ranges

Member Function Documentation

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

Reimplemented from CutApplicatorBase.

Definition at line 32 of file MinPtCutInEtaRanges.cc.

References funct::abs(), i, and query::result.

32  {
33  const double the_eta = ( _absEta ? std::abs(cand->eta()) : cand->eta() );
34  bool result = false;
35  for( unsigned i = 0; i < _ranges.size(); ++i ) {
36  const auto& range = _ranges[i];
37  if( the_eta >= range.first && the_eta < range.second &&
38  cand->pt() > _minPt[i] ) {
39  result = true; break;
40  }
41  }
42  return result;
43 }
int i
Definition: DBlmapReader.cc:9
std::vector< double > _minPt
tuple result
Definition: query.py:137
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< std::pair< double, double > > _ranges

Member Data Documentation

const bool MinPtCutInEtaRanges::_absEta
private

Definition at line 22 of file MinPtCutInEtaRanges.cc.

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

Definition at line 24 of file MinPtCutInEtaRanges.cc.

Referenced by MinPtCutInEtaRanges().

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

Definition at line 23 of file MinPtCutInEtaRanges.cc.

Referenced by MinPtCutInEtaRanges().