CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MuonMomQualityCut Class Reference
Inheritance diagram for MuonMomQualityCut:
CutApplicatorBase candidate_functions::CandidateCut

Public Member Functions

CandidateType candidateType () const final
 
 MuonMomQualityCut (const edm::ParameterSet &c)
 
result_type operator() (const reco::MuonPtr &) const final
 
double value (const reco::CandidatePtr &) const final
 
- Public Member Functions inherited from CutApplicatorBase
virtual result_type asCandidate (const argument_type &) const
 
 CutApplicatorBase ()
 
 CutApplicatorBase (const edm::ParameterSet &c)
 
 CutApplicatorBase (const CutApplicatorBase &)=delete
 
const std::string & name () const override
 
result_type operator() (const argument_type &) const override 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 pat::MuonPtr &) const
 
virtual result_type operator() (const reco::PFTauPtr &) const
 
virtual result_type operator() (const pat::TauPtr &) const
 
CutApplicatorBaseoperator= (const CutApplicatorBase &)=delete
 
 ~CutApplicatorBase () override
 Destructor. More...
 
- Public Member Functions inherited from candidate_functions::CandidateCut
 CandidateCut ()
 
virtual ~CandidateCut ()
 

Private Attributes

const double maxRelPtErr_
 

Additional Inherited Members

- Public Types inherited from CutApplicatorBase
enum  CandidateType {
  NONE, ELECTRON, MUON, PHOTON,
  TAU, PATELECTRON, PATMUON, PATPHOTON,
  PATTAU
}
 

Detailed Description

Definition at line 5 of file MuonMomQualityCut.cc.

Constructor & Destructor Documentation

MuonMomQualityCut::MuonMomQualityCut ( const edm::ParameterSet c)

Definition at line 20 of file MuonMomQualityCut.cc.

20  :
22  maxRelPtErr_(c.getParameter<double>("maxRelPtErr"))
23 {
24 }
T getParameter(std::string const &) const
const double maxRelPtErr_

Member Function Documentation

CandidateType MuonMomQualityCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 11 of file MuonMomQualityCut.cc.

References CutApplicatorBase::MUON, and value().

CutApplicatorBase::result_type MuonMomQualityCut::operator() ( const reco::MuonPtr cand) const
finalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 27 of file MuonMomQualityCut.cc.

References edm::Ref< C, T, F >::isNonnull(), maxRelPtErr_, and reco::Muon::muonBestTrack().

28 {
29  const auto trackRef = cand->muonBestTrack();
30  return trackRef.isNonnull() and trackRef->ptError() <= maxRelPtErr_*trackRef->pt();
31 
32  return true;
33 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:253
virtual TrackRef muonBestTrack() const
Definition: Muon.h:63
const double maxRelPtErr_
double MuonMomQualityCut::value ( const reco::CandidatePtr cand) const
finalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 35 of file MuonMomQualityCut.cc.

References metsig::muon, reco::Muon::muonBestTrack(), and or.

Referenced by candidateType().

36 {
37  const reco::MuonPtr muon(cand);
38  const auto trackRef = muon->muonBestTrack();
39  if ( trackRef.isNull() or trackRef->pt() <= 0 ) return -1;
40 
41  return trackRef->ptError()/trackRef->pt();
42 }
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12

Member Data Documentation

const double MuonMomQualityCut::maxRelPtErr_
private

Definition at line 15 of file MuonMomQualityCut.cc.

Referenced by operator()().