CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackSelection.cc
Go to the documentation of this file.
3 
4 #include<iostream>
5 
6 namespace spr{
7 
9 
10  bool select = pTrack->quality(parameters.minQuality);
11  double dxy = pTrack->dxy(leadPV);
12  double dz = pTrack->dz(leadPV);
13  double dpbyp = 999;
14  if (std::abs(pTrack->qoverp()) > 0.0000001)
15  dpbyp = std::abs(pTrack->qoverpError()/pTrack->qoverp());
16 
17  if (debug) std::cout << "Track:: Pt " << pTrack->pt() << " dxy " << dxy << " dz " << dz << " Chi2 " << pTrack->normalizedChi2() << " dpbyp " << dpbyp << " Quality " << select << std::endl;
18 
19  if (pTrack->pt() < parameters.minPt) select = false;
20  if (dxy > parameters.maxDxyPV || dz > parameters.maxDzPV) select = false;
21  if (pTrack->normalizedChi2() > parameters.maxChi2) select = false;
22  if (dpbyp > parameters.maxDpOverP) select = false;
23 
24  if (parameters.minLayerCrossed>0 || parameters.minOuterHit>0) {
25  const reco::HitPattern& hitp = pTrack->hitPattern();
26  if (parameters.minLayerCrossed>0 && hitp.trackerLayersWithMeasurement() < parameters.minLayerCrossed) select = false;
27  if (parameters.minOuterHit>0 && (hitp.stripTOBLayersWithMeasurement()+hitp.stripTECLayersWithMeasurement() ) < parameters.minOuterHit) select = false;
28  if (debug) {
29  std::cout << "Default Hit Pattern with " << hitp.numberOfHits() << " hits" << std::endl;
30  for (int i=0; i<hitp.numberOfHits(); i++)
32  }
33  }
34  if (parameters.maxInMiss >= 0) {
35  const reco::HitPattern& hitp = pTrack->trackerExpectedHitsInner();
36  if (hitp.trackerLayersWithoutMeasurement() > parameters.maxInMiss) select = false;
37  if (debug) {
38  std::cout << "Inner Hit Pattern with " << hitp.numberOfHits() << " hits" << std::endl;
39  for (int i=0; i<hitp.numberOfHits(); i++)
41  }
42  }
43  if (parameters.maxOutMiss >= 0) {
44  const reco::HitPattern& hitp = pTrack->trackerExpectedHitsOuter();
45  if (hitp.trackerLayersWithoutMeasurement() > parameters.maxOutMiss) select = false;
46  if (debug) {
47  std::cout << "Outer Hit Pattern with " << hitp.numberOfHits() << " hits" << std::endl;
48  for (int i=0; i<hitp.numberOfHits(); i++)
50  }
51  }
52  if (debug) std::cout << "Final Selection Result " << select << std::endl;
53 
54  return select;
55  }
56 }
double qoverp() const
q/p
Definition: TrackBase.h:115
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:375
int i
Definition: DBlmapReader.cc:9
dictionary parameters
Definition: Parameters.py:2
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:111
int trackerLayersWithoutMeasurement() const
Definition: HitPattern.h:739
#define abs(x)
Definition: mlp_lapack.h:159
const HitPattern & trackerExpectedHitsOuter() const
Access the hit pattern counting (in the Tracker) the number of expected crossed layers after the last...
Definition: TrackBase.h:227
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
int trackerLayersWithMeasurement() const
Definition: HitPattern.h:721
double pt() const
track transverse momentum
Definition: TrackBase.h:131
int numberOfHits() const
Definition: HitPattern.cc:213
const HitPattern & trackerExpectedHitsInner() const
Access the hit pattern counting (in the Tracker) the number of expected crossed layers before the fir...
Definition: TrackBase.h:225
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:223
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:192
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:127
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:377
reco::TrackBase::TrackQuality minQuality
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:384
tuple cout
Definition: gather_cfg.py:121
void printHitPattern(int position, std::ostream &stream) const
Definition: HitPattern.cc:564
#define debug
Definition: MEtoEDMFormat.h:34
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:121