]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliESDtrack.h
Bug fix in SDD footer readout (M. Siciliano, F. Prino)
[u/mrichter/AliRoot.git] / STEER / AliESDtrack.h
CommitLineData
61402fa9 1
ae982df3 2#ifndef ALIESDTRACK_H
3#define ALIESDTRACK_H
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
ac3faee4 7/* $Id$ */
8
ae982df3 9//-------------------------------------------------------------------------
10// Class AliESDtrack
15614b8b 11// This is the class to deal with during the physics analysis of data
ae982df3 12//
13// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
14//-------------------------------------------------------------------------
23904d16 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 *****************************************************************************/
ac3faee4 25
a866ac60 26#include <TBits.h>
c9ec41e8 27#include "AliExternalTrackParam.h"
304864ab 28#include "AliPID.h"
15e85efa 29#include "AliESDfriendTrack.h"
30
49edfa08 31class TParticle;
49d13e89 32class AliESDVertex;
ae982df3 33class AliKalmanTrack;
98937d93 34class AliTrackPointArray;
ae982df3 35
c9ec41e8 36class AliESDtrack : public AliExternalTrackParam {
ae982df3 37public:
38 AliESDtrack();
c4d11b15 39 AliESDtrack(const AliESDtrack& track);
49edfa08 40 AliESDtrack(TParticle * part);
51ad6848 41 virtual ~AliESDtrack();
15e85efa 42 const AliESDfriendTrack *GetFriendTrack() const {return fFriendTrack;}
d75007f6 43 void SetFriendTrack(const AliESDfriendTrack *t) {
44 delete fFriendTrack; fFriendTrack=new AliESDfriendTrack(*t);
61402fa9 45 // CKB
d75007f6 46 }
00dce61a 47 void AddCalibObject(TObject * object); // add calib object to the list
48 TObject * GetCalibObject(Int_t index); // return calib objct at given position
9559cbc4 49 void MakeMiniESDtrack();
51ad6848 50 void SetID(Int_t id) { fID =id;}
e1e6896f 51 Int_t GetID() const { return fID;}
ae982df3 52 void SetStatus(ULong_t flags) {fFlags|=flags;}
53 void ResetStatus(ULong_t flags) {fFlags&=~flags;}
15614b8b 54 Bool_t UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags);
ae982df3 55 void SetIntegratedLength(Double_t l) {fTrackLength=l;}
56 void SetIntegratedTimes(const Double_t *times);
8c6a71ab 57 void SetESDpid(const Double_t *p);
58 void GetESDpid(Double_t *p) const;
ae982df3 59
15e85efa 60 Bool_t IsOn(Int_t mask) const {return (fFlags&mask)>0;}
ae982df3 61 ULong_t GetStatus() const {return fFlags;}
62 Int_t GetLabel() const {return fLabel;}
a33a2f3d 63 void SetLabel(Int_t label) {fLabel = label;}
c9ec41e8 64
ae982df3 65 void GetExternalParameters(Double_t &x, Double_t p[5]) const;
66 void GetExternalCovariance(Double_t cov[15]) const;
23904d16 67
ae982df3 68 Double_t GetIntegratedLength() const {return fTrackLength;}
69 void GetIntegratedTimes(Double_t *times) const;
4a78b8c5 70 Double_t GetMass() const;
aad8d435 71 Double_t M() const { return GetMass(); }
72 Double_t E() const;
73 Double_t Y() const;
c0b978f0 74
c9ec41e8 75 Bool_t GetConstrainedPxPyPz(Double_t *p) const {
76 if (!fCp) return kFALSE;
77 return fCp->GetPxPyPz(p);
78 }
79 Bool_t GetConstrainedXYZ(Double_t *r) const {
80 if (!fCp) return kFALSE;
81 return fCp->GetXYZ(r);
82 }
6c4ef2ed 83 const AliExternalTrackParam *GetConstrainedParam() const {return fCp;}
c0b978f0 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;
c9ec41e8 87 Double_t GetConstrainedChi2() const {return fCchi2;}
4aeb9470 88 //
89
67c3dcbe 90
67c3dcbe 91
c9ec41e8 92 Bool_t GetInnerPxPyPz(Double_t *p) const {
93 if (!fIp) return kFALSE;
94 return fIp->GetPxPyPz(p);
95 }
1d303a24 96 const AliExternalTrackParam * GetInnerParam() const { return fIp;}
4aeb9470 97 const AliExternalTrackParam * GetTPCInnerParam() const {return fTPCInner;}
c9ec41e8 98 Bool_t GetInnerXYZ(Double_t *r) const {
99 if (!fIp) return kFALSE;
100 return fIp->GetXYZ(r);
101 }
c0b978f0 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;
98937d93 105
1d303a24 106 const AliExternalTrackParam * GetOuterParam() const { return fOp;}
c0b978f0 107 Bool_t GetOuterPxPyPz(Double_t *p) const {
108 if (!fOp) return kFALSE;
109 return fOp->GetPxPyPz(p);
110 }
111 Bool_t GetOuterXYZ(Double_t *r) const {
112 if (!fOp) return kFALSE;
113 return fOp->GetXYZ(r);
c9ec41e8 114 }
c0b978f0 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;
118
c9ec41e8 119
98937d93 120 Int_t GetNcls(Int_t idet) const;
ef7253ac 121 Int_t GetClusters(Int_t idet, Int_t *idx) const;
98937d93 122
15e85efa 123 void SetITSpid(const Double_t *p);
124 void GetITSpid(Double_t *p) const;
ae982df3 125 Float_t GetITSsignal() const {return fITSsignal;}
13da10da 126 Float_t GetITSchi2() const {return fITSchi2;}
15e85efa 127 Int_t GetITSclusters(Int_t *idx) const;
62665e7f 128 UChar_t GetITSClusterMap() const {return fITSClusterMap;}
15e85efa 129 Int_t GetITSLabel() const {return fITSLabel;}
15e85efa 130 void SetITStrack(AliKalmanTrack * track){
131 fFriendTrack->SetITStrack(track);
132 }
133 AliKalmanTrack *GetITStrack(){
134 return fFriendTrack->GetITStrack();
135 }
136
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];
141 }
142 void SetTPCPointsF(UChar_t findable){fTPCnclsF = findable;}
00dce61a 143 Int_t GetTPCNcls() const { return fTPCncls;}
144 Int_t GetTPCNclsF() const { return fTPCnclsF;}
e1e6896f 145 Float_t GetTPCPoints(Int_t i) const {return fTPCPoints[i];}
15e85efa 146 void SetKinkIndexes(Int_t points[3]) {
147 for (Int_t i=0;i<3;i++) fKinkIndexes[i] = points[i];
148 }
149 void SetV0Indexes(Int_t points[3]) {
150 for (Int_t i=0;i<3;i++) fV0Indexes[i] = points[i];
151 }
152 void SetTPCsignal(Float_t signal, Float_t sigma, UChar_t npoints){
153 fTPCsignal = signal; fTPCsignalS = sigma; fTPCsignalN = npoints;
154 }
13da10da 155 Float_t GetTPCsignal() const {return fTPCsignal;}
00dce61a 156 Float_t GetTPCsignalSigma() const {return fTPCsignalS;}
0eba927a 157 UShort_t GetTPCsignalN() const {return fTPCsignalN;}
13da10da 158 Float_t GetTPCchi2() const {return fTPCchi2;}
15e85efa 159 Int_t GetTPCclusters(Int_t *idx) const;
81e97e0d 160 Float_t GetTPCdensity(Int_t row0, Int_t row1) const;
15e85efa 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];}
3a83c716 164 const TBits& GetTPCClusterMap() const {return fTPCClusterMap;}
eb7f6854 165 const TBits& GetTPCSharedMap() const {return fTPCSharedMap;}
166 void SetTPCClusterMap(const TBits amap) {fTPCClusterMap = amap;}
167 void SetTPCSharedMap(const TBits amap) {fTPCSharedMap = amap;}
15e85efa 168 void SetTRDpid(const Double_t *p);
c5be26b7 169
170// A.Bercuci
faffd83e 171 void SetTRDpidQuality(UChar_t q){fTRDpidQuality = q;}
172 UChar_t GetTRDpidQuality() const {return fTRDpidQuality;}
c5be26b7 173// end A.Bercuci
174
175 void SetTRDQuality(Float_t quality){fTRDQuality=quality;}
15e85efa 176 Float_t GetTRDQuality()const {return fTRDQuality;}
177 void SetTRDBudget(Float_t budget){fTRDBudget=budget;}
178 Float_t GetTRDBudget()const {return fTRDBudget;}
6d45eaef 179 void SetTRDsignals(Float_t dedx, Int_t i, Int_t j) {fTRDsignals[i][j]=dedx;}
15e85efa 180 void SetTRDTimBin(Int_t timbin, Int_t i) {fTRDTimBin[i]=timbin;}
181 void GetTRDpid(Double_t *p) const;
79e94bf8 182 Float_t GetTRDsignal() const {return fTRDsignal;}
6d45eaef 183 Float_t GetTRDsignals(Int_t iPlane, Int_t iSlice=-1) const { if (iSlice == -1)
03ecfe88 184 return (fTRDsignals[iPlane][0] + fTRDsignals[iPlane][1] + fTRDsignals[iPlane][2])/3.0;
6d45eaef 185 return fTRDsignals[iPlane][iSlice];
186 }
15e85efa 187 Int_t GetTRDTimBin(Int_t i) const {return fTRDTimBin[i];}
13da10da 188 Float_t GetTRDchi2() const {return fTRDchi2;}
15e85efa 189 Int_t GetTRDclusters(Int_t *idx) const;
190 Int_t GetTRDncls() const {return fTRDncls;}
79e94bf8 191 void SetTRDpid(Int_t iSpecies, Float_t p);
192 Float_t GetTRDpid(Int_t iSpecies) const;
15e85efa 193 Int_t GetTRDLabel() const {return fTRDLabel;}
c9ec41e8 194
15e85efa 195 void SetTRDtrack(AliKalmanTrack * track){
196 fFriendTrack->SetTRDtrack(track);
197 }
198 AliKalmanTrack *GetTRDtrack(){
199 return fFriendTrack->GetTRDtrack();
200 }
c9ec41e8 201
15e85efa 202 void SetTOFsignal(Double_t tof) {fTOFsignal=tof;}
c630aafd 203 Float_t GetTOFsignal() const {return fTOFsignal;}
15e85efa 204 void SetTOFsignalToT(Double_t ToT) {fTOFsignalToT=ToT;}
85324138 205 Float_t GetTOFsignalToT() const {return fTOFsignalToT;}
d321691a 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;}
13da10da 210 Float_t GetTOFchi2() const {return fTOFchi2;}
c630aafd 211 void SetTOFpid(const Double_t *p);
51ad6848 212 void SetTOFLabel(const Int_t *p);
c630aafd 213 void GetTOFpid(Double_t *p) const;
51ad6848 214 void GetTOFLabel(Int_t *p) const;
215 void GetTOFInfo(Float_t *info) const;
216 void SetTOFInfo(Float_t *info);
85324138 217 Int_t GetTOFCalChannel() const {return fTOFCalChannel;}
15e85efa 218 Int_t GetTOFcluster() const {return fTOFindex;}
219 void SetTOFcluster(Int_t index) {fTOFindex=index;}
220 void SetTOFCalChannel(Int_t index) {fTOFCalChannel=index;}
b67517ef 221
f4b3bbb7 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;}
f4b3bbb7 229 void SetHMPIDcluIdx(Int_t ch,Int_t idx) {fHMPIDcluIdx=ch*1000000+idx;}
230 Int_t GetHMPIDcluIdx() const {return fHMPIDcluIdx;}
231 void SetHMPIDtrk(Float_t x, Float_t y, Float_t th, Float_t ph) {
232 fHMPIDtrkX=x; fHMPIDtrkY=y; fHMPIDtrkTheta=th; fHMPIDtrkPhi=ph;
15e85efa 233 }
f4b3bbb7 234 void GetHMPIDtrk(Float_t &x, Float_t &y, Float_t &th, Float_t &ph) const {
235 x=fHMPIDtrkX; y=fHMPIDtrkY; th=fHMPIDtrkTheta; ph=fHMPIDtrkPhi;
15e85efa 236 }
f4b3bbb7 237 void SetHMPIDmip(Float_t x, Float_t y, Int_t q, Int_t nph=0) {
6135c730 238 fHMPIDmipX=x; fHMPIDmipY=y; fHMPIDqn=1000000*q+nph;
15e85efa 239 }
f4b3bbb7 240 void GetHMPIDmip(Float_t &x,Float_t &y,Int_t &q,Int_t &nph) const {
241 x=fHMPIDmipX; y=fHMPIDmipY; q=fHMPIDqn/1000000; nph=fHMPIDqn%1000000;
15e85efa 242 }
f4b3bbb7 243 Bool_t IsHMPID() const {return fFlags&kHMPIDpid;}
b67517ef 244
245
2e1dcd14 246 Int_t GetEMCALcluster() {return fEMCALindex;}
247 void SetEMCALcluster(Int_t index) {fEMCALindex=index;}
248 Bool_t IsEMCAL() const {return fFlags&kEMCALmatch;}
ac2f7574 249
cf0f66c2 250 void SetTrackPointArray(AliTrackPointArray *points) {
251 fFriendTrack->SetTrackPointArray(points);
252 }
253 const AliTrackPointArray *GetTrackPointArray() const {
254 return fFriendTrack->GetTrackPointArray();
255 }
15e85efa 256 Bool_t RelateToVertex(const AliESDVertex *vtx, Double_t b, Double_t maxd);
49d13e89 257 void GetImpactParameters(Float_t &xy,Float_t &z) const {xy=fD; z=fZ;}
258 void GetImpactParameters(Float_t p[2], Float_t cov[3]) const {
259 p[0]=fD; p[1]=fZ; cov[0]=fCdd; cov[1]=fCdz; cov[2]=fCzz;
260 }
ac2f7574 261 virtual void Print(Option_t * opt) const ;
262
ae982df3 263 enum {
8c6a71ab 264 kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSpid=0x0008,
265 kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCpid=0x0080,
266 kTRDin=0x0100,kTRDout=0x0200,kTRDrefit=0x0400,kTRDpid=0x0800,
267 kTOFin=0x1000,kTOFout=0x2000,kTOFrefit=0x4000,kTOFpid=0x8000,
f4b3bbb7 268 kHMPIDpid=0x20000,
2e1dcd14 269 kEMCALmatch=0x40000,
c4d11b15 270 kTRDbackup=0x80000,
4a78b8c5 271 kTRDStop=0x20000000,
8c6a71ab 272 kESDpid=0x40000000,
ae982df3 273 kTIME=0x80000000
274 };
f122c485 275 enum {
6d45eaef 276 kNPlane = 6,
2e1dcd14 277 kNSlice = 3,
278 kEMCALNoMatch = -999999999
f122c485 279 };
ae982df3 280protected:
90e48c0c 281
90e48c0c 282
49d13e89 283 ULong_t fFlags; // Reconstruction status flags
284 Int_t fLabel; // Track label
285 Int_t fID; // Unique ID of the track
286 Float_t fTrackLength; // Track length
287 Float_t fD; // Impact parameter in XY plane
288 Float_t fZ; // Impact parameter in Z
289 Float_t fCdd,fCdz,fCzz; // Covariance matrix of the impact parameters
304864ab 290 Float_t fTrackTime[AliPID::kSPECIES]; // TOFs estimated by the tracking
c9ec41e8 291 Float_t fR[AliPID::kSPECIES]; // combined "detector response probability"
ae982df3 292
49d13e89 293 Int_t fStopVertex; // Index of the stop vertex
ae982df3 294
e1e6896f 295 AliExternalTrackParam *fCp; // Track parameters constrained to the primary vertex
61402fa9 296 Double32_t fCchi2; // chi2 at the primary vertex
e1e6896f 297
67c3dcbe 298
d3547a27 299 AliExternalTrackParam *fIp; // Track parameters at the first measured point (TPC)
4aeb9470 300 AliExternalTrackParam *fTPCInner; // Track parameters at the first measured point (TPC) - first itteration
23904d16 301
e1e6896f 302
d3547a27 303 AliExternalTrackParam *fOp; // Track parameters at the last measured point (TPC or TRD)
ae982df3 304
ae982df3 305 // ITS related track information
306 Float_t fITSchi2; // chi2 in the ITS
307 Int_t fITSncls; // number of clusters assigned in the ITS
62665e7f 308 UChar_t fITSClusterMap; // map of clusters, one bit per a layer
ae982df3 309 Float_t fITSsignal; // detector's PID signal
304864ab 310 Float_t fITSr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
6e5b1b04 311 Int_t fITSLabel; // label according TPC
15e85efa 312
ae982df3 313 // TPC related track information
15e85efa 314 Float_t fTPCchi2; // chi2 in the TPC
315 Int_t fTPCncls; // number of clusters assigned in the TPC
e1d4c1b5 316 UShort_t fTPCnclsF; // number of findable clusters in the TPC
15e85efa 317 TBits fTPCClusterMap; // Map of clusters, one bit per padrow; 1 if has a cluster on given padrow
eb7f6854 318 TBits fTPCSharedMap; // Map of clusters, one bit per padrow; 1 if has a shared cluster on given padrow
15e85efa 319 Float_t fTPCsignal; // detector's PID signal
320 UShort_t fTPCsignalN; // number of points used for dEdx
e1d4c1b5 321 Float_t fTPCsignalS; // RMS of dEdx measurement
15e85efa 322 Float_t fTPCr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
323 Int_t fTPCLabel; // label according TPC
324 Float_t fTPCPoints[4]; // TPC points -first, max. dens, last and max density
325 Int_t fKinkIndexes[3];// array of indexes of posible kink candidates
326 Int_t fV0Indexes[3]; // array of indexes of posible kink candidates
23904d16 327
ae982df3 328 // TRD related track information
79e94bf8 329 Float_t fTRDchi2; // chi2 in the TRD
c5be26b7 330 UChar_t fTRDncls; // number of clusters assigned in the TRD
331 UChar_t fTRDncls0; // number of clusters assigned in the TRD before first material cross
79e94bf8 332 Float_t fTRDsignal; // detector's PID signal
6d45eaef 333 Float_t fTRDsignals[kNPlane][kNSlice]; // TRD signals from all six planes in 3 slices each
ef7253ac 334 Int_t fTRDTimBin[kNPlane]; // Time bin of Max cluster from all six planes
304864ab 335 Float_t fTRDr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
c5be26b7 336 // A.Bercuci
337 UChar_t fTRDpidQuality; // TRD PID quality according to number of planes. 6 is the best
6e5b1b04 338 Int_t fTRDLabel; // label according TRD
15e85efa 339 Float_t fTRDQuality; // trd quality factor for TOF
340 Float_t fTRDBudget; // trd material budget
341
23904d16 342
ae982df3 343 // TOF related track information
c630aafd 344 Float_t fTOFchi2; // chi2 in the TOF
ef7253ac 345 Int_t fTOFindex; // index of the assigned TOF cluster
15e85efa 346 Int_t fTOFCalChannel; // Channel Index of the TOF Signal
c630aafd 347 Float_t fTOFsignal; // detector's PID signal
85324138 348 Float_t fTOFsignalToT; // detector's ToT signal
d321691a 349 Float_t fTOFsignalRaw; // detector's uncorrected time signal
350 Float_t fTOFsignalDz; // local z of track's impact on the TOF pad
304864ab 351 Float_t fTOFr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
15e85efa 352 Int_t fTOFLabel[3]; // TOF label
353 Float_t fTOFInfo[10]; //! TOF informations
23904d16 354
b67517ef 355 // HMPID related track information (kir)
f4b3bbb7 356 Float_t fHMPIDchi2; // chi2 in the HMPID
357 Int_t fHMPIDqn; // 1000000*QDC + number of photon clusters
358 Int_t fHMPIDcluIdx; // 1000000*chamber id + cluster idx of the assigned MIP cluster
359 Float_t fHMPIDsignal; // HMPID PID signal (Theta ckov, rad)
360 Float_t fHMPIDr[AliPID::kSPECIES];// "detector response probabilities" (for the PID)
361 Float_t fHMPIDtrkTheta; // theta of the track extrapolated to the HMPID, LORS
362 Float_t fHMPIDtrkPhi; // phi of the track extrapolated to the HMPID, LORS
363 Float_t fHMPIDtrkX; // x of the track impact, LORS
364 Float_t fHMPIDtrkY; // y of the track impact, LORS
365 Float_t fHMPIDmipX; // x of the MIP in LORS
366 Float_t fHMPIDmipY; // y of the MIP in LORS
2e1dcd14 367
368 // EMCAL related track information
cf0f66c2 369 Int_t fEMCALindex; // index of associated EMCAL cluster (AliESDCaloCluster)
15e85efa 370
371 AliESDfriendTrack *fFriendTrack; //! All the complementary information
98937d93 372
e1e6896f 373 private:
374
375 AliESDtrack & operator=(const AliESDtrack & ) {return *this;}
376
4aeb9470 377 ClassDef(AliESDtrack,39) //ESDtrack
ae982df3 378};
379
380#endif
381