CMS 3D CMS Logo

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 final
 
result_type operator() (const reco::PhotonPtr &) const final
 
 PhoSCEtaMultiRangeCut (const edm::ParameterSet &c)
 
double value (const reco::CandidatePtr &cand) const final
 
- Public Member Functions inherited from CutApplicatorBase
virtual result_type asCandidate (const argument_type &) const
 
 CutApplicatorBase ()
 
 CutApplicatorBase (const CutApplicatorBase &)=delete
 
 CutApplicatorBase (const edm::ParameterSet &c)
 
const std::string & name () const override
 
result_type operator() (const argument_type &) const final
 
virtual result_type operator() (const pat::ElectronPtr &) const
 
virtual result_type operator() (const pat::MuonPtr &) const
 
virtual result_type operator() (const reco::GsfElectronPtr &) const
 
virtual result_type operator() (const reco::MuonPtr &) const
 
CutApplicatorBaseoperator= (const CutApplicatorBase &)=delete
 
 ~CutApplicatorBase () override
 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
}
 
- Public Types inherited from candidate_functions::CandidateCut
using argument_type = reco::CandidatePtr
 
using result_type = bool
 

Detailed Description

Definition at line 4 of file PhoSCEtaMultiRangeCut.cc.

Constructor & Destructor Documentation

◆ PhoSCEtaMultiRangeCut()

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

Definition at line 6 of file PhoSCEtaMultiRangeCut.cc.

6  : CutApplicatorBase(c), _absEta(c.getParameter<bool>("useAbsEta")) {
7  const std::vector<edm::ParameterSet>& ranges = c.getParameterSetVector("allowedEtaRanges");
8  for (const auto& range : ranges) {
9  const double min = range.getParameter<double>("minEta");
10  const double max = range.getParameter<double>("maxEta");
11  _ranges.emplace_back(min, max);
12  }
13  }

References _ranges, HltBtagPostValidation_cff::c, SiStripPI::max, min(), FastTimerService_cff::range, and diffTwoXMLs::ranges.

Member Function Documentation

◆ candidateType()

CandidateType PhoSCEtaMultiRangeCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 19 of file PhoSCEtaMultiRangeCut.cc.

19 { return PHOTON; }

References CutApplicatorBase::PHOTON.

◆ operator()()

CutApplicatorBase::result_type PhoSCEtaMultiRangeCut::operator() ( const reco::PhotonPtr cand) const
finalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 28 of file PhoSCEtaMultiRangeCut.cc.

28  {
29  const reco::SuperClusterRef& scref = cand->superCluster();
30  const double the_eta = (_absEta ? std::abs(scref->eta()) : scref->eta());
31  bool result = false;
32  for (const auto& range : _ranges) {
33  if (the_eta >= range.first && the_eta < range.second) {
34  result = true;
35  break;
36  }
37  }
38  return result;
39 }

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

◆ value()

double PhoSCEtaMultiRangeCut::value ( const reco::CandidatePtr cand) const
finalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 41 of file PhoSCEtaMultiRangeCut.cc.

41  {
42  reco::PhotonPtr pho(cand);
43  const reco::SuperClusterRef& scref = pho->superCluster();
44  return (_absEta ? std::abs(scref->eta()) : scref->eta());
45 }

References _absEta, and funct::abs().

Member Data Documentation

◆ _absEta

const bool PhoSCEtaMultiRangeCut::_absEta
private

Definition at line 22 of file PhoSCEtaMultiRangeCut.cc.

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

◆ _ranges

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

Definition at line 23 of file PhoSCEtaMultiRangeCut.cc.

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

diffTwoXMLs.ranges
string ranges
Definition: diffTwoXMLs.py:79
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
CutApplicatorBase::PHOTON
Definition: CutApplicatorBase.h:47
min
T min(T a, T b)
Definition: MathUtil.h:58
CutApplicatorBase::CutApplicatorBase
CutApplicatorBase()
Definition: CutApplicatorBase.h:49
edm::Ref< SuperClusterCollection >
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
cand
Definition: decayParser.h:34
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::Ptr
Definition: AssociationVector.h:31
PhoSCEtaMultiRangeCut::_absEta
const bool _absEta
Definition: PhoSCEtaMultiRangeCut.cc:22
PhoSCEtaMultiRangeCut::_ranges
std::vector< std::pair< double, double > > _ranges
Definition: PhoSCEtaMultiRangeCut.cc:23
mps_fire.result
result
Definition: mps_fire.py:303
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22