]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/src/AliL3Track.h
Wrong CVS merging corrected
[u/mrichter/AliRoot.git] / HLT / src / AliL3Track.h
1 // @(#) $Id$
2
3 #ifndef ALIL3TRACK_H
4 #define ALIL3TRACK_H
5
6 #include <string.h>
7
8 #include "AliL3RootTypes.h"
9
10 class AliL3Vertex;
11 class AliL3SpacePointData;
12
13 class AliL3Track {
14   
15  private:
16
17   Int_t fNHits;
18
19   Int_t fMCid;  //Assigned id from MC data.
20
21   Double_t fKappa;   // Signed curvature (projected to a circle)
22   Double_t fRadius;  // Radius of the helix (projected to a circle)
23   Double_t fCenterX; // x coordinate of the center of the helix (projected to a circle)
24   Double_t fCenterY; // y coordinate of the center of the helix (projected to a circle)
25   Bool_t   fFromMainVertex; // true if tracks origin is the main vertex, otherwise false
26   
27   Int_t fRowRange[2]; //Subsector where this track was build
28   Int_t fSector;      //Sector # where  this track was build
29
30   //data from momentum fit
31   Int_t    fQ;    //charge measured fit
32     
33   //track parameters:
34   Double_t fTanl; //tan of dipangle
35   Double_t fPsi;  //azimuthal angle of the momentum 
36   Double_t fPt;   //transverse momentum
37   Double_t fLength; //length of track (s)
38   
39   Double_t fPterr;
40   Double_t fPsierr;
41   Double_t fZ0err;
42   Double_t fTanlerr;
43
44   Double_t fPhi0; //azimuthal angle of the first point
45   Double_t fR0;   //radius of the first point
46   Double_t fZ0;   //z coordinate of the first point (fFirstPoint[2])
47
48   Double_t fFirstPoint[3];
49   Double_t fLastPoint[3];
50   Double_t fPoint[3];
51   Double_t fPointPsi; //azimuthal angle of the momentum at Point
52
53
54   Bool_t fIsPoint;    //Helix crosses the X-plane
55   Bool_t IsPoint(Bool_t ispoint) {fIsPoint = ispoint;return fIsPoint;}
56   
57   Bool_t fIsLocal; //Track given in local coordinates.
58
59   UInt_t fHitNumbers[159];  //Array of hit numbers for this track
60
61   Float_t fPID;
62  public:
63   
64   AliL3Track();
65   virtual ~AliL3Track();
66   
67   virtual void Set(AliL3Track* track);
68   virtual Int_t Compare(const AliL3Track *track) const;
69   virtual void CalculateHelix();
70   
71   Bool_t CalculateReferencePoint(Double_t angle,Double_t radius=132);//Calculate Reference Point
72   Bool_t CalculateEdgePoint(Double_t angle);//Calculate crossing point with line
73   Bool_t CalculatePoint(Double_t xplane);   //Calculate crossing point with X-plane
74   Bool_t IsPoint() {return fIsPoint;}
75   Double_t GetCrossingAngle(Int_t padrow,Int_t slice=-1);
76   Bool_t GetCrossingPoint(Int_t padrow,Float_t *xyz);
77   Double_t GetDistance(Double_t x0,Double_t x1){return 0;}
78   void UpdateToFirstPoint();
79
80   Float_t GetPID() {return fPID;}
81   void    SetPID(Float_t pid) {fPID=pid;}
82
83   void GetClosestPoint(AliL3Vertex *vertex,Double_t &closest_x,Double_t &closest_y,Double_t &closest_z);
84   void Rotate(Int_t slice,Bool_t tolocal=kFALSE);
85   Bool_t IsLocal() {return fIsLocal;}
86   
87   // getter
88   Double_t GetFirstPointX() {return fFirstPoint[0];}
89   Double_t GetFirstPointY() {return fFirstPoint[1];}
90   Double_t GetFirstPointZ() {return fFirstPoint[2];}
91   Double_t GetLastPointX() {return fLastPoint[0];}
92   Double_t GetLastPointY() {return fLastPoint[1];}
93   Double_t GetLastPointZ() {return fLastPoint[2];}
94
95   Double_t GetPointPsi() {return fPointPsi;}
96   Double_t GetPointX() {return fPoint[0];}
97   Double_t GetPointY() {return fPoint[1];}
98   Double_t GetPointZ() {return fPoint[2];}
99
100   Double_t GetPt() const {return fPt;}
101   Double_t GetTgl() const {return fTanl;}
102   Double_t GetPsi() const {return fPsi;}
103   Double_t GetPhi0() const {return fPhi0;}
104   Double_t GetR0() const {return fR0;}
105   Double_t GetZ0() const {return fFirstPoint[2];}
106   //Double_t GetZ0() const {return fZ0;}
107   
108   Double_t GetKappa() const {return fKappa;}
109   Double_t GetRadius() const {return fRadius;}
110   Double_t GetCenterX() const {return fCenterX;}
111   Double_t GetCenterY() const {return fCenterY;}
112
113   Int_t GetNHits() const {return fNHits;}
114   Int_t   GetNumberOfPoints()   const {return fNHits;}
115   Bool_t  ComesFromMainVertex() const {return fFromMainVertex;}
116     
117   Double_t GetPx() const {return fPt*cos(fPsi);}
118   Double_t GetPy() const {return fPt*sin(fPsi);}
119   Double_t GetPz() const {return fPt*fTanl;}
120   
121   Double_t GetP() const;
122   Double_t GetPseudoRapidity() const;
123   //Double_t   GetEta() const; 
124   Double_t   GetRapidity() const;
125   
126   Int_t GetCharge() const {return fQ;}
127   Int_t GetMCid() const {return fMCid;}
128   Double_t GetLength() const {return fLength;}
129
130   Int_t GetFirstRow() const {return fRowRange[0];}
131   Int_t GetLastRow()  const {return fRowRange[1];}
132   Int_t GetSector()   const {return fSector;}
133
134   UInt_t *GetHitNumbers() {return fHitNumbers;}
135
136   // setter   
137   
138   void SetMCid(Int_t f) {fMCid = f;}
139   void SetFirstPoint(Double_t f,Double_t g,Double_t h) {fFirstPoint[0]=f; fFirstPoint[1]=g; fFirstPoint[2]=h;}
140   void SetLastPoint(Double_t f,Double_t g,Double_t h) {fLastPoint[0]=f; fLastPoint[1]=g; fLastPoint[2]=h;}
141   
142   void SetHits(Int_t nhits,UInt_t *hits) {memcpy(fHitNumbers,hits,nhits*sizeof(UInt_t));}
143   
144   void SetPhi0(Double_t f) {fPhi0 = f;}
145   void SetPsi(Double_t f) {fPsi = f;}
146   void SetR0(Double_t f) {fR0 = f;}
147   void SetTgl(Double_t f) {fTanl =f;}
148   //void SetZ0(Double_t f) {fZ0 = f;}
149   void SetZ0(Double_t f) {fFirstPoint[2] = f;}
150   void SetPt(Double_t f) {fPt = f;}
151   void SetLength(Double_t f) {fLength = f;}
152   void SetPterr(Double_t f) {fPterr = f;}
153   void SetPsierr(Double_t f) {fPsierr = f;}
154   void SetZ0err(Double_t f) {fZ0err = f;}
155   void SetTglerr(Double_t f) {fTanlerr = f;}
156   void SetKappa(Double_t f) {fKappa = f;}
157
158   void SetNHits(Int_t f) {fNHits = f;}
159     
160   void SetRowRange(Int_t f,Int_t g) {fRowRange[0]=f; fRowRange[1]=g;}
161   void SetSector(Int_t f) {fSector = f;}
162   
163   void SetRadius(Double_t f) {fRadius = f;}
164   void SetCenterX(Double_t f) {fCenterX = f;}
165   void SetCenterY(Double_t f) {fCenterY = f;}
166   
167   void SetCharge(Int_t f) {fQ = f;}
168   
169   void ComesFromMainVertex(Bool_t f) {fFromMainVertex = f;}
170   
171   ClassDef(AliL3Track,1) //Base track class
172 };
173     
174 #endif
175