]>
Commit | Line | Data |
---|---|---|
ae982df3 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
ae982df3 | 15 | //----------------------------------------------------------------- |
16 | // Implementation of the ESD track class | |
4427806c | 17 | // ESD = Event Summary Data |
15614b8b | 18 | // This is the class to deal with during the phisics analysis of data |
4427806c | 19 | // Origin: Iouri Belikov, CERN |
20 | // e-mail: Jouri.Belikov@cern.ch | |
ae982df3 | 21 | //----------------------------------------------------------------- |
22 | ||
23 | #include "TMath.h" | |
24 | ||
25 | #include "AliESDtrack.h" | |
26 | #include "AliKalmanTrack.h" | |
98937d93 | 27 | #include "AliTrackPointArray.h" |
5f7789fc | 28 | #include "AliLog.h" |
ae982df3 | 29 | |
30 | ClassImp(AliESDtrack) | |
31 | ||
32 | //_______________________________________________________________________ | |
33 | AliESDtrack::AliESDtrack() : | |
90e48c0c | 34 | TObject(), |
35 | fFlags(0), | |
36 | fLabel(0), | |
37 | fID(0), | |
38 | fTrackLength(0), | |
39 | fD(0), | |
40 | fZ(0), | |
41 | fStopVertex(0), | |
42 | fRalpha(0), | |
43 | fRx(0), | |
44 | fCalpha(0), | |
45 | fCx(0), | |
46 | fCchi2(1e10), | |
47 | fIalpha(0), | |
48 | fIx(0), | |
49 | fTalpha(0), | |
50 | fTx(0), | |
51 | fITSchi2(0), | |
52 | fITSncls(0), | |
53 | fITSsignal(0), | |
54 | fITSLabel(0), | |
55 | fITSFakeRatio(0), | |
56 | fITStrack(0), | |
57 | fTPCchi2(0), | |
58 | fTPCncls(0), | |
59 | fTPCClusterMap(159),//number of padrows | |
60 | fTPCsignal(0), | |
61 | fTPCLabel(0), | |
62 | fTRDchi2(0), | |
63 | fTRDncls(0), | |
64 | fTRDncls0(0), | |
65 | fTRDsignal(0), | |
66 | fTRDLabel(0), | |
67 | fTRDQuality(0), | |
23d49657 | 68 | fTRDBudget(0), |
90e48c0c | 69 | fTRDtrack(0), |
70 | fTOFchi2(0), | |
71 | fTOFindex(0), | |
72 | fTOFsignal(-1), | |
73 | fPHOSsignal(-1), | |
74 | fEMCALsignal(-1), | |
75 | fRICHchi2(1e10), | |
76 | fRICHncls(0), | |
77 | fRICHindex(0), | |
78 | fRICHsignal(-1), | |
79 | fRICHtheta(0), | |
80 | fRICHphi(0), | |
81 | fRICHdx(0), | |
98937d93 | 82 | fRICHdy(0), |
83 | fPoints(0) | |
ae982df3 | 84 | { |
85 | // | |
86 | // The default ESD constructor | |
87 | // | |
304864ab | 88 | for (Int_t i=0; i<AliPID::kSPECIES; i++) { |
4a78b8c5 | 89 | fTrackTime[i]=0.; |
90 | fR[i]=1.; | |
91 | fITSr[i]=1.; | |
92 | fTPCr[i]=1.; | |
93 | fTRDr[i]=1.; | |
94 | fTOFr[i]=1.; | |
4a78b8c5 | 95 | fRICHr[i]=1.; |
2bad268c | 96 | } |
ac2f7574 | 97 | |
304864ab | 98 | for (Int_t i=0; i<AliPID::kSPECIESN; i++) { |
704be597 | 99 | fPHOSr[i] = 1.; |
100 | fEMCALr[i] = 1.; | |
101 | } | |
102 | ||
ac2f7574 | 103 | |
4a78b8c5 | 104 | fPHOSpos[0]=fPHOSpos[1]=fPHOSpos[2]=0.; |
704be597 | 105 | fEMCALpos[0]=fEMCALpos[1]=fEMCALpos[2]=0.; |
bb2ceb1f | 106 | Int_t i; |
15614b8b | 107 | for (i=0; i<5; i++) { |
23904d16 | 108 | fRp[i]=fCp[i]=fIp[i]=fTp[i]=0.; |
15614b8b | 109 | } |
110 | for (i=0; i<15; i++) { | |
23904d16 | 111 | fRc[i]=fCc[i]=fIc[i]=fTc[i]=0.; |
15614b8b | 112 | } |
a866ac60 | 113 | for (i=0; i<6; i++) { fITSindex[i]=0; } |
114 | for (i=0; i<180; i++){ fTPCindex[i]=0; } | |
51ad6848 | 115 | for (i=0; i<3;i++) { fKinkIndexes[i]=0;} |
116 | for (i=0; i<3;i++) { fV0Indexes[i]=-1;} | |
c4d11b15 | 117 | for (i=0; i<130; i++) { fTRDindex[i]=0; } |
eab5961e | 118 | for (i=0;i<kNPlane;i++) {fTRDsignals[i]=0.; fTRDTimBin[i]=-1;} |
51ad6848 | 119 | for (Int_t i=0;i<4;i++) {fTPCPoints[i]=-1;} |
120 | for (Int_t i=0;i<3;i++) {fTOFLabel[i]=-1;} | |
121 | for (Int_t i=0;i<10;i++) {fTOFInfo[i]=-1;} | |
6e5b1b04 | 122 | fTPCLabel = 0; |
123 | fTRDLabel = 0; | |
7c97ee80 | 124 | fTRDQuality =0; |
23d49657 | 125 | fTRDBudget =0; |
6e5b1b04 | 126 | fITSLabel = 0; |
c4d11b15 | 127 | fITStrack = 0; |
128 | fTRDtrack = 0; | |
129 | } | |
130 | ||
131 | //_______________________________________________________________________ | |
90e48c0c | 132 | AliESDtrack::AliESDtrack(const AliESDtrack& track): |
133 | TObject(track), | |
134 | fFlags(track.fFlags), | |
135 | fLabel(track.fLabel), | |
136 | fID(track.fID), | |
137 | fTrackLength(track.fTrackLength), | |
138 | fD(track.fD), | |
139 | fZ(track.fZ), | |
140 | fStopVertex(track.fStopVertex), | |
141 | fRalpha(track.fRalpha), | |
142 | fRx(track.fRx), | |
143 | fCalpha(track.fCalpha), | |
144 | fCx(track.fCx), | |
145 | fCchi2(track.fCchi2), | |
146 | fIalpha(track.fIalpha), | |
147 | fIx(track.fIx), | |
148 | fTalpha(track.fTalpha), | |
149 | fTx(track.fTx), | |
150 | fITSchi2(track.fITSchi2), | |
151 | fITSncls(track.fITSncls), | |
152 | fITSsignal(track.fITSsignal), | |
153 | fITSLabel(track.fITSLabel), | |
154 | fITSFakeRatio(track.fITSFakeRatio), | |
155 | fITStrack(0), //coping separatelly - in user code | |
156 | fTPCchi2(track.fTPCchi2), | |
157 | fTPCncls(track.fTPCncls), | |
158 | fTPCClusterMap(track.fTPCClusterMap), | |
159 | fTPCsignal(track.fTPCsignal), | |
160 | fTPCLabel(track.fTPCLabel), | |
161 | fTRDchi2(track.fTRDchi2), | |
162 | fTRDncls(track.fTRDncls), | |
163 | fTRDncls0(track.fTRDncls0), | |
164 | fTRDsignal(track.fTRDsignal), | |
165 | fTRDLabel(track.fTRDLabel), | |
166 | fTRDQuality(track.fTRDQuality), | |
23d49657 | 167 | fTRDBudget(track.fTRDBudget), |
90e48c0c | 168 | fTRDtrack(0), |
169 | fTOFchi2(track.fTOFchi2), | |
170 | fTOFindex(track.fTOFindex), | |
171 | fTOFsignal(track.fTOFsignal), | |
172 | fPHOSsignal(track.fPHOSsignal), | |
173 | fEMCALsignal(track.fEMCALsignal), | |
174 | fRICHchi2(track.fRICHchi2), | |
175 | fRICHncls(track.fRICHncls), | |
176 | fRICHindex(track.fRICHindex), | |
177 | fRICHsignal(track.fRICHsignal), | |
178 | fRICHtheta(track.fRICHtheta), | |
179 | fRICHphi(track.fRICHphi), | |
180 | fRICHdx(track.fRICHdx), | |
98937d93 | 181 | fRICHdy(track.fRICHdy), |
182 | fPoints(track.fPoints) | |
90e48c0c | 183 | { |
c4d11b15 | 184 | // |
185 | //copy constructor | |
186 | // | |
304864ab | 187 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i] =track.fTrackTime[i]; |
188 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fR[i] =track.fR[i]; | |
c4d11b15 | 189 | // |
c4d11b15 | 190 | for (Int_t i=0;i<5;i++) fRp[i] =track.fRp[i]; |
191 | for (Int_t i=0;i<15;i++) fRc[i] =track.fRc[i]; | |
192 | // | |
c4d11b15 | 193 | for (Int_t i=0;i<5;i++) fCp[i] =track.fCp[i]; |
194 | for (Int_t i=0;i<15;i++) fCc[i] =track.fCc[i]; | |
c4d11b15 | 195 | // |
c4d11b15 | 196 | for (Int_t i=0;i<5;i++) fIp[i] =track.fIp[i]; |
197 | for (Int_t i=0;i<15;i++) fIc[i] =track.fIc[i]; | |
198 | // | |
c4d11b15 | 199 | for (Int_t i=0;i<5;i++) fTp[i] =track.fTp[i]; |
200 | for (Int_t i=0;i<15;i++) fTc[i] =track.fTc[i]; | |
201 | // | |
c4d11b15 | 202 | for (Int_t i=0;i<12;i++) fITSchi2MIP[i] =track.fITSchi2MIP[i]; |
c4d11b15 | 203 | for (Int_t i=0;i<6;i++) fITSindex[i]=track.fITSindex[i]; |
304864ab | 204 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fITSr[i]=track.fITSr[i]; |
c4d11b15 | 205 | // |
c4d11b15 | 206 | for (Int_t i=0;i<180;i++) fTPCindex[i]=track.fTPCindex[i]; |
304864ab | 207 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=track.fTPCr[i]; |
51ad6848 | 208 | for (Int_t i=0;i<4;i++) {fTPCPoints[i]=track.fTPCPoints[i];} |
209 | for (Int_t i=0; i<3;i++) { fKinkIndexes[i]=track.fKinkIndexes[i];} | |
210 | for (Int_t i=0; i<3;i++) { fV0Indexes[i]=track.fV0Indexes[i];} | |
c4d11b15 | 211 | // |
c4d11b15 | 212 | for (Int_t i=0;i<130;i++) fTRDindex[i]=track.fTRDindex[i]; |
eab5961e | 213 | for (Int_t i=0;i<kNPlane;i++) { |
214 | fTRDsignals[i]=track.fTRDsignals[i]; | |
215 | fTRDTimBin[i]=track.fTRDTimBin[i]; | |
216 | } | |
304864ab | 217 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTRDr[i]=track.fTRDr[i]; |
c4d11b15 | 218 | // |
304864ab | 219 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTOFr[i]=track.fTOFr[i]; |
51ad6848 | 220 | for (Int_t i=0;i<3;i++) fTOFLabel[i]=track.fTOFLabel[i]; |
221 | for (Int_t i=0;i<10;i++) fTOFInfo[i]=track.fTOFInfo[i]; | |
c4d11b15 | 222 | // |
223 | for (Int_t i=0;i<3;i++) fPHOSpos[i]=track.fPHOSpos[i]; | |
304864ab | 224 | for (Int_t i=0;i<AliPID::kSPECIESN;i++) fPHOSr[i]=track.fPHOSr[i]; |
c4d11b15 | 225 | // |
226 | for (Int_t i=0;i<3;i++) fEMCALpos[i]=track.fEMCALpos[i]; | |
304864ab | 227 | for (Int_t i=0;i<AliPID::kSPECIESN;i++) fEMCALr[i]=track.fEMCALr[i]; |
c4d11b15 | 228 | // |
304864ab | 229 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fRICHr[i]=track.fRICHr[i]; |
ae982df3 | 230 | } |
c4d11b15 | 231 | //_______________________________________________________________________ |
232 | AliESDtrack::~AliESDtrack(){ | |
233 | // | |
234 | // This is destructor according Coding Conventrions | |
235 | // | |
236 | //printf("Delete track\n"); | |
3fd96ae3 | 237 | delete fITStrack; |
98937d93 | 238 | delete fTRDtrack; |
239 | delete fPoints; | |
c4d11b15 | 240 | } |
ae982df3 | 241 | |
9559cbc4 | 242 | //_______________________________________________________________________ |
243 | void AliESDtrack::MakeMiniESDtrack(){ | |
244 | // Resets everything except | |
245 | // fFlags: Reconstruction status flags | |
246 | // fLabel: Track label | |
247 | // fID: Unique ID of the track | |
248 | // fD: Impact parameter in XY-plane | |
249 | // fZ: Impact parameter in Z | |
250 | // fR[AliPID::kSPECIES]: combined "detector response probability" | |
251 | // Running track parameters | |
252 | // fRalpha: track rotation angle | |
253 | // fRx: X-coordinate of the track reference plane | |
254 | // fRp[5]: external track parameters | |
255 | // fRc[15]: external cov. matrix of the track parameters | |
256 | ||
257 | fTrackLength = 0; | |
258 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i] = 0; | |
259 | fStopVertex = 0; | |
260 | ||
261 | // Reset track parameters constrained to the primary vertex | |
262 | fCalpha = 0; | |
263 | fCx = 0; | |
264 | for (Int_t i=0;i<5;i++) fCp[i] = 0; | |
265 | for (Int_t i=0;i<15;i++) fCc[i] = 0; | |
266 | fCchi2 = 0; | |
267 | ||
268 | // Reset track parameters at the inner wall of TPC | |
269 | fIalpha = 0; | |
270 | fIx = 0; | |
271 | for (Int_t i=0;i<5;i++) fIp[i] = 0; | |
272 | for (Int_t i=0;i<15;i++) fIc[i] = 0; | |
273 | ||
274 | // Reset track parameters at the inner wall of the TRD | |
275 | fTalpha = 0; | |
276 | fTx = 0; | |
277 | for (Int_t i=0;i<5;i++) fTp[i] = 0; | |
278 | for (Int_t i=0;i<15;i++) fTc[i] = 0; | |
279 | ||
280 | // Reset ITS track related information | |
281 | fITSchi2 = 0; | |
282 | for (Int_t i=0;i<12;i++) fITSchi2MIP[i] = 0; | |
283 | fITSncls = 0; | |
284 | for (Int_t i=0;i<6;i++) fITSindex[i]= 0; | |
285 | fITSsignal = 0; | |
286 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fITSr[i]= 0; | |
287 | fITSLabel = 0; | |
288 | fITSFakeRatio = 0; | |
289 | fITStrack =0; | |
290 | ||
291 | // Reset TPC related track information | |
292 | fTPCchi2 = 0; | |
293 | fTPCncls = 0; | |
294 | for (Int_t i=0;i<180;i++) fTPCindex[i] = 0; | |
295 | fTPCClusterMap = 0; | |
296 | fTPCsignal= 0; | |
297 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=0; | |
298 | fTPCLabel=0; | |
299 | for (Int_t i=0;i<4;i++) fTPCPoints[i] = 0; | |
300 | for (Int_t i=0; i<3;i++) fKinkIndexes[i] = 0; | |
301 | for (Int_t i=0; i<3;i++) fV0Indexes[i] = 0; | |
302 | ||
303 | // Reset TRD related track information | |
304 | fTRDchi2 = 0; | |
305 | fTRDncls = 0; | |
306 | fTRDncls0 = 0; | |
307 | for (Int_t i=0;i<130;i++) fTRDindex[i] = 0; | |
308 | fTRDsignal = 0; | |
309 | for (Int_t i=0;i<kNPlane;i++) { | |
310 | fTRDsignals[i] = 0; | |
311 | fTRDTimBin[i] = 0; | |
312 | } | |
313 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTRDr[i] = 0; | |
314 | fTRDLabel = 0; | |
315 | fTRDtrack = 0; | |
316 | fTRDQuality = 0; | |
23d49657 | 317 | fTRDBudget = 0; |
9559cbc4 | 318 | |
319 | // Reset TOF related track information | |
320 | fTOFchi2 = 0; | |
321 | fTOFindex = 0; | |
322 | fTOFsignal = 0; | |
323 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTOFr[i] = 0; | |
324 | for (Int_t i=0;i<3;i++) fTOFLabel[i] = 0; | |
325 | for (Int_t i=0;i<10;i++) fTOFInfo[i] = 0; | |
326 | ||
327 | // Reset PHOS related track information | |
328 | for (Int_t i=0;i<3;i++) fPHOSpos[i] = 0; | |
329 | fPHOSsignal = 0; | |
330 | for (Int_t i=0;i<AliPID::kSPECIESN;i++) fPHOSr[i] = 0; | |
331 | ||
332 | // Reset EMCAL related track information | |
333 | for (Int_t i=0;i<3;i++) fEMCALpos[i] = 0; | |
334 | fEMCALsignal = 0; | |
335 | for (Int_t i=0;i<AliPID::kSPECIESN;i++) fEMCALr[i] = 0; | |
336 | ||
337 | // Reset RICH related track information | |
338 | fRICHchi2 = 0; | |
339 | fRICHncls = 0; | |
340 | fRICHindex = 0; | |
341 | fRICHsignal = 0; | |
342 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fRICHr[i] = 0; | |
343 | fRICHtheta = 0; | |
344 | fRICHphi = 0; | |
345 | fRICHdx = 0; | |
346 | fRICHdy = 0; | |
347 | ||
98937d93 | 348 | fPoints = 0; |
9559cbc4 | 349 | } |
ae982df3 | 350 | //_______________________________________________________________________ |
4a78b8c5 | 351 | Double_t AliESDtrack::GetMass() const { |
4427806c | 352 | // Returns the mass of the most probable particle type |
ae982df3 | 353 | Float_t max=0.; |
354 | Int_t k=-1; | |
304864ab | 355 | for (Int_t i=0; i<AliPID::kSPECIES; i++) { |
ae982df3 | 356 | if (fR[i]>max) {k=i; max=fR[i];} |
357 | } | |
db3989b3 | 358 | if (k==0) { // dE/dx "crossing points" in the TPC |
359 | Double_t p=GetP(); | |
360 | if ((p>0.38)&&(p<0.48)) | |
304864ab | 361 | if (fR[0]<fR[3]*10.) return AliPID::ParticleMass(AliPID::kKaon); |
db3989b3 | 362 | if ((p>0.75)&&(p<0.85)) |
304864ab | 363 | if (fR[0]<fR[4]*10.) return AliPID::ParticleMass(AliPID::kProton); |
db3989b3 | 364 | return 0.00051; |
365 | } | |
304864ab | 366 | if (k==1) return AliPID::ParticleMass(AliPID::kMuon); |
367 | if (k==2||k==-1) return AliPID::ParticleMass(AliPID::kPion); | |
368 | if (k==3) return AliPID::ParticleMass(AliPID::kKaon); | |
369 | if (k==4) return AliPID::ParticleMass(AliPID::kProton); | |
5f7789fc | 370 | AliWarning("Undefined mass !"); |
304864ab | 371 | return AliPID::ParticleMass(AliPID::kPion); |
ae982df3 | 372 | } |
373 | ||
374 | //_______________________________________________________________________ | |
15614b8b | 375 | Bool_t AliESDtrack::UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags) { |
ae982df3 | 376 | // |
377 | // This function updates track's running parameters | |
378 | // | |
15614b8b | 379 | Bool_t rc=kTRUE; |
380 | ||
9b859005 | 381 | SetStatus(flags); |
382 | fLabel=t->GetLabel(); | |
383 | ||
384 | if (t->IsStartedTimeIntegral()) { | |
385 | SetStatus(kTIME); | |
386 | Double_t times[10];t->GetIntegratedTimes(times); SetIntegratedTimes(times); | |
387 | SetIntegratedLength(t->GetIntegratedLength()); | |
388 | } | |
389 | ||
390 | fRalpha=t->GetAlpha(); | |
391 | t->GetExternalParameters(fRx,fRp); | |
392 | t->GetExternalCovariance(fRc); | |
393 | ||
ae982df3 | 394 | switch (flags) { |
ad2f1f2b | 395 | |
9b859005 | 396 | case kITSin: case kITSout: case kITSrefit: |
ae982df3 | 397 | fITSncls=t->GetNumberOfClusters(); |
398 | fITSchi2=t->GetChi2(); | |
399 | for (Int_t i=0;i<fITSncls;i++) fITSindex[i]=t->GetClusterIndex(i); | |
400 | fITSsignal=t->GetPIDsignal(); | |
6e5b1b04 | 401 | fITSLabel = t->GetLabel(); |
babd135a | 402 | fITSFakeRatio = t->GetFakeRatio(); |
ae982df3 | 403 | break; |
ad2f1f2b | 404 | |
9b859005 | 405 | case kTPCin: case kTPCrefit: |
6e5b1b04 | 406 | fTPCLabel = t->GetLabel(); |
9b859005 | 407 | fIalpha=fRalpha; |
51ad6848 | 408 | fIx=fRx; |
9b859005 | 409 | { |
410 | Int_t i; | |
411 | for (i=0; i<5; i++) fIp[i]=fRp[i]; | |
412 | for (i=0; i<15;i++) fIc[i]=fRc[i]; | |
413 | } | |
414 | case kTPCout: | |
a866ac60 | 415 | |
ae982df3 | 416 | fTPCncls=t->GetNumberOfClusters(); |
417 | fTPCchi2=t->GetChi2(); | |
a866ac60 | 418 | |
419 | {//prevrow must be declared in separate namespace, otherwise compiler cries: | |
420 | //"jump to case label crosses initialization of `Int_t prevrow'" | |
421 | Int_t prevrow = -1; | |
6e5b1b04 | 422 | // for (Int_t i=0;i<fTPCncls;i++) |
423 | for (Int_t i=0;i<160;i++) | |
a866ac60 | 424 | { |
425 | fTPCindex[i]=t->GetClusterIndex(i); | |
426 | ||
427 | // Piotr's Cluster Map for HBT | |
428 | // ### please change accordingly if cluster array is changing | |
429 | // to "New TPC Tracking" style (with gaps in array) | |
430 | Int_t idx = fTPCindex[i]; | |
431 | Int_t sect = (idx&0xff000000)>>24; | |
432 | Int_t row = (idx&0x00ff0000)>>16; | |
433 | if (sect > 18) row +=63; //if it is outer sector, add number of inner sectors | |
434 | ||
435 | fTPCClusterMap.SetBitNumber(row,kTRUE); | |
436 | ||
437 | //Fill the gap between previous row and this row with 0 bits | |
438 | //In case ### pleas change it as well - just set bit 0 in case there | |
439 | //is no associated clusters for current "i" | |
440 | if (prevrow < 0) | |
441 | { | |
442 | prevrow = row;//if previous bit was not assigned yet == this is the first one | |
443 | } | |
444 | else | |
445 | { //we don't know the order (inner to outer or reverse) | |
446 | //just to be save in case it is going to change | |
447 | Int_t n = 0, m = 0; | |
448 | if (prevrow < row) | |
449 | { | |
450 | n = prevrow; | |
451 | m = row; | |
452 | } | |
453 | else | |
454 | { | |
455 | n = row; | |
456 | m = prevrow; | |
457 | } | |
458 | ||
459 | for (Int_t j = n+1; j < m; j++) | |
460 | { | |
461 | fTPCClusterMap.SetBitNumber(j,kFALSE); | |
462 | } | |
463 | prevrow = row; | |
464 | } | |
465 | // End Of Piotr's Cluster Map for HBT | |
466 | } | |
467 | } | |
ae982df3 | 468 | fTPCsignal=t->GetPIDsignal(); |
469 | {Double_t mass=t->GetMass(); // preliminary mass setting | |
470 | if (mass>0.5) fR[4]=1.; // used by | |
471 | else if (mass<0.4) fR[2]=1.; // the ITS reconstruction | |
a866ac60 | 472 | else fR[3]=1.;} |
473 | // | |
ae982df3 | 474 | break; |
9b859005 | 475 | |
23904d16 | 476 | case kTRDout: case kTRDin: case kTRDrefit: |
51ad6848 | 477 | fTRDLabel = t->GetLabel(); |
79e94bf8 | 478 | fTRDncls=t->GetNumberOfClusters(); |
479 | fTRDchi2=t->GetChi2(); | |
bb2ceb1f | 480 | for (Int_t i=0;i<fTRDncls;i++) fTRDindex[i]=t->GetClusterIndex(i); |
79e94bf8 | 481 | fTRDsignal=t->GetPIDsignal(); |
482 | break; | |
c4d11b15 | 483 | case kTRDbackup: |
484 | t->GetExternalParameters(fTx,fTp); | |
485 | t->GetExternalCovariance(fTc); | |
35f4ab61 | 486 | fTalpha = t->GetAlpha(); |
c4d11b15 | 487 | fTRDncls0 = t->GetNumberOfClusters(); |
488 | break; | |
489 | case kTOFin: | |
490 | break; | |
491 | case kTOFout: | |
492 | break; | |
d0862fea | 493 | case kTRDStop: |
494 | break; | |
ae982df3 | 495 | default: |
5f7789fc | 496 | AliError("Wrong flag !"); |
ae982df3 | 497 | return kFALSE; |
498 | } | |
499 | ||
15614b8b | 500 | return rc; |
ae982df3 | 501 | } |
502 | ||
67c3dcbe | 503 | //_______________________________________________________________________ |
504 | void | |
5ccd1720 | 505 | AliESDtrack::SetConstrainedTrackParams(const AliKalmanTrack *t, Double_t chi2) { |
67c3dcbe | 506 | // |
507 | // This function sets the constrained track parameters | |
508 | // | |
db3989b3 | 509 | Int_t i; |
510 | Double_t x,buf[15]; | |
67c3dcbe | 511 | fCalpha=t->GetAlpha(); |
db3989b3 | 512 | t->GetExternalParameters(x,buf); fCx=x; |
513 | for (i=0; i<5; i++) fCp[i]=buf[i]; | |
514 | t->GetExternalCovariance(buf); | |
515 | for (i=0; i<15; i++) fCc[i]=buf[i]; | |
67c3dcbe | 516 | fCchi2=chi2; |
517 | } | |
518 | ||
519 | ||
ae982df3 | 520 | //_______________________________________________________________________ |
521 | void AliESDtrack::GetExternalParameters(Double_t &x, Double_t p[5]) const { | |
522 | //--------------------------------------------------------------------- | |
523 | // This function returns external representation of the track parameters | |
524 | //--------------------------------------------------------------------- | |
525 | x=fRx; | |
526 | for (Int_t i=0; i<5; i++) p[i]=fRp[i]; | |
527 | } | |
15614b8b | 528 | |
529 | //_______________________________________________________________________ | |
c84a5e9e | 530 | Bool_t AliESDtrack:: |
531 | GetExternalParametersAt(Double_t x, Double_t b, Double_t p[5]) const { | |
15614b8b | 532 | //--------------------------------------------------------------------- |
c84a5e9e | 533 | // This function returns external track parameters extrapolated to |
534 | // the radial position "x" (cm) in the magnetic field "b" (kG) | |
15614b8b | 535 | //--------------------------------------------------------------------- |
c84a5e9e | 536 | Double_t convconst=0.299792458*b/1000.; |
15614b8b | 537 | Double_t dx=x-fRx; |
c84a5e9e | 538 | Double_t f1=fRp[2], f2=f1 + dx*fRp[4]*convconst; |
15614b8b | 539 | |
540 | if (TMath::Abs(f2) >= 0.9999) return kFALSE; | |
541 | ||
542 | Double_t r1=TMath::Sqrt(1.- f1*f1), r2=TMath::Sqrt(1.- f2*f2); | |
543 | p[0] = fRp[0] + dx*(f1+f2)/(r1+r2); | |
544 | p[1] = fRp[1] + dx*(f1+f2)/(f1*r2 + f2*r1)*fRp[3]; | |
545 | p[2] = f2; | |
546 | p[3] = fRp[3]; | |
547 | p[4] = fRp[4]; | |
548 | ||
549 | return kTRUE; | |
550 | } | |
551 | ||
67c3dcbe | 552 | //_______________________________________________________________________ |
a866ac60 | 553 | void AliESDtrack::GetExternalCovariance(Double_t cov[15]) const { |
67c3dcbe | 554 | //--------------------------------------------------------------------- |
555 | // This function returns external representation of the cov. matrix | |
556 | //--------------------------------------------------------------------- | |
a866ac60 | 557 | for (Int_t i=0; i<15; i++) cov[i]=fRc[i]; |
67c3dcbe | 558 | } |
559 | ||
560 | ||
561 | //_______________________________________________________________________ | |
562 | void | |
563 | AliESDtrack::GetConstrainedExternalParameters(Double_t &x, Double_t p[5])const{ | |
564 | //--------------------------------------------------------------------- | |
565 | // This function returns the constrained external track parameters | |
566 | //--------------------------------------------------------------------- | |
567 | x=fCx; | |
568 | for (Int_t i=0; i<5; i++) p[i]=fCp[i]; | |
569 | } | |
570 | //_______________________________________________________________________ | |
571 | void | |
572 | AliESDtrack::GetConstrainedExternalCovariance(Double_t c[15]) const { | |
573 | //--------------------------------------------------------------------- | |
574 | // This function returns the constrained external cov. matrix | |
575 | //--------------------------------------------------------------------- | |
576 | for (Int_t i=0; i<15; i++) c[i]=fCc[i]; | |
577 | } | |
578 | ||
ae982df3 | 579 | |
580 | Double_t AliESDtrack::GetP() const { | |
581 | //--------------------------------------------------------------------- | |
582 | // This function returns the track momentum | |
b322ab2f | 583 | // Results for (nearly) straight tracks are meaningless ! |
ae982df3 | 584 | //--------------------------------------------------------------------- |
2157f4f2 | 585 | if (TMath::Abs(fRp[4])<=0) return 0; |
ae982df3 | 586 | Double_t pt=1./TMath::Abs(fRp[4]); |
5bc70ad8 | 587 | return pt*TMath::Sqrt(1.+ fRp[3]*fRp[3]); |
ae982df3 | 588 | } |
589 | ||
038834e7 | 590 | //_______________________________________________________________________ |
c84a5e9e | 591 | Double_t AliESDtrack::GetD(Double_t b, Double_t x, Double_t y) const { |
038834e7 | 592 | //------------------------------------------------------------------ |
593 | // This function calculates the transverse impact parameter | |
594 | // with respect to a point with global coordinates (x,y) | |
c84a5e9e | 595 | // in the magnetic field "b" (kG) |
038834e7 | 596 | //------------------------------------------------------------------ |
c84a5e9e | 597 | Double_t convconst=0.299792458*b/1000.; |
598 | Double_t rp4=fRp[4]*convconst; | |
038834e7 | 599 | |
600 | Double_t xt=fRx, yt=fRp[0]; | |
601 | ||
602 | Double_t sn=TMath::Sin(fRalpha), cs=TMath::Cos(fRalpha); | |
603 | Double_t a = x*cs + y*sn; | |
604 | y = -x*sn + y*cs; x=a; | |
605 | xt-=x; yt-=y; | |
606 | ||
607 | sn=rp4*xt - fRp[2]; cs=rp4*yt + TMath::Sqrt(1.- fRp[2]*fRp[2]); | |
608 | a=2*(xt*fRp[2] - yt*TMath::Sqrt(1.- fRp[2]*fRp[2]))-rp4*(xt*xt + yt*yt); | |
609 | if (rp4<0) a=-a; | |
610 | return a/(1 + TMath::Sqrt(sn*sn + cs*cs)); | |
611 | } | |
612 | ||
09c96efc | 613 | Bool_t Local2GlobalMomentum(Double_t p[3],Double_t alpha) { |
614 | //---------------------------------------------------------------- | |
615 | // This function performs local->global transformation of the | |
616 | // track momentum. | |
617 | // When called, the arguments are: | |
618 | // p[0] = 1/pt of the track; | |
619 | // p[1] = sine of local azim. angle of the track momentum; | |
620 | // p[2] = tangent of the track momentum dip angle; | |
621 | // alpha - rotation angle. | |
622 | // The result is returned as: | |
623 | // p[0] = px | |
624 | // p[1] = py | |
625 | // p[2] = pz | |
626 | // Results for (nearly) straight tracks are meaningless ! | |
627 | //---------------------------------------------------------------- | |
628 | if (TMath::Abs(p[0])<=0) return kFALSE; | |
629 | if (TMath::Abs(p[1])> 0.999999) return kFALSE; | |
630 | ||
631 | Double_t pt=1./TMath::Abs(p[0]); | |
632 | Double_t cs=TMath::Cos(alpha), sn=TMath::Sin(alpha); | |
633 | Double_t r=TMath::Sqrt(1 - p[1]*p[1]); | |
634 | p[0]=pt*(r*cs - p[1]*sn); p[1]=pt*(p[1]*cs + r*sn); p[2]=pt*p[2]; | |
635 | ||
636 | return kTRUE; | |
637 | } | |
638 | ||
639 | Bool_t Local2GlobalPosition(Double_t r[3],Double_t alpha) { | |
640 | //---------------------------------------------------------------- | |
641 | // This function performs local->global transformation of the | |
642 | // track position. | |
643 | // When called, the arguments are: | |
644 | // r[0] = local x | |
645 | // r[1] = local y | |
646 | // r[2] = local z | |
647 | // alpha - rotation angle. | |
648 | // The result is returned as: | |
649 | // r[0] = global x | |
650 | // r[1] = global y | |
651 | // r[2] = global z | |
652 | //---------------------------------------------------------------- | |
653 | Double_t cs=TMath::Cos(alpha), sn=TMath::Sin(alpha), x=r[0]; | |
654 | r[0]=x*cs - r[1]*sn; r[1]=x*sn + r[1]*cs; | |
655 | ||
656 | return kTRUE; | |
657 | } | |
658 | ||
659 | Bool_t AliESDtrack::GetConstrainedPxPyPz(Double_t *p) const { | |
67c3dcbe | 660 | //--------------------------------------------------------------------- |
661 | // This function returns the constrained global track momentum components | |
b322ab2f | 662 | // Results for (nearly) straight tracks are meaningless ! |
67c3dcbe | 663 | //--------------------------------------------------------------------- |
09c96efc | 664 | p[0]=fCp[4]; p[1]=fCp[2]; p[2]=fCp[3]; |
665 | return Local2GlobalMomentum(p,fCalpha); | |
666 | } | |
b322ab2f | 667 | |
09c96efc | 668 | Bool_t AliESDtrack::GetConstrainedXYZ(Double_t *r) const { |
67c3dcbe | 669 | //--------------------------------------------------------------------- |
09c96efc | 670 | // This function returns the constrained global track position |
67c3dcbe | 671 | //--------------------------------------------------------------------- |
09c96efc | 672 | r[0]=fCx; r[1]=fCp[0]; r[2]=fCp[1]; |
673 | return Local2GlobalPosition(r,fCalpha); | |
67c3dcbe | 674 | } |
675 | ||
09c96efc | 676 | Bool_t AliESDtrack::GetPxPyPz(Double_t *p) const { |
ae982df3 | 677 | //--------------------------------------------------------------------- |
678 | // This function returns the global track momentum components | |
b322ab2f | 679 | // Results for (nearly) straight tracks are meaningless ! |
ae982df3 | 680 | //--------------------------------------------------------------------- |
09c96efc | 681 | p[0]=fRp[4]; p[1]=fRp[2]; p[2]=fRp[3]; |
682 | return Local2GlobalMomentum(p,fRalpha); | |
ae982df3 | 683 | } |
b322ab2f | 684 | |
09c96efc | 685 | Bool_t AliESDtrack::GetXYZ(Double_t *r) const { |
ae982df3 | 686 | //--------------------------------------------------------------------- |
687 | // This function returns the global track position | |
688 | //--------------------------------------------------------------------- | |
09c96efc | 689 | r[0]=fRx; r[1]=fRp[0]; r[2]=fRp[1]; |
690 | return Local2GlobalPosition(r,fRalpha); | |
ae982df3 | 691 | } |
692 | ||
b322ab2f | 693 | void AliESDtrack::GetCovariance(Double_t cv[21]) const { |
694 | //--------------------------------------------------------------------- | |
695 | // This function returns the global covariance matrix of the track params | |
696 | // | |
697 | // Cov(x,x) ... : cv[0] | |
698 | // Cov(y,x) ... : cv[1] cv[2] | |
699 | // Cov(z,x) ... : cv[3] cv[4] cv[5] | |
700 | // Cov(px,x)... : cv[6] cv[7] cv[8] cv[9] | |
23904d16 | 701 | // Cov(py,x)... : cv[10] cv[11] cv[12] cv[13] cv[14] |
702 | // Cov(pz,x)... : cv[15] cv[16] cv[17] cv[18] cv[19] cv[20] | |
b322ab2f | 703 | // |
704 | // Results for (nearly) straight tracks are meaningless ! | |
705 | //--------------------------------------------------------------------- | |
706 | if (TMath::Abs(fRp[4])<=0) { | |
707 | for (Int_t i=0; i<21; i++) cv[i]=0.; | |
708 | return; | |
709 | } | |
710 | if (TMath::Abs(fRp[2]) > 0.999999) { | |
711 | for (Int_t i=0; i<21; i++) cv[i]=0.; | |
712 | return; | |
713 | } | |
714 | Double_t pt=1./TMath::Abs(fRp[4]); | |
715 | Double_t cs=TMath::Cos(fRalpha), sn=TMath::Sin(fRalpha); | |
716 | Double_t r=TMath::Sqrt(1-fRp[2]*fRp[2]); | |
717 | ||
718 | Double_t m00=-sn, m10=cs; | |
719 | Double_t m23=-pt*(sn + fRp[2]*cs/r), m43=-pt*pt*(r*cs - fRp[2]*sn); | |
720 | Double_t m24= pt*(cs - fRp[2]*sn/r), m44=-pt*pt*(r*sn + fRp[2]*cs); | |
721 | Double_t m35=pt, m45=-pt*pt*fRp[3]; | |
722 | ||
723 | cv[0]=fRc[0]*m00*m00; | |
724 | cv[1]=fRc[0]*m00*m10; | |
725 | cv[2]=fRc[0]*m10*m10; | |
726 | cv[3]=fRc[1]*m00; | |
727 | cv[4]=fRc[1]*m10; | |
728 | cv[5]=fRc[2]; | |
729 | cv[6]=m00*(fRc[3]*m23+fRc[10]*m43); | |
730 | cv[7]=m10*(fRc[3]*m23+fRc[10]*m43); | |
731 | cv[8]=fRc[4]*m23+fRc[11]*m43; | |
732 | cv[9]=m23*(fRc[5]*m23+fRc[12]*m43)+m43*(fRc[12]*m23+fRc[14]*m43); | |
733 | cv[10]=m00*(fRc[3]*m24+fRc[10]*m44); | |
734 | cv[11]=m10*(fRc[3]*m24+fRc[10]*m44); | |
735 | cv[12]=fRc[4]*m24+fRc[11]*m44; | |
736 | cv[13]=m23*(fRc[5]*m24+fRc[12]*m44)+m43*(fRc[12]*m24+fRc[14]*m44); | |
737 | cv[14]=m24*(fRc[5]*m24+fRc[12]*m44)+m44*(fRc[12]*m24+fRc[14]*m44); | |
738 | cv[15]=m00*(fRc[6]*m35+fRc[10]*m45); | |
739 | cv[16]=m10*(fRc[6]*m35+fRc[10]*m45); | |
740 | cv[17]=fRc[7]*m35+fRc[11]*m45; | |
741 | cv[18]=m23*(fRc[8]*m35+fRc[12]*m45)+m43*(fRc[13]*m35+fRc[14]*m45); | |
742 | cv[19]=m24*(fRc[8]*m35+fRc[12]*m45)+m44*(fRc[13]*m35+fRc[14]*m45); | |
743 | cv[20]=m35*(fRc[9]*m35+fRc[13]*m45)+m45*(fRc[13]*m35+fRc[14]*m45); | |
744 | } | |
67c3dcbe | 745 | |
09c96efc | 746 | Bool_t AliESDtrack::GetInnerPxPyPz(Double_t *p) const { |
9b859005 | 747 | //--------------------------------------------------------------------- |
748 | // This function returns the global track momentum components | |
749 | // af the entrance of the TPC | |
750 | //--------------------------------------------------------------------- | |
09c96efc | 751 | p[0]=fIp[4]; p[1]=fIp[2]; p[2]=fIp[3]; |
752 | return Local2GlobalMomentum(p,fIalpha); | |
9b859005 | 753 | } |
754 | ||
09c96efc | 755 | Bool_t AliESDtrack::GetInnerXYZ(Double_t *r) const { |
9b859005 | 756 | //--------------------------------------------------------------------- |
757 | // This function returns the global track position | |
758 | // af the entrance of the TPC | |
759 | //--------------------------------------------------------------------- | |
09c96efc | 760 | if (fIx==0) return kFALSE; |
761 | r[0]=fIx; r[1]=fIp[0]; r[2]=fIp[1]; | |
762 | return Local2GlobalPosition(r,fIalpha); | |
9b859005 | 763 | } |
764 | ||
a866ac60 | 765 | void AliESDtrack::GetInnerExternalParameters(Double_t &x, Double_t p[5]) const |
766 | { | |
767 | //skowron | |
768 | //--------------------------------------------------------------------- | |
769 | // This function returns external representation of the track parameters at Inner Layer of TPC | |
770 | //--------------------------------------------------------------------- | |
771 | x=fIx; | |
772 | for (Int_t i=0; i<5; i++) p[i]=fIp[i]; | |
773 | } | |
774 | void AliESDtrack::GetInnerExternalCovariance(Double_t cov[15]) const | |
775 | { | |
776 | //skowron | |
777 | //--------------------------------------------------------------------- | |
778 | // This function returns external representation of the cov. matrix at Inner Layer of TPC | |
779 | //--------------------------------------------------------------------- | |
780 | for (Int_t i=0; i<15; i++) cov[i]=fIc[i]; | |
781 | ||
782 | } | |
783 | ||
98937d93 | 784 | Int_t AliESDtrack::GetNcls(Int_t idet) const |
785 | { | |
786 | // Get number of clusters by subdetector index | |
787 | // | |
788 | Int_t ncls = 0; | |
789 | switch(idet){ | |
790 | case 0: | |
791 | ncls = fITSncls; | |
792 | break; | |
793 | case 1: | |
794 | ncls = fTPCncls; | |
795 | break; | |
796 | case 2: | |
797 | ncls = fTRDncls; | |
798 | break; | |
799 | case 3: | |
800 | if (fTOFindex != 0) | |
801 | ncls = 1; | |
802 | break; | |
803 | default: | |
804 | break; | |
805 | } | |
806 | return ncls; | |
807 | } | |
808 | ||
809 | Int_t AliESDtrack::GetClusters(Int_t idet, UInt_t *idx) const | |
810 | { | |
811 | // Get cluster index array by subdetector index | |
812 | // | |
813 | Int_t ncls = 0; | |
814 | switch(idet){ | |
815 | case 0: | |
816 | ncls = GetITSclusters(idx); | |
817 | break; | |
818 | case 1: | |
819 | ncls = GetTPCclusters((Int_t *)idx); | |
820 | break; | |
821 | case 2: | |
822 | ncls = GetTRDclusters(idx); | |
823 | break; | |
824 | case 3: | |
825 | if (fTOFindex != 0) { | |
826 | idx[0] = GetTOFcluster(); | |
827 | ncls = 1; | |
828 | } | |
829 | break; | |
830 | default: | |
831 | break; | |
832 | } | |
833 | return ncls; | |
834 | } | |
835 | ||
35f4ab61 | 836 | void AliESDtrack::GetTRDExternalParameters(Double_t &x, Double_t&alpha, Double_t p[5], Double_t cov[15]) const |
c4d11b15 | 837 | { |
838 | // | |
839 | //this function returns TRD parameters | |
840 | // | |
841 | x=fTx; | |
35f4ab61 | 842 | alpha = fTalpha; |
c4d11b15 | 843 | for (Int_t i=0; i<5; i++) p[i]=fTp[i]; |
844 | for (Int_t i=0; i<15; i++) cov[i]=fTc[i]; | |
845 | } | |
846 | ||
c84a5e9e | 847 | Bool_t AliESDtrack::GetPxPyPzAt(Double_t x, Double_t b, Double_t *p) const { |
672b5f43 | 848 | //--------------------------------------------------------------------- |
c84a5e9e | 849 | // This function returns the global track momentum extrapolated to |
850 | // the radial position "x" (cm) in the magnetic field "b" (kG) | |
672b5f43 | 851 | //--------------------------------------------------------------------- |
c84a5e9e | 852 | Double_t convconst=0.299792458*b/1000.; |
09c96efc | 853 | p[0]=fRp[4]; |
c84a5e9e | 854 | p[1]=fRp[2]+(x-fRx)*fRp[4]*convconst; |
09c96efc | 855 | p[2]=fRp[3]; |
856 | return Local2GlobalMomentum(p,fRalpha); | |
672b5f43 | 857 | } |
858 | ||
c84a5e9e | 859 | Bool_t AliESDtrack::GetXYZAt(Double_t x, Double_t b, Double_t *r) const { |
3fd96ae3 | 860 | //--------------------------------------------------------------------- |
c84a5e9e | 861 | // This function returns the global track position extrapolated to |
862 | // the radial position "x" (cm) in the magnetic field "b" (kG) | |
3fd96ae3 | 863 | //--------------------------------------------------------------------- |
c84a5e9e | 864 | Double_t convconst=0.299792458*b/1000.; |
23904d16 | 865 | Double_t dx=x-fRx; |
c84a5e9e | 866 | Double_t f1=fRp[2], f2=f1 + dx*fRp[4]*convconst; |
23904d16 | 867 | |
868 | if (TMath::Abs(f2) >= 0.9999) return kFALSE; | |
869 | ||
870 | Double_t r1=TMath::Sqrt(1.- f1*f1), r2=TMath::Sqrt(1.- f2*f2); | |
09c96efc | 871 | r[0] = x; |
872 | r[1] = fRp[0] + dx*(f1+f2)/(r1+r2); | |
873 | r[2] = fRp[1] + dx*(f1+f2)/(f1*r2 + f2*r1)*fRp[3]; | |
874 | return Local2GlobalPosition(r,fRalpha); | |
23904d16 | 875 | } |
672b5f43 | 876 | |
ae982df3 | 877 | //_______________________________________________________________________ |
878 | void AliESDtrack::GetIntegratedTimes(Double_t *times) const { | |
4427806c | 879 | // Returns the array with integrated times for each particle hypothesis |
304864ab | 880 | for (Int_t i=0; i<AliPID::kSPECIES; i++) times[i]=fTrackTime[i]; |
ae982df3 | 881 | } |
882 | ||
883 | //_______________________________________________________________________ | |
884 | void AliESDtrack::SetIntegratedTimes(const Double_t *times) { | |
4427806c | 885 | // Sets the array with integrated times for each particle hypotesis |
304864ab | 886 | for (Int_t i=0; i<AliPID::kSPECIES; i++) fTrackTime[i]=times[i]; |
ae982df3 | 887 | } |
888 | ||
c630aafd | 889 | //_______________________________________________________________________ |
4427806c | 890 | void AliESDtrack::SetITSpid(const Double_t *p) { |
891 | // Sets values for the probability of each particle type (in ITS) | |
304864ab | 892 | for (Int_t i=0; i<AliPID::kSPECIES; i++) fITSr[i]=p[i]; |
c630aafd | 893 | SetStatus(AliESDtrack::kITSpid); |
894 | } | |
895 | ||
babd135a | 896 | void AliESDtrack::SetITSChi2MIP(const Float_t *chi2mip){ |
c4d11b15 | 897 | for (Int_t i=0; i<12; i++) fITSchi2MIP[i]=chi2mip[i]; |
babd135a | 898 | } |
c630aafd | 899 | //_______________________________________________________________________ |
900 | void AliESDtrack::GetITSpid(Double_t *p) const { | |
4427806c | 901 | // Gets the probability of each particle type (in ITS) |
304864ab | 902 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fITSr[i]; |
c630aafd | 903 | } |
904 | ||
ae982df3 | 905 | //_______________________________________________________________________ |
906 | Int_t AliESDtrack::GetITSclusters(UInt_t *idx) const { | |
907 | //--------------------------------------------------------------------- | |
908 | // This function returns indices of the assgined ITS clusters | |
909 | //--------------------------------------------------------------------- | |
910 | for (Int_t i=0; i<fITSncls; i++) idx[i]=fITSindex[i]; | |
911 | return fITSncls; | |
912 | } | |
913 | ||
914 | //_______________________________________________________________________ | |
05e445cd | 915 | Int_t AliESDtrack::GetTPCclusters(Int_t *idx) const { |
ae982df3 | 916 | //--------------------------------------------------------------------- |
917 | // This function returns indices of the assgined ITS clusters | |
918 | //--------------------------------------------------------------------- | |
d1420ddf | 919 | if (idx!=0) |
920 | for (Int_t i=0; i<180; i++) idx[i]=fTPCindex[i]; // MI I prefer some constant | |
ae982df3 | 921 | return fTPCncls; |
922 | } | |
8c6a71ab | 923 | |
81e97e0d | 924 | Float_t AliESDtrack::GetTPCdensity(Int_t row0, Int_t row1) const{ |
925 | // | |
926 | // GetDensity of the clusters on given region between row0 and row1 | |
927 | // Dead zone effect takin into acoount | |
928 | // | |
929 | Int_t good = 0; | |
930 | Int_t found = 0; | |
931 | // | |
932 | for (Int_t i=row0;i<=row1;i++){ | |
933 | Int_t index = fTPCindex[i]; | |
934 | if (index!=-1) good++; // track outside of dead zone | |
935 | if (index>0) found++; | |
936 | } | |
937 | Float_t density=0.5; | |
938 | if (good>(row1-row0)*0.5) density = Float_t(found)/Float_t(good); | |
939 | return density; | |
940 | } | |
c84a5e9e | 941 | |
8c6a71ab | 942 | //_______________________________________________________________________ |
943 | void AliESDtrack::SetTPCpid(const Double_t *p) { | |
4427806c | 944 | // Sets values for the probability of each particle type (in TPC) |
c84a5e9e | 945 | for (Int_t i=0; i<AliPID::kSPECIES; i++) fTPCr[i]=p[i]; |
8c6a71ab | 946 | SetStatus(AliESDtrack::kTPCpid); |
947 | } | |
948 | ||
949 | //_______________________________________________________________________ | |
950 | void AliESDtrack::GetTPCpid(Double_t *p) const { | |
4427806c | 951 | // Gets the probability of each particle type (in TPC) |
304864ab | 952 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTPCr[i]; |
8c6a71ab | 953 | } |
954 | ||
bb2ceb1f | 955 | //_______________________________________________________________________ |
956 | Int_t AliESDtrack::GetTRDclusters(UInt_t *idx) const { | |
957 | //--------------------------------------------------------------------- | |
958 | // This function returns indices of the assgined TRD clusters | |
959 | //--------------------------------------------------------------------- | |
d1420ddf | 960 | if (idx!=0) |
c4d11b15 | 961 | for (Int_t i=0; i<130; i++) idx[i]=fTRDindex[i]; // MI I prefer some constant |
bb2ceb1f | 962 | return fTRDncls; |
963 | } | |
964 | ||
c630aafd | 965 | //_______________________________________________________________________ |
966 | void AliESDtrack::SetTRDpid(const Double_t *p) { | |
4427806c | 967 | // Sets values for the probability of each particle type (in TRD) |
304864ab | 968 | for (Int_t i=0; i<AliPID::kSPECIES; i++) fTRDr[i]=p[i]; |
c630aafd | 969 | SetStatus(AliESDtrack::kTRDpid); |
970 | } | |
971 | ||
972 | //_______________________________________________________________________ | |
973 | void AliESDtrack::GetTRDpid(Double_t *p) const { | |
4427806c | 974 | // Gets the probability of each particle type (in TRD) |
304864ab | 975 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTRDr[i]; |
c630aafd | 976 | } |
977 | ||
79e94bf8 | 978 | //_______________________________________________________________________ |
979 | void AliESDtrack::SetTRDpid(Int_t iSpecies, Float_t p) | |
980 | { | |
4427806c | 981 | // Sets the probability of particle type iSpecies to p (in TRD) |
79e94bf8 | 982 | fTRDr[iSpecies] = p; |
983 | } | |
984 | ||
985 | Float_t AliESDtrack::GetTRDpid(Int_t iSpecies) const | |
986 | { | |
4427806c | 987 | // Returns the probability of particle type iSpecies (in TRD) |
79e94bf8 | 988 | return fTRDr[iSpecies]; |
989 | } | |
990 | ||
c630aafd | 991 | //_______________________________________________________________________ |
992 | void AliESDtrack::SetTOFpid(const Double_t *p) { | |
4427806c | 993 | // Sets the probability of each particle type (in TOF) |
304864ab | 994 | for (Int_t i=0; i<AliPID::kSPECIES; i++) fTOFr[i]=p[i]; |
c630aafd | 995 | SetStatus(AliESDtrack::kTOFpid); |
996 | } | |
997 | ||
51ad6848 | 998 | //_______________________________________________________________________ |
999 | void AliESDtrack::SetTOFLabel(const Int_t *p) { | |
1000 | // Sets (in TOF) | |
1001 | for (Int_t i=0; i<3; i++) fTOFLabel[i]=p[i]; | |
1002 | } | |
1003 | ||
c630aafd | 1004 | //_______________________________________________________________________ |
1005 | void AliESDtrack::GetTOFpid(Double_t *p) const { | |
4427806c | 1006 | // Gets probabilities of each particle type (in TOF) |
304864ab | 1007 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTOFr[i]; |
c630aafd | 1008 | } |
1009 | ||
51ad6848 | 1010 | //_______________________________________________________________________ |
1011 | void AliESDtrack::GetTOFLabel(Int_t *p) const { | |
1012 | // Gets (in TOF) | |
1013 | for (Int_t i=0; i<3; i++) p[i]=fTOFLabel[i]; | |
1014 | } | |
1015 | ||
1016 | //_______________________________________________________________________ | |
1017 | void AliESDtrack::GetTOFInfo(Float_t *info) const { | |
1018 | // Gets (in TOF) | |
1019 | for (Int_t i=0; i<10; i++) info[i]=fTOFInfo[i]; | |
1020 | } | |
1021 | ||
1022 | //_______________________________________________________________________ | |
1023 | void AliESDtrack::SetTOFInfo(Float_t*info) { | |
1024 | // Gets (in TOF) | |
1025 | for (Int_t i=0; i<10; i++) fTOFInfo[i]=info[i]; | |
1026 | } | |
1027 | ||
4a78b8c5 | 1028 | |
1029 | ||
1030 | //_______________________________________________________________________ | |
1031 | void AliESDtrack::SetPHOSpid(const Double_t *p) { | |
1032 | // Sets the probability of each particle type (in PHOS) | |
304864ab | 1033 | for (Int_t i=0; i<AliPID::kSPECIESN; i++) fPHOSr[i]=p[i]; |
4a78b8c5 | 1034 | SetStatus(AliESDtrack::kPHOSpid); |
1035 | } | |
1036 | ||
1037 | //_______________________________________________________________________ | |
1038 | void AliESDtrack::GetPHOSpid(Double_t *p) const { | |
1039 | // Gets probabilities of each particle type (in PHOS) | |
304864ab | 1040 | for (Int_t i=0; i<AliPID::kSPECIESN; i++) p[i]=fPHOSr[i]; |
4a78b8c5 | 1041 | } |
1042 | ||
704be597 | 1043 | //_______________________________________________________________________ |
1044 | void AliESDtrack::SetEMCALpid(const Double_t *p) { | |
1045 | // Sets the probability of each particle type (in EMCAL) | |
304864ab | 1046 | for (Int_t i=0; i<AliPID::kSPECIESN; i++) fEMCALr[i]=p[i]; |
704be597 | 1047 | SetStatus(AliESDtrack::kEMCALpid); |
1048 | } | |
1049 | ||
1050 | //_______________________________________________________________________ | |
1051 | void AliESDtrack::GetEMCALpid(Double_t *p) const { | |
1052 | // Gets probabilities of each particle type (in EMCAL) | |
304864ab | 1053 | for (Int_t i=0; i<AliPID::kSPECIESN; i++) p[i]=fEMCALr[i]; |
704be597 | 1054 | } |
4a78b8c5 | 1055 | |
1056 | //_______________________________________________________________________ | |
1057 | void AliESDtrack::SetRICHpid(const Double_t *p) { | |
1058 | // Sets the probability of each particle type (in RICH) | |
304864ab | 1059 | for (Int_t i=0; i<AliPID::kSPECIES; i++) fRICHr[i]=p[i]; |
4a78b8c5 | 1060 | SetStatus(AliESDtrack::kRICHpid); |
1061 | } | |
1062 | ||
1063 | //_______________________________________________________________________ | |
1064 | void AliESDtrack::GetRICHpid(Double_t *p) const { | |
1065 | // Gets probabilities of each particle type (in RICH) | |
304864ab | 1066 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fRICHr[i]; |
4a78b8c5 | 1067 | } |
1068 | ||
1069 | ||
1070 | ||
8c6a71ab | 1071 | //_______________________________________________________________________ |
1072 | void AliESDtrack::SetESDpid(const Double_t *p) { | |
4427806c | 1073 | // Sets the probability of each particle type for the ESD track |
304864ab | 1074 | for (Int_t i=0; i<AliPID::kSPECIES; i++) fR[i]=p[i]; |
8c6a71ab | 1075 | SetStatus(AliESDtrack::kESDpid); |
1076 | } | |
1077 | ||
1078 | //_______________________________________________________________________ | |
1079 | void AliESDtrack::GetESDpid(Double_t *p) const { | |
4427806c | 1080 | // Gets probability of each particle type for the ESD track |
304864ab | 1081 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fR[i]; |
8c6a71ab | 1082 | } |
1083 | ||
ac2f7574 | 1084 | //_______________________________________________________________________ |
1085 | void AliESDtrack::Print(Option_t *) const { | |
1086 | // Prints info on the track | |
1087 | ||
5f7789fc | 1088 | printf("ESD track info\n") ; |
304864ab | 1089 | Double_t p[AliPID::kSPECIESN] ; |
ac2f7574 | 1090 | Int_t index = 0 ; |
1091 | if( IsOn(kITSpid) ){ | |
1092 | printf("From ITS: ") ; | |
1093 | GetITSpid(p) ; | |
304864ab | 1094 | for(index = 0 ; index < AliPID::kSPECIES; index++) |
ac2f7574 | 1095 | printf("%f, ", p[index]) ; |
1096 | printf("\n signal = %f\n", GetITSsignal()) ; | |
1097 | } | |
1098 | if( IsOn(kTPCpid) ){ | |
1099 | printf("From TPC: ") ; | |
1100 | GetTPCpid(p) ; | |
304864ab | 1101 | for(index = 0 ; index < AliPID::kSPECIES; index++) |
ac2f7574 | 1102 | printf("%f, ", p[index]) ; |
1103 | printf("\n signal = %f\n", GetTPCsignal()) ; | |
1104 | } | |
1105 | if( IsOn(kTRDpid) ){ | |
1106 | printf("From TRD: ") ; | |
1107 | GetTRDpid(p) ; | |
304864ab | 1108 | for(index = 0 ; index < AliPID::kSPECIES; index++) |
ac2f7574 | 1109 | printf("%f, ", p[index]) ; |
1110 | printf("\n signal = %f\n", GetTRDsignal()) ; | |
1111 | } | |
1112 | if( IsOn(kTOFpid) ){ | |
1113 | printf("From TOF: ") ; | |
1114 | GetTOFpid(p) ; | |
304864ab | 1115 | for(index = 0 ; index < AliPID::kSPECIES; index++) |
ac2f7574 | 1116 | printf("%f, ", p[index]) ; |
1117 | printf("\n signal = %f\n", GetTOFsignal()) ; | |
1118 | } | |
1119 | if( IsOn(kRICHpid) ){ | |
038834e7 | 1120 | printf("From RICH: ") ; |
ac2f7574 | 1121 | GetRICHpid(p) ; |
304864ab | 1122 | for(index = 0 ; index < AliPID::kSPECIES; index++) |
ac2f7574 | 1123 | printf("%f, ", p[index]) ; |
1124 | printf("\n signal = %f\n", GetRICHsignal()) ; | |
1125 | } | |
1126 | if( IsOn(kPHOSpid) ){ | |
1127 | printf("From PHOS: ") ; | |
1128 | GetPHOSpid(p) ; | |
304864ab | 1129 | for(index = 0 ; index < AliPID::kSPECIESN; index++) |
ac2f7574 | 1130 | printf("%f, ", p[index]) ; |
1131 | printf("\n signal = %f\n", GetPHOSsignal()) ; | |
1132 | } | |
704be597 | 1133 | if( IsOn(kEMCALpid) ){ |
1134 | printf("From EMCAL: ") ; | |
1135 | GetEMCALpid(p) ; | |
304864ab | 1136 | for(index = 0 ; index < AliPID::kSPECIESN; index++) |
704be597 | 1137 | printf("%f, ", p[index]) ; |
1138 | printf("\n signal = %f\n", GetEMCALsignal()) ; | |
1139 | } | |
ac2f7574 | 1140 | } |