CMS 3D CMS Logo

MuonTrackCut.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:
14  // inner track selection cuts
19 
21 };
23 
24 // Define constructors and initialization routines
27  minTrackerLayersWithMeasurement_(-1),
28  minPixelLayersWithMeasurement_(-1),
29  minNumberOfValidPixelHits_(-1),
30  minValidFraction_(-1),
31  trackQuality_(reco::Track::undefQuality),
32  minNumberOfValidMuonHits_(-1),
33  doInnerTrack_(false),
34  doGlobalTrack_(false) {
35  if (c.existsAs<edm::ParameterSet>("innerTrack")) {
36  doInnerTrack_ = true;
37 
38  const edm::ParameterSet cc = c.getParameter<edm::ParameterSet>("innerTrack");
39  if (cc.exists("minTrackerLayersWithMeasurement"))
40  minTrackerLayersWithMeasurement_ = cc.getParameter<int>("minTrackerLayersWithMeasurement");
41  if (cc.exists("minPixelLayersWithMeasurement"))
42  minPixelLayersWithMeasurement_ = cc.getParameter<int>("minPixelLayersWithMeasurement");
43  if (cc.exists("minNumberOfValidPixelHits"))
44  minNumberOfValidPixelHits_ = cc.getParameter<int>("minNumberOfValidPixelHits");
45  if (cc.exists("minValidFraction"))
46  minValidFraction_ = cc.getParameter<double>("minValidFraction");
47  const std::string trackQualityStr = cc.exists("trackQuality") ? cc.getParameter<std::string>("trackQuality") : "";
48  trackQuality_ = reco::Track::qualityByName(trackQualityStr);
49  }
50  if (c.existsAs<edm::ParameterSet>("globalTrack")) {
51  doGlobalTrack_ = true;
52 
53  const edm::ParameterSet cc = c.getParameter<edm::ParameterSet>("globalTrack");
54  //if ( cc.exists("maxNormalizedChi2") ) maxNormalizedChi2_ = cc.getParameter<double>("maxNormalizedChi2");
55  if (cc.exists("minNumberOfValidMuonHits"))
56  minNumberOfValidMuonHits_ = cc.getParameter<int>("minNumberOfValidMuonHits");
57  }
58 }
59 
60 // Functors for evaluation
62  if (doInnerTrack_) {
63  const reco::TrackRef t = muon->innerTrack();
64  if (t.isNull())
65  return false;
66  const auto& h = t->hitPattern();
68  return false;
69  if (h.trackerLayersWithMeasurement() < minTrackerLayersWithMeasurement_)
70  return false;
71  if (h.pixelLayersWithMeasurement() < minPixelLayersWithMeasurement_)
72  return false;
73  if (h.numberOfValidPixelHits() < minNumberOfValidPixelHits_)
74  return false;
75  if (t->validFraction() <= minValidFraction_)
76  return false;
77  }
78  if (doGlobalTrack_) {
79  const reco::TrackRef t = muon->globalTrack();
80  if (t.isNull())
81  return false;
82  const auto& h = t->hitPattern();
83  if (h.numberOfValidMuonHits() < minNumberOfValidMuonHits_)
84  return false;
85  // if ( t->normalizedChi2() > maxNormalizedChi2_ ) return false; Not used for
86  }
87 
88  return true;
89 }
90 
92  const reco::MuonPtr muon(cand);
93  if (doInnerTrack_) {
94  const reco::TrackRef t = muon->innerTrack();
95  if (t.isNull())
96  return 0;
97  const auto& h = t->hitPattern();
99  return t->quality(trackQuality_);
100  if (h.trackerLayersWithMeasurement() < minTrackerLayersWithMeasurement_)
101  return h.trackerLayersWithMeasurement();
102  if (h.pixelLayersWithMeasurement() < minPixelLayersWithMeasurement_)
103  return h.pixelLayersWithMeasurement();
104  if (h.numberOfValidPixelHits() < minNumberOfValidPixelHits_)
105  return h.numberOfValidPixelHits();
106  if (t->validFraction() <= minValidFraction_)
107  return t->validFraction();
108 
109  return t->validFraction();
110  }
111  if (doGlobalTrack_) {
112  const reco::TrackRef t = muon->globalTrack();
113  if (t.isNull())
114  return 0;
115  const auto& h = t->hitPattern();
116  if (h.numberOfValidMuonHits() < minNumberOfValidMuonHits_)
117  return h.numberOfValidMuonHits();
118  // if ( t->normalizedChi2() > maxNormalizedChi2_ ) return false; Not used for
119 
120  return h.numberOfValidMuonHits();
121  }
122 
123  return 0;
124 }
MuonTrackCut::candidateType
CandidateType candidateType() const final
Definition: MuonTrackCut.cc:10
MuonTrackCut::minNumberOfValidMuonHits_
int minNumberOfValidMuonHits_
Definition: MuonTrackCut.cc:18
Muon.h
MuonTrackCut::trackQuality_
reco::Track::TrackQuality trackQuality_
Definition: MuonTrackCut.cc:17
funct::false
false
Definition: Factorize.h:29
muon
Definition: MuonCocktails.h:17
reco::TrackBase::undefQuality
Definition: TrackBase.h:151
reco::TrackBase::TrackQuality
TrackQuality
track quality
Definition: TrackBase.h:150
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
watchdog.const
const
Definition: watchdog.py:83
MuonTrackCut::MuonTrackCut
MuonTrackCut(const edm::ParameterSet &c)
Definition: MuonTrackCut.cc:25
edm::Ref< TrackCollection >
candidate_functions::CandidateCut::result_type
bool result_type
Definition: CandidateCut.h:11
MuonTrackCut::minValidFraction_
double minValidFraction_
Definition: MuonTrackCut.cc:16
HLT_FULL_cff.muon
muon
Definition: HLT_FULL_cff.py:11725
MuonSelectors.h
h
MuonTrackCut::minPixelLayersWithMeasurement_
int minPixelLayersWithMeasurement_
Definition: MuonTrackCut.cc:15
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
CutApplicatorBase::MUON
Definition: CutApplicatorBase.h:47
edm::ParameterSet
Definition: ParameterSet.h:47
MuonTrackCut::doGlobalTrack_
bool doGlobalTrack_
Definition: MuonTrackCut.cc:20
CutApplicatorBase::CandidateType
CandidateType
Definition: CutApplicatorBase.h:47
edmplugin::PluginFactory
Definition: PluginFactory.h:34
cand
Definition: decayParser.h:32
MuonTrackCut::doInnerTrack_
bool doInnerTrack_
Definition: MuonTrackCut.cc:20
cc
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::Ptr< reco::Muon >
CutApplicatorBase
Definition: CutApplicatorBase.h:45
reco::TrackBase::qualityByName
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
MuonTrackCut::minNumberOfValidPixelHits_
int minNumberOfValidPixelHits_
Definition: MuonTrackCut.cc:15
MuonTrackCut::operator()
result_type operator()(const reco::MuonPtr &) const final
Definition: MuonTrackCut.cc:61
MuonTrackCut
Definition: MuonTrackCut.cc:5
CutApplicatorBase.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
MuonTrackCut::minTrackerLayersWithMeasurement_
int minTrackerLayersWithMeasurement_
Definition: MuonTrackCut.cc:15
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
MuonTrackCut::value
double value(const reco::CandidatePtr &) const final
Definition: MuonTrackCut.cc:91