bugfix
[u/mrichter/AliRoot.git] / STEER / AliESDtrack.h
CommitLineData
ae982df3 1#ifndef ALIESDTRACK_H
2#define ALIESDTRACK_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
ac3faee4 6/* $Id$ */
7
ae982df3 8//-------------------------------------------------------------------------
9// Class AliESDtrack
15614b8b 10// This is the class to deal with during the physics analysis of data
ae982df3 11//
12// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
13//-------------------------------------------------------------------------
ac3faee4 14
a866ac60 15#include <TBits.h>
ac3faee4 16#include <TObject.h>
ae982df3 17class AliKalmanTrack;
18
19class AliESDtrack : public TObject {
20public:
21 AliESDtrack();
c4d11b15 22 AliESDtrack(const AliESDtrack& track);
51ad6848 23 virtual ~AliESDtrack();
24 void SetID(Int_t id) { fID =id;}
25 Int_t GetID(){ return fID;}
ae982df3 26 void SetStatus(ULong_t flags) {fFlags|=flags;}
27 void ResetStatus(ULong_t flags) {fFlags&=~flags;}
15614b8b 28 Bool_t UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags);
ae982df3 29 void SetIntegratedLength(Double_t l) {fTrackLength=l;}
30 void SetIntegratedTimes(const Double_t *times);
8c6a71ab 31 void SetESDpid(const Double_t *p);
32 void GetESDpid(Double_t *p) const;
ae982df3 33
34 ULong_t GetStatus() const {return fFlags;}
35 Int_t GetLabel() const {return fLabel;}
36 Double_t GetAlpha() const {return fRalpha;}
37 void GetExternalParameters(Double_t &x, Double_t p[5]) const;
15614b8b 38 Bool_t GetExternalParametersAt(Double_t x, Double_t p[5]) const;
ae982df3 39 void GetExternalCovariance(Double_t cov[15]) const;
40 Double_t GetIntegratedLength() const {return fTrackLength;}
41 void GetIntegratedTimes(Double_t *times) const;
4a78b8c5 42 Double_t GetMass() const;
ae982df3 43 Double_t GetP() const;
44 void GetPxPyPz(Double_t *p) const;
45 void GetXYZ(Double_t *r) const;
b322ab2f 46 void GetCovariance(Double_t cov[21]) const;
9f64824b 47 Int_t GetSign() const {return (fRp[4]>0) ? 1 : -1;}
ae982df3 48
5ccd1720 49 void SetConstrainedTrackParams(const AliKalmanTrack *t, Double_t chi2);
67c3dcbe 50
51 Double_t GetConstrainedAlpha() const {return fCalpha;}
52 Double_t GetConstrainedChi2() const {return fCchi2;}
53 void GetConstrainedExternalParameters(Double_t &x, Double_t p[5]) const;
54 void GetConstrainedExternalCovariance(Double_t cov[15]) const;
55
56 void GetConstrainedPxPyPz(Double_t *p) const;
57 void GetConstrainedXYZ(Double_t *r) const;
58
9b859005 59 void GetInnerPxPyPz(Double_t *p) const;
60 void GetInnerXYZ(Double_t *r) const;
a866ac60 61 void GetInnerExternalParameters(Double_t &x, Double_t p[5]) const;//skowron
62 void GetInnerExternalCovariance(Double_t cov[15]) const;//skowron
63 Double_t GetInnerAlpha() const {return fIalpha;}
64
65
3fd96ae3 66 void GetOuterPxPyPzPHOS(Double_t *p) const;
67 void GetOuterPxPyPzEMCAL(Double_t *p) const;
68 void GetOuterXYZPHOS(Double_t *r) const;
69 void GetOuterXYZEMCAL(Double_t *r) const;
672b5f43 70
c630aafd 71 void SetITSpid(const Double_t *p);
babd135a 72 void SetITSChi2MIP(const Float_t *chi2mip);
c4d11b15 73 void SetITStrack(AliKalmanTrack * track){fITStrack=track;}
c630aafd 74 void GetITSpid(Double_t *p) const;
ae982df3 75 Float_t GetITSsignal() const {return fITSsignal;}
13da10da 76 Float_t GetITSchi2() const {return fITSchi2;}
ae982df3 77 Int_t GetITSclusters(UInt_t *idx) const;
6e5b1b04 78 Int_t GetITSLabel() const {return fITSLabel;}
babd135a 79 Float_t GetITSFakeRatio() const {return fITSFakeRatio;}
c4d11b15 80 AliKalmanTrack * GetITStrack(){return fITStrack;}
ae982df3 81
13da10da 82 void SetTPCpid(const Double_t *p);
83 void GetTPCpid(Double_t *p) const;
51ad6848 84 void SetTPCPoints(Float_t points[4]){for (Int_t i=0;i<4;i++) fTPCPoints[i]=points[i];}
85 void SetKinkIndexes(Int_t points[3]) {for (Int_t i=0;i<3;i++) fKinkIndexes[i] = points[i];}
86 void SetV0Indexes(Int_t points[3]) {for (Int_t i=0;i<3;i++) fV0Indexes[i] = points[i];}
13da10da 87 Float_t GetTPCsignal() const {return fTPCsignal;}
88 Float_t GetTPCchi2() const {return fTPCchi2;}
89 Int_t GetTPCclusters(Int_t *idx) const;
6e5b1b04 90 Int_t GetTPCLabel() const {return fTPCLabel;}
51ad6848 91 Int_t GetKinkIndex(Int_t i) const { return fKinkIndexes[i];}
92 Int_t GetV0Index(Int_t i) const { return fV0Indexes[i];}
3a83c716 93 const TBits& GetTPCClusterMap() const {return fTPCClusterMap;}
a866ac60 94
c630aafd 95 void SetTRDpid(const Double_t *p);
c4d11b15 96 void SetTRDtrack(AliKalmanTrack * track){fTRDtrack=track;}
c630aafd 97 void GetTRDpid(Double_t *p) const;
79e94bf8 98 Float_t GetTRDsignal() const {return fTRDsignal;}
13da10da 99 Float_t GetTRDchi2() const {return fTRDchi2;}
bb2ceb1f 100 Int_t GetTRDclusters(UInt_t *idx) const;
51ad6848 101 Int_t GetTRDncls() const {return fTRDncls;}
79e94bf8 102 void SetTRDpid(Int_t iSpecies, Float_t p);
103 Float_t GetTRDpid(Int_t iSpecies) const;
6e5b1b04 104 Int_t GetTRDLabel() const {return fTRDLabel;}
35f4ab61 105 void GetTRDExternalParameters(Double_t &x, Double_t &alpha, Double_t p[5], Double_t cov[15]) const;//MI
c4d11b15 106 AliKalmanTrack * GetTRDtrack(){return fTRDtrack;}
79e94bf8 107
c630aafd 108 void SetTOFsignal(Double_t tof) {fTOFsignal=tof;}
109 Float_t GetTOFsignal() const {return fTOFsignal;}
13da10da 110 Float_t GetTOFchi2() const {return fTOFchi2;}
c630aafd 111 void SetTOFpid(const Double_t *p);
51ad6848 112 void SetTOFLabel(const Int_t *p);
c630aafd 113 void GetTOFpid(Double_t *p) const;
51ad6848 114 void GetTOFLabel(Int_t *p) const;
115 void GetTOFInfo(Float_t *info) const;
116 void SetTOFInfo(Float_t *info);
c630aafd 117 UInt_t GetTOFcluster() const {return fTOFindex;}
118 void SetTOFcluster(UInt_t index) {fTOFindex=index;}
4a78b8c5 119
120 void SetRICHsignal(Double_t beta) {fRICHsignal=beta;}
121 Float_t GetRICHsignal() const {return fRICHsignal;}
122 void SetRICHpid(const Double_t *p);
123 void GetRICHpid(Double_t *p) const;
124
125 void SetPHOSposition(const Double_t *pos) {
126 fPHOSpos[0] = pos[0]; fPHOSpos[1]=pos[1]; fPHOSpos[2]=pos[2];
127 }
128 void SetPHOSsignal(Double_t ene) {fPHOSsignal = ene; }
129 void SetPHOSpid(const Double_t *p);
130 void GetPHOSposition(Double_t *pos) const {
131 pos[0]=fPHOSpos[0]; pos[1]=fPHOSpos[1]; pos[2]=fPHOSpos[2];
132 }
133 Float_t GetPHOSsignal() const {return fPHOSsignal;}
134 void GetPHOSpid(Double_t *p) const;
135
704be597 136 void SetEMCALposition(const Double_t *pos) {
137 fEMCALpos[0] = pos[0]; fEMCALpos[1]=pos[1]; fEMCALpos[2]=pos[2];
138 }
139 void SetEMCALsignal(Double_t ene) {fEMCALsignal = ene; }
140 void SetEMCALpid(const Double_t *p);
141 void GetEMCALposition(Double_t *pos) const {
142 pos[0]=fEMCALpos[0]; pos[1]=fEMCALpos[1]; pos[2]=fEMCALpos[2];
143 }
144 Float_t GetEMCALsignal() const {return fEMCALsignal;}
145 void GetEMCALpid(Double_t *p) const;
146
3a83c716 147 Bool_t IsOn(Int_t mask) const {return (fFlags&mask)>0;}
704be597 148 Bool_t IsRICH() const {return fFlags&kRICHpid;}
149 Bool_t IsPHOS() const {return fFlags&kPHOSpid;}
150 Bool_t IsEMCAL() const {return fFlags&kEMCALpid;}
ac2f7574 151
152 virtual void Print(Option_t * opt) const ;
153
ae982df3 154 enum {
8c6a71ab 155 kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSpid=0x0008,
156 kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCpid=0x0080,
157 kTRDin=0x0100,kTRDout=0x0200,kTRDrefit=0x0400,kTRDpid=0x0800,
158 kTOFin=0x1000,kTOFout=0x2000,kTOFrefit=0x4000,kTOFpid=0x8000,
c4d11b15 159 kPHOSpid=0x10000, kRICHpid=0x20000, kEMCALpid=0x40000,
160 kTRDbackup=0x80000,
4a78b8c5 161 kTRDStop=0x20000000,
8c6a71ab 162 kESDpid=0x40000000,
ae982df3 163 kTIME=0x80000000
164 };
f82d8b8c 165 enum {
166 kSPECIES=5, // Number of particle species recognized by the PID
704be597 167 kSPECIESN=10, // Number of charged+neutral particle species recognized by the PHOS/EMCAL PID
f82d8b8c 168 kElectron=0, kMuon=1, kPion=2, kKaon=3, kProton=4, kPhoton=5,
704be597 169 kPi0=6, kNeutron=7, kKaon0=8, kEleCon=9 // PHOS/EMCAL definition
f82d8b8c 170 };
ae982df3 171protected:
172 ULong_t fFlags; // Reconstruction status flags
173 Int_t fLabel; // Track label
51ad6848 174 Int_t fID; // Unique ID of the track
ae982df3 175 Float_t fTrackLength; // Track length
176 Float_t fTrackTime[kSPECIES]; // TOFs estimated by the tracking
177 Float_t fR[kSPECIES]; // combined "detector response probability"
178
179 Int_t fStopVertex; // Index of stop vertex
180
181//Running track parameters
182 Double_t fRalpha; // track rotation angle
183 Double_t fRx; // X-coordinate of the track reference plane
184 Double_t fRp[5]; // external track parameters
185 Double_t fRc[15]; // external cov. matrix of the track parameters
186
67c3dcbe 187//Track parameters constrained to the primary vertex
3a83c716 188 Double_t fCalpha; // Track rotation angle
189 Double_t fCx; // x-coordinate of the track reference plane
190 Double_t fCp[5]; // external track parameters
191 Double_t fCc[15]; // external cov. matrix of the track parameters
67c3dcbe 192 Double_t fCchi2; //chi2 at the primary vertex
193
672b5f43 194//Track parameters at the inner wall of the TPC
3a83c716 195 Double_t fIalpha; // Track rotation angle
196 Double_t fIx; // x-coordinate of the track reference plane
197 Double_t fIp[5]; // external track parameters
198 Double_t fIc[15]; // external cov. matrix of the track parameters
c4d11b15 199//Track parameters at the inner wall of the TRD
200 Double_t fTalpha; // Track rotation angle
201 Double_t fTx; // x-coordinate of the track reference plane
202 Double_t fTp[5]; // external track parameters
203 Double_t fTc[15]; // external cov. matrix of the track parameters
ae982df3 204
672b5f43 205//Track parameters at the radius of the PHOS
15614b8b 206 Double_t fOalpha; //! Track rotation angle
207 Double_t fOx; //! x-coordinate of the track reference plane
208 Double_t fOp[5]; //! external track parameters
209 Double_t fOc[15]; //! external cov. matrix of the track parameters
ae982df3 210
704be597 211//Track parameters at the radius of the EMCAL
15614b8b 212 Double_t fXalpha; //! Track rotation angle
213 Double_t fXx; //! x-coordinate of the track reference plane
214 Double_t fXp[5]; //! external track parameters
215 Double_t fXc[15]; //! external cov. matrix of the track parameters
704be597 216
ae982df3 217 // ITS related track information
218 Float_t fITSchi2; // chi2 in the ITS
c4d11b15 219 Float_t fITSchi2MIP[12]; // chi2s in the ITS
ae982df3 220 Int_t fITSncls; // number of clusters assigned in the ITS
221 UInt_t fITSindex[6]; //! indices of the assigned ITS clusters
222 Float_t fITSsignal; // detector's PID signal
431be10d 223 Float_t fITSr[kSPECIES]; // "detector response probabilities" (for the PID)
6e5b1b04 224 Int_t fITSLabel; // label according TPC
babd135a 225 Float_t fITSFakeRatio; // ration of fake tracks
3fd96ae3 226 AliKalmanTrack * fITStrack; //! OWNER: pointer to the ITS track -- currently for debug purpose
c4d11b15 227
ae982df3 228 // TPC related track information
229 Float_t fTPCchi2; // chi2 in the TPC
230 Int_t fTPCncls; // number of clusters assigned in the TPC
51ad6848 231 Int_t fTPCindex[180]; //! indices of the assigned TPC clusters
a866ac60 232 TBits fTPCClusterMap; // Map of clusters, one bit per padrow; 1 if has a cluster on given padrow
ae982df3 233 Float_t fTPCsignal; // detector's PID signal
8c6a71ab 234 Float_t fTPCr[kSPECIES]; // "detector response probabilities" (for the PID)
6e5b1b04 235 Int_t fTPCLabel; // label according TPC
51ad6848 236 Float_t fTPCPoints[4]; // TPC points -first, max. dens, last and max density
237 Int_t fKinkIndexes[3]; // array of indexes of posible kink candidates
238 Int_t fV0Indexes[3]; // array of indexes of posible kink candidates
ae982df3 239 // TRD related track information
79e94bf8 240 Float_t fTRDchi2; // chi2 in the TRD
241 Int_t fTRDncls; // number of clusters assigned in the TRD
c4d11b15 242 Int_t fTRDncls0; // number of clusters assigned in the TRD before first material cross
243 UInt_t fTRDindex[130]; //! indices of the assigned TRD clusters
79e94bf8 244 Float_t fTRDsignal; // detector's PID signal
431be10d 245 Float_t fTRDr[kSPECIES]; // "detector response probabilities" (for the PID)
6e5b1b04 246 Int_t fTRDLabel; // label according TRD
3fd96ae3 247 AliKalmanTrack * fTRDtrack; //! OWNER: pointer to the TRD track -- currently for debug purpose
ae982df3 248 // TOF related track information
c630aafd 249 Float_t fTOFchi2; // chi2 in the TOF
bb2ceb1f 250 UInt_t fTOFindex; // index of the assigned TOF cluster
c630aafd 251 Float_t fTOFsignal; // detector's PID signal
252 Float_t fTOFr[kSPECIES]; // "detector response probabilities" (for the PID)
51ad6848 253 Int_t fTOFLabel[3]; // TOF label
254 Float_t fTOFInfo[10]; //! TOF informations
4a78b8c5 255 // PHOS related track information
51ad6848 256 Float_t fPHOSpos[3]; // position localised by PHOS in global coordinate system
4a78b8c5 257 Float_t fPHOSsignal; // energy measured by PHOS
704be597 258 Float_t fPHOSr[kSPECIESN]; // PID information from PHOS
259
260 // EMCAL related track information
261 Float_t fEMCALpos[3]; //position localised by EMCAL in global coordinate system
262 Float_t fEMCALsignal; // energy measured by EMCAL
263 Float_t fEMCALr[kSPECIESN]; // PID information from EMCAL
ae982df3 264
4a78b8c5 265 // HMPID related track information
266 Float_t fRICHsignal; // detector's PID signal (beta for RICH)
267 Float_t fRICHr[kSPECIES];// "detector response probabilities" (for the PID)
268
51ad6848 269 ClassDef(AliESDtrack,9) //ESDtrack
ae982df3 270};
271
272#endif
273