(Marian)
[u/mrichter/AliRoot.git] / TPC / AliTPCtrack.h
CommitLineData
73042f01 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 */
0938c7d3 5/* $Id$ */
6
73042f01 7//-------------------------------------------------------
8// TPC Track Class
9//
10// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
2fc0c115 11//
12// December 18, 2000
13// Internal view of the TPC track parametrisation as well as the order of
14// track parameters are subject for possible changes !
15// Use GetExternalParameters() and GetExternalCovariance() to access TPC
16// track information regardless of its internal representation.
17// This formation is now fixed in the following way:
18// external param0: local Y-coordinate of a track (cm)
19// external param1: local Z-coordinate of a track (cm)
20// external param2: local sine of the track momentum azimuth angle
21// external param3: tangent of the track momentum dip angle
22// external param4: 1/pt (1/(GeV/c))
23//
b19a0509 24#include <AliKalmanTrack.h>
73042f01 25#include <TMath.h>
73042f01 26
b9de75e1 27#include "AliTPCreco.h"
51ad6848 28#include "AliExternalTrackParam.h"
83d73500 29class AliESDtrack;
9c9d2487 30
73042f01 31//_____________________________________________________________________________
b19a0509 32class AliTPCtrack : public AliKalmanTrack {
73042f01 33public:
9c8948ff 34 AliTPCtrack();
b19a0509 35 AliTPCtrack(UInt_t index, const Double_t xx[5],
36 const Double_t cc[15], Double_t xr, Double_t alpha);
83d73500 37 AliTPCtrack(const AliESDtrack& t);
b19a0509 38 AliTPCtrack(const AliTPCtrack& t);
7c27857f 39 virtual ~AliTPCtrack() {}
7f6ddf58 40 Int_t PropagateToVertex(Double_t x0=36.66,Double_t rho=1.2e-3);
b19a0509 41 Int_t Rotate(Double_t angle);
7f6ddf58 42 void SetdEdx(Double_t dedx) {fdEdx=dedx;}
b19a0509 43
c630aafd 44 Double_t GetYat(Double_t x) const ;
be9c5115 45 Double_t GetX() const {return fX;}
46 Double_t GetAlpha() const {return fAlpha;}
47 Double_t GetdEdx() const {return fdEdx;}
83d73500 48 Double_t GetPIDsignal() const {return GetdEdx();}
be9c5115 49
b19a0509 50 Double_t GetY() const {return fP0;}
51 Double_t GetZ() const {return fP1;}
83d73500 52 Double_t GetSnp() const {return fX*fP4 - fP2;}
5773defd 53 Double_t Get1Pt() const;
b9de75e1 54 Double_t GetTgl() const {return fP3;}
be9c5115 55
b19a0509 56 Double_t GetSigmaY2() const {return fC00;}
57 Double_t GetSigmaZ2() const {return fC11;}
be9c5115 58
77e58468 59// Some methods useful for users. Implementation is not
60// optimized for speed but for minimal maintanance effort
61 Double_t Phi() const;
62 Double_t Theta() const {return TMath::Pi()/2.-TMath::ATan(GetTgl());}
63 Double_t Px() const {return TMath::Cos(Phi())/TMath::Abs(Get1Pt());}
64 Double_t Py() const {return TMath::Sin(Phi())/TMath::Abs(Get1Pt());}
65 Double_t Pz() const {return GetTgl()/TMath::Abs(Get1Pt());}
c5507f6d 66 Double_t Pt() const {return 1./TMath::Abs(Get1Pt());}
77e58468 67 Double_t P() const {return TMath::Sqrt(Pt()*Pt()+Pz()*Pz());}
68
be9c5115 69 Int_t Compare(const TObject *o) const;
70
71 void GetExternalParameters(Double_t& xr, Double_t x[5]) const ;
72 void GetExternalCovariance(Double_t cov[15]) const ;
73
9c9d2487 74 // [SR, 01.04.2003]
9c9d2487 75 Int_t GetNumber() const {return fNumber;}
76 void SetNumber(Int_t n) {fNumber = n;}
77 //
78
b9de75e1 79 Int_t GetClusterIndex(Int_t i) const {return fIndex[i];}
80
be9c5115 81//******** To be removed next release !!! **************
82 Double_t GetEta() const {return fP2;}
b9de75e1 83 Double_t GetC() const {return fP4;}
be9c5115 84 void GetCovariance(Double_t cc[15]) const {
85 cc[0 ]=fC00;
86 cc[1 ]=fC10; cc[2 ]=fC11;
87 cc[3 ]=fC20; cc[4 ]=fC21; cc[5 ]=fC22;
b9de75e1 88 cc[6 ]=fC40; cc[7 ]=fC41; cc[8 ]=fC42; cc[9 ]=fC44;
89 cc[10]=fC30; cc[11]=fC31; cc[12]=fC32; cc[13]=fC43; cc[14]=fC33;
83d73500 90 }
be9c5115 91//******************************************************
92
be9c5115 93 virtual Double_t GetPredictedChi2(const AliCluster *cluster) const;
7f6ddf58 94 Int_t PropagateTo(Double_t xr,Double_t x0=28.94,Double_t rho=0.9e-3);
be9c5115 95 Int_t Update(const AliCluster* c, Double_t chi2, UInt_t i);
b9de75e1 96 void ResetCovariance();
a91e73bc 97 void ResetClusters() {SetNumberOfClusters(0); SetChi2(0.);}
51ad6848 98 void UpdatePoints();//update points
99 Float_t* GetPoints() {return fPoints;}
51584047 100 //
101 // TClonesArray * fHelixIn; //array of helixes
102 //TClonesArray * fHelixOut; //array of helixes
103 //
104 Float_t Density(Int_t row0, Int_t row1); //calculate cluster density
105 Float_t Density2(Int_t row0, Int_t row1); //calculate cluster density
106 Double_t GetZat0() const;
107 Double_t GetD(Double_t x=0, Double_t y=0) const;
51ad6848 108 AliExternalTrackParam & GetReference(){ return fReference;}
109 void UpdateReference(){ new (&fReference) AliExternalTrackParam(*this);}
81e97e0d 110 Int_t GetKinkIndex(Int_t i) const{ return fKinkIndexes[i];}
51ad6848 111 Int_t* GetKinkIndexes() { return fKinkIndexes;}
81e97e0d 112 Int_t GetV0Index(Int_t i) const{ return fV0Indexes[i];}
113 Int_t* GetV0Indexes() { return fV0Indexes;}
1c53abe2 114protected:
c84a5e9e 115 void GetXYZ(Float_t r[3]) const;
116
be9c5115 117 Double_t fX; // X-coordinate of this track (reference plane)
118 Double_t fAlpha; // Rotation angle the local (TPC sector)
119 // coordinate system and the global ALICE one.
73042f01 120
7f6ddf58 121 Double_t fdEdx; // dE/dx
73042f01 122
be9c5115 123 Double_t fP0; // Y-coordinate of a track
124 Double_t fP1; // Z-coordinate of a track
125 Double_t fP2; // C*x0
b9de75e1 126 Double_t fP3; // tangent of the track momentum dip angle
127 Double_t fP4; // track curvature
be9c5115 128
129 Double_t fC00; // covariance
130 Double_t fC10, fC11; // matrix
131 Double_t fC20, fC21, fC22; // of the
132 Double_t fC30, fC31, fC32, fC33; // track
133 Double_t fC40, fC41, fC42, fC43, fC44; // parameters
83d73500 134
51584047 135 Int_t fIndex[kMaxRow]; // indices of associated clusters
51ad6848 136 Float_t fPoints[4]; //first, max dens row end points of the track and max density
9c9d2487 137 //[SR, 01.04.2003]
9c9d2487 138 Int_t fNumber; // magic number used for number of clusters
2fc0c115 139 // MI addition
140 Float_t fSdEdx; // sigma of dedx
141 //
142 Int_t fNFoundable; //number of foundable clusters - dead zone taken to the account
143 Bool_t fBConstrain; // indicate seeding with vertex constrain
144 Int_t fLastPoint; // last cluster position
145 Int_t fFirstPoint; // first cluster position
146 Int_t fRemoval; // removal factor
147 Int_t fTrackType; // track type - 0 - normal - 1 - kink - 2 -V0 3- double found
148 Int_t fLab2; // index of corresponding track (kink, V0, double)
149 Int_t fNShared; // number of shared points
51ad6848 150 AliExternalTrackParam fReference; // track parameters at the middle of the chamber
2fc0c115 151 Float_t fKinkPoint[12]; //radius, of kink, dfi and dtheta
51ad6848 152 Int_t fKinkIndexes[3]; // kink indexes - minus = mother + daughter
81e97e0d 153 Int_t fV0Indexes[3]; // kink indexes - minus = mother + daughter
24de2d6d 154
155 ClassDef(AliTPCtrack,2) // Time Projection Chamber reconstructed tracks
73042f01 156};
157
be9c5115 158inline
159void AliTPCtrack::GetExternalParameters(Double_t& xr, Double_t x[5]) const {
be9c5115 160 // This function return external TPC track representation
83d73500 161 xr=fX;
5773defd 162 x[0]=GetY(); x[1]=GetZ(); x[2]=GetSnp(); x[3]=GetTgl();
163 x[4]=(TMath::Sign(1e-9,fP4) + fP4)*GetLocalConvConst();
be9c5115 164}
165
c84a5e9e 166inline void AliTPCtrack::GetXYZ(Float_t r[3]) const {
167 //---------------------------------------------------------------------
168 // Returns the position of the track in the global coord. system
169 //---------------------------------------------------------------------
170 Double_t cs=TMath::Cos(fAlpha), sn=TMath::Sin(fAlpha);
171 r[0]=fX*cs - fP0*sn; r[1]=fX*sn + fP0*cs; r[2]=fP1;
172}
173
174
73042f01 175#endif
176