1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
15 //-----------------------------------------------------------------
16 // Implementation of the ESD track class
17 // ESD = Event Summary Data
18 // This is the class to deal with during the phisics analysis of data
19 // Origin: Iouri Belikov, CERN
20 // e-mail: Jouri.Belikov@cern.ch
21 //-----------------------------------------------------------------
25 #include "AliESDtrack.h"
26 #include "AliKalmanTrack.h"
31 //_______________________________________________________________________
32 AliESDtrack::AliESDtrack() :
54 fTPCClusterMap(159),//number of padrows
75 // The default ESD constructor
77 for (Int_t i=0; i<AliPID::kSPECIES; i++) {
87 for (Int_t i=0; i<AliPID::kSPECIESN; i++) {
93 fPHOSpos[0]=fPHOSpos[1]=fPHOSpos[2]=0.;
94 fEMCALpos[0]=fEMCALpos[1]=fEMCALpos[2]=0.;
97 fRp[i]=fCp[i]=fIp[i]=fTp[i]=0.;
99 for (i=0; i<15; i++) {
100 fRc[i]=fCc[i]=fIc[i]=fTc[i]=0.;
102 for (i=0; i<6; i++) { fITSindex[i]=0; }
103 for (i=0; i<180; i++){ fTPCindex[i]=0; }
104 for (i=0; i<3;i++) { fKinkIndexes[i]=0;}
105 for (i=0; i<3;i++) { fV0Indexes[i]=-1;}
106 for (i=0; i<130; i++) { fTRDindex[i]=0; }
107 for (i=0;i<kNPlane;i++) {fTRDsignals[i]=0.; fTRDTimBin[i]=-1;}
108 for (Int_t i=0;i<4;i++) {fTPCPoints[i]=-1;}
109 for (Int_t i=0;i<3;i++) {fTOFLabel[i]=-1;}
110 for (Int_t i=0;i<10;i++) {fTOFInfo[i]=-1;}
118 //_______________________________________________________________________
120 AliESDtrack::AliESDtrack(const AliESDtrack& track):TObject(track){
124 fFlags = track.fFlags;
125 fLabel =track.fLabel;
127 fTrackLength =track.fTrackLength;
128 fD=track.fD; fZ=track.fZ;
129 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i] =track.fTrackTime[i];
130 for (Int_t i=0;i<AliPID::kSPECIES;i++) fR[i] =track.fR[i];
131 fStopVertex =track.fStopVertex;
133 fRalpha =track.fRalpha;
135 for (Int_t i=0;i<5;i++) fRp[i] =track.fRp[i];
136 for (Int_t i=0;i<15;i++) fRc[i] =track.fRc[i];
138 fCalpha =track.fCalpha;
140 for (Int_t i=0;i<5;i++) fCp[i] =track.fCp[i];
141 for (Int_t i=0;i<15;i++) fCc[i] =track.fCc[i];
142 fCchi2 =track.fCchi2;
144 fIalpha =track.fIalpha;
146 for (Int_t i=0;i<5;i++) fIp[i] =track.fIp[i];
147 for (Int_t i=0;i<15;i++) fIc[i] =track.fIc[i];
149 fTalpha =track.fTalpha;
151 for (Int_t i=0;i<5;i++) fTp[i] =track.fTp[i];
152 for (Int_t i=0;i<15;i++) fTc[i] =track.fTc[i];
154 fITSchi2 =track.fITSchi2;
155 for (Int_t i=0;i<12;i++) fITSchi2MIP[i] =track.fITSchi2MIP[i];
156 fITSncls =track.fITSncls;
157 for (Int_t i=0;i<6;i++) fITSindex[i]=track.fITSindex[i];
158 fITSsignal =track.fITSsignal;
159 for (Int_t i=0;i<AliPID::kSPECIES;i++) fITSr[i]=track.fITSr[i];
160 fITSLabel =track.fITSLabel;
161 fITSFakeRatio =track.fITSFakeRatio;
162 fITStrack =0; //coping separatelly - in user code
164 fTPCchi2 =track.fTPCchi2;
165 fTPCncls =track.fTPCncls;
166 for (Int_t i=0;i<180;i++) fTPCindex[i]=track.fTPCindex[i];
167 fTPCClusterMap=track.fTPCClusterMap;
168 fTPCsignal=track.fTPCsignal;
169 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=track.fTPCr[i];
170 fTPCLabel=track.fTPCLabel;
171 for (Int_t i=0;i<4;i++) {fTPCPoints[i]=track.fTPCPoints[i];}
172 for (Int_t i=0; i<3;i++) { fKinkIndexes[i]=track.fKinkIndexes[i];}
173 for (Int_t i=0; i<3;i++) { fV0Indexes[i]=track.fV0Indexes[i];}
175 fTRDchi2=track.fTRDchi2;
176 fTRDncls=track.fTRDncls;
177 fTRDncls0=track.fTRDncls0;
178 for (Int_t i=0;i<130;i++) fTRDindex[i]=track.fTRDindex[i];
179 fTRDsignal=track.fTRDsignal;
180 for (Int_t i=0;i<kNPlane;i++) {
181 fTRDsignals[i]=track.fTRDsignals[i];
182 fTRDTimBin[i]=track.fTRDTimBin[i];
184 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTRDr[i]=track.fTRDr[i];
185 fTRDLabel=track.fTRDLabel;
188 fTOFchi2=track.fTOFchi2;
189 fTOFindex=track.fTOFindex;
190 fTOFsignal=track.fTOFsignal;
191 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTOFr[i]=track.fTOFr[i];
192 for (Int_t i=0;i<3;i++) fTOFLabel[i]=track.fTOFLabel[i];
193 for (Int_t i=0;i<10;i++) fTOFInfo[i]=track.fTOFInfo[i];
195 for (Int_t i=0;i<3;i++) fPHOSpos[i]=track.fPHOSpos[i];
196 fPHOSsignal=track.fPHOSsignal;
197 for (Int_t i=0;i<AliPID::kSPECIESN;i++) fPHOSr[i]=track.fPHOSr[i];
199 for (Int_t i=0;i<3;i++) fEMCALpos[i]=track.fEMCALpos[i];
200 fEMCALsignal=track.fEMCALsignal;
201 for (Int_t i=0;i<AliPID::kSPECIESN;i++) fEMCALr[i]=track.fEMCALr[i];
203 fRICHchi2=track.fRICHchi2;
204 fRICHncls=track.fRICHncls;
205 fRICHindex=track.fRICHindex;
206 fRICHsignal=track.fRICHsignal;
207 for (Int_t i=0;i<AliPID::kSPECIES;i++) fRICHr[i]=track.fRICHr[i];
208 fRICHtheta=track.fRICHtheta;
209 fRICHphi=track.fRICHphi;
210 fRICHdx=track.fRICHdx;
211 fRICHdy=track.fRICHdy;
213 //_______________________________________________________________________
214 AliESDtrack::~AliESDtrack(){
216 // This is destructor according Coding Conventrions
218 //printf("Delete track\n");
223 //_______________________________________________________________________
224 Double_t AliESDtrack::GetMass() const {
225 // Returns the mass of the most probable particle type
228 for (Int_t i=0; i<AliPID::kSPECIES; i++) {
229 if (fR[i]>max) {k=i; max=fR[i];}
231 if (k==0) { // dE/dx "crossing points" in the TPC
233 if ((p>0.38)&&(p<0.48))
234 if (fR[0]<fR[3]*10.) return AliPID::ParticleMass(AliPID::kKaon);
235 if ((p>0.75)&&(p<0.85))
236 if (fR[0]<fR[4]*10.) return AliPID::ParticleMass(AliPID::kProton);
239 if (k==1) return AliPID::ParticleMass(AliPID::kMuon);
240 if (k==2||k==-1) return AliPID::ParticleMass(AliPID::kPion);
241 if (k==3) return AliPID::ParticleMass(AliPID::kKaon);
242 if (k==4) return AliPID::ParticleMass(AliPID::kProton);
243 AliWarning("Undefined mass !");
244 return AliPID::ParticleMass(AliPID::kPion);
247 //_______________________________________________________________________
248 Bool_t AliESDtrack::UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags) {
250 // This function updates track's running parameters
255 fLabel=t->GetLabel();
257 if (t->IsStartedTimeIntegral()) {
259 Double_t times[10];t->GetIntegratedTimes(times); SetIntegratedTimes(times);
260 SetIntegratedLength(t->GetIntegratedLength());
263 fRalpha=t->GetAlpha();
264 t->GetExternalParameters(fRx,fRp);
265 t->GetExternalCovariance(fRc);
269 case kITSin: case kITSout: case kITSrefit:
270 fITSncls=t->GetNumberOfClusters();
271 fITSchi2=t->GetChi2();
272 for (Int_t i=0;i<fITSncls;i++) fITSindex[i]=t->GetClusterIndex(i);
273 fITSsignal=t->GetPIDsignal();
274 fITSLabel = t->GetLabel();
275 fITSFakeRatio = t->GetFakeRatio();
278 case kTPCin: case kTPCrefit:
279 fTPCLabel = t->GetLabel();
284 for (i=0; i<5; i++) fIp[i]=fRp[i];
285 for (i=0; i<15;i++) fIc[i]=fRc[i];
289 fTPCncls=t->GetNumberOfClusters();
290 fTPCchi2=t->GetChi2();
292 {//prevrow must be declared in separate namespace, otherwise compiler cries:
293 //"jump to case label crosses initialization of `Int_t prevrow'"
295 // for (Int_t i=0;i<fTPCncls;i++)
296 for (Int_t i=0;i<160;i++)
298 fTPCindex[i]=t->GetClusterIndex(i);
300 // Piotr's Cluster Map for HBT
301 // ### please change accordingly if cluster array is changing
302 // to "New TPC Tracking" style (with gaps in array)
303 Int_t idx = fTPCindex[i];
304 Int_t sect = (idx&0xff000000)>>24;
305 Int_t row = (idx&0x00ff0000)>>16;
306 if (sect > 18) row +=63; //if it is outer sector, add number of inner sectors
308 fTPCClusterMap.SetBitNumber(row,kTRUE);
310 //Fill the gap between previous row and this row with 0 bits
311 //In case ### pleas change it as well - just set bit 0 in case there
312 //is no associated clusters for current "i"
315 prevrow = row;//if previous bit was not assigned yet == this is the first one
318 { //we don't know the order (inner to outer or reverse)
319 //just to be save in case it is going to change
332 for (Int_t j = n+1; j < m; j++)
334 fTPCClusterMap.SetBitNumber(j,kFALSE);
338 // End Of Piotr's Cluster Map for HBT
341 fTPCsignal=t->GetPIDsignal();
342 {Double_t mass=t->GetMass(); // preliminary mass setting
343 if (mass>0.5) fR[4]=1.; // used by
344 else if (mass<0.4) fR[2]=1.; // the ITS reconstruction
349 case kTRDout: case kTRDin: case kTRDrefit:
350 fTRDLabel = t->GetLabel();
351 fTRDncls=t->GetNumberOfClusters();
352 fTRDchi2=t->GetChi2();
353 for (Int_t i=0;i<fTRDncls;i++) fTRDindex[i]=t->GetClusterIndex(i);
354 fTRDsignal=t->GetPIDsignal();
357 t->GetExternalParameters(fTx,fTp);
358 t->GetExternalCovariance(fTc);
359 fTalpha = t->GetAlpha();
360 fTRDncls0 = t->GetNumberOfClusters();
369 AliError("Wrong flag !");
376 //_______________________________________________________________________
378 AliESDtrack::SetConstrainedTrackParams(const AliKalmanTrack *t, Double_t chi2) {
380 // This function sets the constrained track parameters
384 fCalpha=t->GetAlpha();
385 t->GetExternalParameters(x,buf); fCx=x;
386 for (i=0; i<5; i++) fCp[i]=buf[i];
387 t->GetExternalCovariance(buf);
388 for (i=0; i<15; i++) fCc[i]=buf[i];
393 //_______________________________________________________________________
394 void AliESDtrack::GetExternalParameters(Double_t &x, Double_t p[5]) const {
395 //---------------------------------------------------------------------
396 // This function returns external representation of the track parameters
397 //---------------------------------------------------------------------
399 for (Int_t i=0; i<5; i++) p[i]=fRp[i];
402 //_______________________________________________________________________
403 Bool_t AliESDtrack::GetExternalParametersAt(Double_t x, Double_t p[5]) const {
404 //---------------------------------------------------------------------
405 // This function returns external representation of the track parameters
406 // at the position given by the first argument
407 //---------------------------------------------------------------------
409 Double_t f1=fRp[2], f2=f1 + dx*fRp[4]/AliKalmanTrack::GetConvConst();
411 if (TMath::Abs(f2) >= 0.9999) return kFALSE;
413 Double_t r1=TMath::Sqrt(1.- f1*f1), r2=TMath::Sqrt(1.- f2*f2);
414 p[0] = fRp[0] + dx*(f1+f2)/(r1+r2);
415 p[1] = fRp[1] + dx*(f1+f2)/(f1*r2 + f2*r1)*fRp[3];
423 //_______________________________________________________________________
424 void AliESDtrack::GetExternalCovariance(Double_t cov[15]) const {
425 //---------------------------------------------------------------------
426 // This function returns external representation of the cov. matrix
427 //---------------------------------------------------------------------
428 for (Int_t i=0; i<15; i++) cov[i]=fRc[i];
432 //_______________________________________________________________________
434 AliESDtrack::GetConstrainedExternalParameters(Double_t &x, Double_t p[5])const{
435 //---------------------------------------------------------------------
436 // This function returns the constrained external track parameters
437 //---------------------------------------------------------------------
439 for (Int_t i=0; i<5; i++) p[i]=fCp[i];
441 //_______________________________________________________________________
443 AliESDtrack::GetConstrainedExternalCovariance(Double_t c[15]) const {
444 //---------------------------------------------------------------------
445 // This function returns the constrained external cov. matrix
446 //---------------------------------------------------------------------
447 for (Int_t i=0; i<15; i++) c[i]=fCc[i];
451 Double_t AliESDtrack::GetP() const {
452 //---------------------------------------------------------------------
453 // This function returns the track momentum
454 // Results for (nearly) straight tracks are meaningless !
455 //---------------------------------------------------------------------
456 if (TMath::Abs(fRp[4])<=0) return 0;
457 Double_t pt=1./TMath::Abs(fRp[4]);
458 return pt*TMath::Sqrt(1.+ fRp[3]*fRp[3]);
461 Bool_t Local2GlobalMomentum(Double_t p[3],Double_t alpha) {
462 //----------------------------------------------------------------
463 // This function performs local->global transformation of the
465 // When called, the arguments are:
466 // p[0] = 1/pt of the track;
467 // p[1] = sine of local azim. angle of the track momentum;
468 // p[2] = tangent of the track momentum dip angle;
469 // alpha - rotation angle.
470 // The result is returned as:
474 // Results for (nearly) straight tracks are meaningless !
475 //----------------------------------------------------------------
476 if (TMath::Abs(p[0])<=0) return kFALSE;
477 if (TMath::Abs(p[1])> 0.999999) return kFALSE;
479 Double_t pt=1./TMath::Abs(p[0]);
480 Double_t cs=TMath::Cos(alpha), sn=TMath::Sin(alpha);
481 Double_t r=TMath::Sqrt(1 - p[1]*p[1]);
482 p[0]=pt*(r*cs - p[1]*sn); p[1]=pt*(p[1]*cs + r*sn); p[2]=pt*p[2];
487 Bool_t Local2GlobalPosition(Double_t r[3],Double_t alpha) {
488 //----------------------------------------------------------------
489 // This function performs local->global transformation of the
491 // When called, the arguments are:
495 // alpha - rotation angle.
496 // The result is returned as:
500 //----------------------------------------------------------------
501 Double_t cs=TMath::Cos(alpha), sn=TMath::Sin(alpha), x=r[0];
502 r[0]=x*cs - r[1]*sn; r[1]=x*sn + r[1]*cs;
507 Bool_t AliESDtrack::GetConstrainedPxPyPz(Double_t *p) const {
508 //---------------------------------------------------------------------
509 // This function returns the constrained global track momentum components
510 // Results for (nearly) straight tracks are meaningless !
511 //---------------------------------------------------------------------
512 p[0]=fCp[4]; p[1]=fCp[2]; p[2]=fCp[3];
513 return Local2GlobalMomentum(p,fCalpha);
516 Bool_t AliESDtrack::GetConstrainedXYZ(Double_t *r) const {
517 //---------------------------------------------------------------------
518 // This function returns the constrained global track position
519 //---------------------------------------------------------------------
520 r[0]=fCx; r[1]=fCp[0]; r[2]=fCp[1];
521 return Local2GlobalPosition(r,fCalpha);
524 Bool_t AliESDtrack::GetPxPyPz(Double_t *p) const {
525 //---------------------------------------------------------------------
526 // This function returns the global track momentum components
527 // Results for (nearly) straight tracks are meaningless !
528 //---------------------------------------------------------------------
529 p[0]=fRp[4]; p[1]=fRp[2]; p[2]=fRp[3];
530 return Local2GlobalMomentum(p,fRalpha);
533 Bool_t AliESDtrack::GetXYZ(Double_t *r) const {
534 //---------------------------------------------------------------------
535 // This function returns the global track position
536 //---------------------------------------------------------------------
537 r[0]=fRx; r[1]=fRp[0]; r[2]=fRp[1];
538 return Local2GlobalPosition(r,fRalpha);
541 void AliESDtrack::GetCovariance(Double_t cv[21]) const {
542 //---------------------------------------------------------------------
543 // This function returns the global covariance matrix of the track params
545 // Cov(x,x) ... : cv[0]
546 // Cov(y,x) ... : cv[1] cv[2]
547 // Cov(z,x) ... : cv[3] cv[4] cv[5]
548 // Cov(px,x)... : cv[6] cv[7] cv[8] cv[9]
549 // Cov(py,x)... : cv[10] cv[11] cv[12] cv[13] cv[14]
550 // Cov(pz,x)... : cv[15] cv[16] cv[17] cv[18] cv[19] cv[20]
552 // Results for (nearly) straight tracks are meaningless !
553 //---------------------------------------------------------------------
554 if (TMath::Abs(fRp[4])<=0) {
555 for (Int_t i=0; i<21; i++) cv[i]=0.;
558 if (TMath::Abs(fRp[2]) > 0.999999) {
559 for (Int_t i=0; i<21; i++) cv[i]=0.;
562 Double_t pt=1./TMath::Abs(fRp[4]);
563 Double_t cs=TMath::Cos(fRalpha), sn=TMath::Sin(fRalpha);
564 Double_t r=TMath::Sqrt(1-fRp[2]*fRp[2]);
566 Double_t m00=-sn, m10=cs;
567 Double_t m23=-pt*(sn + fRp[2]*cs/r), m43=-pt*pt*(r*cs - fRp[2]*sn);
568 Double_t m24= pt*(cs - fRp[2]*sn/r), m44=-pt*pt*(r*sn + fRp[2]*cs);
569 Double_t m35=pt, m45=-pt*pt*fRp[3];
571 cv[0]=fRc[0]*m00*m00;
572 cv[1]=fRc[0]*m00*m10;
573 cv[2]=fRc[0]*m10*m10;
577 cv[6]=m00*(fRc[3]*m23+fRc[10]*m43);
578 cv[7]=m10*(fRc[3]*m23+fRc[10]*m43);
579 cv[8]=fRc[4]*m23+fRc[11]*m43;
580 cv[9]=m23*(fRc[5]*m23+fRc[12]*m43)+m43*(fRc[12]*m23+fRc[14]*m43);
581 cv[10]=m00*(fRc[3]*m24+fRc[10]*m44);
582 cv[11]=m10*(fRc[3]*m24+fRc[10]*m44);
583 cv[12]=fRc[4]*m24+fRc[11]*m44;
584 cv[13]=m23*(fRc[5]*m24+fRc[12]*m44)+m43*(fRc[12]*m24+fRc[14]*m44);
585 cv[14]=m24*(fRc[5]*m24+fRc[12]*m44)+m44*(fRc[12]*m24+fRc[14]*m44);
586 cv[15]=m00*(fRc[6]*m35+fRc[10]*m45);
587 cv[16]=m10*(fRc[6]*m35+fRc[10]*m45);
588 cv[17]=fRc[7]*m35+fRc[11]*m45;
589 cv[18]=m23*(fRc[8]*m35+fRc[12]*m45)+m43*(fRc[13]*m35+fRc[14]*m45);
590 cv[19]=m24*(fRc[8]*m35+fRc[12]*m45)+m44*(fRc[13]*m35+fRc[14]*m45);
591 cv[20]=m35*(fRc[9]*m35+fRc[13]*m45)+m45*(fRc[13]*m35+fRc[14]*m45);
594 Bool_t AliESDtrack::GetInnerPxPyPz(Double_t *p) const {
595 //---------------------------------------------------------------------
596 // This function returns the global track momentum components
597 // af the entrance of the TPC
598 //---------------------------------------------------------------------
599 p[0]=fIp[4]; p[1]=fIp[2]; p[2]=fIp[3];
600 return Local2GlobalMomentum(p,fIalpha);
603 Bool_t AliESDtrack::GetInnerXYZ(Double_t *r) const {
604 //---------------------------------------------------------------------
605 // This function returns the global track position
606 // af the entrance of the TPC
607 //---------------------------------------------------------------------
608 if (fIx==0) return kFALSE;
609 r[0]=fIx; r[1]=fIp[0]; r[2]=fIp[1];
610 return Local2GlobalPosition(r,fIalpha);
613 void AliESDtrack::GetInnerExternalParameters(Double_t &x, Double_t p[5]) const
616 //---------------------------------------------------------------------
617 // This function returns external representation of the track parameters at Inner Layer of TPC
618 //---------------------------------------------------------------------
620 for (Int_t i=0; i<5; i++) p[i]=fIp[i];
622 void AliESDtrack::GetInnerExternalCovariance(Double_t cov[15]) const
625 //---------------------------------------------------------------------
626 // This function returns external representation of the cov. matrix at Inner Layer of TPC
627 //---------------------------------------------------------------------
628 for (Int_t i=0; i<15; i++) cov[i]=fIc[i];
632 void AliESDtrack::GetTRDExternalParameters(Double_t &x, Double_t&alpha, Double_t p[5], Double_t cov[15]) const
635 //this function returns TRD parameters
639 for (Int_t i=0; i<5; i++) p[i]=fTp[i];
640 for (Int_t i=0; i<15; i++) cov[i]=fTc[i];
643 Bool_t AliESDtrack::GetPxPyPzAt(Double_t x,Double_t *p) const {
644 //---------------------------------------------------------------------
645 // This function returns the global track momentum components
646 // at the position "x" using the helix track approximation
647 //---------------------------------------------------------------------
649 p[1]=fRp[2]+(x-fRx)*fRp[4]/AliKalmanTrack::GetConvConst();
651 return Local2GlobalMomentum(p,fRalpha);
654 Bool_t AliESDtrack::GetXYZAt(Double_t x, Double_t *r) const {
655 //---------------------------------------------------------------------
656 // This function returns the global track position
657 // af the radius "x" using the helix track approximation
658 //---------------------------------------------------------------------
660 Double_t f1=fRp[2], f2=f1 + dx*fRp[4]/AliKalmanTrack::GetConvConst();
662 if (TMath::Abs(f2) >= 0.9999) return kFALSE;
664 Double_t r1=TMath::Sqrt(1.- f1*f1), r2=TMath::Sqrt(1.- f2*f2);
666 r[1] = fRp[0] + dx*(f1+f2)/(r1+r2);
667 r[2] = fRp[1] + dx*(f1+f2)/(f1*r2 + f2*r1)*fRp[3];
668 return Local2GlobalPosition(r,fRalpha);
671 //_______________________________________________________________________
672 void AliESDtrack::GetIntegratedTimes(Double_t *times) const {
673 // Returns the array with integrated times for each particle hypothesis
674 for (Int_t i=0; i<AliPID::kSPECIES; i++) times[i]=fTrackTime[i];
677 //_______________________________________________________________________
678 void AliESDtrack::SetIntegratedTimes(const Double_t *times) {
679 // Sets the array with integrated times for each particle hypotesis
680 for (Int_t i=0; i<AliPID::kSPECIES; i++) fTrackTime[i]=times[i];
683 //_______________________________________________________________________
684 void AliESDtrack::SetITSpid(const Double_t *p) {
685 // Sets values for the probability of each particle type (in ITS)
686 for (Int_t i=0; i<AliPID::kSPECIES; i++) fITSr[i]=p[i];
687 SetStatus(AliESDtrack::kITSpid);
690 void AliESDtrack::SetITSChi2MIP(const Float_t *chi2mip){
691 for (Int_t i=0; i<12; i++) fITSchi2MIP[i]=chi2mip[i];
693 //_______________________________________________________________________
694 void AliESDtrack::GetITSpid(Double_t *p) const {
695 // Gets the probability of each particle type (in ITS)
696 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fITSr[i];
699 //_______________________________________________________________________
700 Int_t AliESDtrack::GetITSclusters(UInt_t *idx) const {
701 //---------------------------------------------------------------------
702 // This function returns indices of the assgined ITS clusters
703 //---------------------------------------------------------------------
704 for (Int_t i=0; i<fITSncls; i++) idx[i]=fITSindex[i];
708 //_______________________________________________________________________
709 Int_t AliESDtrack::GetTPCclusters(Int_t *idx) const {
710 //---------------------------------------------------------------------
711 // This function returns indices of the assgined ITS clusters
712 //---------------------------------------------------------------------
714 for (Int_t i=0; i<180; i++) idx[i]=fTPCindex[i]; // MI I prefer some constant
718 //_______________________________________________________________________
719 void AliESDtrack::SetTPCpid(const Double_t *p) {
720 // Sets values for the probability of each particle type (in TPC)
721 for (Int_t i=0; i<AliPID::kSPECIES; i++) fTPCr[i]=p[i];
722 SetStatus(AliESDtrack::kTPCpid);
725 //_______________________________________________________________________
726 void AliESDtrack::GetTPCpid(Double_t *p) const {
727 // Gets the probability of each particle type (in TPC)
728 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTPCr[i];
731 //_______________________________________________________________________
732 Int_t AliESDtrack::GetTRDclusters(UInt_t *idx) const {
733 //---------------------------------------------------------------------
734 // This function returns indices of the assgined TRD clusters
735 //---------------------------------------------------------------------
737 for (Int_t i=0; i<130; i++) idx[i]=fTRDindex[i]; // MI I prefer some constant
741 //_______________________________________________________________________
742 void AliESDtrack::SetTRDpid(const Double_t *p) {
743 // Sets values for the probability of each particle type (in TRD)
744 for (Int_t i=0; i<AliPID::kSPECIES; i++) fTRDr[i]=p[i];
745 SetStatus(AliESDtrack::kTRDpid);
748 //_______________________________________________________________________
749 void AliESDtrack::GetTRDpid(Double_t *p) const {
750 // Gets the probability of each particle type (in TRD)
751 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTRDr[i];
754 //_______________________________________________________________________
755 void AliESDtrack::SetTRDpid(Int_t iSpecies, Float_t p)
757 // Sets the probability of particle type iSpecies to p (in TRD)
761 Float_t AliESDtrack::GetTRDpid(Int_t iSpecies) const
763 // Returns the probability of particle type iSpecies (in TRD)
764 return fTRDr[iSpecies];
767 //_______________________________________________________________________
768 void AliESDtrack::SetTOFpid(const Double_t *p) {
769 // Sets the probability of each particle type (in TOF)
770 for (Int_t i=0; i<AliPID::kSPECIES; i++) fTOFr[i]=p[i];
771 SetStatus(AliESDtrack::kTOFpid);
774 //_______________________________________________________________________
775 void AliESDtrack::SetTOFLabel(const Int_t *p) {
777 for (Int_t i=0; i<3; i++) fTOFLabel[i]=p[i];
780 //_______________________________________________________________________
781 void AliESDtrack::GetTOFpid(Double_t *p) const {
782 // Gets probabilities of each particle type (in TOF)
783 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTOFr[i];
786 //_______________________________________________________________________
787 void AliESDtrack::GetTOFLabel(Int_t *p) const {
789 for (Int_t i=0; i<3; i++) p[i]=fTOFLabel[i];
792 //_______________________________________________________________________
793 void AliESDtrack::GetTOFInfo(Float_t *info) const {
795 for (Int_t i=0; i<10; i++) info[i]=fTOFInfo[i];
798 //_______________________________________________________________________
799 void AliESDtrack::SetTOFInfo(Float_t*info) {
801 for (Int_t i=0; i<10; i++) fTOFInfo[i]=info[i];
806 //_______________________________________________________________________
807 void AliESDtrack::SetPHOSpid(const Double_t *p) {
808 // Sets the probability of each particle type (in PHOS)
809 for (Int_t i=0; i<AliPID::kSPECIESN; i++) fPHOSr[i]=p[i];
810 SetStatus(AliESDtrack::kPHOSpid);
813 //_______________________________________________________________________
814 void AliESDtrack::GetPHOSpid(Double_t *p) const {
815 // Gets probabilities of each particle type (in PHOS)
816 for (Int_t i=0; i<AliPID::kSPECIESN; i++) p[i]=fPHOSr[i];
819 //_______________________________________________________________________
820 void AliESDtrack::SetEMCALpid(const Double_t *p) {
821 // Sets the probability of each particle type (in EMCAL)
822 for (Int_t i=0; i<AliPID::kSPECIESN; i++) fEMCALr[i]=p[i];
823 SetStatus(AliESDtrack::kEMCALpid);
826 //_______________________________________________________________________
827 void AliESDtrack::GetEMCALpid(Double_t *p) const {
828 // Gets probabilities of each particle type (in EMCAL)
829 for (Int_t i=0; i<AliPID::kSPECIESN; i++) p[i]=fEMCALr[i];
832 //_______________________________________________________________________
833 void AliESDtrack::SetRICHpid(const Double_t *p) {
834 // Sets the probability of each particle type (in RICH)
835 for (Int_t i=0; i<AliPID::kSPECIES; i++) fRICHr[i]=p[i];
836 SetStatus(AliESDtrack::kRICHpid);
839 //_______________________________________________________________________
840 void AliESDtrack::GetRICHpid(Double_t *p) const {
841 // Gets probabilities of each particle type (in RICH)
842 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fRICHr[i];
847 //_______________________________________________________________________
848 void AliESDtrack::SetESDpid(const Double_t *p) {
849 // Sets the probability of each particle type for the ESD track
850 for (Int_t i=0; i<AliPID::kSPECIES; i++) fR[i]=p[i];
851 SetStatus(AliESDtrack::kESDpid);
854 //_______________________________________________________________________
855 void AliESDtrack::GetESDpid(Double_t *p) const {
856 // Gets probability of each particle type for the ESD track
857 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fR[i];
860 //_______________________________________________________________________
861 void AliESDtrack::Print(Option_t *) const {
862 // Prints info on the track
864 printf("ESD track info\n") ;
865 Double_t p[AliPID::kSPECIESN] ;
868 printf("From ITS: ") ;
870 for(index = 0 ; index < AliPID::kSPECIES; index++)
871 printf("%f, ", p[index]) ;
872 printf("\n signal = %f\n", GetITSsignal()) ;
875 printf("From TPC: ") ;
877 for(index = 0 ; index < AliPID::kSPECIES; index++)
878 printf("%f, ", p[index]) ;
879 printf("\n signal = %f\n", GetTPCsignal()) ;
882 printf("From TRD: ") ;
884 for(index = 0 ; index < AliPID::kSPECIES; index++)
885 printf("%f, ", p[index]) ;
886 printf("\n signal = %f\n", GetTRDsignal()) ;
889 printf("From TOF: ") ;
891 for(index = 0 ; index < AliPID::kSPECIES; index++)
892 printf("%f, ", p[index]) ;
893 printf("\n signal = %f\n", GetTOFsignal()) ;
895 if( IsOn(kRICHpid) ){
896 printf("From TOF: ") ;
898 for(index = 0 ; index < AliPID::kSPECIES; index++)
899 printf("%f, ", p[index]) ;
900 printf("\n signal = %f\n", GetRICHsignal()) ;
902 if( IsOn(kPHOSpid) ){
903 printf("From PHOS: ") ;
905 for(index = 0 ; index < AliPID::kSPECIESN; index++)
906 printf("%f, ", p[index]) ;
907 printf("\n signal = %f\n", GetPHOSsignal()) ;
909 if( IsOn(kEMCALpid) ){
910 printf("From EMCAL: ") ;
912 for(index = 0 ; index < AliPID::kSPECIESN; index++)
913 printf("%f, ", p[index]) ;
914 printf("\n signal = %f\n", GetEMCALsignal()) ;