Adding calibration classes for TPC
[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;
c0b978f0 71
c9ec41e8 72 Bool_t GetConstrainedPxPyPz(Double_t *p) const {
73 if (!fCp) return kFALSE;
74 return fCp->GetPxPyPz(p);
75 }
76 Bool_t GetConstrainedXYZ(Double_t *r) const {
77 if (!fCp) return kFALSE;
78 return fCp->GetXYZ(r);
79 }
6c4ef2ed 80 const AliExternalTrackParam *GetConstrainedParam() const {return fCp;}
c0b978f0 81 Bool_t GetConstrainedExternalParameters
82 (Double_t &alpha, Double_t &x, Double_t p[5]) const;
83 Bool_t GetConstrainedExternalCovariance(Double_t cov[15]) const;
c9ec41e8 84 Double_t GetConstrainedChi2() const {return fCchi2;}
67c3dcbe 85
67c3dcbe 86
c9ec41e8 87 Bool_t GetInnerPxPyPz(Double_t *p) const {
88 if (!fIp) return kFALSE;
89 return fIp->GetPxPyPz(p);
90 }
1d303a24 91 const AliExternalTrackParam * GetInnerParam() const { return fIp;}
c9ec41e8 92 Bool_t GetInnerXYZ(Double_t *r) const {
93 if (!fIp) return kFALSE;
94 return fIp->GetXYZ(r);
95 }
c0b978f0 96 Bool_t GetInnerExternalParameters
97 (Double_t &alpha, Double_t &x, Double_t p[5]) const;
98 Bool_t GetInnerExternalCovariance(Double_t cov[15]) const;
98937d93 99
1d303a24 100 const AliExternalTrackParam * GetOuterParam() const { return fOp;}
c0b978f0 101 Bool_t GetOuterPxPyPz(Double_t *p) const {
102 if (!fOp) return kFALSE;
103 return fOp->GetPxPyPz(p);
104 }
105 Bool_t GetOuterXYZ(Double_t *r) const {
106 if (!fOp) return kFALSE;
107 return fOp->GetXYZ(r);
c9ec41e8 108 }
c0b978f0 109 Bool_t GetOuterExternalParameters
110 (Double_t &alpha, Double_t &x, Double_t p[5]) const;
111 Bool_t GetOuterExternalCovariance(Double_t cov[15]) const;
112
c9ec41e8 113
98937d93 114 Int_t GetNcls(Int_t idet) const;
ef7253ac 115 Int_t GetClusters(Int_t idet, Int_t *idx) const;
98937d93 116
15e85efa 117 void SetITSpid(const Double_t *p);
118 void GetITSpid(Double_t *p) const;
ae982df3 119 Float_t GetITSsignal() const {return fITSsignal;}
13da10da 120 Float_t GetITSchi2() const {return fITSchi2;}
15e85efa 121 Int_t GetITSclusters(Int_t *idx) const;
62665e7f 122 UChar_t GetITSClusterMap() const {return fITSClusterMap;}
15e85efa 123 Int_t GetITSLabel() const {return fITSLabel;}
15e85efa 124 void SetITStrack(AliKalmanTrack * track){
125 fFriendTrack->SetITStrack(track);
126 }
127 AliKalmanTrack *GetITStrack(){
128 return fFriendTrack->GetITStrack();
129 }
130
131 void SetTPCpid(const Double_t *p);
132 void GetTPCpid(Double_t *p) const;
133 void SetTPCPoints(Float_t points[4]){
134 for (Int_t i=0;i<4;i++) fTPCPoints[i]=points[i];
135 }
136 void SetTPCPointsF(UChar_t findable){fTPCnclsF = findable;}
00dce61a 137 Int_t GetTPCNcls() const { return fTPCncls;}
138 Int_t GetTPCNclsF() const { return fTPCnclsF;}
e1e6896f 139 Float_t GetTPCPoints(Int_t i) const {return fTPCPoints[i];}
15e85efa 140 void SetKinkIndexes(Int_t points[3]) {
141 for (Int_t i=0;i<3;i++) fKinkIndexes[i] = points[i];
142 }
143 void SetV0Indexes(Int_t points[3]) {
144 for (Int_t i=0;i<3;i++) fV0Indexes[i] = points[i];
145 }
146 void SetTPCsignal(Float_t signal, Float_t sigma, UChar_t npoints){
147 fTPCsignal = signal; fTPCsignalS = sigma; fTPCsignalN = npoints;
148 }
13da10da 149 Float_t GetTPCsignal() const {return fTPCsignal;}
00dce61a 150 Float_t GetTPCsignalSigma() const {return fTPCsignalS;}
0eba927a 151 UShort_t GetTPCsignalN() const {return fTPCsignalN;}
13da10da 152 Float_t GetTPCchi2() const {return fTPCchi2;}
15e85efa 153 Int_t GetTPCclusters(Int_t *idx) const;
81e97e0d 154 Float_t GetTPCdensity(Int_t row0, Int_t row1) const;
15e85efa 155 Int_t GetTPCLabel() const {return fTPCLabel;}
156 Int_t GetKinkIndex(Int_t i) const { return fKinkIndexes[i];}
157 Int_t GetV0Index(Int_t i) const { return fV0Indexes[i];}
3a83c716 158 const TBits& GetTPCClusterMap() const {return fTPCClusterMap;}
a866ac60 159
15e85efa 160 void SetTRDpid(const Double_t *p);
161 void SetTRDQuality(Float_t quality){fTRDQuality=quality;}
162 Float_t GetTRDQuality()const {return fTRDQuality;}
163 void SetTRDBudget(Float_t budget){fTRDBudget=budget;}
164 Float_t GetTRDBudget()const {return fTRDBudget;}
6d45eaef 165 void SetTRDsignals(Float_t dedx, Int_t i, Int_t j) {fTRDsignals[i][j]=dedx;}
15e85efa 166 void SetTRDTimBin(Int_t timbin, Int_t i) {fTRDTimBin[i]=timbin;}
167 void GetTRDpid(Double_t *p) const;
79e94bf8 168 Float_t GetTRDsignal() const {return fTRDsignal;}
6d45eaef 169 Float_t GetTRDsignals(Int_t iPlane, Int_t iSlice=-1) const { if (iSlice == -1)
03ecfe88 170 return (fTRDsignals[iPlane][0] + fTRDsignals[iPlane][1] + fTRDsignals[iPlane][2])/3.0;
6d45eaef 171 return fTRDsignals[iPlane][iSlice];
172 }
15e85efa 173 Int_t GetTRDTimBin(Int_t i) const {return fTRDTimBin[i];}
13da10da 174 Float_t GetTRDchi2() const {return fTRDchi2;}
15e85efa 175 Int_t GetTRDclusters(Int_t *idx) const;
176 Int_t GetTRDncls() const {return fTRDncls;}
79e94bf8 177 void SetTRDpid(Int_t iSpecies, Float_t p);
178 Float_t GetTRDpid(Int_t iSpecies) const;
15e85efa 179 Int_t GetTRDLabel() const {return fTRDLabel;}
c9ec41e8 180
15e85efa 181 void SetTRDtrack(AliKalmanTrack * track){
182 fFriendTrack->SetTRDtrack(track);
183 }
184 AliKalmanTrack *GetTRDtrack(){
185 return fFriendTrack->GetTRDtrack();
186 }
c9ec41e8 187
15e85efa 188 void SetTOFsignal(Double_t tof) {fTOFsignal=tof;}
c630aafd 189 Float_t GetTOFsignal() const {return fTOFsignal;}
15e85efa 190 void SetTOFsignalToT(Double_t ToT) {fTOFsignalToT=ToT;}
85324138 191 Float_t GetTOFsignalToT() const {return fTOFsignalToT;}
d321691a 192 void SetTOFsignalRaw(Double_t tof) {fTOFsignalRaw=tof;}
193 Float_t GetTOFsignalRaw() const {return fTOFsignalRaw;}
194 void SetTOFsignalDz(Double_t dz) {fTOFsignalDz=dz;}
195 Float_t GetTOFsignalDz() const {return fTOFsignalDz;}
13da10da 196 Float_t GetTOFchi2() const {return fTOFchi2;}
c630aafd 197 void SetTOFpid(const Double_t *p);
51ad6848 198 void SetTOFLabel(const Int_t *p);
c630aafd 199 void GetTOFpid(Double_t *p) const;
51ad6848 200 void GetTOFLabel(Int_t *p) const;
201 void GetTOFInfo(Float_t *info) const;
202 void SetTOFInfo(Float_t *info);
85324138 203 Int_t GetTOFCalChannel() const {return fTOFCalChannel;}
15e85efa 204 Int_t GetTOFcluster() const {return fTOFindex;}
205 void SetTOFcluster(Int_t index) {fTOFindex=index;}
206 void SetTOFCalChannel(Int_t index) {fTOFCalChannel=index;}
b67517ef 207
f4b3bbb7 208// HMPID methodes +++++++++++++++++++++++++++++++++ (kir)
209 void SetHMPIDsignal(Double_t theta) {fHMPIDsignal=theta;}
210 Float_t GetHMPIDsignal() const {return fHMPIDsignal;}
211 void SetHMPIDpid(const Double_t *p);
212 void GetHMPIDpid(Double_t *p) const;
213 void SetHMPIDchi2(Double_t chi2) {fHMPIDchi2=chi2;}
214 Float_t GetHMPIDchi2() const {return fHMPIDchi2;}
215 void SetHMPIDcluster(Int_t index) {fHMPIDcluIdx=index;}
216 Int_t GetHMPIDcluster() const {return fHMPIDcluIdx;}
217 void SetHMPIDcluIdx(Int_t ch,Int_t idx) {fHMPIDcluIdx=ch*1000000+idx;}
218 Int_t GetHMPIDcluIdx() const {return fHMPIDcluIdx;}
219 void SetHMPIDtrk(Float_t x, Float_t y, Float_t th, Float_t ph) {
220 fHMPIDtrkX=x; fHMPIDtrkY=y; fHMPIDtrkTheta=th; fHMPIDtrkPhi=ph;
15e85efa 221 }
f4b3bbb7 222 void GetHMPIDtrk(Float_t &x, Float_t &y, Float_t &th, Float_t &ph) const {
223 x=fHMPIDtrkX; y=fHMPIDtrkY; th=fHMPIDtrkTheta; ph=fHMPIDtrkPhi;
15e85efa 224 }
f4b3bbb7 225 void SetHMPIDmip(Float_t x, Float_t y, Int_t q, Int_t nph=0) {
226 fHMPIDmipX=x; fHMPIDmipY=y; fHMPIDqn=100000*q+nph;
15e85efa 227 }
f4b3bbb7 228 void GetHMPIDmip(Float_t &x,Float_t &y,Int_t &q,Int_t &nph) const {
229 x=fHMPIDmipX; y=fHMPIDmipY; q=fHMPIDqn/1000000; nph=fHMPIDqn%1000000;
15e85efa 230 }
f4b3bbb7 231 Bool_t IsHMPID() const {return fFlags&kHMPIDpid;}
b67517ef 232
233
2e1dcd14 234 Int_t GetEMCALcluster() {return fEMCALindex;}
235 void SetEMCALcluster(Int_t index) {fEMCALindex=index;}
236 Bool_t IsEMCAL() const {return fFlags&kEMCALmatch;}
ac2f7574 237
cf0f66c2 238 void SetTrackPointArray(AliTrackPointArray *points) {
239 fFriendTrack->SetTrackPointArray(points);
240 }
241 const AliTrackPointArray *GetTrackPointArray() const {
242 return fFriendTrack->GetTrackPointArray();
243 }
15e85efa 244 Bool_t RelateToVertex(const AliESDVertex *vtx, Double_t b, Double_t maxd);
49d13e89 245 void GetImpactParameters(Float_t &xy,Float_t &z) const {xy=fD; z=fZ;}
246 void GetImpactParameters(Float_t p[2], Float_t cov[3]) const {
247 p[0]=fD; p[1]=fZ; cov[0]=fCdd; cov[1]=fCdz; cov[2]=fCzz;
248 }
ac2f7574 249 virtual void Print(Option_t * opt) const ;
250
6c94f330 251 //MI
252 Bool_t PropagateTo(Double_t x, Double_t b, Double_t mass, Double_t maxStep,
253 Bool_t rotateTo=kTRUE, Double_t maxSnp=0.8);
254
ae982df3 255 enum {
8c6a71ab 256 kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSpid=0x0008,
257 kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCpid=0x0080,
258 kTRDin=0x0100,kTRDout=0x0200,kTRDrefit=0x0400,kTRDpid=0x0800,
259 kTOFin=0x1000,kTOFout=0x2000,kTOFrefit=0x4000,kTOFpid=0x8000,
f4b3bbb7 260 kHMPIDpid=0x20000,
2e1dcd14 261 kEMCALmatch=0x40000,
c4d11b15 262 kTRDbackup=0x80000,
4a78b8c5 263 kTRDStop=0x20000000,
8c6a71ab 264 kESDpid=0x40000000,
ae982df3 265 kTIME=0x80000000
266 };
f122c485 267 enum {
6d45eaef 268 kNPlane = 6,
2e1dcd14 269 kNSlice = 3,
270 kEMCALNoMatch = -999999999
f122c485 271 };
ae982df3 272protected:
90e48c0c 273
90e48c0c 274
49d13e89 275 ULong_t fFlags; // Reconstruction status flags
276 Int_t fLabel; // Track label
277 Int_t fID; // Unique ID of the track
278 Float_t fTrackLength; // Track length
279 Float_t fD; // Impact parameter in XY plane
280 Float_t fZ; // Impact parameter in Z
281 Float_t fCdd,fCdz,fCzz; // Covariance matrix of the impact parameters
304864ab 282 Float_t fTrackTime[AliPID::kSPECIES]; // TOFs estimated by the tracking
c9ec41e8 283 Float_t fR[AliPID::kSPECIES]; // combined "detector response probability"
ae982df3 284
49d13e89 285 Int_t fStopVertex; // Index of the stop vertex
ae982df3 286
e1e6896f 287 AliExternalTrackParam *fCp; // Track parameters constrained to the primary vertex
61402fa9 288 Double32_t fCchi2; // chi2 at the primary vertex
e1e6896f 289
67c3dcbe 290
d3547a27 291 AliExternalTrackParam *fIp; // Track parameters at the first measured point (TPC)
23904d16 292
e1e6896f 293
d3547a27 294 AliExternalTrackParam *fOp; // Track parameters at the last measured point (TPC or TRD)
ae982df3 295
ae982df3 296 // ITS related track information
297 Float_t fITSchi2; // chi2 in the ITS
298 Int_t fITSncls; // number of clusters assigned in the ITS
62665e7f 299 UChar_t fITSClusterMap; // map of clusters, one bit per a layer
ae982df3 300 Float_t fITSsignal; // detector's PID signal
304864ab 301 Float_t fITSr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
6e5b1b04 302 Int_t fITSLabel; // label according TPC
15e85efa 303
ae982df3 304 // TPC related track information
15e85efa 305 Float_t fTPCchi2; // chi2 in the TPC
306 Int_t fTPCncls; // number of clusters assigned in the TPC
e1d4c1b5 307 UShort_t fTPCnclsF; // number of findable clusters in the TPC
15e85efa 308 TBits fTPCClusterMap; // Map of clusters, one bit per padrow; 1 if has a cluster on given padrow
309 Float_t fTPCsignal; // detector's PID signal
310 UShort_t fTPCsignalN; // number of points used for dEdx
e1d4c1b5 311 Float_t fTPCsignalS; // RMS of dEdx measurement
15e85efa 312 Float_t fTPCr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
313 Int_t fTPCLabel; // label according TPC
314 Float_t fTPCPoints[4]; // TPC points -first, max. dens, last and max density
315 Int_t fKinkIndexes[3];// array of indexes of posible kink candidates
316 Int_t fV0Indexes[3]; // array of indexes of posible kink candidates
23904d16 317
ae982df3 318 // TRD related track information
79e94bf8 319 Float_t fTRDchi2; // chi2 in the TRD
320 Int_t fTRDncls; // number of clusters assigned in the TRD
c4d11b15 321 Int_t fTRDncls0; // number of clusters assigned in the TRD before first material cross
79e94bf8 322 Float_t fTRDsignal; // detector's PID signal
6d45eaef 323 Float_t fTRDsignals[kNPlane][kNSlice]; // TRD signals from all six planes in 3 slices each
ef7253ac 324 Int_t fTRDTimBin[kNPlane]; // Time bin of Max cluster from all six planes
304864ab 325 Float_t fTRDr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
6e5b1b04 326 Int_t fTRDLabel; // label according TRD
15e85efa 327 Float_t fTRDQuality; // trd quality factor for TOF
328 Float_t fTRDBudget; // trd material budget
329
23904d16 330
ae982df3 331 // TOF related track information
c630aafd 332 Float_t fTOFchi2; // chi2 in the TOF
ef7253ac 333 Int_t fTOFindex; // index of the assigned TOF cluster
15e85efa 334 Int_t fTOFCalChannel; // Channel Index of the TOF Signal
c630aafd 335 Float_t fTOFsignal; // detector's PID signal
85324138 336 Float_t fTOFsignalToT; // detector's ToT signal
d321691a 337 Float_t fTOFsignalRaw; // detector's uncorrected time signal
338 Float_t fTOFsignalDz; // local z of track's impact on the TOF pad
304864ab 339 Float_t fTOFr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
15e85efa 340 Int_t fTOFLabel[3]; // TOF label
341 Float_t fTOFInfo[10]; //! TOF informations
23904d16 342
b67517ef 343 // HMPID related track information (kir)
f4b3bbb7 344 Float_t fHMPIDchi2; // chi2 in the HMPID
345 Int_t fHMPIDqn; // 1000000*QDC + number of photon clusters
346 Int_t fHMPIDcluIdx; // 1000000*chamber id + cluster idx of the assigned MIP cluster
347 Float_t fHMPIDsignal; // HMPID PID signal (Theta ckov, rad)
348 Float_t fHMPIDr[AliPID::kSPECIES];// "detector response probabilities" (for the PID)
349 Float_t fHMPIDtrkTheta; // theta of the track extrapolated to the HMPID, LORS
350 Float_t fHMPIDtrkPhi; // phi of the track extrapolated to the HMPID, LORS
351 Float_t fHMPIDtrkX; // x of the track impact, LORS
352 Float_t fHMPIDtrkY; // y of the track impact, LORS
353 Float_t fHMPIDmipX; // x of the MIP in LORS
354 Float_t fHMPIDmipY; // y of the MIP in LORS
2e1dcd14 355
356 // EMCAL related track information
cf0f66c2 357 Int_t fEMCALindex; // index of associated EMCAL cluster (AliESDCaloCluster)
15e85efa 358
359 AliESDfriendTrack *fFriendTrack; //! All the complementary information
98937d93 360
e1e6896f 361 private:
362
363 AliESDtrack & operator=(const AliESDtrack & ) {return *this;}
364
2bf8c29b 365 ClassDef(AliESDtrack,36) //ESDtrack
ae982df3 366};
367
368#endif
369