4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
9 //-------------------------------------------------------------------------
11 // This is the class to deal with during the physics analysis of data
13 // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
14 //-------------------------------------------------------------------------
15 /*****************************************************************************
16 * Use GetExternalParameters() and GetExternalCovariance() to access the *
17 * track information regardless of its internal representation. *
18 * This formation is now fixed in the following way: *
19 * external param0: local Y-coordinate of a track (cm) *
20 * external param1: local Z-coordinate of a track (cm) *
21 * external param2: local sine of the track momentum azimuthal angle *
22 * external param3: tangent of the track momentum dip angle *
23 * external param4: 1/pt (1/(GeV/c)) *
24 *****************************************************************************/
27 #include "AliExternalTrackParam.h"
29 #include "AliESDfriendTrack.h"
34 class AliTrackPointArray;
36 class AliESDtrack : public AliExternalTrackParam {
39 AliESDtrack(const AliESDtrack& track);
40 AliESDtrack(TParticle * part);
41 virtual ~AliESDtrack();
42 const AliESDfriendTrack *GetFriendTrack() const {return fFriendTrack;}
43 void SetFriendTrack(const AliESDfriendTrack *t) {
44 delete fFriendTrack; fFriendTrack=new AliESDfriendTrack(*t);
47 void AddCalibObject(TObject * object); // add calib object to the list
48 TObject * GetCalibObject(Int_t index); // return calib objct at given position
49 void MakeMiniESDtrack();
50 void SetID(Int_t id) { fID =id;}
51 Int_t GetID() const { return fID;}
52 void SetStatus(ULong_t flags) {fFlags|=flags;}
53 void ResetStatus(ULong_t flags) {fFlags&=~flags;}
54 Bool_t UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags);
55 void SetIntegratedLength(Double_t l) {fTrackLength=l;}
56 void SetIntegratedTimes(const Double_t *times);
57 void SetESDpid(const Double_t *p);
58 void GetESDpid(Double_t *p) const;
60 Bool_t IsOn(Int_t mask) const {return (fFlags&mask)>0;}
61 ULong_t GetStatus() const {return fFlags;}
62 Int_t GetLabel() const {return fLabel;}
63 void SetLabel(Int_t label) {fLabel = label;}
65 void GetExternalParameters(Double_t &x, Double_t p[5]) const;
66 void GetExternalCovariance(Double_t cov[15]) const;
68 Double_t GetIntegratedLength() const {return fTrackLength;}
69 void GetIntegratedTimes(Double_t *times) const;
70 Double_t GetMass() const;
71 Double_t M() const { return GetMass(); }
75 Bool_t GetConstrainedPxPyPz(Double_t *p) const {
76 if (!fCp) return kFALSE;
77 return fCp->GetPxPyPz(p);
79 Bool_t GetConstrainedXYZ(Double_t *r) const {
80 if (!fCp) return kFALSE;
81 return fCp->GetXYZ(r);
83 const AliExternalTrackParam *GetConstrainedParam() const {return fCp;}
84 Bool_t GetConstrainedExternalParameters
85 (Double_t &alpha, Double_t &x, Double_t p[5]) const;
86 Bool_t GetConstrainedExternalCovariance(Double_t cov[15]) const;
87 Double_t GetConstrainedChi2() const {return fCchi2;}
92 Bool_t GetInnerPxPyPz(Double_t *p) const {
93 if (!fIp) return kFALSE;
94 return fIp->GetPxPyPz(p);
96 const AliExternalTrackParam * GetInnerParam() const { return fIp;}
97 const AliExternalTrackParam * GetTPCInnerParam() const {return fTPCInner;}
98 Bool_t GetInnerXYZ(Double_t *r) const {
99 if (!fIp) return kFALSE;
100 return fIp->GetXYZ(r);
102 Bool_t GetInnerExternalParameters
103 (Double_t &alpha, Double_t &x, Double_t p[5]) const;
104 Bool_t GetInnerExternalCovariance(Double_t cov[15]) const;
106 const AliExternalTrackParam * GetOuterParam() const { return fOp;}
107 Bool_t GetOuterPxPyPz(Double_t *p) const {
108 if (!fOp) return kFALSE;
109 return fOp->GetPxPyPz(p);
111 Bool_t GetOuterXYZ(Double_t *r) const {
112 if (!fOp) return kFALSE;
113 return fOp->GetXYZ(r);
115 Bool_t GetOuterExternalParameters
116 (Double_t &alpha, Double_t &x, Double_t p[5]) const;
117 Bool_t GetOuterExternalCovariance(Double_t cov[15]) const;
120 Int_t GetNcls(Int_t idet) const;
121 Int_t GetClusters(Int_t idet, Int_t *idx) const;
123 void SetITSpid(const Double_t *p);
124 void GetITSpid(Double_t *p) const;
125 Float_t GetITSsignal() const {return fITSsignal;}
126 Float_t GetITSchi2() const {return fITSchi2;}
127 Int_t GetITSclusters(Int_t *idx) const;
128 UChar_t GetITSClusterMap() const {return fITSClusterMap;}
129 Int_t GetITSLabel() const {return fITSLabel;}
130 void SetITStrack(AliKalmanTrack * track){
131 fFriendTrack->SetITStrack(track);
133 AliKalmanTrack *GetITStrack(){
134 return fFriendTrack->GetITStrack();
137 void SetTPCpid(const Double_t *p);
138 void GetTPCpid(Double_t *p) const;
139 void SetTPCPoints(Float_t points[4]){
140 for (Int_t i=0;i<4;i++) fTPCPoints[i]=points[i];
142 void SetTPCPointsF(UChar_t findable){fTPCnclsF = findable;}
143 Int_t GetTPCNcls() const { return fTPCncls;}
144 Int_t GetTPCNclsF() const { return fTPCnclsF;}
145 Float_t GetTPCPoints(Int_t i) const {return fTPCPoints[i];}
146 void SetKinkIndexes(Int_t points[3]) {
147 for (Int_t i=0;i<3;i++) fKinkIndexes[i] = points[i];
149 void SetV0Indexes(Int_t points[3]) {
150 for (Int_t i=0;i<3;i++) fV0Indexes[i] = points[i];
152 void SetTPCsignal(Float_t signal, Float_t sigma, UChar_t npoints){
153 fTPCsignal = signal; fTPCsignalS = sigma; fTPCsignalN = npoints;
155 Float_t GetTPCsignal() const {return fTPCsignal;}
156 Float_t GetTPCsignalSigma() const {return fTPCsignalS;}
157 UShort_t GetTPCsignalN() const {return fTPCsignalN;}
158 Float_t GetTPCchi2() const {return fTPCchi2;}
159 Int_t GetTPCclusters(Int_t *idx) const;
160 Float_t GetTPCdensity(Int_t row0, Int_t row1) const;
161 Int_t GetTPCLabel() const {return fTPCLabel;}
162 Int_t GetKinkIndex(Int_t i) const { return fKinkIndexes[i];}
163 Int_t GetV0Index(Int_t i) const { return fV0Indexes[i];}
164 const TBits& GetTPCClusterMap() const {return fTPCClusterMap;}
165 const TBits& GetTPCSharedMap() const {return fTPCSharedMap;}
166 void SetTPCClusterMap(const TBits amap) {fTPCClusterMap = amap;}
167 void SetTPCSharedMap(const TBits amap) {fTPCSharedMap = amap;}
168 void SetTRDpid(const Double_t *p);
171 void SetTRDpidQuality(UChar_t q){fTRDpidQuality = q;}
172 UChar_t GetTRDpidQuality() const {return fTRDpidQuality;}
175 void SetTRDQuality(Float_t quality){fTRDQuality=quality;}
176 Float_t GetTRDQuality()const {return fTRDQuality;}
177 void SetTRDBudget(Float_t budget){fTRDBudget=budget;}
178 Float_t GetTRDBudget()const {return fTRDBudget;}
179 void SetTRDsignals(Float_t dedx, Int_t i, Int_t j) {fTRDsignals[i][j]=dedx;}
180 void SetTRDTimBin(Int_t timbin, Int_t i) {fTRDTimBin[i]=timbin;}
181 void GetTRDpid(Double_t *p) const;
182 Float_t GetTRDsignal() const {return fTRDsignal;}
183 Float_t GetTRDsignals(Int_t iPlane, Int_t iSlice=-1) const { if (iSlice == -1)
184 return (fTRDsignals[iPlane][0] + fTRDsignals[iPlane][1] + fTRDsignals[iPlane][2])/3.0;
185 return fTRDsignals[iPlane][iSlice];
187 Int_t GetTRDTimBin(Int_t i) const {return fTRDTimBin[i];}
188 Float_t GetTRDchi2() const {return fTRDchi2;}
189 Int_t GetTRDclusters(Int_t *idx) const;
190 Int_t GetTRDncls() const {return fTRDncls;}
191 void SetTRDpid(Int_t iSpecies, Float_t p);
192 Float_t GetTRDpid(Int_t iSpecies) const;
193 Int_t GetTRDLabel() const {return fTRDLabel;}
195 void SetTRDtrack(AliKalmanTrack * track){
196 fFriendTrack->SetTRDtrack(track);
198 AliKalmanTrack *GetTRDtrack(){
199 return fFriendTrack->GetTRDtrack();
202 void SetTOFsignal(Double_t tof) {fTOFsignal=tof;}
203 Float_t GetTOFsignal() const {return fTOFsignal;}
204 void SetTOFsignalToT(Double_t ToT) {fTOFsignalToT=ToT;}
205 Float_t GetTOFsignalToT() const {return fTOFsignalToT;}
206 void SetTOFsignalRaw(Double_t tof) {fTOFsignalRaw=tof;}
207 Float_t GetTOFsignalRaw() const {return fTOFsignalRaw;}
208 void SetTOFsignalDz(Double_t dz) {fTOFsignalDz=dz;}
209 Float_t GetTOFsignalDz() const {return fTOFsignalDz;}
210 Float_t GetTOFchi2() const {return fTOFchi2;}
211 void SetTOFpid(const Double_t *p);
212 void SetTOFLabel(const Int_t *p);
213 void GetTOFpid(Double_t *p) const;
214 void GetTOFLabel(Int_t *p) const;
215 void GetTOFInfo(Float_t *info) const;
216 void SetTOFInfo(Float_t *info);
217 Int_t GetTOFCalChannel() const {return fTOFCalChannel;}
218 Int_t GetTOFcluster() const {return fTOFindex;}
219 void SetTOFcluster(Int_t index) {fTOFindex=index;}
220 void SetTOFCalChannel(Int_t index) {fTOFCalChannel=index;}
222 // HMPID methodes +++++++++++++++++++++++++++++++++ (kir)
223 void SetHMPIDsignal(Double_t theta) {fHMPIDsignal=theta;}
224 Float_t GetHMPIDsignal() const {return fHMPIDsignal;}
225 void SetHMPIDpid(const Double_t *p);
226 void GetHMPIDpid(Double_t *p) const;
227 void SetHMPIDchi2(Double_t chi2) {fHMPIDchi2=chi2;}
228 Float_t GetHMPIDchi2() const {return fHMPIDchi2;}
229 void SetHMPIDcluster(Int_t index) {fHMPIDcluIdx=index;}
230 Int_t GetHMPIDcluster() const {return fHMPIDcluIdx;}
231 void SetHMPIDcluIdx(Int_t ch,Int_t idx) {fHMPIDcluIdx=ch*1000000+idx;}
232 Int_t GetHMPIDcluIdx() const {return fHMPIDcluIdx;}
233 void SetHMPIDtrk(Float_t x, Float_t y, Float_t th, Float_t ph) {
234 fHMPIDtrkX=x; fHMPIDtrkY=y; fHMPIDtrkTheta=th; fHMPIDtrkPhi=ph;
236 void GetHMPIDtrk(Float_t &x, Float_t &y, Float_t &th, Float_t &ph) const {
237 x=fHMPIDtrkX; y=fHMPIDtrkY; th=fHMPIDtrkTheta; ph=fHMPIDtrkPhi;
239 void SetHMPIDmip(Float_t x, Float_t y, Int_t q, Int_t nph=0) {
240 fHMPIDmipX=x; fHMPIDmipY=y; fHMPIDqn=1000000*q+nph;
242 void GetHMPIDmip(Float_t &x,Float_t &y,Int_t &q,Int_t &nph) const {
243 x=fHMPIDmipX; y=fHMPIDmipY; q=fHMPIDqn/1000000; nph=fHMPIDqn%1000000;
245 Bool_t IsHMPID() const {return fFlags&kHMPIDpid;}
248 Int_t GetEMCALcluster() {return fEMCALindex;}
249 void SetEMCALcluster(Int_t index) {fEMCALindex=index;}
250 Bool_t IsEMCAL() const {return fFlags&kEMCALmatch;}
252 void SetTrackPointArray(AliTrackPointArray *points) {
253 fFriendTrack->SetTrackPointArray(points);
255 const AliTrackPointArray *GetTrackPointArray() const {
256 return fFriendTrack->GetTrackPointArray();
258 Bool_t RelateToVertex(const AliESDVertex *vtx, Double_t b, Double_t maxd);
259 void GetImpactParameters(Float_t &xy,Float_t &z) const {xy=fD; z=fZ;}
260 void GetImpactParameters(Float_t p[2], Float_t cov[3]) const {
261 p[0]=fD; p[1]=fZ; cov[0]=fCdd; cov[1]=fCdz; cov[2]=fCzz;
263 virtual void Print(Option_t * opt) const ;
266 kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSpid=0x0008,
267 kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCpid=0x0080,
268 kTRDin=0x0100,kTRDout=0x0200,kTRDrefit=0x0400,kTRDpid=0x0800,
269 kTOFin=0x1000,kTOFout=0x2000,kTOFrefit=0x4000,kTOFpid=0x8000,
280 kEMCALNoMatch = -999999999
285 ULong_t fFlags; // Reconstruction status flags
286 Int_t fLabel; // Track label
287 Int_t fID; // Unique ID of the track
288 Float_t fTrackLength; // Track length
289 Float_t fD; // Impact parameter in XY plane
290 Float_t fZ; // Impact parameter in Z
291 Float_t fCdd,fCdz,fCzz; // Covariance matrix of the impact parameters
292 Float_t fTrackTime[AliPID::kSPECIES]; // TOFs estimated by the tracking
293 Float_t fR[AliPID::kSPECIES]; // combined "detector response probability"
295 Int_t fStopVertex; // Index of the stop vertex
297 AliExternalTrackParam *fCp; // Track parameters constrained to the primary vertex
298 Double32_t fCchi2; // chi2 at the primary vertex
301 AliExternalTrackParam *fIp; // Track parameters at the first measured point (TPC)
302 AliExternalTrackParam *fTPCInner; // Track parameters at the first measured point (TPC) - first itteration
305 AliExternalTrackParam *fOp; // Track parameters at the last measured point (TPC or TRD)
307 // ITS related track information
308 Float_t fITSchi2; // chi2 in the ITS
309 Int_t fITSncls; // number of clusters assigned in the ITS
310 UChar_t fITSClusterMap; // map of clusters, one bit per a layer
311 Float_t fITSsignal; // detector's PID signal
312 Float_t fITSr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
313 Int_t fITSLabel; // label according TPC
315 // TPC related track information
316 Float_t fTPCchi2; // chi2 in the TPC
317 Int_t fTPCncls; // number of clusters assigned in the TPC
318 UShort_t fTPCnclsF; // number of findable clusters in the TPC
319 TBits fTPCClusterMap; // Map of clusters, one bit per padrow; 1 if has a cluster on given padrow
320 TBits fTPCSharedMap; // Map of clusters, one bit per padrow; 1 if has a shared cluster on given padrow
321 Float_t fTPCsignal; // detector's PID signal
322 UShort_t fTPCsignalN; // number of points used for dEdx
323 Float_t fTPCsignalS; // RMS of dEdx measurement
324 Float_t fTPCr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
325 Int_t fTPCLabel; // label according TPC
326 Float_t fTPCPoints[4]; // TPC points -first, max. dens, last and max density
327 Int_t fKinkIndexes[3];// array of indexes of posible kink candidates
328 Int_t fV0Indexes[3]; // array of indexes of posible kink candidates
330 // TRD related track information
331 Float_t fTRDchi2; // chi2 in the TRD
332 UChar_t fTRDncls; // number of clusters assigned in the TRD
333 UChar_t fTRDncls0; // number of clusters assigned in the TRD before first material cross
334 Float_t fTRDsignal; // detector's PID signal
335 Float_t fTRDsignals[kNPlane][kNSlice]; // TRD signals from all six planes in 3 slices each
336 Int_t fTRDTimBin[kNPlane]; // Time bin of Max cluster from all six planes
337 Float_t fTRDr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
339 UChar_t fTRDpidQuality; // TRD PID quality according to number of planes. 6 is the best
340 Int_t fTRDLabel; // label according TRD
341 Float_t fTRDQuality; // trd quality factor for TOF
342 Float_t fTRDBudget; // trd material budget
345 // TOF related track information
346 Float_t fTOFchi2; // chi2 in the TOF
347 Int_t fTOFindex; // index of the assigned TOF cluster
348 Int_t fTOFCalChannel; // Channel Index of the TOF Signal
349 Float_t fTOFsignal; // detector's PID signal
350 Float_t fTOFsignalToT; // detector's ToT signal
351 Float_t fTOFsignalRaw; // detector's uncorrected time signal
352 Float_t fTOFsignalDz; // local z of track's impact on the TOF pad
353 Float_t fTOFr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
354 Int_t fTOFLabel[3]; // TOF label
355 Float_t fTOFInfo[10]; //! TOF informations
357 // HMPID related track information (kir)
358 Float_t fHMPIDchi2; // chi2 in the HMPID
359 Int_t fHMPIDqn; // 1000000*QDC + number of photon clusters
360 Int_t fHMPIDcluIdx; // 1000000*chamber id + cluster idx of the assigned MIP cluster
361 Float_t fHMPIDsignal; // HMPID PID signal (Theta ckov, rad)
362 Float_t fHMPIDr[AliPID::kSPECIES];// "detector response probabilities" (for the PID)
363 Float_t fHMPIDtrkTheta; // theta of the track extrapolated to the HMPID, LORS
364 Float_t fHMPIDtrkPhi; // phi of the track extrapolated to the HMPID, LORS
365 Float_t fHMPIDtrkX; // x of the track impact, LORS
366 Float_t fHMPIDtrkY; // y of the track impact, LORS
367 Float_t fHMPIDmipX; // x of the MIP in LORS
368 Float_t fHMPIDmipY; // y of the MIP in LORS
370 // EMCAL related track information
371 Int_t fEMCALindex; // index of associated EMCAL cluster (AliESDCaloCluster)
373 AliESDfriendTrack *fFriendTrack; //! All the complementary information
377 AliESDtrack & operator=(const AliESDtrack & ) {return *this;}
379 ClassDef(AliESDtrack,39) //ESDtrack