4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 #include <AliKalmanTrack.h>
10 #include "AliTRDgeometry.h"
11 #include "AliESDtrack.h"
18 const unsigned kMAX_CLUSTERS_PER_TRACK=210;
20 class AliTRDtracklet :public TObject{
21 friend class AliTRDtrack;
24 void Set(Float_t x, Float_t y, Float_t z, Float_t alpha, Float_t error2){fX=x; fY=y; fZ=z; fAlpha=alpha; fSigma2= error2;}
25 void SetP0(Float_t p0){fP0=p0;}
26 void SetP1(Float_t p1){fP1=p1;}
27 void SetN(Int_t n){fNFound=n;}
28 void SetNCross(Int_t nc){fNCross=nc;}
29 void SetPlane(Int_t plane){fPlane=plane;}
30 void SetSigma2(Float_t sigma2){fExpectedSigma2=sigma2;}
31 void SetChi2(Float_t chi2){fChi2=chi2;}
32 void SetTilt(Float_t tilt){fTilt=tilt;}
33 Float_t GetX() const { return fX;}
34 Float_t GetY() const { return fY;}
35 Float_t GetZ() const {return fZ;}
36 Float_t GetAlpha() const { return fAlpha;}
37 Float_t GetTrackletSigma2() const { return fSigma2;}
39 Float_t GetP0() const {return fP0;}
40 Float_t GetP1() const {return fP1;}
41 Int_t GetN() const {return fNFound;}
42 Int_t GetNCross() const {return fNCross;}
43 Int_t GetPlane() const {return fPlane;}
44 Float_t GetClusterSigma2() const {return fExpectedSigma2;}
45 Float_t GetChi2() const {return fChi2;}
46 Float_t GetTilt() const {return fTilt;}
48 Float_t fY; // y position
49 Float_t fZ; // z position
50 Float_t fX; // x position
51 Float_t fAlpha; // rotation angle
52 Float_t fSigma2; // expected error of tracklet position
53 Float_t fP0; // offset in y
54 Float_t fP1; // offset in tangent
55 Int_t fNFound; // number of found clusters
56 Int_t fNCross; // number of crosses
57 Int_t fPlane; // plane number
58 Float_t fExpectedSigma2; // expected sigma of residual distribution of clusters
59 Float_t fChi2; // chi2 of the tracklet
60 Float_t fTilt; // tilt factor
61 ClassDef(AliTRDtracklet,2)
67 class AliTRDtrack : public AliKalmanTrack {
69 // Represents reconstructed TRD track
70 friend class AliTRDtracker;
73 AliTRDtrack():AliKalmanTrack(){fBackupTrack=0;}
74 AliTRDtrack(const AliTRDcluster *c, UInt_t index, const Double_t xx[5],
75 const Double_t cc[15], Double_t xr, Double_t alpha);
76 AliTRDtrack(const AliTRDtrack& t);
77 AliTRDtrack(const AliKalmanTrack& t, Double_t alpha);
78 AliTRDtrack(const AliESDtrack& t);
80 Int_t Compare(const TObject *o) const;
81 void CookdEdx(Double_t low=0.05, Double_t up=0.55);
82 Float_t StatusForTOF();
83 Double_t GetAlpha() const {return fAlpha;}
84 Int_t GetSector() const {
85 //if (fabs(fAlpha) < AliTRDgeometry::GetAlpha()/2) return 0;
86 return Int_t(TVector2::Phi_0_2pi(fAlpha)/AliTRDgeometry::GetAlpha())%AliTRDgeometry::kNsect;}
88 Double_t GetC() const {return fC;}
89 Int_t GetClusterIndex(Int_t i) const {return fIndex[i];}
90 Float_t GetClusterdQdl(Int_t i) const {return fdQdl[i];}
92 void GetCovariance(Double_t cov[15]) const;
93 Double_t GetdEdx() const {return fdEdx;}
94 Double_t GetPIDsignal() const {return GetdEdx();}
95 Float_t GetPIDsignals(Int_t i) const {return fdEdxPlane[i];}
96 Int_t GetPIDTimBin(Int_t i) const {return fTimBinPlane[i];}
97 Double_t GetEta() const {return fE;}
99 void GetExternalCovariance(Double_t cov[15]) const ;
100 void GetExternalParameters(Double_t& xr, Double_t x[5]) const ;
102 Double_t GetLikelihoodElectron() const { return fLhElectron; };
104 Double_t Get1Pt() const {return (1e-9*TMath::Abs(fC)/fC + fC)*GetConvConst(); }
105 Double_t GetP() const {
106 return TMath::Abs(GetPt())*sqrt(1.+GetTgl()*GetTgl());
108 Double_t GetPredictedChi2(const AliTRDcluster*, Double_t h01) const ;
109 Double_t GetPt() const {return 1./Get1Pt();}
110 void GetPxPyPz(Double_t &px, Double_t &py, Double_t &pz) const ;
111 void GetGlobalXYZ(Double_t &x, Double_t &y, Double_t &z) const ;
112 Int_t GetSeedLabel() const { return fSeedLab; }
113 Double_t GetSigmaC2() const {return fCcc;}
114 Double_t GetSigmaTgl2() const {return fCtt;}
115 Double_t GetSigmaY2() const {return fCyy;}
116 Double_t GetSigmaZ2() const {return fCzz;}
117 Double_t GetSnp() const {return fX*fC - fE;}
118 Double_t GetTgl() const {return fT;}
119 Double_t GetX() const {return fX;}
120 Double_t GetY() const {return fY;}
121 Double_t GetZ() const {return fZ;}
122 UInt_t * GetBackupIndexes() {return fIndexBackup;}
123 UInt_t * GetIndexes() {return fIndex;}
124 Double_t GetYat(Double_t xk) const {
125 //-----------------------------------------------------------------
126 // This function calculates the Y-coordinate of a track at the plane x=xk.
127 // Needed for matching with the TOF (I.Belikov)
128 //-----------------------------------------------------------------
129 Double_t c1=fC*fX - fE, r1=TMath::Sqrt(1.- c1*c1);
130 Double_t c2=fC*xk - fE, r2=TMath::Sqrt(1.- c2*c2);
131 return fY + (xk-fX)*(c1+c2)/(r1+r2);
133 Int_t GetProlongation(Double_t xk, Double_t &y, Double_t &z);
135 void SetStop(Bool_t stop) {fStopped=stop;}
136 Bool_t GetStop() const {return fStopped;}
138 Int_t PropagateTo(Double_t xr, Double_t x0=8.72, Double_t rho=5.86e-3);
139 void ResetCovariance();
140 void ResetCovariance(Float_t mult);
141 void ResetClusters() { SetChi2(0.); SetNumberOfClusters(0); }
142 Int_t Rotate(Double_t angle);
144 void SetdEdx(Float_t dedx) {fdEdx=dedx;}
145 void SetPIDsignals(Float_t dedx, Int_t i) {fdEdxPlane[i]=dedx;}
146 void SetPIDTimBin(Int_t timbin, Int_t i) {fTimBinPlane[i]=timbin;}
147 void SetLikelihoodElectron(Float_t l) { fLhElectron = l; };
149 void SetSampledEdx(Float_t q, Int_t i) {
150 Double_t s=GetSnp(), t=GetTgl();
151 q*= TMath::Sqrt((1-s*s)/(1+t*t));
154 void SetSampledEdx(Float_t q) {
155 Double_t s=GetSnp(), t=GetTgl();
156 q*= TMath::Sqrt((1-s*s)/(1+t*t));
161 void SetSeedLabel(Int_t lab) { fSeedLab=lab; }
163 Int_t Update(const AliTRDcluster* c, Double_t chi2, UInt_t i,
165 Int_t UpdateMI(const AliTRDcluster* c, Double_t chi2, UInt_t i,
166 Double_t h01, Int_t plane);
167 Int_t UpdateMI(const AliTRDtracklet & tracklet);
170 void AddNWrong() {fNWrong++;}
172 Int_t GetNWrong() const {return fNWrong;}
173 Int_t GetNRotate() const {return fNRotate;}
174 Int_t GetNCross() const {return fNCross;}
175 void IncCross() {fNCross++; if (fBackupTrack) fBackupTrack->IncCross();}
176 AliTRDtrack * GetBackupTrack(){return fBackupTrack;}
177 void MakeBackupTrack();
183 Int_t fSeedLab; // track label taken from seeding
184 Float_t fdEdx; // dE/dx
185 Float_t fdEdxPlane[kNPlane]; // dE/dx from all 6 planes
186 Int_t fTimBinPlane[kNPlane]; // time bin of Max cluster from all 6 planes
188 Double_t fAlpha; // rotation angle
189 Double_t fX; // running local X-coordinate of the track (time bin)
190 Bool_t fStopped; // track stop indication
192 Double_t fY; // Y-coordinate of the track
193 Double_t fZ; // Z-coordinate of the track
195 Double_t fT; // tangent of the track momentum dip angle
196 Double_t fC; // track curvature
198 Double_t fCyy; // covariance
199 Double_t fCzy, fCzz; // matrix
200 Double_t fCey, fCez, fCee; // of the
201 Double_t fCty, fCtz, fCte, fCtt; // track
202 Double_t fCcy, fCcz, fCce, fCct, fCcc; // parameters
204 UInt_t fIndex[kMAX_CLUSTERS_PER_TRACK]; // global indexes of clusters
205 UInt_t fIndexBackup[kMAX_CLUSTERS_PER_TRACK]; //backup indexes of clusters - used in iterations
206 Float_t fdQdl[kMAX_CLUSTERS_PER_TRACK]; // cluster amplitudes corrected
209 Float_t fLhElectron; // Likelihood to be an electron
210 Int_t fNWrong; // number of wrong clusters
211 Int_t fNRotate; // number of rotation
212 Int_t fNCross; // number of the cross materials
213 Int_t fNExpected; //expected number of cluster
214 Int_t fNLast; //number of clusters in last 2 layers
215 Int_t fNExpectedLast; //number of expected clusters on last 2 layers
216 Int_t fNdedx; //number of clusters for dEdx measurment
217 Float_t fChi2Last; //chi2 in the last 2 layers
218 AliTRDtracklet fTracklets[6]; //tracklets
219 AliTRDtrack * fBackupTrack; //! backup track
220 ClassDef(AliTRDtrack,2) // TRD reconstructed tracks