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