]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCtrack.h
3d0cfbc5e8c4b4f23cd8d9bc6975d69df23b8684
[u/mrichter/AliRoot.git] / TPC / AliTPCtrack.h
1 #ifndef ALITPCTRACK_H
2 #define ALITPCTRACK_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8
9
10 //-------------------------------------------------------
11 //                    TPC Track Class
12 //
13 //   Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch 
14 //-------------------------------------------------------
15
16 /*****************************************************************************
17  *                          December 18, 2000                                *
18  *  Internal view of the TPC track parametrisation as well as the order of   *
19  *           track parameters are subject for possible changes !             *
20  *  Use GetExternalParameters() and GetExternalCovariance() to access TPC    *
21  *      track information regardless of its internal representation.         *
22  * This formation is now fixed in the following way:                         *
23  *      external param0:   local Y-coordinate of a track (cm)                *
24  *      external param1:   local Z-coordinate of a track (cm)                *
25  *      external param2:   local sine of the track momentum azimuth angle    *
26  *      external param3:   tangent of the track momentum dip angle           *
27  *      external param4:   1/pt (1/(GeV/c))                                  *
28  *****************************************************************************/
29
30 #include <AliKalmanTrack.h>
31 #include <TMath.h>
32
33 #include "AliTPCreco.h"
34
35 //_____________________________________________________________________________
36 class AliTPCtrack : public AliKalmanTrack {
37 public:
38   AliTPCtrack();
39   AliTPCtrack(UInt_t index, const Double_t xx[5], 
40               const Double_t cc[15], Double_t xr, Double_t alpha); 
41   AliTPCtrack(const AliKalmanTrack& t, Double_t alpha);
42   AliTPCtrack(const AliTPCtrack& t);
43   virtual ~AliTPCtrack() {}
44   Int_t PropagateToVertex(Double_t x0=36.66,Double_t rho=1.2e-3);
45   Int_t Rotate(Double_t angle);
46   void SetdEdx(Double_t dedx) {fdEdx=dedx;}
47
48   Double_t GetX()     const {return fX;}
49   Double_t GetAlpha() const {return fAlpha;}
50   Double_t GetdEdx()  const {return fdEdx;}
51
52   Double_t GetY()   const {return fP0;}
53   Double_t GetZ()   const {return fP1;}
54   Double_t GetSnp() const {return fX*fP4 - fP2;}             
55   Double_t 
56     Get1Pt() const { return (1e-9*TMath::Abs(fP4)/fP4 + fP4)*GetConvConst(); }
57   Double_t GetTgl() const {return fP3;}
58
59   Double_t GetSigmaY2() const {return fC00;}
60   Double_t GetSigmaZ2() const {return fC11;}
61
62 // Some methods useful for users. Implementation is not
63 // optimized for speed but for minimal maintanance effort
64   Double_t Phi() const;
65   Double_t Theta() const {return TMath::Pi()/2.-TMath::ATan(GetTgl());}
66   Double_t Px() const {return TMath::Cos(Phi())/TMath::Abs(Get1Pt());}
67   Double_t Py() const {return TMath::Sin(Phi())/TMath::Abs(Get1Pt());}
68   Double_t Pz() const {return GetTgl()/TMath::Abs(Get1Pt());}
69   Double_t Pt() const {return 1./TMath::Abs(Get1Pt());}
70   Double_t P() const {return TMath::Sqrt(Pt()*Pt()+Pz()*Pz());}
71
72   Int_t Compare(const TObject *o) const;
73
74   void GetExternalParameters(Double_t& xr, Double_t x[5]) const ;
75   void GetExternalCovariance(Double_t cov[15]) const ;
76
77   Int_t GetClusterIndex(Int_t i) const {return fIndex[i];}
78
79 //******** To be removed next release !!! **************
80   Double_t GetEta() const {return fP2;}
81   Double_t GetC()   const {return fP4;}
82   void GetCovariance(Double_t cc[15]) const {
83     cc[0 ]=fC00;
84     cc[1 ]=fC10;  cc[2 ]=fC11;
85     cc[3 ]=fC20;  cc[4 ]=fC21;  cc[5 ]=fC22;
86     cc[6 ]=fC40;  cc[7 ]=fC41;  cc[8 ]=fC42;  cc[9 ]=fC44;
87     cc[10]=fC30;  cc[11]=fC31;  cc[12]=fC32;  cc[13]=fC43;  cc[14]=fC33;
88   }  
89 //****************************************************** 
90
91   virtual Double_t GetPredictedChi2(const AliCluster *cluster) const;
92   Int_t PropagateTo(Double_t xr,Double_t x0=28.94,Double_t rho=0.9e-3);
93   Int_t Update(const AliCluster* c, Double_t chi2, UInt_t i);
94   void ResetCovariance();
95
96 protected: 
97   Double_t fX;              // X-coordinate of this track (reference plane)
98   Double_t fAlpha;          // Rotation angle the local (TPC sector)
99                             // coordinate system and the global ALICE one.
100
101   Double_t fdEdx;           // dE/dx
102
103   Double_t fP0;             // Y-coordinate of a track
104   Double_t fP1;             // Z-coordinate of a track
105   Double_t fP2;             // C*x0
106   Double_t fP3;             // tangent of the track momentum dip angle
107   Double_t fP4;             // track curvature
108
109   Double_t fC00;                         // covariance
110   Double_t fC10, fC11;                   // matrix
111   Double_t fC20, fC21, fC22;             // of the
112   Double_t fC30, fC31, fC32, fC33;       // track
113   Double_t fC40, fC41, fC42, fC43, fC44; // parameters
114  
115   UInt_t fIndex[kMaxRow];       // indices of associated clusters 
116
117   ClassDef(AliTPCtrack,1)   // Time Projection Chamber reconstructed tracks
118 };
119
120 inline 
121 void AliTPCtrack::GetExternalParameters(Double_t& xr, Double_t x[5]) const {
122   //---------------------------------------------------------------------
123   // This function return external TPC track representation
124   //---------------------------------------------------------------------
125      xr=fX;          
126      x[0]=GetY(); x[1]=GetZ(); x[2]=GetSnp(); x[3]=GetTgl(); x[4]=Get1Pt();
127 }
128
129 #endif
130
131