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)
 
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< 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
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 36 of file MinPtCutInEtaRanges.cc.

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

36  {
37  const double the_eta = ( _absEta ? std::abs(cand->eta()) : cand->eta() );
38  bool result = false;
39  for( unsigned i = 0; i < _ranges.size(); ++i ) {
40  const auto& range = _ranges[i];
41  if( the_eta >= range.first && the_eta < range.second &&
42  cand->pt() > _minPt[i] ) {
43  result = true; break;
44  }
45  }
46  return result;
47 }
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
double MinPtCutInEtaRanges::value ( const reco::CandidatePtr cand) const
inlinefinaloverridevirtual

Implements candidate_functions::CandidateCut.

Definition at line 19 of file MinPtCutInEtaRanges.cc.

19  {
20  return cand->pt();
21  }

Member Data Documentation

const bool MinPtCutInEtaRanges::_absEta
private

Definition at line 26 of file MinPtCutInEtaRanges.cc.

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

Definition at line 28 of file MinPtCutInEtaRanges.cc.

Referenced by MinPtCutInEtaRanges().

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

Definition at line 27 of file MinPtCutInEtaRanges.cc.

Referenced by MinPtCutInEtaRanges().