CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TrackBase.h
Go to the documentation of this file.
1 #ifndef TrackReco_TrackBase_h
2 #define TrackReco_TrackBase_h
3 
58 #include <bitset>
59 
60 namespace reco {
61 
62  class TrackBase {
63  public:
65  enum { dimension = 5 };
66 
68  enum { covarianceSize = dimension * (dimension + 1) / 2 };
69 
72 
75 
78 
81 
83  enum { i_qoverp = 0, i_lambda, i_phi, i_dxy, i_dsz };
84 
86  typedef unsigned int index;
87 
91  ctf = 1,
93  cosmics = 3,
107  nuclInter = 17,
112  // Phase1
119  beamhalo = 28,
120  gsf = 29,
121  // HLT algo name
122  hltPixel = 30,
123  // steps used by PF
124  hltIter0 = 31,
125  hltIter1 = 32,
126  hltIter2 = 33,
127  hltIter3 = 34,
128  hltIter4 = 35,
129  // steps used by all other objects @HLT
130  hltIterX = 36,
131  // steps used by HI muon regional iterative tracking
141  algoSize = 46
142  };
143 
145  typedef std::bitset<algoSize> AlgoMask;
146 
147  static const std::string algoNames[];
148 
152  loose = 0,
153  tight = 1,
155  confirmed = 3, // means found by more than one iteration
156  goodIterative = 4, // meaningless
159  discarded = 7, // because a better track found. kept in the collection for reference....
161  };
162 
163  static const std::string qualityNames[];
164 
166  TrackBase();
167 
169  TrackBase(double chi2,
170  double ndof,
171  const Point &vertex,
172  const Vector &momentum,
173  int charge,
174  const CovarianceMatrix &cov,
177  signed char nloops = 0,
178  uint8_t stopReason = 0,
179  float t0 = 0.f,
180  float beta = 0.f,
181  float covt0t0 = -1.f,
182  float covbetabeta = -1.f);
183 
185  virtual ~TrackBase();
186 
188  bool isTimeOk() const { return covt0t0_ > 0.f; }
189 
191  double chi2() const;
192 
194  double ndof() const;
195 
197  double normalizedChi2() const;
198 
200  int charge() const;
201 
203  double qoverp() const;
204 
206  double theta() const;
207 
209  double lambda() const;
210 
212  double dxy() const;
213 
215  double d0() const;
216 
218  double dsz() const;
219 
221  double dz() const;
222 
224  double p2() const;
225 
227  double p() const;
228 
230  double pt2() const;
231 
233  double pt() const;
234 
236  double px() const;
237 
239  double py() const;
240 
242  double pz() const;
243 
245  double phi() const;
246 
248  double eta() const;
249 
251  double vx() const;
252 
254  double vy() const;
255 
257  double vz() const;
258 
260  const Vector &momentum() const;
261 
263  const Point &referencePoint() const;
264 
266  double t0() const;
267 
269  double beta() const;
270 
272  const Point &vertex() const;
273  //__attribute__((deprecated("This method is DEPRECATED, please use referencePoint() instead.")));
274 
276  double dxy(const Point &myBeamSpot) const;
277 
279  double dxy(const BeamSpot &theBeamSpot) const;
280 
282  double dsz(const Point &myBeamSpot) const;
283 
285  double dz(const Point &myBeamSpot) const;
286 
288  ParameterVector parameters() const;
289 
291  CovarianceMatrix covariance() const;
292 
294  double parameter(int i) const;
295 
297  double covariance(int i, int j) const;
298 
300  double covt0t0() const;
301 
303  double covBetaBeta() const;
304 
306  double error(int i) const;
307 
309  double qoverpError() const;
310 
312  double ptError2() const;
313 
315  double ptError() const;
316 
318  double thetaError() const;
319 
321  double lambdaError() const;
322 
324  double etaError() const;
325 
327  double phiError() const;
328 
330  double dxyError() const;
331 
333  double d0Error() const;
334 
336  double dszError() const;
337 
339  double dzError() const;
340 
342  double t0Error() const;
343 
345  double betaError() const;
346 
348  double dxyError(Point const &vtx, math::Error<3>::type const &vertexCov) const;
349 
351  double dxyError(const BeamSpot &theBeamSpot) const;
352 
354  CovarianceMatrix &fill(CovarianceMatrix &v) const;
355 
357  static index covIndex(index i, index j);
358 
360  const HitPattern &hitPattern() const;
361 
363  unsigned short numberOfValidHits() const;
364 
366  unsigned short numberOfLostHits() const;
367 
369  int missingInnerHits() const;
370 
372  int missingOuterHits() const;
373 
375  double validFraction() const;
376 
378  template <typename C>
379  bool appendHits(const C &c, const TrackerTopology &ttopo);
380 
381  template <typename I>
382  bool appendHits(const I &begin, const I &end, const TrackerTopology &ttopo);
383 
385  bool appendHitPattern(const TrackingRecHit &hit, const TrackerTopology &ttopo);
386  bool appendHitPattern(const DetId &id, TrackingRecHit::Type hitType, const TrackerTopology &ttopo);
387 
394  bool appendTrackerHitPattern(uint16_t subdet, uint16_t layer, uint16_t stereo, TrackingRecHit::Type hitType);
395  bool appendHitPattern(const uint16_t pattern, TrackingRecHit::Type hitType);
396 
403  bool appendMuonHitPattern(const DetId &id, TrackingRecHit::Type hitType);
404 
406  void resetHitPattern();
407 
409  void setAlgorithm(const TrackAlgorithm a);
410 
412 
413  void setAlgoMask(AlgoMask a) { algoMask_ = a; }
414 
415  AlgoMask algoMask() const { return algoMask_; }
416  unsigned long long algoMaskUL() const { return algoMask().to_ullong(); }
417  bool isAlgoInMask(TrackAlgorithm a) const { return algoMask()[a]; }
418 
419  TrackAlgorithm algo() const;
421 
422  std::string algoName() const;
423 
425 
426  static TrackAlgorithm algoByName(const std::string &name);
427 
429  bool quality(const TrackQuality) const;
430 
431  void setQuality(const TrackQuality);
432 
434 
436 
437  int qualityMask() const;
438 
439  void setQualityMask(int qualMask);
440 
441  void setNLoops(signed char value);
442 
443  bool isLooper() const;
444 
445  signed char nLoops() const;
446 
447  void setStopReason(uint8_t value) { stopReason_ = value; }
448 
449  uint8_t stopReason() const { return stopReason_; }
450 
451  private:
454 
457 
460 
462  float chi2_;
463 
465  Point vertex_;
466 
468  float t0_;
469 
471  Vector momentum_;
472 
475  float beta_;
476 
478  std::bitset<algoSize> algoMask_;
479 
481  float ndof_;
482 
484  char charge_;
485 
487  uint8_t algorithm_;
488 
491 
493  uint8_t quality_;
494 
496  // I use signed char because I don't expect more than 128 loops and I could use a negative value for a special purpose.
497  signed char nLoops_;
498 
500  uint8_t stopReason_;
501  };
502 
503  // Access the hit pattern, indicating in which Tracker layers the track has hits.
504  inline const HitPattern &TrackBase::hitPattern() const { return hitPattern_; }
505 
506  inline bool TrackBase::appendHitPattern(const DetId &id, TrackingRecHit::Type hitType, const TrackerTopology &ttopo) {
507  return hitPattern_.appendHit(id, hitType, ttopo);
508  }
509 
510  inline bool TrackBase::appendHitPattern(const TrackingRecHit &hit, const TrackerTopology &ttopo) {
511  return hitPattern_.appendHit(hit, ttopo);
512  }
513 
514  inline bool TrackBase::appendTrackerHitPattern(uint16_t subdet,
515  uint16_t layer,
516  uint16_t stereo,
517  TrackingRecHit::Type hitType) {
518  return hitPattern_.appendTrackerHit(subdet, layer, stereo, hitType);
519  }
520 
521  inline bool TrackBase::appendHitPattern(uint16_t pattern, TrackingRecHit::Type hitType) {
522  return hitPattern_.appendHit(pattern, hitType);
523  }
524 
526  return hitPattern_.appendMuonHit(id, hitType);
527  }
528 
530 
531  template <typename I>
532  bool TrackBase::appendHits(const I &begin, const I &end, const TrackerTopology &ttopo) {
533  return hitPattern_.appendHits(begin, end, ttopo);
534  }
535 
536  template <typename C>
537  bool TrackBase::appendHits(const C &c, const TrackerTopology &ttopo) {
538  return hitPattern_.appendHits(c.begin(), c.end(), ttopo);
539  }
540 
542  int a = (i <= j ? i : j);
543  int b = (i <= j ? j : i);
544  return b * (b + 1) / 2 + a;
545  }
546 
549 
551 
552  inline bool TrackBase::quality(const TrackBase::TrackQuality q) const {
553  switch (q) {
554  case undefQuality:
555  return quality_ == 0;
556  case goodIterative:
558  default:
559  return (quality_ & (1 << q)) >> q;
560  }
561  return false;
562  }
563 
565  if (q == undefQuality) {
566  quality_ = 0;
567  } else {
568  quality_ |= (1 << q);
569  }
570  }
571 
573  if (int(q) < int(qualitySize) && int(q) >= 0) {
574  return qualityNames[int(q)];
575  }
576  return "undefQuality";
577  }
578 
580  if (int(a) < int(algoSize) && int(a) > 0) {
581  return algoNames[int(a)];
582  }
583  return "undefAlgorithm";
584  }
585 
586  // chi-squared of the fit
587  inline double TrackBase::chi2() const { return chi2_; }
588 
589  // number of degrees of freedom of the fit
590  inline double TrackBase::ndof() const { return ndof_; }
591 
592  // chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
593  inline double TrackBase::normalizedChi2() const { return ndof_ != 0 ? chi2_ / ndof_ : chi2_ * 1e6; }
594 
595  // track electric charge
596  inline int TrackBase::charge() const { return charge_; }
597 
598  // q / p
599  inline double TrackBase::qoverp() const { return charge() / p(); }
600 
601  // polar angle
602  inline double TrackBase::theta() const { return momentum_.theta(); }
603 
604  // Lambda angle
605  inline double TrackBase::lambda() const { return M_PI_2 - momentum_.theta(); }
606 
607  // dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close to (0,0,0): see parametrization definition above for details). See also function dxy(myBeamSpot) below.
608  inline double TrackBase::dxy() const { return (-vx() * py() + vy() * px()) / pt(); }
609 
610  // dxy parameter in perigee convention (d0 = -dxy)
611  inline double TrackBase::d0() const { return -dxy(); }
612 
613  // dsz parameter (THIS IS NOT the SZ impact parameter to (0,0,0) if refPoint is far from (0,0,0): see parametrization definition above for details)
614  inline double TrackBase::dsz() const {
615  const auto thept = pt();
616  const auto thepinv = 1 / p();
617  const auto theptoverp = thept * thepinv;
618  return vz() * theptoverp - (vx() * px() + vy() * py()) / thept * pz() * thepinv;
619  }
620 
621  // dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to (0,0,0). See also function dz(myBeamSpot) below.
622  inline double TrackBase::dz() const {
623  const auto thept2inv = 1 / pt2();
624  return vz() - (vx() * px() + vy() * py()) * pz() * thept2inv;
625  }
626 
627  // momentum vector magnitude square
628  inline double TrackBase::p2() const { return momentum_.Mag2(); }
629 
630  // momentum vector magnitude
631  inline double TrackBase::p() const { return sqrt(p2()); }
632 
633  // track transverse momentum square
634  inline double TrackBase::pt2() const { return momentum_.Perp2(); }
635 
636  // track transverse momentum
637  inline double TrackBase::pt() const { return sqrt(pt2()); }
638 
639  // x coordinate of momentum vector
640  inline double TrackBase::px() const { return momentum_.x(); }
641 
642  // y coordinate of momentum vector
643  inline double TrackBase::py() const { return momentum_.y(); }
644 
645  // z coordinate of momentum vector
646  inline double TrackBase::pz() const { return momentum_.z(); }
647 
648  // azimuthal angle of momentum vector
649  inline double TrackBase::phi() const { return momentum_.Phi(); }
650 
651  // pseudorapidity of momentum vector
652  inline double TrackBase::eta() const { return momentum_.Eta(); }
653 
654  // x coordinate of the reference point on track
655  inline double TrackBase::vx() const { return vertex_.x(); }
656 
657  // y coordinate of the reference point on track
658  inline double TrackBase::vy() const { return vertex_.y(); }
659 
660  // z coordinate of the reference point on track
661  inline double TrackBase::vz() const { return vertex_.z(); }
662 
663  // track momentum vector
664  inline const TrackBase::Vector &TrackBase::momentum() const { return momentum_; }
665 
666  // Reference point on the track
667  inline const TrackBase::Point &TrackBase::referencePoint() const { return vertex_; }
668 
669  // Time at the reference point on the track
670  inline double TrackBase::t0() const { return t0_; }
671 
672  // Velocity at the reference point on the track in natural units
673  inline double TrackBase::beta() const { return beta_; }
674 
675  // reference point on the track. This method is DEPRECATED, please use referencePoint() instead
676  inline const TrackBase::Point &TrackBase::vertex() const { return vertex_; }
677 
678  // dxy parameter with respect to a user-given beamSpot
679  // (WARNING: this quantity can only be interpreted as a minimum transverse distance if beamSpot, if the beam spot is reasonably close to the refPoint, since linear approximations are involved).
680  // This is a good approximation for Tracker tracks.
681  inline double TrackBase::dxy(const Point &myBeamSpot) const {
682  return (-(vx() - myBeamSpot.x()) * py() + (vy() - myBeamSpot.y()) * px()) / pt();
683  }
684 
685  // dxy parameter with respect to the beamSpot taking into account the beamspot slopes
686  // (WARNING: this quantity can only be interpreted as a minimum transverse distance if beamSpot, if the beam spot is reasonably close to the refPoint, since linear approximations are involved).
687  // This is a good approximation for Tracker tracks.
688  inline double TrackBase::dxy(const BeamSpot &theBeamSpot) const { return dxy(theBeamSpot.position(vz())); }
689 
690  // dsz parameter with respect to a user-given beamSpot
691  // (WARNING: this quantity can only be interpreted as the distance in the S-Z plane to the beamSpot, if the beam spot is reasonably close to the refPoint, since linear approximations are involved).
692  // This is a good approximation for Tracker tracks.
693  inline double TrackBase::dsz(const Point &myBeamSpot) const {
694  const auto thept = pt();
695  const auto thepinv = 1 / p();
696  const auto theptoverp = thept * thepinv;
697  return (vz() - myBeamSpot.z()) * theptoverp -
698  ((vx() - myBeamSpot.x()) * px() + (vy() - myBeamSpot.y()) * py()) / thept * pz() * thepinv;
699  }
700 
701  // dz parameter with respect to a user-given beamSpot
702  // (WARNING: this quantity can only be interpreted as the track z0, if the beamSpot is reasonably close to the refPoint, since linear approximations are involved).
703  // This is a good approximation for Tracker tracks.
704  inline double TrackBase::dz(const Point &myBeamSpot) const {
705  const auto theptinv2 = 1 / pt2();
706  return (vz() - myBeamSpot.z()) -
707  ((vx() - myBeamSpot.x()) * px() + (vy() - myBeamSpot.y()) * py()) * pz() * theptinv2;
708  }
709 
710  // Track parameters with one-to-one correspondence to the covariance matrix
712  return TrackBase::ParameterVector(qoverp(), lambda(), phi(), dxy(), dsz());
713  }
714 
715  // return track covariance matrix
718  fill(m);
719  return m;
720  }
721 
722  // i-th parameter ( i = 0, ... 4 )
723  inline double TrackBase::parameter(int i) const { return parameters()[i]; }
724 
725  // (i,j)-th element of covariance matrix (i, j = 0, ... 4)
726  inline double TrackBase::covariance(int i, int j) const { return covariance_[covIndex(i, j)]; }
727 
728  // error on specified element
729  inline double TrackBase::error(int i) const { return sqrt(covariance_[covIndex(i, i)]); }
730 
731  // error on signed transverse curvature
732  inline double TrackBase::qoverpError() const { return error(i_qoverp); }
733 
734  // error on Pt (set to 1000**2 TeV**2 if charge==0 for safety)
735  inline double TrackBase::ptError2() const {
736  const auto thecharge = charge();
737 
738  if (thecharge != 0) {
739  const auto thept2 = pt2();
740  const auto thep2 = p2();
741  const auto thepz = pz();
742  const auto ptimespt = sqrt(thep2 * thept2);
743  const auto oneovercharge = 1 / thecharge;
744 
745  return thept2 * thep2 * oneovercharge * oneovercharge * covariance(i_qoverp, i_qoverp) +
746  2 * ptimespt * oneovercharge * thepz * covariance(i_qoverp, i_lambda) +
747  thepz * thepz * covariance(i_lambda, i_lambda);
748  }
749 
750  return 1.e12;
751  }
752 
753  // error on Pt (set to 1000 TeV if charge==0 for safety)
754  inline double TrackBase::ptError() const { return sqrt(ptError2()); }
755 
756  // error on theta
757  inline double TrackBase::thetaError() const { return error(i_lambda); }
758 
759  // error on lambda
760  inline double TrackBase::lambdaError() const { return error(i_lambda); }
761 
762  // error on eta
763  inline double TrackBase::etaError() const { return error(i_lambda) * sqrt(p2() / pt2()); }
764 
765  // error on phi
766  inline double TrackBase::phiError() const { return error(i_phi); }
767 
768  // error on dxy
769  inline double TrackBase::dxyError() const { return error(i_dxy); }
770 
771  // error on d0
772  inline double TrackBase::d0Error() const { return error(i_dxy); }
773 
774  // error on dsz
775  inline double TrackBase::dszError() const { return error(i_dsz); }
776 
777  // error on dz
778  inline double TrackBase::dzError() const { return error(i_dsz) * sqrt(p2() / pt2()); }
779 
780  // covariance of t0
781  inline double TrackBase::covt0t0() const { return covt0t0_; }
782 
783  // covariance of beta
784  inline double TrackBase::covBetaBeta() const { return covbetabeta_; }
785 
786  // error on t0
787  inline double TrackBase::t0Error() const { return std::sqrt(covt0t0_); }
788 
789  // error on beta
790  inline double TrackBase::betaError() const { return std::sqrt(covbetabeta_); }
791 
792  // error on dxy with respect to a given beamspot
793  inline double TrackBase::dxyError(const BeamSpot &theBeamSpot) const {
794  return dxyError(theBeamSpot.position(vz()), theBeamSpot.rotatedCovariance3D());
795  }
796 
797  // number of valid hits found
798  inline unsigned short TrackBase::numberOfValidHits() const { return hitPattern_.numberOfValidHits(); }
799 
800  // number of cases where track crossed a layer without getting a hit.
801  inline unsigned short TrackBase::numberOfLostHits() const {
803  }
804 
805  // number of hits expected from inner track extrapolation but missing
806  inline int TrackBase::missingInnerHits() const {
808  }
809 
810  // number of hits expected from outer track extrapolation but missing
811  inline int TrackBase::missingOuterHits() const {
813  }
814 
815  // fraction of valid hits on the track
816  inline double TrackBase::validFraction() const {
821 
822  const auto tot = valid + lost + lostIn + lostOut;
823 
824  if (tot == 0) {
825  return -1;
826  }
827 
828  return valid / (double)(tot);
829  }
830 
831  //Track algorithm
833  algorithm_ = a;
834  algoMask_.reset();
836  }
837 
840  algoMask_.set(a);
841  }
842 
843  inline int TrackBase::qualityMask() const { return quality_; }
844 
845  inline void TrackBase::setQualityMask(int qualMask) { quality_ = qualMask; }
846 
847  inline void TrackBase::setNLoops(signed char value) { nLoops_ = value; }
848 
849  inline bool TrackBase::isLooper() const { return (nLoops_ > 0); }
850 
851  inline signed char TrackBase::nLoops() const { return nLoops_; }
852 
853 } // namespace reco
854 
855 #endif
double qoverp() const
q / p
Definition: TrackBase.h:599
bool appendMuonHitPattern(const DetId &id, TrackingRecHit::Type hitType)
Definition: TrackBase.h:525
double p() const
momentum vector magnitude
Definition: TrackBase.h:631
uint8_t stopReason_
Stop Reason.
Definition: TrackBase.h:500
float chi2_
chi-squared
Definition: TrackBase.h:462
double t0() const
time at the reference point
Definition: TrackBase.h:670
void setQualityMask(int qualMask)
Definition: TrackBase.h:845
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:667
double d0Error() const
error on d0
Definition: TrackBase.h:772
void setQuality(const TrackQuality)
Definition: TrackBase.h:564
static std::string qualityName(TrackQuality)
Definition: TrackBase.h:572
unsigned int index
index type
Definition: TrackBase.h:86
const edm::EventSetup & c
bool isLooper() const
Definition: TrackBase.h:849
bool appendHits(const I &begin, const I &end, const TrackerTopology &ttopo)
Definition: HitPattern.h:522
static index covIndex(index i, index j)
covariance matrix index in array
Definition: TrackBase.h:541
uint8_t quality_
track quality
Definition: TrackBase.h:493
double validFraction() const
fraction of valid hits on the track
Definition: TrackBase.h:816
uint8_t originalAlgorithm_
track algorithm
Definition: TrackBase.h:490
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
Definition: TrackBase.h:611
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:593
TrackBase()
default constructor
Definition: TrackBase.cc:59
TrackQuality
track quality
Definition: TrackBase.h:150
double theta() const
polar angle
Definition: TrackBase.h:602
double dxyError() const
error on dxy
Definition: TrackBase.h:769
char charge_
electric charge
Definition: TrackBase.h:484
int numberOfValidHits() const
Definition: HitPattern.h:811
Point vertex_
innermost (reference) point on track
Definition: TrackBase.h:465
int missingOuterHits() const
number of hits expected from outer track extrapolation but missing
Definition: TrackBase.h:811
uint8_t stopReason() const
Definition: TrackBase.h:449
float covbetabeta_
Definition: TrackBase.h:459
double etaError() const
error on eta
Definition: TrackBase.h:763
#define M_PI_2
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
Definition: TrackBase.h:801
ErrorD< N >::type type
Definition: Error.h:32
math::Vector< dimension >::type ParameterVector
parameter vector
Definition: TrackBase.h:71
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:640
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:664
double dsz() const
dsz parameter (THIS IS NOT the SZ impact parameter to (0,0,0) if refPoint is far from (0...
Definition: TrackBase.h:614
signed char nLoops_
number of loops made during the building of the trajectory of a looper particle
Definition: TrackBase.h:497
TrackAlgorithm
track algorithm
Definition: TrackBase.h:89
constexpr std::array< uint8_t, layerIndexSize > layer
int numberOfLostTrackerHits(HitCategory category) const
Definition: HitPattern.h:887
double p2() const
momentum vector magnitude square
Definition: TrackBase.h:628
TrackAlgorithm algo() const
Definition: TrackBase.h:547
void setNLoops(signed char value)
Definition: TrackBase.h:847
void setOriginalAlgorithm(const TrackAlgorithm a)
Definition: TrackBase.h:838
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
Definition: TrackBase.h:676
double dszError() const
error on dsz
Definition: TrackBase.h:775
bool isTimeOk() const
return true if timing measurement is usable
Definition: TrackBase.h:188
double beta() const
velocity at the reference point in natural units
Definition: TrackBase.h:673
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
static const std::string qualityNames[]
Definition: TrackBase.h:163
void setStopReason(uint8_t value)
Definition: TrackBase.h:447
fixed size vector
Definition: Vector.h:24
bool appendTrackerHitPattern(uint16_t subdet, uint16_t layer, uint16_t stereo, TrackingRecHit::Type hitType)
Definition: TrackBase.h:514
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:587
std::bitset< algoSize > algoMask_
algo mask, bit set for the algo where it was reconstructed + each algo a track was found overlapping ...
Definition: TrackBase.h:478
double ndof() const
number of degrees of freedom of the fit
Definition: TrackBase.h:590
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:716
T sqrt(T t)
Definition: SSEVec.h:19
double pt() const
track transverse momentum
Definition: TrackBase.h:637
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Definition: TrackBase.h:754
int missingInnerHits() const
number of hits expected from inner track extrapolation but missing
Definition: TrackBase.h:806
double phiError() const
error on phi
Definition: TrackBase.h:766
int qualityMask() const
Definition: TrackBase.h:843
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:210
double lambda() const
Lambda angle.
Definition: TrackBase.h:605
const std::complex< double > I
Definition: I.h:8
double error(int i) const
error on specified element
Definition: TrackBase.h:729
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:798
void resetHitPattern()
Sets HitPattern as empty.
Definition: TrackBase.h:529
math::XYZPoint Point
point in the space
Definition: TrackBase.h:80
void setAlgoMask(AlgoMask a)
Definition: TrackBase.h:413
bool appendTrackerHit(uint16_t subdet, uint16_t layer, uint16_t stereo, TrackingRecHit::Type hitType)
Definition: HitPattern.cc:282
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:646
double parameter(int i) const
i-th parameter ( i = 0, ... 4 )
Definition: TrackBase.h:723
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:732
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:622
double dzError() const
error on dz
Definition: TrackBase.h:778
bool isAlgoInMask(TrackAlgorithm a) const
Definition: TrackBase.h:417
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:661
Definition: DetId.h:17
TrackAlgorithm originalAlgo() const
Definition: TrackBase.h:548
double covBetaBeta() const
error on beta
Definition: TrackBase.h:784
std::bitset< algoSize > AlgoMask
algo mask
Definition: TrackBase.h:145
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
float covt0t0_
errors for time and velocity (separate from cov for now)
Definition: TrackBase.h:459
AlgoMask algoMask() const
Definition: TrackBase.h:415
virtual ~TrackBase()
virtual destructor
Definition: TrackBase.cc:122
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:504
signed char nLoops() const
Definition: TrackBase.h:851
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::string algoName() const
Definition: TrackBase.h:550
This class analyses the reconstruction quality for a given track.
Definition: TrackQuality.h:29
double b
Definition: hdecay.h:118
float ndof_
number of degrees of freedom
Definition: TrackBase.h:481
bool appendHitPattern(const TrackingRecHit &hit, const TrackerTopology &ttopo)
append a single hit to the HitPattern
Definition: TrackBase.h:510
static const std::string algoNames[]
Definition: TrackBase.h:147
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:552
int numberOfLostHits(HitCategory category) const
Definition: HitPattern.h:885
int numberOfValidTrackerHits() const
Definition: HitPattern.h:813
void setAlgorithm(const TrackAlgorithm a)
Track algorithm.
Definition: TrackBase.h:832
double covt0t0() const
error on t0
Definition: TrackBase.h:781
ParameterVector parameters() const
Track parameters with one-to-one correspondence to the covariance matrix.
Definition: TrackBase.h:711
double lambdaError() const
error on lambda
Definition: TrackBase.h:760
float t0_
time at the reference point on track
Definition: TrackBase.h:468
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:658
float covariance_[covarianceSize]
perigee 5x5 covariance matrix
Definition: TrackBase.h:456
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
HitPattern hitPattern_
hit pattern
Definition: TrackBase.h:453
double a
Definition: hdecay.h:119
CovarianceMatrix & fill(CovarianceMatrix &v) const
fill SMatrix
Definition: TrackBase.cc:124
string end
Definition: dataset.py:937
double betaError() const
error on beta
Definition: TrackBase.h:790
static TrackAlgorithm algoByName(const std::string &name)
Definition: TrackBase.cc:137
Vector momentum_
momentum vector at innermost point
Definition: TrackBase.h:471
double ptError2() const
error on Pt (set to 1000**2 TeV**2 if charge==0 for safety)
Definition: TrackBase.h:735
int charge() const
track electric charge
Definition: TrackBase.h:596
const Point & position() const
position
Definition: BeamSpot.h:59
double pt2() const
track transverse momentum square
Definition: TrackBase.h:634
unsigned long long algoMaskUL() const
Definition: TrackBase.h:416
Covariance3DMatrix rotatedCovariance3D() const
Definition: BeamSpot.cc:73
uint8_t algorithm_
track algorithm
Definition: TrackBase.h:487
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:608
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:77
bool appendHits(const C &c, const TrackerTopology &ttopo)
append hit patterns from vector of hit references
Definition: TrackBase.h:537
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:643
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:655
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Definition: TrackBase.h:74
double thetaError() const
error on theta
Definition: TrackBase.h:757
double t0Error() const
error on t0
Definition: TrackBase.h:787
bool appendMuonHit(const DetId &id, TrackingRecHit::Type hitType)
Definition: HitPattern.cc:286