CMS 3D CMS Logo

MuonMomQualityCut.cc
Go to the documentation of this file.
4 
6 {
7 public:
9 
10  result_type operator()(const reco::MuonPtr&) const override final;
11  CandidateType candidateType() const override final { return MUON; }
12  double value(const reco::CandidatePtr&) const override final;
13 
14 private:
15  const double maxRelPtErr_;
16 };
18 
19 // Define constructors and initialization routines
22  maxRelPtErr_(c.getParameter<double>("maxRelPtErr"))
23 {
24 }
25 
26 // Functors for evaluation
27 CutApplicatorBase::result_type MuonMomQualityCut::operator()(const reco::MuonPtr& cand) const
28 {
29  const auto trackRef = cand->muonBestTrack();
30  return trackRef.isNonnull() and trackRef->ptError() <= maxRelPtErr_*trackRef->pt();
31 
32  return true;
33 }
34 
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 }
MuonMomQualityCut(const edm::ParameterSet &c)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
result_type operator()(const reco::MuonPtr &) const override final
double value(const reco::CandidatePtr &) const override final
virtual TrackRef muonBestTrack() const
Definition: Muon.h:63
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
CandidateType candidateType() const override final
const double maxRelPtErr_
#define DEFINE_EDM_PLUGIN(factory, type, name)