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

Public Member Functions

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

Constructor & Destructor Documentation

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

Definition at line 6 of file PhoSCEtaMultiRangeCut.cc.

References _ranges, edm::ParameterSet::getParameterSetVector(), bookConverter::max, 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
T min(T a, T b)
Definition: MathUtil.h:58
string ranges
Definition: diffTwoXMLs.py:78
std::vector< std::pair< double, double > > _ranges

Member Function Documentation

CandidateType PhoSCEtaMultiRangeCut::candidateType ( ) const
inlinefinaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 22 of file PhoSCEtaMultiRangeCut.cc.

References CutApplicatorBase::PHOTON.

22  {
23  return PHOTON;
24  }
CutApplicatorBase::result_type PhoSCEtaMultiRangeCut::operator() ( const reco::PhotonPtr cand) const
finaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 37 of file PhoSCEtaMultiRangeCut.cc.

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

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

Implements candidate_functions::CandidateCut.

Definition at line 50 of file PhoSCEtaMultiRangeCut.cc.

References _absEta, and funct::abs().

50  {
51  reco::PhotonPtr pho(cand);
52  const reco::SuperClusterRef& scref = pho->superCluster();
53  return ( _absEta ? std::abs(scref->eta()) : scref->eta() );
54 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

const bool PhoSCEtaMultiRangeCut::_absEta
private

Definition at line 27 of file PhoSCEtaMultiRangeCut.cc.

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

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

Definition at line 28 of file PhoSCEtaMultiRangeCut.cc.

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