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() :
53 fTPCClusterMap(159),//number of padrows
67 // The default ESD constructor
70 for (Int_t i=0; i<AliPID::kSPECIES; i++) {
80 for (Int_t i=0; i<AliPID::kSPECIESN; i++) {
86 fPHOSpos[0]=fPHOSpos[1]=fPHOSpos[2]=0.;
87 fEMCALpos[0]=fEMCALpos[1]=fEMCALpos[2]=0.;
90 fRp[i]=fCp[i]=fIp[i]=fTp[i]=0.;
92 for (i=0; i<15; i++) {
93 fRc[i]=fCc[i]=fIc[i]=fTc[i]=0.;
95 for (i=0; i<6; i++) { fITSindex[i]=0; }
96 for (i=0; i<180; i++){ fTPCindex[i]=0; }
97 for (i=0; i<3;i++) { fKinkIndexes[i]=0;}
98 for (i=0; i<3;i++) { fV0Indexes[i]=-1;}
99 for (i=0; i<130; i++) { fTRDindex[i]=0; }
100 for (i=0;i<kNPlane;i++) {fTRDsignals[i]=0.; fTRDTimBin[i]=-1;}
101 for (Int_t i=0;i<4;i++) {fTPCPoints[i]=-1;}
102 for (Int_t i=0;i<3;i++) {fTOFLabel[i]=-1;}
103 for (Int_t i=0;i<10;i++) {fTOFInfo[i]=-1;}
111 //_______________________________________________________________________
113 AliESDtrack::AliESDtrack(const AliESDtrack& track):TObject(track){
118 fFlags = track.fFlags;
119 fLabel =track.fLabel;
120 fTrackLength =track.fTrackLength;
121 fD=track.fD; fZ=track.fZ;
122 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i] =track.fTrackTime[i];
123 for (Int_t i=0;i<AliPID::kSPECIES;i++) fR[i] =track.fR[i];
124 fStopVertex =track.fStopVertex;
126 fRalpha =track.fRalpha;
128 for (Int_t i=0;i<5;i++) fRp[i] =track.fRp[i];
129 for (Int_t i=0;i<15;i++) fRc[i] =track.fRc[i];
131 fCalpha =track.fCalpha;
133 for (Int_t i=0;i<5;i++) fCp[i] =track.fCp[i];
134 for (Int_t i=0;i<15;i++) fCc[i] =track.fCc[i];
135 fCchi2 =track.fCchi2;
137 fIalpha =track.fIalpha;
139 for (Int_t i=0;i<5;i++) fIp[i] =track.fIp[i];
140 for (Int_t i=0;i<15;i++) fIc[i] =track.fIc[i];
142 fTalpha =track.fTalpha;
144 for (Int_t i=0;i<5;i++) fTp[i] =track.fTp[i];
145 for (Int_t i=0;i<15;i++) fTc[i] =track.fTc[i];
147 fITSchi2 =track.fITSchi2;
148 for (Int_t i=0;i<12;i++) fITSchi2MIP[i] =track.fITSchi2MIP[i];
149 fITSncls =track.fITSncls;
150 for (Int_t i=0;i<6;i++) fITSindex[i]=track.fITSindex[i];
151 fITSsignal =track.fITSsignal;
152 for (Int_t i=0;i<AliPID::kSPECIES;i++) fITSr[i]=track.fITSr[i];
153 fITSLabel =track.fITSLabel;
154 fITSFakeRatio =track.fITSFakeRatio;
155 fITStrack =0; //coping separatelly - in user code
157 fTPCchi2 =track.fTPCchi2;
158 fTPCncls =track.fTPCncls;
159 for (Int_t i=0;i<180;i++) fTPCindex[i]=track.fTPCindex[i];
160 fTPCClusterMap=track.fTPCClusterMap;
161 fTPCsignal=track.fTPCsignal;
162 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=track.fTPCr[i];
163 fTPCLabel=track.fTPCLabel;
164 for (Int_t i=0;i<4;i++) {fTPCPoints[i]=track.fTPCPoints[i];}
165 for (Int_t i=0; i<3;i++) { fKinkIndexes[i]=track.fKinkIndexes[i];}
166 for (Int_t i=0; i<3;i++) { fV0Indexes[i]=track.fV0Indexes[i];}
168 fTRDchi2=track.fTRDchi2;
169 fTRDncls=track.fTRDncls;
170 fTRDncls0=track.fTRDncls0;
171 for (Int_t i=0;i<130;i++) fTRDindex[i]=track.fTRDindex[i];
172 fTRDsignal=track.fTRDsignal;
173 for (Int_t i=0;i<kNPlane;i++) {
174 fTRDsignals[i]=track.fTRDsignals[i];
175 fTRDTimBin[i]=track.fTRDTimBin[i];
177 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTRDr[i]=track.fTRDr[i];
178 fTRDLabel=track.fTRDLabel;
181 fTOFchi2=track.fTOFchi2;
182 fTOFindex=track.fTOFindex;
183 fTOFsignal=track.fTOFsignal;
184 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTOFr[i]=track.fTOFr[i];
185 for (Int_t i=0;i<3;i++) fTOFLabel[i]=track.fTOFLabel[i];
186 for (Int_t i=0;i<10;i++) fTOFInfo[i]=track.fTOFInfo[i];
188 for (Int_t i=0;i<3;i++) fPHOSpos[i]=track.fPHOSpos[i];
189 fPHOSsignal=track.fPHOSsignal;
190 for (Int_t i=0;i<AliPID::kSPECIESN;i++) fPHOSr[i]=track.fPHOSr[i];
192 for (Int_t i=0;i<3;i++) fEMCALpos[i]=track.fEMCALpos[i];
193 fEMCALsignal=track.fEMCALsignal;
194 for (Int_t i=0;i<AliPID::kSPECIESN;i++) fEMCALr[i]=track.fEMCALr[i];
196 fRICHsignal=track.fRICHsignal;
197 for (Int_t i=0;i<AliPID::kSPECIES;i++) fRICHr[i]=track.fRICHr[i];
201 //_______________________________________________________________________
202 AliESDtrack::~AliESDtrack(){
204 // This is destructor according Coding Conventrions
206 //printf("Delete track\n");
211 //_______________________________________________________________________
212 Double_t AliESDtrack::GetMass() const {
213 // Returns the mass of the most probable particle type
216 for (Int_t i=0; i<AliPID::kSPECIES; i++) {
217 if (fR[i]>max) {k=i; max=fR[i];}
219 if (k==0) { // dE/dx "crossing points" in the TPC
221 if ((p>0.38)&&(p<0.48))
222 if (fR[0]<fR[3]*10.) return AliPID::ParticleMass(AliPID::kKaon);
223 if ((p>0.75)&&(p<0.85))
224 if (fR[0]<fR[4]*10.) return AliPID::ParticleMass(AliPID::kProton);
227 if (k==1) return AliPID::ParticleMass(AliPID::kMuon);
228 if (k==2||k==-1) return AliPID::ParticleMass(AliPID::kPion);
229 if (k==3) return AliPID::ParticleMass(AliPID::kKaon);
230 if (k==4) return AliPID::ParticleMass(AliPID::kProton);
231 AliWarning("Undefined mass !");
232 return AliPID::ParticleMass(AliPID::kPion);
235 //_______________________________________________________________________
236 Bool_t AliESDtrack::UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags) {
238 // This function updates track's running parameters
243 fLabel=t->GetLabel();
245 if (t->IsStartedTimeIntegral()) {
247 Double_t times[10];t->GetIntegratedTimes(times); SetIntegratedTimes(times);
248 SetIntegratedLength(t->GetIntegratedLength());
251 fRalpha=t->GetAlpha();
252 t->GetExternalParameters(fRx,fRp);
253 t->GetExternalCovariance(fRc);
257 case kITSin: case kITSout: case kITSrefit:
258 fITSncls=t->GetNumberOfClusters();
259 fITSchi2=t->GetChi2();
260 for (Int_t i=0;i<fITSncls;i++) fITSindex[i]=t->GetClusterIndex(i);
261 fITSsignal=t->GetPIDsignal();
262 fITSLabel = t->GetLabel();
263 fITSFakeRatio = t->GetFakeRatio();
266 case kTPCin: case kTPCrefit:
267 fTPCLabel = t->GetLabel();
272 for (i=0; i<5; i++) fIp[i]=fRp[i];
273 for (i=0; i<15;i++) fIc[i]=fRc[i];
277 fTPCncls=t->GetNumberOfClusters();
278 fTPCchi2=t->GetChi2();
280 {//prevrow must be declared in separate namespace, otherwise compiler cries:
281 //"jump to case label crosses initialization of `Int_t prevrow'"
283 // for (Int_t i=0;i<fTPCncls;i++)
284 for (Int_t i=0;i<160;i++)
286 fTPCindex[i]=t->GetClusterIndex(i);
288 // Piotr's Cluster Map for HBT
289 // ### please change accordingly if cluster array is changing
290 // to "New TPC Tracking" style (with gaps in array)
291 Int_t idx = fTPCindex[i];
292 Int_t sect = (idx&0xff000000)>>24;
293 Int_t row = (idx&0x00ff0000)>>16;
294 if (sect > 18) row +=63; //if it is outer sector, add number of inner sectors
296 fTPCClusterMap.SetBitNumber(row,kTRUE);
298 //Fill the gap between previous row and this row with 0 bits
299 //In case ### pleas change it as well - just set bit 0 in case there
300 //is no associated clusters for current "i"
303 prevrow = row;//if previous bit was not assigned yet == this is the first one
306 { //we don't know the order (inner to outer or reverse)
307 //just to be save in case it is going to change
320 for (Int_t j = n+1; j < m; j++)
322 fTPCClusterMap.SetBitNumber(j,kFALSE);
326 // End Of Piotr's Cluster Map for HBT
329 fTPCsignal=t->GetPIDsignal();
330 {Double_t mass=t->GetMass(); // preliminary mass setting
331 if (mass>0.5) fR[4]=1.; // used by
332 else if (mass<0.4) fR[2]=1.; // the ITS reconstruction
337 case kTRDout: case kTRDin: case kTRDrefit:
338 fTRDLabel = t->GetLabel();
339 fTRDncls=t->GetNumberOfClusters();
340 fTRDchi2=t->GetChi2();
341 for (Int_t i=0;i<fTRDncls;i++) fTRDindex[i]=t->GetClusterIndex(i);
342 fTRDsignal=t->GetPIDsignal();
345 t->GetExternalParameters(fTx,fTp);
346 t->GetExternalCovariance(fTc);
347 fTalpha = t->GetAlpha();
348 fTRDncls0 = t->GetNumberOfClusters();
357 AliError("Wrong flag !");
364 //_______________________________________________________________________
366 AliESDtrack::SetConstrainedTrackParams(const AliKalmanTrack *t, Double_t chi2) {
368 // This function sets the constrained track parameters
372 fCalpha=t->GetAlpha();
373 t->GetExternalParameters(x,buf); fCx=x;
374 for (i=0; i<5; i++) fCp[i]=buf[i];
375 t->GetExternalCovariance(buf);
376 for (i=0; i<15; i++) fCc[i]=buf[i];
381 //_______________________________________________________________________
382 void AliESDtrack::GetExternalParameters(Double_t &x, Double_t p[5]) const {
383 //---------------------------------------------------------------------
384 // This function returns external representation of the track parameters
385 //---------------------------------------------------------------------
387 for (Int_t i=0; i<5; i++) p[i]=fRp[i];
390 //_______________________________________________________________________
391 Bool_t AliESDtrack::GetExternalParametersAt(Double_t x, Double_t p[5]) const {
392 //---------------------------------------------------------------------
393 // This function returns external representation of the track parameters
394 // at the position given by the first argument
395 //---------------------------------------------------------------------
397 Double_t f1=fRp[2], f2=f1 + dx*fRp[4]/AliKalmanTrack::GetConvConst();
399 if (TMath::Abs(f2) >= 0.9999) return kFALSE;
401 Double_t r1=TMath::Sqrt(1.- f1*f1), r2=TMath::Sqrt(1.- f2*f2);
402 p[0] = fRp[0] + dx*(f1+f2)/(r1+r2);
403 p[1] = fRp[1] + dx*(f1+f2)/(f1*r2 + f2*r1)*fRp[3];
411 //_______________________________________________________________________
412 void AliESDtrack::GetExternalCovariance(Double_t cov[15]) const {
413 //---------------------------------------------------------------------
414 // This function returns external representation of the cov. matrix
415 //---------------------------------------------------------------------
416 for (Int_t i=0; i<15; i++) cov[i]=fRc[i];
420 //_______________________________________________________________________
422 AliESDtrack::GetConstrainedExternalParameters(Double_t &x, Double_t p[5])const{
423 //---------------------------------------------------------------------
424 // This function returns the constrained external track parameters
425 //---------------------------------------------------------------------
427 for (Int_t i=0; i<5; i++) p[i]=fCp[i];
429 //_______________________________________________________________________
431 AliESDtrack::GetConstrainedExternalCovariance(Double_t c[15]) const {
432 //---------------------------------------------------------------------
433 // This function returns the constrained external cov. matrix
434 //---------------------------------------------------------------------
435 for (Int_t i=0; i<15; i++) c[i]=fCc[i];
439 Double_t AliESDtrack::GetP() const {
440 //---------------------------------------------------------------------
441 // This function returns the track momentum
442 // Results for (nearly) straight tracks are meaningless !
443 //---------------------------------------------------------------------
444 if (TMath::Abs(fRp[4])<=0) return 0;
445 Double_t pt=1./TMath::Abs(fRp[4]);
446 return pt*TMath::Sqrt(1.+ fRp[3]*fRp[3]);
449 Bool_t Local2GlobalMomentum(Double_t p[3],Double_t alpha) {
450 //----------------------------------------------------------------
451 // This function performs local->global transformation of the
453 // When called, the arguments are:
454 // p[0] = 1/pt of the track;
455 // p[1] = sine of local azim. angle of the track momentum;
456 // p[2] = tangent of the track momentum dip angle;
457 // alpha - rotation angle.
458 // The result is returned as:
462 // Results for (nearly) straight tracks are meaningless !
463 //----------------------------------------------------------------
464 if (TMath::Abs(p[0])<=0) return kFALSE;
465 if (TMath::Abs(p[1])> 0.999999) return kFALSE;
467 Double_t pt=1./TMath::Abs(p[0]);
468 Double_t cs=TMath::Cos(alpha), sn=TMath::Sin(alpha);
469 Double_t r=TMath::Sqrt(1 - p[1]*p[1]);
470 p[0]=pt*(r*cs - p[1]*sn); p[1]=pt*(p[1]*cs + r*sn); p[2]=pt*p[2];
475 Bool_t Local2GlobalPosition(Double_t r[3],Double_t alpha) {
476 //----------------------------------------------------------------
477 // This function performs local->global transformation of the
479 // When called, the arguments are:
483 // alpha - rotation angle.
484 // The result is returned as:
488 //----------------------------------------------------------------
489 Double_t cs=TMath::Cos(alpha), sn=TMath::Sin(alpha), x=r[0];
490 r[0]=x*cs - r[1]*sn; r[1]=x*sn + r[1]*cs;
495 Bool_t AliESDtrack::GetConstrainedPxPyPz(Double_t *p) const {
496 //---------------------------------------------------------------------
497 // This function returns the constrained global track momentum components
498 // Results for (nearly) straight tracks are meaningless !
499 //---------------------------------------------------------------------
500 p[0]=fCp[4]; p[1]=fCp[2]; p[2]=fCp[3];
501 return Local2GlobalMomentum(p,fCalpha);
504 Bool_t AliESDtrack::GetConstrainedXYZ(Double_t *r) const {
505 //---------------------------------------------------------------------
506 // This function returns the constrained global track position
507 //---------------------------------------------------------------------
508 r[0]=fCx; r[1]=fCp[0]; r[2]=fCp[1];
509 return Local2GlobalPosition(r,fCalpha);
512 Bool_t AliESDtrack::GetPxPyPz(Double_t *p) const {
513 //---------------------------------------------------------------------
514 // This function returns the global track momentum components
515 // Results for (nearly) straight tracks are meaningless !
516 //---------------------------------------------------------------------
517 p[0]=fRp[4]; p[1]=fRp[2]; p[2]=fRp[3];
518 return Local2GlobalMomentum(p,fRalpha);
521 Bool_t AliESDtrack::GetXYZ(Double_t *r) const {
522 //---------------------------------------------------------------------
523 // This function returns the global track position
524 //---------------------------------------------------------------------
525 r[0]=fRx; r[1]=fRp[0]; r[2]=fRp[1];
526 return Local2GlobalPosition(r,fRalpha);
529 void AliESDtrack::GetCovariance(Double_t cv[21]) const {
530 //---------------------------------------------------------------------
531 // This function returns the global covariance matrix of the track params
533 // Cov(x,x) ... : cv[0]
534 // Cov(y,x) ... : cv[1] cv[2]
535 // Cov(z,x) ... : cv[3] cv[4] cv[5]
536 // Cov(px,x)... : cv[6] cv[7] cv[8] cv[9]
537 // Cov(py,x)... : cv[10] cv[11] cv[12] cv[13] cv[14]
538 // Cov(pz,x)... : cv[15] cv[16] cv[17] cv[18] cv[19] cv[20]
540 // Results for (nearly) straight tracks are meaningless !
541 //---------------------------------------------------------------------
542 if (TMath::Abs(fRp[4])<=0) {
543 for (Int_t i=0; i<21; i++) cv[i]=0.;
546 if (TMath::Abs(fRp[2]) > 0.999999) {
547 for (Int_t i=0; i<21; i++) cv[i]=0.;
550 Double_t pt=1./TMath::Abs(fRp[4]);
551 Double_t cs=TMath::Cos(fRalpha), sn=TMath::Sin(fRalpha);
552 Double_t r=TMath::Sqrt(1-fRp[2]*fRp[2]);
554 Double_t m00=-sn, m10=cs;
555 Double_t m23=-pt*(sn + fRp[2]*cs/r), m43=-pt*pt*(r*cs - fRp[2]*sn);
556 Double_t m24= pt*(cs - fRp[2]*sn/r), m44=-pt*pt*(r*sn + fRp[2]*cs);
557 Double_t m35=pt, m45=-pt*pt*fRp[3];
559 cv[0]=fRc[0]*m00*m00;
560 cv[1]=fRc[0]*m00*m10;
561 cv[2]=fRc[0]*m10*m10;
565 cv[6]=m00*(fRc[3]*m23+fRc[10]*m43);
566 cv[7]=m10*(fRc[3]*m23+fRc[10]*m43);
567 cv[8]=fRc[4]*m23+fRc[11]*m43;
568 cv[9]=m23*(fRc[5]*m23+fRc[12]*m43)+m43*(fRc[12]*m23+fRc[14]*m43);
569 cv[10]=m00*(fRc[3]*m24+fRc[10]*m44);
570 cv[11]=m10*(fRc[3]*m24+fRc[10]*m44);
571 cv[12]=fRc[4]*m24+fRc[11]*m44;
572 cv[13]=m23*(fRc[5]*m24+fRc[12]*m44)+m43*(fRc[12]*m24+fRc[14]*m44);
573 cv[14]=m24*(fRc[5]*m24+fRc[12]*m44)+m44*(fRc[12]*m24+fRc[14]*m44);
574 cv[15]=m00*(fRc[6]*m35+fRc[10]*m45);
575 cv[16]=m10*(fRc[6]*m35+fRc[10]*m45);
576 cv[17]=fRc[7]*m35+fRc[11]*m45;
577 cv[18]=m23*(fRc[8]*m35+fRc[12]*m45)+m43*(fRc[13]*m35+fRc[14]*m45);
578 cv[19]=m24*(fRc[8]*m35+fRc[12]*m45)+m44*(fRc[13]*m35+fRc[14]*m45);
579 cv[20]=m35*(fRc[9]*m35+fRc[13]*m45)+m45*(fRc[13]*m35+fRc[14]*m45);
582 Bool_t AliESDtrack::GetInnerPxPyPz(Double_t *p) const {
583 //---------------------------------------------------------------------
584 // This function returns the global track momentum components
585 // af the entrance of the TPC
586 //---------------------------------------------------------------------
587 p[0]=fIp[4]; p[1]=fIp[2]; p[2]=fIp[3];
588 return Local2GlobalMomentum(p,fIalpha);
591 Bool_t AliESDtrack::GetInnerXYZ(Double_t *r) const {
592 //---------------------------------------------------------------------
593 // This function returns the global track position
594 // af the entrance of the TPC
595 //---------------------------------------------------------------------
596 if (fIx==0) return kFALSE;
597 r[0]=fIx; r[1]=fIp[0]; r[2]=fIp[1];
598 return Local2GlobalPosition(r,fIalpha);
601 void AliESDtrack::GetInnerExternalParameters(Double_t &x, Double_t p[5]) const
604 //---------------------------------------------------------------------
605 // This function returns external representation of the track parameters at Inner Layer of TPC
606 //---------------------------------------------------------------------
608 for (Int_t i=0; i<5; i++) p[i]=fIp[i];
610 void AliESDtrack::GetInnerExternalCovariance(Double_t cov[15]) const
613 //---------------------------------------------------------------------
614 // This function returns external representation of the cov. matrix at Inner Layer of TPC
615 //---------------------------------------------------------------------
616 for (Int_t i=0; i<15; i++) cov[i]=fIc[i];
620 void AliESDtrack::GetTRDExternalParameters(Double_t &x, Double_t&alpha, Double_t p[5], Double_t cov[15]) const
623 //this function returns TRD parameters
627 for (Int_t i=0; i<5; i++) p[i]=fTp[i];
628 for (Int_t i=0; i<15; i++) cov[i]=fTc[i];
631 Bool_t AliESDtrack::GetPxPyPzAt(Double_t x,Double_t *p) const {
632 //---------------------------------------------------------------------
633 // This function returns the global track momentum components
634 // at the position "x" using the helix track approximation
635 //---------------------------------------------------------------------
637 p[1]=fRp[2]+(x-fRx)*fRp[4]/AliKalmanTrack::GetConvConst();
639 return Local2GlobalMomentum(p,fRalpha);
642 Bool_t AliESDtrack::GetXYZAt(Double_t x, Double_t *r) const {
643 //---------------------------------------------------------------------
644 // This function returns the global track position
645 // af the radius "x" using the helix track approximation
646 //---------------------------------------------------------------------
648 Double_t f1=fRp[2], f2=f1 + dx*fRp[4]/AliKalmanTrack::GetConvConst();
650 if (TMath::Abs(f2) >= 0.9999) return kFALSE;
652 Double_t r1=TMath::Sqrt(1.- f1*f1), r2=TMath::Sqrt(1.- f2*f2);
654 r[1] = fRp[0] + dx*(f1+f2)/(r1+r2);
655 r[2] = fRp[1] + dx*(f1+f2)/(f1*r2 + f2*r1)*fRp[3];
656 return Local2GlobalPosition(r,fRalpha);
659 //_______________________________________________________________________
660 void AliESDtrack::GetIntegratedTimes(Double_t *times) const {
661 // Returns the array with integrated times for each particle hypothesis
662 for (Int_t i=0; i<AliPID::kSPECIES; i++) times[i]=fTrackTime[i];
665 //_______________________________________________________________________
666 void AliESDtrack::SetIntegratedTimes(const Double_t *times) {
667 // Sets the array with integrated times for each particle hypotesis
668 for (Int_t i=0; i<AliPID::kSPECIES; i++) fTrackTime[i]=times[i];
671 //_______________________________________________________________________
672 void AliESDtrack::SetITSpid(const Double_t *p) {
673 // Sets values for the probability of each particle type (in ITS)
674 for (Int_t i=0; i<AliPID::kSPECIES; i++) fITSr[i]=p[i];
675 SetStatus(AliESDtrack::kITSpid);
678 void AliESDtrack::SetITSChi2MIP(const Float_t *chi2mip){
679 for (Int_t i=0; i<12; i++) fITSchi2MIP[i]=chi2mip[i];
681 //_______________________________________________________________________
682 void AliESDtrack::GetITSpid(Double_t *p) const {
683 // Gets the probability of each particle type (in ITS)
684 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fITSr[i];
687 //_______________________________________________________________________
688 Int_t AliESDtrack::GetITSclusters(UInt_t *idx) const {
689 //---------------------------------------------------------------------
690 // This function returns indices of the assgined ITS clusters
691 //---------------------------------------------------------------------
692 for (Int_t i=0; i<fITSncls; i++) idx[i]=fITSindex[i];
696 //_______________________________________________________________________
697 Int_t AliESDtrack::GetTPCclusters(Int_t *idx) const {
698 //---------------------------------------------------------------------
699 // This function returns indices of the assgined ITS clusters
700 //---------------------------------------------------------------------
702 for (Int_t i=0; i<180; i++) idx[i]=fTPCindex[i]; // MI I prefer some constant
706 //_______________________________________________________________________
707 void AliESDtrack::SetTPCpid(const Double_t *p) {
708 // Sets values for the probability of each particle type (in TPC)
709 for (Int_t i=0; i<AliPID::kSPECIES; i++) fTPCr[i]=p[i];
710 SetStatus(AliESDtrack::kTPCpid);
713 //_______________________________________________________________________
714 void AliESDtrack::GetTPCpid(Double_t *p) const {
715 // Gets the probability of each particle type (in TPC)
716 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTPCr[i];
719 //_______________________________________________________________________
720 Int_t AliESDtrack::GetTRDclusters(UInt_t *idx) const {
721 //---------------------------------------------------------------------
722 // This function returns indices of the assgined TRD clusters
723 //---------------------------------------------------------------------
725 for (Int_t i=0; i<130; i++) idx[i]=fTRDindex[i]; // MI I prefer some constant
729 //_______________________________________________________________________
730 void AliESDtrack::SetTRDpid(const Double_t *p) {
731 // Sets values for the probability of each particle type (in TRD)
732 for (Int_t i=0; i<AliPID::kSPECIES; i++) fTRDr[i]=p[i];
733 SetStatus(AliESDtrack::kTRDpid);
736 //_______________________________________________________________________
737 void AliESDtrack::GetTRDpid(Double_t *p) const {
738 // Gets the probability of each particle type (in TRD)
739 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTRDr[i];
742 //_______________________________________________________________________
743 void AliESDtrack::SetTRDpid(Int_t iSpecies, Float_t p)
745 // Sets the probability of particle type iSpecies to p (in TRD)
749 Float_t AliESDtrack::GetTRDpid(Int_t iSpecies) const
751 // Returns the probability of particle type iSpecies (in TRD)
752 return fTRDr[iSpecies];
755 //_______________________________________________________________________
756 void AliESDtrack::SetTOFpid(const Double_t *p) {
757 // Sets the probability of each particle type (in TOF)
758 for (Int_t i=0; i<AliPID::kSPECIES; i++) fTOFr[i]=p[i];
759 SetStatus(AliESDtrack::kTOFpid);
762 //_______________________________________________________________________
763 void AliESDtrack::SetTOFLabel(const Int_t *p) {
765 for (Int_t i=0; i<3; i++) fTOFLabel[i]=p[i];
768 //_______________________________________________________________________
769 void AliESDtrack::GetTOFpid(Double_t *p) const {
770 // Gets probabilities of each particle type (in TOF)
771 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTOFr[i];
774 //_______________________________________________________________________
775 void AliESDtrack::GetTOFLabel(Int_t *p) const {
777 for (Int_t i=0; i<3; i++) p[i]=fTOFLabel[i];
780 //_______________________________________________________________________
781 void AliESDtrack::GetTOFInfo(Float_t *info) const {
783 for (Int_t i=0; i<10; i++) info[i]=fTOFInfo[i];
786 //_______________________________________________________________________
787 void AliESDtrack::SetTOFInfo(Float_t*info) {
789 for (Int_t i=0; i<10; i++) fTOFInfo[i]=info[i];
794 //_______________________________________________________________________
795 void AliESDtrack::SetPHOSpid(const Double_t *p) {
796 // Sets the probability of each particle type (in PHOS)
797 for (Int_t i=0; i<AliPID::kSPECIESN; i++) fPHOSr[i]=p[i];
798 SetStatus(AliESDtrack::kPHOSpid);
801 //_______________________________________________________________________
802 void AliESDtrack::GetPHOSpid(Double_t *p) const {
803 // Gets probabilities of each particle type (in PHOS)
804 for (Int_t i=0; i<AliPID::kSPECIESN; i++) p[i]=fPHOSr[i];
807 //_______________________________________________________________________
808 void AliESDtrack::SetEMCALpid(const Double_t *p) {
809 // Sets the probability of each particle type (in EMCAL)
810 for (Int_t i=0; i<AliPID::kSPECIESN; i++) fEMCALr[i]=p[i];
811 SetStatus(AliESDtrack::kEMCALpid);
814 //_______________________________________________________________________
815 void AliESDtrack::GetEMCALpid(Double_t *p) const {
816 // Gets probabilities of each particle type (in EMCAL)
817 for (Int_t i=0; i<AliPID::kSPECIESN; i++) p[i]=fEMCALr[i];
820 //_______________________________________________________________________
821 void AliESDtrack::SetRICHpid(const Double_t *p) {
822 // Sets the probability of each particle type (in RICH)
823 for (Int_t i=0; i<AliPID::kSPECIES; i++) fRICHr[i]=p[i];
824 SetStatus(AliESDtrack::kRICHpid);
827 //_______________________________________________________________________
828 void AliESDtrack::GetRICHpid(Double_t *p) const {
829 // Gets probabilities of each particle type (in RICH)
830 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fRICHr[i];
835 //_______________________________________________________________________
836 void AliESDtrack::SetESDpid(const Double_t *p) {
837 // Sets the probability of each particle type for the ESD track
838 for (Int_t i=0; i<AliPID::kSPECIES; i++) fR[i]=p[i];
839 SetStatus(AliESDtrack::kESDpid);
842 //_______________________________________________________________________
843 void AliESDtrack::GetESDpid(Double_t *p) const {
844 // Gets probability of each particle type for the ESD track
845 for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fR[i];
848 //_______________________________________________________________________
849 void AliESDtrack::Print(Option_t *) const {
850 // Prints info on the track
852 printf("ESD track info\n") ;
853 Double_t p[AliPID::kSPECIESN] ;
856 printf("From ITS: ") ;
858 for(index = 0 ; index < AliPID::kSPECIES; index++)
859 printf("%f, ", p[index]) ;
860 printf("\n signal = %f\n", GetITSsignal()) ;
863 printf("From TPC: ") ;
865 for(index = 0 ; index < AliPID::kSPECIES; index++)
866 printf("%f, ", p[index]) ;
867 printf("\n signal = %f\n", GetTPCsignal()) ;
870 printf("From TRD: ") ;
872 for(index = 0 ; index < AliPID::kSPECIES; index++)
873 printf("%f, ", p[index]) ;
874 printf("\n signal = %f\n", GetTRDsignal()) ;
877 printf("From TOF: ") ;
879 for(index = 0 ; index < AliPID::kSPECIES; index++)
880 printf("%f, ", p[index]) ;
881 printf("\n signal = %f\n", GetTOFsignal()) ;
883 if( IsOn(kRICHpid) ){
884 printf("From TOF: ") ;
886 for(index = 0 ; index < AliPID::kSPECIES; index++)
887 printf("%f, ", p[index]) ;
888 printf("\n signal = %f\n", GetRICHsignal()) ;
890 if( IsOn(kPHOSpid) ){
891 printf("From PHOS: ") ;
893 for(index = 0 ; index < AliPID::kSPECIESN; index++)
894 printf("%f, ", p[index]) ;
895 printf("\n signal = %f\n", GetPHOSsignal()) ;
897 if( IsOn(kEMCALpid) ){
898 printf("From EMCAL: ") ;
900 for(index = 0 ; index < AliPID::kSPECIESN; index++)
901 printf("%f, ", p[index]) ;
902 printf("\n signal = %f\n", GetEMCALsignal()) ;