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 "AliKalmanTrack.h"
17 #include "AliTRDtracklet.h"
19 #ifndef ALITRDSEEDV1_H
20 #include "AliTRDseedV1.h"
24 class AliTrackReference;
26 class AliTRDtrack : public AliKalmanTrack {
30 enum { kMAXCLUSTERSPERTRACK = 210 };
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 Double_t GetC() const { return AliExternalTrackParam
69 Double_t GetPredictedChi2(const AliTRDcluster *c
70 , Double_t h01) const;
71 AliTRDPIDMethod GetPIDMethod() const { return fPIDmethod; }
72 Float_t GetPIDsignals(Int_t iPlane
73 , Int_t iSlice) const { return fdEdxPlane[iPlane][iSlice]; }
74 Int_t GetPIDTimBin(Int_t i) const { return fTimBinPlane[i]; }
75 Double_t GetLikelihoodElectron() const { return fLhElectron; }
76 Int_t GetSeedLabel() const { return fSeedLab; }
77 Int_t *GetBackupIndexes() { return fIndexBackup; }
78 Int_t *GetIndexes() { return fIndex; }
79 Int_t GetProlongation(Double_t xk
82 Bool_t GetStop() const { return fStopped; }
83 Int_t GetNRotate() const { return fNRotate; }
84 Int_t GetNWrong() const { return fNWrong; }
85 Int_t GetNCross() const { return fNCross; }
86 Int_t GetNExpected() const { return fNExpected; }
87 Int_t GetNLast() const { return fNLast; }
88 Int_t GetNExpectedLast() const { return fNExpectedLast; }
89 AliTRDtracklet GetTracklets(Int_t i) const { return fTracklets[i]; }
90 Float_t GetBudget(Int_t i) const { return fBudget[i]; }
91 Float_t GetChi2Last() const { return fChi2Last; }
92 AliTRDtrack *GetBackupTrack() { return fBackupTrack; }
93 // dummy to bridge the function in AliTRDtrackV1
94 //Int_t GetNumberOfClusters() const { printf("AliTRDtrack::GetNumberOfClusters()\n");
95 // return AliKalmanTrack::GetNumberOfClusters(); }
96 inline virtual Int_t GetNumberOfTracklets() const;
97 virtual Int_t GetTrackletIndex(Int_t plane) const { return plane>=0 && plane<6
98 ? fTrackletIndex[plane] : -1; }
101 void SetdEdx(Double_t dedx) { fdEdx = dedx; }
102 void SetStop(Bool_t stop) { fStopped = stop; }
103 void SetPIDsignals(Float_t dedx
105 , Int_t iSlice) { fdEdxPlane[iPlane][iSlice] = dedx; }
106 void SetPIDTimBin(Int_t timbin, Int_t i) { fTimBinPlane[i] = timbin; }
107 void SetLikelihoodElectron(Float_t l) { fLhElectron = l; }
108 void SetSampledEdx(Float_t q, Int_t i);
109 void SetSampledEdx(Float_t q);
110 void SetSeedLabel(Int_t lab) { fSeedLab = lab; }
111 void SetNWrong(Int_t nwrong) { fNWrong = nwrong; }
112 void SetNCross(Int_t ncross) { fNCross = ncross; }
113 void SetNExpected(Int_t nexp) { fNExpected = nexp; }
114 void SetNLast(Int_t nlast) { fNLast = nlast; }
115 void SetNExpectedLast(Int_t nexp) { fNExpectedLast = nexp; }
116 void SetChi2Last(Float_t chi2) { fChi2Last = chi2; }
117 void SetTracklets(Int_t i, AliTRDtracklet t) { fTracklets[i] = t; }
118 void SetBudget(Int_t i, Float_t budget) { fBudget[i] = budget; }
119 void SetPIDMethod(AliTRDPIDMethod method) { fPIDmethod = method; }
121 void SetTrackSegmentDirMom(const Int_t plane);
122 void CookdEdx(Double_t low = 0.05, Double_t up = 0.7);
123 void CookdEdxTimBin(const Int_t tid);
124 Bool_t CookPID(Int_t &pidQuality);
125 void SetCluster(AliTRDcluster* cl
126 , Int_t index = -1) { fClusters[(index == -1)
127 ? GetNumberOfClusters()-1
129 AliTRDcluster* GetCluster(Int_t layer) const { return (layer >= 0 &&
130 layer < GetNumberOfClusters())
133 Float_t GetMomentumPlane(Int_t plane) const { return (plane >= 0 &&
137 const Double_t* GetPID() const { return fPID; }
138 Float_t GetSnpPlane(Int_t plane) const { return (plane >= 0 &&
142 Float_t GetTglPlane(Int_t plane) const { return (plane >= 0 &&
146 Float_t GetTrackLengthPlane(Int_t plane) const;
148 void MakeBackupTrack();
149 Bool_t PropagateTo(Double_t xr, Double_t x0 = 8.72, Double_t rho = 5.86e-3);
150 Int_t PropagateToR(Double_t xr, Double_t step);
151 Int_t PropagateToX(Double_t xr, Double_t step);
152 Bool_t Rotate(Double_t angle, Bool_t absolute = kFALSE);
153 Float_t StatusForTOF();
154 Bool_t Update(const AliTRDcluster *c, Double_t chi2, Int_t index, Double_t h01);
155 Bool_t Update(const AliTRDtracklet &tracklet, Double_t chi2, Int_t index);
156 Int_t UpdateMI(/*const */AliTRDcluster *c, Double_t chi2
157 , Int_t index, Double_t h01
158 , Int_t plane, Int_t tid = 0);
162 AliTRDtrack &operator=(const AliTRDtrack &t);
164 void CookdEdxNN(Float_t *dedx);
165 Double_t GetBz() const;
166 Bool_t Update(const AliCluster */*c*/, Double_t /*chi2*/, Int_t /*idx*/) { return 0; }
167 Double_t GetPredictedChi2(const AliCluster* /*c*/) const { return 0.0; }
171 Int_t fSeedLab; // Track label taken from seeding
172 Float_t fdEdx; // dE/dx (truncated mean)
173 Float_t fDE; // Integrated delta energy
174 Float_t fdEdxPlane[kNplane][kNslice]; // dE/dx from all 6 planes in 3 slices each
175 Int_t fTimBinPlane[kNplane]; // Time bin of Max cluster from all 6 planes
176 UChar_t fPIDquality; // No of planes used for PID calculation
177 Double_t fPID[AliPID::kSPECIES]; // PID probabilities
178 Float_t fMom[kNplane]; // Track momentum at chamber entrance
179 Float_t fSnp[kNplane]; // Track direction
180 Float_t fTgl[kNplane]; // Track direction
181 AliTRDcluster *fClusters[kMAXCLUSTERSPERTRACK]; // List of assigned clusters
182 Bool_t fClusterOwner; // Indicates the track is owner of cluster
183 AliTRDPIDMethod fPIDmethod; // Switch between different PID methods
184 Bool_t fStopped; // Track stop indication
185 Int_t fIndex[kMAXCLUSTERSPERTRACK]; // Global indexes of clusters
186 Int_t fIndexBackup[kMAXCLUSTERSPERTRACK]; // Backup indexes of clusters - used in iterations
187 Float_t fdQdl[kMAXCLUSTERSPERTRACK]; // Cluster amplitudes corrected for track angles
189 Float_t fLhElectron; // Likelihood to be an electron
190 Int_t fNWrong; // Number of wrong clusters
191 Int_t fNRotate; // Number of rotation
192 Int_t fNCross; // Number of the cross materials
193 Int_t fNExpected; // Expected number of cluster
194 Int_t fNLast; // Number of clusters in last 2 layers
195 Int_t fNExpectedLast; // Number of expected clusters on last 2 layers
196 Int_t fNdedx; // Number of clusters for dEdx measurment
197 Float_t fChi2Last; // Chi2 in the last 2 layers
198 AliTRDtracklet fTracklets[6]; // Tracklets
199 Float_t fBudget[3]; // Integrated material budget
200 AliTRDtrack *fBackupTrack; //! Backup track
202 Int_t fTrackletIndex[6]; // Tracklets index in the tracker list
203 AliTRDseedV1 fTracklet[6]; // Tracklets array defining the track
205 ClassDef(AliTRDtrack,9) // TRD reconstructed tracks
209 //___________________________________________________________
210 inline Int_t AliTRDtrack::GetNumberOfTracklets() const
213 for(int ip=0; ip<6; ip++) if(fTrackletIndex[ip] >= 0) ntrklt++;