StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StiTrack.h
1 
20 #ifndef StiTrack_H
21 #define StiTrack_H 1
22 
23 //std
24 #include <math.h>
25 #include <vector>
26 using namespace std;
27 
28 //SCL
29 #include "StThreeVector.hh"
30 #include "StThreeVectorF.hh"
31 
32 //Sti
33 class StiHit;
34 class StHit;
35 class StMeasuredPoint;
36 class StiTrackFinder;
37 class StiTrackFitter;
38 class StiTrack;
39 class StiTrackNode;
40 class StiNodePars;
41 class StiNodeErrs;
42 
49 enum StiDirection {kOutsideIn=0, kInsideOut};
50 
59 class StiTrack
60 {
61 public:
62 
63  enum StiTrackProperty {kCharge=0,
64  kMass,
65  kChi2,
66  kDca2,
67  kDca3,
68  kFlag,
69  kPrimaryDca,
70  kPointCount,
71  kFitPointCount,
72  kGapCount,
73  kTrackLength,
74  kMaxPointCount,
75  kisPrimary,
76  kTpcDedx,
77  kSvtDedx,
78  kCurvature,
79  kP,
80  kPt,
81  kRapidity,
82  kPseudoRapidity,
83  kPhi,
84  kTanL };
85  static void setTrackFinder(StiTrackFinder * finder);
86  static void setTrackFitter(StiTrackFitter * fitter);
87  static StiTrackFinder * getTrackFinder();
88  static StiTrackFitter * getTrackFitter();
89 
90  StiTrack();
91  virtual ~StiTrack() { /* nops */ }
92 
93  virtual int initialize(const vector<StiHit*> &)=0;
94  virtual int initialize0(const std::vector<StiHit*> &hits, StiNodePars *firstPars, StiNodePars *lastPars, StiNodeErrs *firstErrs, StiNodeErrs *lastErrs)=0;
95 
96  virtual int fit (int direction=kOutsideIn);
97  virtual bool find(int direction=kOutsideIn);
98  virtual void reset()=0;
99  virtual void unset(){;}
100  virtual void reduce(){;}
101  virtual void getMomentum(double p[3], double e[6]) const =0;
102  virtual double getCurvature() const=0; // transverse curvature
103  virtual double getP() const=0; // transverse momentum
104  virtual double getPt() const=0; // transverse momentum
105  virtual double getRapidity() const=0; // rapidity
106  virtual double getPseudoRapidity() const=0; // pseudo rapidity
107  virtual double getPhi() const=0; // azimuthal angle
108  virtual double getTanL() const=0; // tan(lambda)
109  virtual double getDca(const StiHit*)const; // distance of closest approach to main vertex
110  virtual double getDca() const=0; // distance of closest approach to main vertex
111  virtual double getDca2(StiTrack *t) const=0; // distance of closest approach to given track - 2D calc
112  virtual double getDca3(StiTrack *t) const=0; // distance of closest approach to given track - 3D calc
113  virtual int getPointCount (int detectorId=0) const=0;
114  virtual int getFitPointCount(int detectorId=0) const=0;
115  virtual int getGapCount() const=0;
116  virtual int getMaxPointCount(int detectorId=0) const=0;
118  virtual UShort_t getSeedHitCount() const =0;
119  virtual void setSeedHitCount(UShort_t c)=0;
120  virtual double getTrackLength() const=0;
121  virtual vector<const StMeasuredPoint*> stHits() const=0;
123  virtual double getMass() const=0;
125  virtual int getCharge() const=0;
127  virtual double getChi2() const=0;
128  virtual double getChi2Max() const=0; // maximal chi2
129  virtual void setFlag(int v)=0;
130  virtual int getFlag() const=0;
131  virtual vector<StiHit*> getHits()=0;
132  // Convenience Accessor using a switch
133  virtual double getValue(int key) const;
134  int getId() const {return mId;}
135  void setId(int id) {mId=id;}
136  virtual StiTrackNode *extendToVertex(StiHit* vertex)=0;
137  // virtual bool extendToVertex(StiHit* vertex, const StiDetector * alternate)=0;
138  virtual int refit()=0;
139  virtual int refitL()=0;
140  StiTrack &operator=(const StiTrack &tk);
141  protected:
142  static StiTrackFinder * trackFinder;
143  static StiTrackFitter * trackFitter;
144 
145  friend ostream& operator<<(ostream& os, const StiTrack& track);
146 protected:
147  int mId;
148  int mIdDb;
149 };
150 
151 //Dummy get global dca method always returns zero
152 inline double StiTrack::getDca(const StiHit*)const
153 {
154  return 0;
155 }
156 #endif
Definition: StHit.h:125
Abstract definition of a Track.
Definition: StiTrack.h:59
Definition: StiHit.h:51
An abstract class defining the interface to the track finder.