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

Public Member Functions

CandidateType candidateType () const overridefinal
 
 MuonMomQualityCut (const edm::ParameterSet &c)
 
result_type operator() (const reco::MuonPtr &) const overridefinal
 
double value (const reco::CandidatePtr &) 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 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
 
virtual ~CutApplicatorBase ()
 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
inlinefinaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 11 of file MuonMomQualityCut.cc.

References CutApplicatorBase::MUON.

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

Reimplemented from CutApplicatorBase.

Definition at line 27 of file MuonMomQualityCut.cc.

References edm::Ptr< T >::isNonnull(), and maxRelPtErr_.

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: Ptr.h:169
const double maxRelPtErr_
double MuonMomQualityCut::value ( const reco::CandidatePtr cand) const
finaloverridevirtual

Implements candidate_functions::CandidateCut.

Definition at line 35 of file MuonMomQualityCut.cc.

References metsig::muon, and or.

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::EventIDconst &, edm::Timestampconst & > 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()().