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 }
TrackQuality
track quality
Definition: TrackBase.h:150
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
int minNumberOfValidPixelHits_
Definition: MuonTrackCut.cc:15
double value(const reco::CandidatePtr &) const final
Definition: MuonTrackCut.cc:91
MuonTrackCut(const edm::ParameterSet &c)
Definition: MuonTrackCut.cc:25
int minNumberOfValidMuonHits_
Definition: MuonTrackCut.cc:18
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
int minTrackerLayersWithMeasurement_
Definition: MuonTrackCut.cc:15
fixed size matrix
reco::Track::TrackQuality trackQuality_
Definition: MuonTrackCut.cc:17
double minValidFraction_
Definition: MuonTrackCut.cc:16
#define DEFINE_EDM_PLUGIN(factory, type, name)
CandidateType candidateType() const final
Definition: MuonTrackCut.cc:10
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
result_type operator()(const reco::MuonPtr &) const final
Definition: MuonTrackCut.cc:61
bool doInnerTrack_
Definition: MuonTrackCut.cc:20
int minPixelLayersWithMeasurement_
Definition: MuonTrackCut.cc:15
bool doGlobalTrack_
Definition: MuonTrackCut.cc:20