4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
9 ///////////////////////////////////////////////////////////////////////////////
11 // Represents a reconstructed TRD track //
13 ///////////////////////////////////////////////////////////////////////////////
15 #include "AliESDtrack.h"
16 #include "AliKalmanTrack.h"
18 #include "AliTRDtracklet.h"
20 #ifndef ALITRDSEEDV1_H
21 #include "AliTRDseedV1.h"
24 class AliTrackReference;
26 class AliTRDtrack : public AliKalmanTrack {
30 enum { kMAXCLUSTERSPERTRACK = 210 };
34 , kNplane = AliESDtrack::kTRDnPlanes
40 enum AliTRDPIDMethod {
45 AliTRDtrack(/*const*/ AliTRDcluster *c, Int_t index
46 , const Double_t xx[5], const Double_t cc[15]
47 , Double_t xr, Double_t alpha);
48 AliTRDtrack(const AliTRDtrack &t/*, const Bool_t owner = kTRUE*/);
49 AliTRDtrack(const AliESDtrack &t);
50 virtual ~AliTRDtrack();
51 AliTRDtrack(const AliKalmanTrack &t, Double_t alpha);
53 void ResetClusters() { SetChi2(0.0);
54 SetNumberOfClusters(0); }
55 Int_t Compare(const TObject *o) const;
56 void AddNWrong() { fNWrong++; }
57 void IncCross() { fNCross++;
59 fBackupTrack->IncCross(); }
61 Int_t GetSector() const;
62 Float_t GetClusterdQdl(Int_t i) const { return fdQdl[i]; }
63 Double_t GetdEdx() const { return fdEdx; }
64 Int_t GetNdedx() const { return fNdedx; }
65 Double_t GetPIDsignal() const { return GetdEdx(); }
66 Int_t GetClusterIndex(Int_t i) const { return fIndex[i]; }
67 using AliExternalTrackParam::GetC;
68 Double_t GetC() const { return AliExternalTrackParam
70 Double_t GetPredictedChi2(const AliTRDcluster *c
71 , Double_t h01) const;
72 AliTRDPIDMethod GetPIDMethod() const { return fPIDmethod; }
73 Float_t GetPIDsignals(Int_t iPlane
74 , Int_t iSlice) const { return fdEdxPlane[iPlane][iSlice]; }
75 Int_t GetPIDTimBin(Int_t i) const { return fTimBinPlane[i]; }
76 Double_t GetLikelihoodElectron() const { return fLhElectron; }
77 Int_t GetSeedLabel() const { return fSeedLab; }
78 Int_t *GetBackupIndexes() { return fIndexBackup; }
79 Int_t *GetIndexes() { return fIndex; }
80 Int_t GetProlongation(Double_t xk
83 Bool_t GetStop() const { return fStopped; }
84 Int_t GetNRotate() const { return fNRotate; }
85 Int_t GetNWrong() const { return fNWrong; }
86 Int_t GetNCross() const { return fNCross; }
87 Int_t GetNExpected() const { return fNExpected; }
88 Int_t GetNLast() const { return fNLast; }
89 Int_t GetNExpectedLast() const { return fNExpectedLast; }
90 AliTRDtracklet GetTracklets(Int_t i) const { return fTracklets[i]; }
91 Float_t GetBudget(Int_t i) const { return fBudget[i]; }
92 Float_t GetChi2Last() const { return fChi2Last; }
93 AliTRDtrack *GetBackupTrack() { return fBackupTrack; }
94 // dummy to bridge the function in AliTRDtrackV1
95 //Int_t GetNumberOfClusters() const { printf("AliTRDtrack::GetNumberOfClusters()\n");
96 // return AliKalmanTrack::GetNumberOfClusters(); }
97 inline virtual Int_t GetNumberOfTracklets() const;
98 virtual Int_t GetTrackletIndex(Int_t plane) const { return plane>=0 && plane<6
99 ? fTrackletIndex[plane] : -1; }
102 void SetdEdx(Double_t dedx) { fdEdx = dedx; }
103 void SetStop(Bool_t stop) { fStopped = stop; }
104 void SetPIDsignals(Float_t dedx
106 , Int_t iSlice) { fdEdxPlane[iPlane][iSlice] = dedx; }
107 void SetPIDTimBin(Int_t timbin, Int_t i) { fTimBinPlane[i] = timbin; }
108 void SetLikelihoodElectron(Float_t l) { fLhElectron = l; }
109 void SetSampledEdx(Float_t q, Int_t i);
110 void SetSampledEdx(Float_t q);
111 void SetSeedLabel(Int_t lab) { fSeedLab = lab; }
112 void SetNWrong(Int_t nwrong) { fNWrong = nwrong; }
113 void SetNCross(Int_t ncross) { fNCross = ncross; }
114 void SetNExpected(Int_t nexp) { fNExpected = nexp; }
115 void SetNLast(Int_t nlast) { fNLast = nlast; }
116 void SetNExpectedLast(Int_t nexp) { fNExpectedLast = nexp; }
117 void SetChi2Last(Float_t chi2) { fChi2Last = chi2; }
118 void SetTracklets(Int_t i, AliTRDtracklet t) { fTracklets[i] = t; }
119 void SetBudget(Int_t i, Float_t budget) { fBudget[i] = budget; }
120 void SetPIDMethod(AliTRDPIDMethod method) { fPIDmethod = method; }
122 void SetTrackSegmentDirMom(const Int_t plane);
123 void CookdEdx(Double_t low = 0.05, Double_t up = 0.7);
124 void CookdEdxTimBin(const Int_t tid);
125 Bool_t CookPID(Int_t &pidQuality);
126 void SetCluster(AliTRDcluster* cl
127 , Int_t index = -1) { fClusters[(index == -1)
128 ? GetNumberOfClusters()-1
130 AliTRDcluster* GetCluster(Int_t layer) const { return (layer >= 0 &&
131 layer < GetNumberOfClusters())
134 Float_t GetMomentumPlane(Int_t plane) const { return (plane >= 0 &&
138 const Double_t* GetPID() const { return fPID; }
139 Float_t GetSnpPlane(Int_t plane) const { return (plane >= 0 &&
143 Float_t GetTglPlane(Int_t plane) const { return (plane >= 0 &&
147 Float_t GetTrackLengthPlane(Int_t plane) const;
149 void MakeBackupTrack();
150 Bool_t PropagateTo(Double_t xr, Double_t x0 = 8.72, Double_t rho = 5.86e-3);
151 Int_t PropagateToR(Double_t xr, Double_t step);
152 Int_t PropagateToX(Double_t xr, Double_t step);
153 Bool_t Rotate(Double_t angle, Bool_t absolute = kFALSE);
154 Float_t StatusForTOF();
155 Bool_t Update(const AliTRDcluster *c, Double_t chi2, Int_t index, Double_t h01);
156 Bool_t Update(const AliTRDtracklet &tracklet, Double_t chi2, Int_t index);
157 Int_t UpdateMI(/*const */AliTRDcluster *c, Double_t chi2
158 , Int_t index, Double_t h01
159 , Int_t plane, Int_t tid = 0);
163 AliTRDtrack &operator=(const AliTRDtrack &t);
165 void CookdEdxNN(Float_t *dedx);
166 Double_t GetBz() const;
167 Bool_t Update(const AliCluster */*c*/, Double_t /*chi2*/, Int_t /*idx*/) { return 0; }
168 Double_t GetPredictedChi2(const AliCluster* /*c*/) const { return 0.0; }
172 Int_t fSeedLab; // Track label taken from seeding
173 Float_t fdEdx; // dE/dx (truncated mean)
174 Float_t fDE; // Integrated delta energy
175 Float_t fdEdxPlane[kNplane][kNslice]; // dE/dx from all 6 planes in 3 slices each
176 Int_t fTimBinPlane[kNplane]; // Time bin of Max cluster from all 6 planes
177 UChar_t fPIDquality; // No of planes used for PID calculation
178 Double_t fPID[AliPID::kSPECIES]; // PID probabilities
179 Float_t fMom[kNplane]; // Track momentum at chamber entrance
180 Float_t fSnp[kNplane]; // Track direction
181 Float_t fTgl[kNplane]; // Track direction
182 AliTRDcluster *fClusters[kMAXCLUSTERSPERTRACK]; // List of assigned clusters
183 Bool_t fClusterOwner; // Indicates the track is owner of cluster
184 AliTRDPIDMethod fPIDmethod; // Switch between different PID methods
185 Bool_t fStopped; // Track stop indication
186 Int_t fIndex[kMAXCLUSTERSPERTRACK]; // Global indexes of clusters
187 Int_t fIndexBackup[kMAXCLUSTERSPERTRACK]; // Backup indexes of clusters - used in iterations
188 Float_t fdQdl[kMAXCLUSTERSPERTRACK]; // Cluster amplitudes corrected for track angles
190 Float_t fLhElectron; // Likelihood to be an electron
191 Int_t fNWrong; // Number of wrong clusters
192 Int_t fNRotate; // Number of rotation
193 Int_t fNCross; // Number of the cross materials
194 Int_t fNExpected; // Expected number of cluster
195 Int_t fNLast; // Number of clusters in last 2 layers
196 Int_t fNExpectedLast; // Number of expected clusters on last 2 layers
197 Int_t fNdedx; // Number of clusters for dEdx measurment
198 Float_t fChi2Last; // Chi2 in the last 2 layers
199 AliTRDtracklet fTracklets[6]; // Tracklets
200 Float_t fBudget[3]; // Integrated material budget
201 AliTRDtrack *fBackupTrack; //! Backup track
203 Int_t fTrackletIndex[6]; // Tracklets index in the tracker list
204 AliTRDseedV1 fTracklet[6]; // Tracklets array defining the track
206 ClassDef(AliTRDtrack,9) // TRD reconstructed tracks
210 //___________________________________________________________
211 inline Int_t AliTRDtrack::GetNumberOfTracklets() const
214 for(int ip=0; ip<6; ip++) if(fTrackletIndex[ip] >= 0) ntrklt++;