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

Public Member Functions

CandidateType candidateType () const overridefinal
 
 GsfEleSCEtaMultiRangeCut (const edm::ParameterSet &c)
 
result_type operator() (const reco::GsfElectronPtr &) const overridefinal
 
- Public Member Functions inherited from CutApplicatorBase
virtual result_type asCandidate (const argument_type &) 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 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< 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 4 of file GsfEleSCEtaMultiRangeCut.cc.

Constructor & Destructor Documentation

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

Definition at line 6 of file GsfEleSCEtaMultiRangeCut.cc.

References _ranges, edm::ParameterSet::getParameterSetVector(), max(), bookConverter::min, and diffTwoXMLs::ranges.

6  :
8  _absEta(c.getParameter<bool>("useAbsEta")) {
9  const std::vector<edm::ParameterSet>& ranges =
10  c.getParameterSetVector("allowedEtaRanges");
11  for( const auto& range : ranges ) {
12  const double min = range.getParameter<double>("minEta");
13  const double max = range.getParameter<double>("maxEta");
14  _ranges.emplace_back(min,max);
15  }
16  }
T getParameter(std::string const &) const
VParameterSet const & getParameterSetVector(std::string const &name) const
const T & max(const T &a, const T &b)
std::vector< std::pair< double, double > > _ranges
string ranges
Definition: diffTwoXMLs.py:78
CutApplicatorBase(const edm::ParameterSet &c)

Member Function Documentation

CandidateType GsfEleSCEtaMultiRangeCut::candidateType ( ) const
inlinefinaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 20 of file GsfEleSCEtaMultiRangeCut.cc.

References CutApplicatorBase::ELECTRON.

20  {
21  return ELECTRON;
22  }
CutApplicatorBase::result_type GsfEleSCEtaMultiRangeCut::operator() ( const reco::GsfElectronPtr cand) const
finaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 35 of file GsfEleSCEtaMultiRangeCut.cc.

References _absEta, _ranges, funct::abs(), and query::result.

35  {
36  const reco::SuperClusterRef& scref = cand->superCluster();
37  const double the_eta = ( _absEta ? std::abs(scref->eta()) : scref->eta() );
38  bool result = false;
39  for(const auto& range : _ranges ) {
40  if( the_eta >= range.first && the_eta < range.second ) {
41  result = true; break;
42  }
43  }
44  return result;
45 }
tuple result
Definition: query.py:137
std::vector< std::pair< double, double > > _ranges
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

const bool GsfEleSCEtaMultiRangeCut::_absEta
private

Definition at line 25 of file GsfEleSCEtaMultiRangeCut.cc.

Referenced by operator()().

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

Definition at line 26 of file GsfEleSCEtaMultiRangeCut.cc.

Referenced by GsfEleSCEtaMultiRangeCut(), and operator()().