Recalculated sampling fraction, with the addition of Birks' Law
[u/mrichter/AliRoot.git] / STEER / AliESDtrack.cxx
CommitLineData
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
ae982df3 18// This is the class to deal with during the phisical analysis of data
4427806c 19// Origin: Iouri Belikov, CERN
20// e-mail: Jouri.Belikov@cern.ch
ae982df3 21//-----------------------------------------------------------------
22
23#include "TMath.h"
704be597 24#include "TString.h"
ae982df3 25
26#include "AliESDtrack.h"
27#include "AliKalmanTrack.h"
28
29ClassImp(AliESDtrack)
30
31//_______________________________________________________________________
32AliESDtrack::AliESDtrack() :
2bad268c 33fFlags(0),
34fLabel(0),
35fTrackLength(0),
36fStopVertex(0),
37fRalpha(0),
38fRx(0),
a866ac60 39fCalpha(0),
40fCx(0),
67c3dcbe 41fCchi2(1e10),
a866ac60 42fIalpha(0),
43fIx(0),
44fOalpha(0),
45fOx(0),
2bad268c 46fITSchi2(0),
ae982df3 47fITSncls(0),
2bad268c 48fITSsignal(0),
2bad268c 49fTPCchi2(0),
05e445cd 50fTPCncls(0),
a866ac60 51fTPCClusterMap(159),//number of padrows
2bad268c 52fTPCsignal(0),
53fTRDchi2(0),
54fTRDncls(0),
55fTRDsignal(0),
56fTOFchi2(0),
57fTOFindex(0),
4a78b8c5 58fTOFsignal(-1),
59fPHOSsignal(-1),
704be597 60fEMCALsignal(-1),
4a78b8c5 61fRICHsignal(-1)
ae982df3 62{
63 //
64 // The default ESD constructor
65 //
2bad268c 66 for (Int_t i=0; i<kSPECIES; i++) {
4a78b8c5 67 fTrackTime[i]=0.;
68 fR[i]=1.;
69 fITSr[i]=1.;
70 fTPCr[i]=1.;
71 fTRDr[i]=1.;
72 fTOFr[i]=1.;
4a78b8c5 73 fRICHr[i]=1.;
2bad268c 74 }
ac2f7574 75
704be597 76 for (Int_t i=0; i<kSPECIESN; i++) {
77 fPHOSr[i] = 1.;
78 fEMCALr[i] = 1.;
79 }
80
ac2f7574 81
4a78b8c5 82 fPHOSpos[0]=fPHOSpos[1]=fPHOSpos[2]=0.;
704be597 83 fEMCALpos[0]=fEMCALpos[1]=fEMCALpos[2]=0.;
bb2ceb1f 84 Int_t i;
a866ac60 85 for (i=0; i<5; i++) { fRp[i]=0.; fCp[i]=0.; fIp[i]=0.; fOp[i]=0.;}
86 for (i=0; i<15; i++) { fRc[i]=0.; fCc[i]=0.; fIc[i]=0.; fOc[i]=0.; }
87 for (i=0; i<6; i++) { fITSindex[i]=0; }
88 for (i=0; i<180; i++){ fTPCindex[i]=0; }
89 for (i=0; i<90; i++) { fTRDindex[i]=0; }
6e5b1b04 90 fTPCLabel = 0;
91 fTRDLabel = 0;
92 fITSLabel = 0;
ac2f7574 93
ae982df3 94}
95
96//_______________________________________________________________________
4a78b8c5 97Double_t AliESDtrack::GetMass() const {
4427806c 98 // Returns the mass of the most probable particle type
ae982df3 99 Float_t max=0.;
100 Int_t k=-1;
101 for (Int_t i=0; i<kSPECIES; i++) {
102 if (fR[i]>max) {k=i; max=fR[i];}
103 }
104 if (k==0) return 0.00051;
105 if (k==1) return 0.10566;
106 if (k==2||k==-1) return 0.13957;
107 if (k==3) return 0.49368;
108 if (k==4) return 0.93827;
109 Warning("GetMass()","Undefined mass !");
110 return 0.13957;
111}
112
113//_______________________________________________________________________
ad2f1f2b 114Bool_t AliESDtrack::UpdateTrackParams(AliKalmanTrack *t, ULong_t flags) {
ae982df3 115 //
116 // This function updates track's running parameters
117 //
9b859005 118 SetStatus(flags);
119 fLabel=t->GetLabel();
120
121 if (t->IsStartedTimeIntegral()) {
122 SetStatus(kTIME);
123 Double_t times[10];t->GetIntegratedTimes(times); SetIntegratedTimes(times);
124 SetIntegratedLength(t->GetIntegratedLength());
125 }
126
127 fRalpha=t->GetAlpha();
128 t->GetExternalParameters(fRx,fRp);
129 t->GetExternalCovariance(fRc);
130
ae982df3 131 switch (flags) {
ad2f1f2b 132
9b859005 133 case kITSin: case kITSout: case kITSrefit:
ae982df3 134 fITSncls=t->GetNumberOfClusters();
135 fITSchi2=t->GetChi2();
136 for (Int_t i=0;i<fITSncls;i++) fITSindex[i]=t->GetClusterIndex(i);
137 fITSsignal=t->GetPIDsignal();
6e5b1b04 138 fITSLabel = t->GetLabel();
babd135a 139 fITSFakeRatio = t->GetFakeRatio();
ae982df3 140 break;
ad2f1f2b 141
9b859005 142 case kTPCin: case kTPCrefit:
6e5b1b04 143 fTPCLabel = t->GetLabel();
9b859005 144 fIalpha=fRalpha;
145 fIx=fRx;
146 {
147 Int_t i;
148 for (i=0; i<5; i++) fIp[i]=fRp[i];
149 for (i=0; i<15;i++) fIc[i]=fRc[i];
150 }
151 case kTPCout:
a866ac60 152
ae982df3 153 fTPCncls=t->GetNumberOfClusters();
154 fTPCchi2=t->GetChi2();
a866ac60 155
156 {//prevrow must be declared in separate namespace, otherwise compiler cries:
157 //"jump to case label crosses initialization of `Int_t prevrow'"
158 Int_t prevrow = -1;
6e5b1b04 159 // for (Int_t i=0;i<fTPCncls;i++)
160 for (Int_t i=0;i<160;i++)
a866ac60 161 {
162 fTPCindex[i]=t->GetClusterIndex(i);
163
164 // Piotr's Cluster Map for HBT
165 // ### please change accordingly if cluster array is changing
166 // to "New TPC Tracking" style (with gaps in array)
167 Int_t idx = fTPCindex[i];
168 Int_t sect = (idx&0xff000000)>>24;
169 Int_t row = (idx&0x00ff0000)>>16;
170 if (sect > 18) row +=63; //if it is outer sector, add number of inner sectors
171
172 fTPCClusterMap.SetBitNumber(row,kTRUE);
173
174 //Fill the gap between previous row and this row with 0 bits
175 //In case ### pleas change it as well - just set bit 0 in case there
176 //is no associated clusters for current "i"
177 if (prevrow < 0)
178 {
179 prevrow = row;//if previous bit was not assigned yet == this is the first one
180 }
181 else
182 { //we don't know the order (inner to outer or reverse)
183 //just to be save in case it is going to change
184 Int_t n = 0, m = 0;
185 if (prevrow < row)
186 {
187 n = prevrow;
188 m = row;
189 }
190 else
191 {
192 n = row;
193 m = prevrow;
194 }
195
196 for (Int_t j = n+1; j < m; j++)
197 {
198 fTPCClusterMap.SetBitNumber(j,kFALSE);
199 }
200 prevrow = row;
201 }
202 // End Of Piotr's Cluster Map for HBT
203 }
204 }
ae982df3 205 fTPCsignal=t->GetPIDsignal();
206 {Double_t mass=t->GetMass(); // preliminary mass setting
207 if (mass>0.5) fR[4]=1.; // used by
208 else if (mass<0.4) fR[2]=1.; // the ITS reconstruction
a866ac60 209 else fR[3]=1.;}
210 //
ae982df3 211 break;
9b859005 212
672b5f43 213 case kTRDout:
704be597 214 { //requested by the PHOS/EMCAL ("temporary solution")
258fa377 215 Double_t r=460.;
e964f790 216 if (t->PropagateTo(r,30.,0.)) {
217 fOalpha=t->GetAlpha();
218 t->GetExternalParameters(fOx,fOp);
219 t->GetExternalCovariance(fOc);
220 }
704be597 221 r=450.;
222 if (t->PropagateTo(r,30.,0.)) {
223 fXalpha=t->GetAlpha();
224 t->GetExternalParameters(fXx,fXp);
225 t->GetExternalCovariance(fXc);
226 }
672b5f43 227 }
5bc70ad8 228 case kTOFin:
229 break;
230 case kTOFout:
231 break;
672b5f43 232 case kTRDin: case kTRDrefit:
6e5b1b04 233 fTRDLabel = t->GetLabel();
234
79e94bf8 235 fTRDncls=t->GetNumberOfClusters();
236 fTRDchi2=t->GetChi2();
bb2ceb1f 237 for (Int_t i=0;i<fTRDncls;i++) fTRDindex[i]=t->GetClusterIndex(i);
79e94bf8 238 fTRDsignal=t->GetPIDsignal();
239 break;
d0862fea 240 case kTRDStop:
241 break;
ae982df3 242 default:
243 Error("UpdateTrackParams()","Wrong flag !\n");
244 return kFALSE;
245 }
246
ae982df3 247 return kTRUE;
248}
249
67c3dcbe 250//_______________________________________________________________________
251void
252AliESDtrack::SetConstrainedTrackParams(AliKalmanTrack *t, Double_t chi2) {
253 //
254 // This function sets the constrained track parameters
255 //
256 fCalpha=t->GetAlpha();
257 t->GetExternalParameters(fCx,fCp);
258 t->GetExternalCovariance(fCc);
259 fCchi2=chi2;
260}
261
262
ae982df3 263//_______________________________________________________________________
264void AliESDtrack::GetExternalParameters(Double_t &x, Double_t p[5]) const {
265 //---------------------------------------------------------------------
266 // This function returns external representation of the track parameters
267 //---------------------------------------------------------------------
268 x=fRx;
269 for (Int_t i=0; i<5; i++) p[i]=fRp[i];
270}
67c3dcbe 271//_______________________________________________________________________
a866ac60 272void AliESDtrack::GetExternalCovariance(Double_t cov[15]) const {
67c3dcbe 273 //---------------------------------------------------------------------
274 // This function returns external representation of the cov. matrix
275 //---------------------------------------------------------------------
a866ac60 276 for (Int_t i=0; i<15; i++) cov[i]=fRc[i];
67c3dcbe 277}
278
279
280//_______________________________________________________________________
281void
282AliESDtrack::GetConstrainedExternalParameters(Double_t &x, Double_t p[5])const{
283 //---------------------------------------------------------------------
284 // This function returns the constrained external track parameters
285 //---------------------------------------------------------------------
286 x=fCx;
287 for (Int_t i=0; i<5; i++) p[i]=fCp[i];
288}
289//_______________________________________________________________________
290void
291AliESDtrack::GetConstrainedExternalCovariance(Double_t c[15]) const {
292 //---------------------------------------------------------------------
293 // This function returns the constrained external cov. matrix
294 //---------------------------------------------------------------------
295 for (Int_t i=0; i<15; i++) c[i]=fCc[i];
296}
297
ae982df3 298
299Double_t AliESDtrack::GetP() const {
300 //---------------------------------------------------------------------
301 // This function returns the track momentum
302 //---------------------------------------------------------------------
2157f4f2 303 if (TMath::Abs(fRp[4])<=0) return 0;
ae982df3 304 Double_t pt=1./TMath::Abs(fRp[4]);
5bc70ad8 305 return pt*TMath::Sqrt(1.+ fRp[3]*fRp[3]);
ae982df3 306}
307
67c3dcbe 308void AliESDtrack::GetConstrainedPxPyPz(Double_t *p) const {
309 //---------------------------------------------------------------------
310 // This function returns the constrained global track momentum components
311 //---------------------------------------------------------------------
2157f4f2 312 if (TMath::Abs(fCp[4])<=0) {
313 p[0]=p[1]=p[2]=0;
314 return;
315 }
67c3dcbe 316 Double_t phi=TMath::ASin(fCp[2]) + fCalpha;
317 Double_t pt=1./TMath::Abs(fCp[4]);
318 p[0]=pt*TMath::Cos(phi); p[1]=pt*TMath::Sin(phi); p[2]=pt*fCp[3];
319}
320void AliESDtrack::GetConstrainedXYZ(Double_t *xyz) const {
321 //---------------------------------------------------------------------
322 // This function returns the global track position
323 //---------------------------------------------------------------------
324 Double_t phi=TMath::ATan2(fCp[0],fCx) + fCalpha;
325 Double_t r=TMath::Sqrt(fCx*fCx + fCp[0]*fCp[0]);
326 xyz[0]=r*TMath::Cos(phi); xyz[1]=r*TMath::Sin(phi); xyz[2]=fCp[1];
327}
328
ae982df3 329void AliESDtrack::GetPxPyPz(Double_t *p) const {
330 //---------------------------------------------------------------------
331 // This function returns the global track momentum components
332 //---------------------------------------------------------------------
2157f4f2 333 if (TMath::Abs(fRp[4])<=0) {
334 p[0]=p[1]=p[2]=0;
335 return;
336 }
ae982df3 337 Double_t phi=TMath::ASin(fRp[2]) + fRalpha;
338 Double_t pt=1./TMath::Abs(fRp[4]);
339 p[0]=pt*TMath::Cos(phi); p[1]=pt*TMath::Sin(phi); p[2]=pt*fRp[3];
340}
ae982df3 341void AliESDtrack::GetXYZ(Double_t *xyz) const {
342 //---------------------------------------------------------------------
343 // This function returns the global track position
344 //---------------------------------------------------------------------
bb2ceb1f 345 Double_t phi=TMath::ATan2(fRp[0],fRx) + fRalpha;
ae982df3 346 Double_t r=TMath::Sqrt(fRx*fRx + fRp[0]*fRp[0]);
347 xyz[0]=r*TMath::Cos(phi); xyz[1]=r*TMath::Sin(phi); xyz[2]=fRp[1];
348}
349
67c3dcbe 350
9b859005 351void AliESDtrack::GetInnerPxPyPz(Double_t *p) const {
352 //---------------------------------------------------------------------
353 // This function returns the global track momentum components
354 // af the entrance of the TPC
355 //---------------------------------------------------------------------
e964f790 356 if (fIx==0) {p[0]=p[1]=p[2]=0.; return;}
9b859005 357 Double_t phi=TMath::ASin(fIp[2]) + fIalpha;
358 Double_t pt=1./TMath::Abs(fIp[4]);
359 p[0]=pt*TMath::Cos(phi); p[1]=pt*TMath::Sin(phi); p[2]=pt*fIp[3];
360}
361
362void AliESDtrack::GetInnerXYZ(Double_t *xyz) const {
363 //---------------------------------------------------------------------
364 // This function returns the global track position
365 // af the entrance of the TPC
366 //---------------------------------------------------------------------
e964f790 367 if (fIx==0) {xyz[0]=xyz[1]=xyz[2]=0.; return;}
9b859005 368 Double_t phi=TMath::ATan2(fIp[0],fIx) + fIalpha;
369 Double_t r=TMath::Sqrt(fIx*fIx + fIp[0]*fIp[0]);
370 xyz[0]=r*TMath::Cos(phi); xyz[1]=r*TMath::Sin(phi); xyz[2]=fIp[1];
371}
372
a866ac60 373void AliESDtrack::GetInnerExternalParameters(Double_t &x, Double_t p[5]) const
374{
375 //skowron
376 //---------------------------------------------------------------------
377 // This function returns external representation of the track parameters at Inner Layer of TPC
378 //---------------------------------------------------------------------
379 x=fIx;
380 for (Int_t i=0; i<5; i++) p[i]=fIp[i];
381}
382void AliESDtrack::GetInnerExternalCovariance(Double_t cov[15]) const
383{
384 //skowron
385 //---------------------------------------------------------------------
386 // This function returns external representation of the cov. matrix at Inner Layer of TPC
387 //---------------------------------------------------------------------
388 for (Int_t i=0; i<15; i++) cov[i]=fIc[i];
389
390}
391
704be597 392void AliESDtrack::GetOuterPxPyPz(Double_t *p, TString det) const {
672b5f43 393 //---------------------------------------------------------------------
394 // This function returns the global track momentum components
395 // af the radius of the PHOS
396 //---------------------------------------------------------------------
704be597 397 p[0]=p[1]=p[2]=0. ;
398 if (det == "PHOS") {
399 if (fOx==0)
400 return;
401 Double_t phi=TMath::ASin(fOp[2]) + fOalpha;
402 Double_t pt=1./TMath::Abs(fOp[4]);
403 p[0]=pt*TMath::Cos(phi);
404 p[1]=pt*TMath::Sin(phi);
405 p[2]=pt*fOp[3];
406 }
407 else if (det == "EMCAL" ) {
408 if (fXx==0)
409 return;
410 Double_t phi=TMath::ASin(fXp[2]) + fXalpha;
411 Double_t pt=1./TMath::Abs(fXp[4]);
412 p[0]=pt*TMath::Cos(phi);
413 p[1]=pt*TMath::Sin(phi);
414 p[2]=pt*fXp[3];
415 }
416 else
417 Warning("GetOuterPxPyPz", "Only valid for PHOS or EMCAL") ;
672b5f43 418}
419
704be597 420void AliESDtrack::GetOuterXYZ(Double_t *xyz, TString det) const {
672b5f43 421 //---------------------------------------------------------------------
422 // This function returns the global track position
704be597 423 // af the radius of the PHOS/EMCAL
424 //---------------------------------------------------------------------
425 xyz[0]=xyz[1]=xyz[2]=0.;
426 if ( det == "PHOS" ) {
427 if (fOx==0)
428 return;
429 Double_t phi=TMath::ATan2(fOp[0],fOx) + fOalpha;
430 Double_t r=TMath::Sqrt(fOx*fOx + fOp[0]*fOp[0]);
431 xyz[0]=r*TMath::Cos(phi); xyz[1]=r*TMath::Sin(phi); xyz[2]=fOp[1];
432 }
433 else if ( det == "EMCAL" ) {
434 if (fXx==0)
435 return;
436 Double_t phi=TMath::ATan2(fXp[0],fOx) + fXalpha;
437 Double_t r=TMath::Sqrt(fXx*fXx + fXp[0]*fXp[0]);
438 xyz[0]=r*TMath::Cos(phi);
439 xyz[1]=r*TMath::Sin(phi);
440 xyz[2]=fXp[1];
441 }
672b5f43 442}
443
ae982df3 444//_______________________________________________________________________
445void AliESDtrack::GetIntegratedTimes(Double_t *times) const {
4427806c 446 // Returns the array with integrated times for each particle hypothesis
ae982df3 447 for (Int_t i=0; i<kSPECIES; i++) times[i]=fTrackTime[i];
448}
449
450//_______________________________________________________________________
451void AliESDtrack::SetIntegratedTimes(const Double_t *times) {
4427806c 452 // Sets the array with integrated times for each particle hypotesis
ae982df3 453 for (Int_t i=0; i<kSPECIES; i++) fTrackTime[i]=times[i];
454}
455
c630aafd 456//_______________________________________________________________________
4427806c 457void AliESDtrack::SetITSpid(const Double_t *p) {
458 // Sets values for the probability of each particle type (in ITS)
c630aafd 459 for (Int_t i=0; i<kSPECIES; i++) fITSr[i]=p[i];
460 SetStatus(AliESDtrack::kITSpid);
461}
462
babd135a 463void AliESDtrack::SetITSChi2MIP(const Float_t *chi2mip){
464 for (Int_t i=0; i<6; i++) fITSchi2MIP[i]=chi2mip[i];
465}
c630aafd 466//_______________________________________________________________________
467void AliESDtrack::GetITSpid(Double_t *p) const {
4427806c 468 // Gets the probability of each particle type (in ITS)
c630aafd 469 for (Int_t i=0; i<kSPECIES; i++) p[i]=fITSr[i];
470}
471
ae982df3 472//_______________________________________________________________________
473Int_t AliESDtrack::GetITSclusters(UInt_t *idx) const {
474 //---------------------------------------------------------------------
475 // This function returns indices of the assgined ITS clusters
476 //---------------------------------------------------------------------
477 for (Int_t i=0; i<fITSncls; i++) idx[i]=fITSindex[i];
478 return fITSncls;
479}
480
481//_______________________________________________________________________
05e445cd 482Int_t AliESDtrack::GetTPCclusters(Int_t *idx) const {
ae982df3 483 //---------------------------------------------------------------------
484 // This function returns indices of the assgined ITS clusters
485 //---------------------------------------------------------------------
d1420ddf 486 if (idx!=0)
487 for (Int_t i=0; i<180; i++) idx[i]=fTPCindex[i]; // MI I prefer some constant
ae982df3 488 return fTPCncls;
489}
8c6a71ab 490
491//_______________________________________________________________________
492void AliESDtrack::SetTPCpid(const Double_t *p) {
4427806c 493 // Sets values for the probability of each particle type (in TPC)
8c6a71ab 494 for (Int_t i=0; i<kSPECIES; i++) fTPCr[i]=p[i];
495 SetStatus(AliESDtrack::kTPCpid);
496}
497
498//_______________________________________________________________________
499void AliESDtrack::GetTPCpid(Double_t *p) const {
4427806c 500 // Gets the probability of each particle type (in TPC)
8c6a71ab 501 for (Int_t i=0; i<kSPECIES; i++) p[i]=fTPCr[i];
502}
503
bb2ceb1f 504//_______________________________________________________________________
505Int_t AliESDtrack::GetTRDclusters(UInt_t *idx) const {
506 //---------------------------------------------------------------------
507 // This function returns indices of the assgined TRD clusters
508 //---------------------------------------------------------------------
d1420ddf 509 if (idx!=0)
510 for (Int_t i=0; i<90; i++) idx[i]=fTRDindex[i]; // MI I prefer some constant
bb2ceb1f 511 return fTRDncls;
512}
513
c630aafd 514//_______________________________________________________________________
515void AliESDtrack::SetTRDpid(const Double_t *p) {
4427806c 516 // Sets values for the probability of each particle type (in TRD)
c630aafd 517 for (Int_t i=0; i<kSPECIES; i++) fTRDr[i]=p[i];
518 SetStatus(AliESDtrack::kTRDpid);
519}
520
521//_______________________________________________________________________
522void AliESDtrack::GetTRDpid(Double_t *p) const {
4427806c 523 // Gets the probability of each particle type (in TRD)
c630aafd 524 for (Int_t i=0; i<kSPECIES; i++) p[i]=fTRDr[i];
525}
526
79e94bf8 527//_______________________________________________________________________
528void AliESDtrack::SetTRDpid(Int_t iSpecies, Float_t p)
529{
4427806c 530 // Sets the probability of particle type iSpecies to p (in TRD)
79e94bf8 531 fTRDr[iSpecies] = p;
532}
533
534Float_t AliESDtrack::GetTRDpid(Int_t iSpecies) const
535{
4427806c 536 // Returns the probability of particle type iSpecies (in TRD)
79e94bf8 537 return fTRDr[iSpecies];
538}
539
c630aafd 540//_______________________________________________________________________
541void AliESDtrack::SetTOFpid(const Double_t *p) {
4427806c 542 // Sets the probability of each particle type (in TOF)
c630aafd 543 for (Int_t i=0; i<kSPECIES; i++) fTOFr[i]=p[i];
544 SetStatus(AliESDtrack::kTOFpid);
545}
546
547//_______________________________________________________________________
548void AliESDtrack::GetTOFpid(Double_t *p) const {
4427806c 549 // Gets probabilities of each particle type (in TOF)
c630aafd 550 for (Int_t i=0; i<kSPECIES; i++) p[i]=fTOFr[i];
551}
552
4a78b8c5 553
554
555//_______________________________________________________________________
556void AliESDtrack::SetPHOSpid(const Double_t *p) {
557 // Sets the probability of each particle type (in PHOS)
ac2f7574 558 for (Int_t i=0; i<kSPECIESN; i++) fPHOSr[i]=p[i];
4a78b8c5 559 SetStatus(AliESDtrack::kPHOSpid);
560}
561
562//_______________________________________________________________________
563void AliESDtrack::GetPHOSpid(Double_t *p) const {
564 // Gets probabilities of each particle type (in PHOS)
ac2f7574 565 for (Int_t i=0; i<kSPECIESN; i++) p[i]=fPHOSr[i];
4a78b8c5 566}
567
704be597 568//_______________________________________________________________________
569void AliESDtrack::SetEMCALpid(const Double_t *p) {
570 // Sets the probability of each particle type (in EMCAL)
571 for (Int_t i=0; i<kSPECIESN; i++) fEMCALr[i]=p[i];
572 SetStatus(AliESDtrack::kEMCALpid);
573}
574
575//_______________________________________________________________________
576void AliESDtrack::GetEMCALpid(Double_t *p) const {
577 // Gets probabilities of each particle type (in EMCAL)
578 for (Int_t i=0; i<kSPECIESN; i++) p[i]=fEMCALr[i];
579}
4a78b8c5 580
581//_______________________________________________________________________
582void AliESDtrack::SetRICHpid(const Double_t *p) {
583 // Sets the probability of each particle type (in RICH)
584 for (Int_t i=0; i<kSPECIES; i++) fRICHr[i]=p[i];
585 SetStatus(AliESDtrack::kRICHpid);
586}
587
588//_______________________________________________________________________
589void AliESDtrack::GetRICHpid(Double_t *p) const {
590 // Gets probabilities of each particle type (in RICH)
591 for (Int_t i=0; i<kSPECIES; i++) p[i]=fRICHr[i];
592}
593
594
595
8c6a71ab 596//_______________________________________________________________________
597void AliESDtrack::SetESDpid(const Double_t *p) {
4427806c 598 // Sets the probability of each particle type for the ESD track
8c6a71ab 599 for (Int_t i=0; i<kSPECIES; i++) fR[i]=p[i];
600 SetStatus(AliESDtrack::kESDpid);
601}
602
603//_______________________________________________________________________
604void AliESDtrack::GetESDpid(Double_t *p) const {
4427806c 605 // Gets probability of each particle type for the ESD track
8c6a71ab 606 for (Int_t i=0; i<kSPECIES; i++) p[i]=fR[i];
607}
608
ac2f7574 609//_______________________________________________________________________
610void AliESDtrack::Print(Option_t *) const {
611 // Prints info on the track
612
613 Info("Print","Track info") ;
614 Double_t p[kSPECIESN] ;
615 Int_t index = 0 ;
616 if( IsOn(kITSpid) ){
617 printf("From ITS: ") ;
618 GetITSpid(p) ;
619 for(index = 0 ; index < kSPECIES; index++)
620 printf("%f, ", p[index]) ;
621 printf("\n signal = %f\n", GetITSsignal()) ;
622 }
623 if( IsOn(kTPCpid) ){
624 printf("From TPC: ") ;
625 GetTPCpid(p) ;
626 for(index = 0 ; index < kSPECIES; index++)
627 printf("%f, ", p[index]) ;
628 printf("\n signal = %f\n", GetTPCsignal()) ;
629 }
630 if( IsOn(kTRDpid) ){
631 printf("From TRD: ") ;
632 GetTRDpid(p) ;
633 for(index = 0 ; index < kSPECIES; index++)
634 printf("%f, ", p[index]) ;
635 printf("\n signal = %f\n", GetTRDsignal()) ;
636 }
637 if( IsOn(kTOFpid) ){
638 printf("From TOF: ") ;
639 GetTOFpid(p) ;
640 for(index = 0 ; index < kSPECIES; index++)
641 printf("%f, ", p[index]) ;
642 printf("\n signal = %f\n", GetTOFsignal()) ;
643 }
644 if( IsOn(kRICHpid) ){
645 printf("From TOF: ") ;
646 GetRICHpid(p) ;
647 for(index = 0 ; index < kSPECIES; index++)
648 printf("%f, ", p[index]) ;
649 printf("\n signal = %f\n", GetRICHsignal()) ;
650 }
651 if( IsOn(kPHOSpid) ){
652 printf("From PHOS: ") ;
653 GetPHOSpid(p) ;
654 for(index = 0 ; index < kSPECIESN; index++)
655 printf("%f, ", p[index]) ;
656 printf("\n signal = %f\n", GetPHOSsignal()) ;
657 }
704be597 658 if( IsOn(kEMCALpid) ){
659 printf("From EMCAL: ") ;
660 GetEMCALpid(p) ;
661 for(index = 0 ; index < kSPECIESN; index++)
662 printf("%f, ", p[index]) ;
663 printf("\n signal = %f\n", GetEMCALsignal()) ;
664 }
ac2f7574 665}