CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MuonMomQualityCut.cc
Go to the documentation of this file.
4 
6 public:
8 
9  result_type operator()(const reco::MuonPtr&) const final;
10  CandidateType candidateType() const final { return MUON; }
11  double value(const reco::CandidatePtr&) const final;
12 
13 private:
15 };
17 
18 // Define constructors and initialization routines
19 MuonMomQualityCut::MuonMomQualityCut(const edm::ParameterSet& c)
20  : CutApplicatorBase(c), maxRelPtErr_(c.getParameter<double>("maxRelPtErr")) {}
21 
22 // Functors for evaluation
24  const auto trackRef = cand->muonBestTrack();
25  return trackRef.isNonnull() and trackRef->ptError() <= maxRelPtErr_ * trackRef->pt();
26 
27  return true;
28 }
29 
30 double MuonMomQualityCut::value(const reco::CandidatePtr& cand) const {
31  const reco::MuonPtr muon(cand);
32  const auto trackRef = muon->muonBestTrack();
33  if (trackRef.isNull() or trackRef->pt() <= 0)
34  return -1;
35 
36  return trackRef->ptError() / trackRef->pt();
37 }
MuonMomQualityCut(const edm::ParameterSet &c)
const edm::EventSetup & c
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
CandidateType candidateType() const final
result_type operator()(const reco::MuonPtr &) const final
double value(const reco::CandidatePtr &) const final
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
const double maxRelPtErr_
#define DEFINE_EDM_PLUGIN(factory, type, name)