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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////
20 // Handling of the attributes of a reconstructed particle track.
25 // Float_t a[4]={195.,1.2,-0.04,8.5};
27 // pmu.SetVector(a,"car");
29 // t1.Set4Momentum(pmu);
31 // Float_t b[3]={1.2,-0.04,8.5};
33 // p.SetVector(b,"car");
35 // t2.Set3Momentum(p);
42 // Float_t pi=acos(-1.);
43 // Float_t thcms=0.2*pi; // decay theta angle in cms
44 // Float_t phicms=pi/4.; // decay theta angle in cms
47 // t2.Decay(m1,m2,thcms,phicms); // Track t2 decay : Lambda -> proton + pion
51 // Int_t ndec=t2.GetNdecay();
52 // AliTrack* d1=t2.GetDecayTrack(1); // Access to decay track number 1
53 // AliTrack* d2=t2.GetDecayTrack(2); // Access to decay track number 2
55 // AliSignal s1,s2,s3,s4;
57 // .... // Code (e.g. detector readout) to fill AliSignal data
59 // AliTrack trec; // Track which will be reconstructed from signals
60 // trec.AddSignal(s1);
61 // trec.AddSignal(s3);
62 // trec.AddSignal(s4);
67 // ... // Code which accesses signals from trec and reconstructs
68 // 3-momentum P, charge Q, mass M etc...
70 // trec.Set3Momentum(P);
74 // Float_t r1[3]={1.6,-3.8,25.7};
75 // Float_t er1[3]={0.2,0.5,1.8};
76 // Float_t r2[3]={8.6,23.8,-6.7};
77 // Float_t er2[3]={0.93,1.78,0.8};
78 // AliPosition begin,end;
79 // begin.SetPosition(r1,"car");
80 // begin.SetPositionErrors(er1,"car");
81 // end.SetPosition(r2,"car");
82 // end.SetPositionErrors(er2,"car");
83 // trec.SetBeginPoint(begin);
84 // trec.SetEndPoint(end);
86 // Note : All quantities are in GeV, GeV/c or GeV/c**2
88 //--- Author: Nick van Eijndhoven 10-jul-1997 UU-SAP Utrecht
89 //- Modified: NvE $Date$ UU-SAP Utrecht
90 ///////////////////////////////////////////////////////////////////////////
93 #include "Riostream.h"
95 ClassImp(AliTrack) // Class implementation to enable ROOT I/O
97 AliTrack::AliTrack() : TNamed(),Ali4Vector()
99 // Default constructor
100 // All variables initialised to 0
104 ///////////////////////////////////////////////////////////////////////////
105 void AliTrack::Init()
107 // Initialisation of pointers etc...
120 ///////////////////////////////////////////////////////////////////////////
121 AliTrack::~AliTrack()
123 // Destructor to delete memory allocated for decay tracks array.
124 // This destructor automatically cleares the pointer of this AliTrack
125 // from all the link slots of the related AliSignal objects.
127 Int_t nsig=GetNsignals();
128 for (Int_t i=1; i<=nsig; i++)
130 AliSignal* s=GetSignal(i);
131 if (s) s->ResetLinks(this);
186 ///////////////////////////////////////////////////////////////////////////
187 AliTrack::AliTrack(const AliTrack& t) : TNamed(t),Ali4Vector(t)
194 if (t.fBegin) fBegin=new AliPositionObj(*(t.fBegin));
195 if (t.fEnd) fEnd=new AliPositionObj(*(t.fEnd));
196 if (t.fRef) fRef=new AliPositionObj(*(t.fRef));
197 if (t.fImpactXY) fImpactXY=new AliPositionObj(*(t.fImpactXY));
198 if (t.fImpactXZ) fImpactXZ=new AliPositionObj(*(t.fImpactXZ));
199 if (t.fImpactYZ) fImpactYZ=new AliPositionObj(*(t.fImpactYZ));
200 if (t.fClosest) fClosest=new AliPositionObj(*(t.fClosest));
207 Int_t ndec=t.GetNdecay();
210 fDecays=new TObjArray(ndec);
212 for (Int_t it=1; it<=ndec; it++)
214 AliTrack* tx=t.GetDecayTrack(it);
215 fDecays->Add(new AliTrack(*tx));
219 Int_t nsig=t.GetNsignals();
222 fSignals=new TObjArray(nsig);
223 for (Int_t is=1; is<=nsig; is++)
225 AliSignal* sx=t.GetSignal(is);
230 Int_t nhyp=t.GetNhypotheses();
233 fHypotheses=new TObjArray(nhyp);
234 fHypotheses->SetOwner();
235 for (Int_t ih=1; ih<=nhyp; ih++)
237 AliTrack* tx=t.GetTrackHypothesis(ih);
238 fHypotheses->Add(new AliTrack(*tx));
242 ///////////////////////////////////////////////////////////////////////////
243 void AliTrack::Reset()
245 // Reset all variables to 0 and delete all auto-generated decay tracks.
252 Double_t a[4]={0,0,0,0};
307 ///////////////////////////////////////////////////////////////////////////
308 void AliTrack::Set3Momentum(Ali3Vector& p)
310 // Set the track parameters according to the 3-momentum p.
311 // In case the mass was not yet set, the energy is set to correspond to m=0.
313 Double_t inv=GetInvariant();
314 if (inv<0) SetMass(0.);
316 ///////////////////////////////////////////////////////////////////////////
317 void AliTrack::Set4Momentum(Ali4Vector& p)
319 // Set the track parameters according to the 4-momentum p
320 Double_t E=p.GetScalar();
321 Double_t dE=p.GetResultError();
322 Ali3Vector pv=p.Get3Vector();
326 ///////////////////////////////////////////////////////////////////////////
327 void AliTrack::SetMass(Double_t m,Double_t dm)
329 // Set the particle mass
330 // The default value for the error dm is 0.
331 Double_t inv=pow(m,2);
332 Double_t dinv=fabs(2.*m*dm);
333 SetInvariant(inv,dinv);
335 ///////////////////////////////////////////////////////////////////////////
336 void AliTrack::SetCharge(Float_t q)
338 // Set the particle charge
341 ///////////////////////////////////////////////////////////////////////////
342 void AliTrack::Data(TString f)
344 // Provide track information within the coordinate frame f
345 Double_t m=GetMass();
346 Double_t dm=GetResultError();
347 const char* name=GetName();
348 const char* title=GetTitle();
350 cout << " *" << ClassName() << "::Data*";
351 if (strlen(name)) cout << " Name : " << GetName();
352 if (strlen(title)) cout << " Title : " << GetTitle();
354 cout << " Id : " << fUserId << " Code : " << fCode
355 << " m : " << m << " dm : " << dm << " Charge : " << fQ
356 << " p : " << GetMomentum() << endl;
357 cout << " Nhypotheses : " << GetNhypotheses() << " Ndecay-tracks : " << GetNdecay()
358 << " Nsignals : " << GetNsignals() << endl;
361 ///////////////////////////////////////////////////////////////////////////
362 void AliTrack::List(TString f)
364 // Provide current track and decay level 1 information within coordinate frame f
366 Data(f); // Information of the current track
368 // Decay products of this track
370 for (Int_t id=1; id<=GetNdecay(); id++)
372 td=GetDecayTrack(id);
375 cout << " ---Level 1 sec. track no. " << id << endl;
380 cout << " *AliTrack::List* Error : Empty decay track slot." << endl;
384 ///////////////////////////////////////////////////////////////////////////
385 void AliTrack::ListAll(TString f)
387 // Provide complete track and decay information within the coordinate frame f
389 Data(f); // Information of the current track
390 if (fBegin) { cout << " Begin-point :"; fBegin->Data(f); }
391 if (fEnd) { cout << " End-point :"; fEnd->Data(f); }
392 if (fRef) { cout << " Ref-point :"; fRef->Data(f); }
394 Int_t nhyp=GetNhypotheses();
397 cout << " List of the " << nhyp << " track hypotheses : " << endl;
398 for (Int_t ih=1; ih<=nhyp; ih++)
400 AliTrack* tx=GetTrackHypothesis(ih);
405 Int_t nsig=GetNsignals();
408 cout << " List of the corresponding slots for the " << nsig
409 << " related signals : " << endl;
413 for (Int_t is=1; is<=nsig; is++)
415 AliSignal* sx=GetSignal(is);
418 nrefs=sx->GetIndices(this,slotarr,0);
419 for (Int_t jref=0; jref<nrefs; jref++)
421 jslot=slotarr.At(jref);
432 Dumps(t,1,f); // Information of all decay products
434 //////////////////////////////////////////////////////////////////////////
435 void AliTrack::Dumps(AliTrack* t,Int_t n,TString f)
437 // Recursively provide the info of all decay levels of this track
439 for (Int_t id=1; id<=t->GetNdecay(); id++)
441 td=t->GetDecayTrack(id);
444 cout << " ---Level " << n << " sec. track no. " << id << endl;
447 Int_t nhyp=td->GetNhypotheses();
450 cout << " List of the " << nhyp << " track hypotheses : " << endl;
451 for (Int_t ih=1; ih<=nhyp; ih++)
453 AliTrack* tx=td->GetTrackHypothesis(ih);
458 Int_t nsig=td->GetNsignals();
461 cout << " List of the " << nsig << " related signals : " << endl;
462 for (Int_t is=1; is<=nsig; is++)
464 AliSignal* sx=td->GetSignal(is);
469 // Go for next decay level of this decay track recursively
474 cout << " *AliTrack::Dumps* Error : Empty decay track slot." << endl;
478 //////////////////////////////////////////////////////////////////////////
479 Double_t AliTrack::GetMomentum()
481 // Provide the value of the track 3-momentum.
482 // The error can be obtained by invoking GetResultError() after
483 // invokation of GetMomentum().
484 Double_t norm=fV.GetNorm();
485 fDresult=fV.GetResultError();
488 ///////////////////////////////////////////////////////////////////////////
489 Ali3Vector AliTrack::Get3Momentum() const
491 // Provide the track 3-momentum
492 return (Ali3Vector)Get3Vector();
494 ///////////////////////////////////////////////////////////////////////////
495 Double_t AliTrack::GetMass()
497 // Provide the particle mass.
498 // The error can be obtained by invoking GetResultError() after
499 // invokation of GetMass().
500 Double_t inv=GetInvariant();
501 Double_t dinv=GetResultError();
505 Double_t m=sqrt(inv);
506 if (m) dm=dinv/(2.*m);
512 cout << "*AliTrack::GetMass* Unphysical situation m**2 = " << inv << endl;
513 cout << " Value 0 will be returned." << endl;
518 ///////////////////////////////////////////////////////////////////////////
519 Float_t AliTrack::GetCharge() const
521 // Provide the particle charge
524 ///////////////////////////////////////////////////////////////////////////
525 Double_t AliTrack::GetEnergy()
527 // Provide the particle's energy.
528 // The error can be obtained by invoking GetResultError() after
529 // invokation of GetEnergy().
530 Double_t E=GetScalar();
537 cout << "*AliTrack::GetEnergy* Unphysical situation E = " << E << endl;
538 cout << " Value 0 will be returned." << endl;
542 ///////////////////////////////////////////////////////////////////////////
543 void AliTrack::Decay(Double_t m1,Double_t m2,Double_t thcms,Double_t phicms)
545 // Perform 2-body decay of current track
546 // m1 : mass of decay product 1
547 // m2 : mass of decay product 2
548 // thcms : cms theta decay angle (in rad.) of m1
549 // phicms : cms phi decay angle (in rad.) of m1
551 Double_t M=GetMass();
553 // Compute the 4-momenta of the decay products in the cms
554 // Note : p2=p1=pnorm for a 2-body decay
556 if (M) e1=((M*M)+(m1*m1)-(m2*m2))/(2.*M);
558 if (M) e2=((M*M)+(m2*m2)-(m1*m1))/(2.*M);
559 Double_t pnorm=(e1*e1)-(m1*m1);
574 p.SetVector(a,"sph");
577 pprim1.SetVector(e1,p);
578 pprim1.SetInvariant(m1*m1);
582 pprim2.SetVector(e2,p);
583 pprim2.SetInvariant(m2*m2);
585 // Determine boost parameters from the parent particle
586 Double_t E=GetEnergy();
594 Ali4Vector p1=q.Inverse(pprim1); // Boost decay product 1
595 Ali4Vector p2=q.Inverse(pprim2); // Boost decay product 2
597 // Enter the boosted data into the decay tracks array
603 fDecays=new TObjArray(2);
606 fDecays->Add(new AliTrack);
607 ((AliTrack*)fDecays->At(0))->Set4Momentum(p1);
608 ((AliTrack*)fDecays->At(0))->SetMass(m1);
609 fDecays->Add(new AliTrack);
610 ((AliTrack*)fDecays->At(1))->Set4Momentum(p2);
611 ((AliTrack*)fDecays->At(1))->SetMass(m2);
613 ///////////////////////////////////////////////////////////////////////////
614 Int_t AliTrack::GetNdecay() const
616 // Provide the number of decay produced tracks
618 if (fDecays) ndec=fDecays->GetEntries();
621 ///////////////////////////////////////////////////////////////////////////
622 AliTrack* AliTrack::GetDecayTrack(Int_t j) const
624 // Provide decay produced track number j
625 // Note : j=1 denotes the first decay track
628 cout << " *AliTrack::GetDecayTrack* No tracks present." << endl;
633 if ((j >= 1) && (j <= GetNdecay()))
635 return (AliTrack*)fDecays->At(j-1);
639 cout << " *AliTrack* decay track number : " << j << " out of range."
640 << " Ndec = " << GetNdecay() << endl;
645 ///////////////////////////////////////////////////////////////////////////
646 void AliTrack::RemoveDecays()
648 // Remove all decay tracks from this track.
655 ///////////////////////////////////////////////////////////////////////////
656 void AliTrack::AddSignal(AliSignal& s)
658 // Relate an AliSignal object to this track.
659 if (!fSignals) fSignals=new TObjArray(1);
661 // Check if this signal is already stored for this track
662 Int_t nsig=GetNsignals();
663 for (Int_t i=0; i<nsig; i++)
665 if (&s==fSignals->At(i)) return;
670 ///////////////////////////////////////////////////////////////////////////
671 void AliTrack::RemoveSignal(AliSignal& s)
673 // Remove related AliSignal object from this track.
676 AliSignal* test=(AliSignal*)fSignals->Remove(&s);
677 if (test) fSignals->Compress();
680 ///////////////////////////////////////////////////////////////////////////
681 void AliTrack::RemoveSignals()
683 // Remove all related AliSignal objects from this track.
691 ///////////////////////////////////////////////////////////////////////////
692 Int_t AliTrack::GetNsignals() const
694 // Provide the number of related AliSignals.
696 if (fSignals) nsig=fSignals->GetEntries();
699 ///////////////////////////////////////////////////////////////////////////
700 AliSignal* AliTrack::GetSignal(Int_t j) const
702 // Provide the related AliSignal number j.
703 // Note : j=1 denotes the first signal.
706 cout << " *AliTrack::GetSignal* No signals present." << endl;
711 if ((j >= 1) && (j <= GetNsignals()))
713 return (AliSignal*)fSignals->At(j-1);
717 cout << " *AliTrack* signal number : " << j << " out of range."
718 << " Nsig = " << GetNsignals() << endl;
723 ///////////////////////////////////////////////////////////////////////////
724 void AliTrack::AddTrackHypothesis(AliTrack& t)
726 // Relate a track hypothesis to this track.
727 // Note : a private copy of the input track will be made via the Clone()
731 fHypotheses=new TObjArray(1);
732 fHypotheses->SetOwner();
734 fHypotheses->Add(t.Clone());
736 ///////////////////////////////////////////////////////////////////////////
737 void AliTrack::AddTrackHypothesis(Double_t prob,Double_t m,Double_t dm)
739 // Add a track hypothesis by explicitly setting the mass and probability.
740 // This will affect e.g. the hypothesis track's energy, since the momentum
741 // and all other attributes will be copied from the current track.
745 // prob=probalility m=mass value dm=error on the mass value.
746 // The default value for the mass error dm is 0.
750 t.RemoveTrackHypotheses();
752 t.SetTitle("Mass hypothesis");
755 AddTrackHypothesis(t);
757 ///////////////////////////////////////////////////////////////////////////
758 void AliTrack::RemoveTrackHypothesis(AliTrack& t)
760 // Remove the specified track hypothesis from this track.
763 AliTrack* test=(AliTrack*)fHypotheses->Remove(&t);
764 if (test) fHypotheses->Compress();
767 ///////////////////////////////////////////////////////////////////////////
768 void AliTrack::RemoveTrackHypotheses()
770 // Remove all track hypotheses from this track.
777 ///////////////////////////////////////////////////////////////////////////
778 Int_t AliTrack::GetNhypotheses() const
780 // Provide the number of track hypotheses.
782 if (fHypotheses) nhyp=fHypotheses->GetEntries();
785 ///////////////////////////////////////////////////////////////////////////
786 AliTrack* AliTrack::GetTrackHypothesis(Int_t j) const
788 // Provide the j-th track hypothesis.
789 // Note : j=1 denotes the first hypothesis.
790 // Default : j=0 ==> Hypothesis with highest probability.
792 if (!fHypotheses) return 0;
794 Int_t nhyp=GetNhypotheses();
796 // Check validity of index j
799 cout << " *AliTrack* hypothesis number : " << j << " out of range."
800 << " Nhyp = " << nhyp << endl;
806 if (j==0) // Provide track hypothesis with highest probability
809 t=(AliTrack*)fHypotheses->At(0);
810 if (t) prob=t->GetProb();
812 for (Int_t ih=1; ih<nhyp; ih++)
814 AliTrack* tx=(AliTrack*)fHypotheses->At(ih);
818 if (probx > prob) t=tx;
823 else // Provide requested j-th track hypothesis
825 return (AliTrack*)fHypotheses->At(j-1);
828 ///////////////////////////////////////////////////////////////////////////
829 void AliTrack::SetBeginPoint(AliPosition& p)
831 // Store the position of the track begin-point.
834 fBegin=new AliPositionObj(p);
841 ///////////////////////////////////////////////////////////////////////////
842 AliPosition* AliTrack::GetBeginPoint()
844 // Provide the position of the track begin-point.
847 ///////////////////////////////////////////////////////////////////////////
848 void AliTrack::SetEndPoint(AliPosition& p)
850 // Store the position of the track end-point.
853 fEnd=new AliPositionObj(p);
860 ///////////////////////////////////////////////////////////////////////////
861 AliPosition* AliTrack::GetEndPoint()
863 // Provide the position of the track end-point.
866 ///////////////////////////////////////////////////////////////////////////
867 void AliTrack::SetReferencePoint(AliPosition& p)
869 // Store the position of the track reference-point.
870 // The reference-point is the point on the track in which the
871 // 3-momentum vector components have been defined.
872 // This reference point is the preferable point to start track extrapolations
873 // etc... which are sensitive to the components of the 3-momentum vector.
876 fRef=new AliPositionObj(p);
883 ///////////////////////////////////////////////////////////////////////////
884 AliPosition* AliTrack::GetReferencePoint()
886 // Provide the position of the track reference-point.
887 // The reference-point is the point on the track in which the
888 // 3-momentum vector components have been defined.
889 // This reference point is the preferable point to start track extrapolations
890 // etc... which are sensitive to the components of the 3-momentum vector.
893 ///////////////////////////////////////////////////////////////////////////
894 void AliTrack::SetMass()
896 // Set the mass and error to the value of the hypothesis with highest prob.
900 // Select mass hypothesis with highest probability
901 AliTrack* t=GetTrackHypothesis(0);
905 dm=t->GetResultError();
910 cout << " *AliTrack::SetMass()* No hypothesis present => No action." << endl;
913 ///////////////////////////////////////////////////////////////////////////
914 Double_t AliTrack::GetPt()
916 // Provide trans. momentum value w.r.t. z-axis.
917 // The error on the value can be obtained by GetResultError()
918 // after invokation of GetPt().
921 Double_t norm=v.GetNorm();
922 fDresult=v.GetResultError();
926 ///////////////////////////////////////////////////////////////////////////
927 Double_t AliTrack::GetPl()
929 // Provide long. momentum value w.r.t. z-axis.
930 // Note : the returned value can also be negative.
931 // The error on the value can be obtained by GetResultError()
932 // after invokation of GetPl().
936 Double_t pl=v.GetNorm();
937 fDresult=v.GetResultError();
940 v.GetVector(a,"sph");
941 if (cos(a[1])<0) pl=-pl;
945 ///////////////////////////////////////////////////////////////////////////
946 Double_t AliTrack::GetEt()
948 // Provide trans. energy value w.r.t. z-axis.
949 // The error on the value can be obtained by GetResultError()
950 // after invokation of GetEt().
951 Double_t et=GetScaTrans();
955 ///////////////////////////////////////////////////////////////////////////
956 Double_t AliTrack::GetEl()
958 // Provide long. energy value w.r.t. z-axis.
959 // Note : the returned value can also be negative.
960 // The error on the value can be obtained by GetResultError()
961 // after invokation of GetEl().
962 Double_t el=GetScaLong();
966 ///////////////////////////////////////////////////////////////////////////
967 Double_t AliTrack::GetMt()
969 // Provide transverse mass value w.r.t. z-axis.
970 // The error on the value can be obtained by GetResultError()
971 // after invokation of GetMt().
973 Double_t dpt=GetResultError();
974 Double_t m=GetMass();
975 Double_t dm=GetResultError();
977 Double_t mt=sqrt(pt*pt+m*m);
979 if (mt) dmt2=(pow((pt*dpt),2)+pow((m*dm),2))/(mt*mt);
984 ///////////////////////////////////////////////////////////////////////////
985 Double_t AliTrack::GetRapidity()
987 // Provide rapidity value w.r.t. z-axis.
988 // The error on the value can be obtained by GetResultError()
989 // after invokation of GetRapidity().
990 // Note : Also GetPseudoRapidity() is available since this class is
991 // derived from Ali4Vector.
992 Double_t e=GetEnergy();
993 Double_t de=GetResultError();
995 Double_t dpl=GetResultError();
999 Double_t y=9999,dy2=0;
1000 if (sum && dif) y=0.5*log(sum/dif);
1002 if (sum*dif) dy2=(1./(sum*dif))*(pow((pl*de),2)+pow((e*dpl),2));
1007 ///////////////////////////////////////////////////////////////////////////
1008 void AliTrack::SetImpactPoint(AliPosition& p,TString q)
1010 // Store the position of the impact-point in the plane "q=0".
1011 // Here q denotes one of the axes X, Y or Z.
1012 // Note : The character to denote the axis may be entered in lower or
1015 if (q=="x" || q=="X") axis=1;
1016 if (q=="y" || q=="Y") axis=2;
1017 if (q=="z" || q=="Z") axis=3;
1021 case 1: // Impact-point in the plane X=0
1024 fImpactYZ=new AliPositionObj(p);
1032 case 2: // Impact-point in the plane Y=0
1035 fImpactXZ=new AliPositionObj(p);
1043 case 3: // Impact-point in the plane Z=0
1046 fImpactXY=new AliPositionObj(p);
1054 default: // Unsupported axis
1055 cout << "*AliTrack::SetImpactPoint* Unsupported axis : " << q << endl
1056 << " Possible axes are 'X', 'Y' and 'Z'." << endl;
1060 ///////////////////////////////////////////////////////////////////////////
1061 AliPosition* AliTrack::GetImpactPoint(TString q)
1063 // Provide the position of the impact-point in the plane "q=0".
1064 // Here q denotes one of the axes X, Y or Z.
1065 // Note : The character to denote the axis may be entered in lower or
1068 if (q=="x" || q=="X") axis=1;
1069 if (q=="y" || q=="Y") axis=2;
1070 if (q=="z" || q=="Z") axis=3;
1074 case 1: // Impact-point in the plane X=0
1077 case 2: // Impact-point in the plane Y=0
1080 case 3: // Impact-point in the plane Z=0
1083 default: // Unsupported axis
1084 cout << "*AliTrack::GetImpactPoint* Unsupported axis : " << q << endl
1085 << " Possible axes are 'X', 'Y' and 'Z'." << endl;
1089 ///////////////////////////////////////////////////////////////////////////
1090 void AliTrack::SetId(Int_t id)
1092 // Set a user defined unique identifier for this track.
1095 ///////////////////////////////////////////////////////////////////////////
1096 Int_t AliTrack::GetId() const
1098 // Provide the user defined unique identifier of this track.
1101 ///////////////////////////////////////////////////////////////////////////
1102 void AliTrack::SetClosestPoint(AliPosition& p)
1104 // Set position p as the point of closest approach w.r.t. some reference
1107 fClosest=new AliPositionObj(p);
1114 ///////////////////////////////////////////////////////////////////////////
1115 AliPosition* AliTrack::GetClosestPoint()
1117 // Provide the point of closest approach w.r.t. some reference
1120 ///////////////////////////////////////////////////////////////////////////
1121 void AliTrack::SetChi2(Float_t chi2)
1123 // Set the chi-squared value of the track fit.
1126 cout << " *AliTrack::SetChi2* Invalid chi2 value : " << chi2 << endl;
1133 ///////////////////////////////////////////////////////////////////////////
1134 void AliTrack::SetNdf(Int_t ndf)
1136 // Set the number of degrees of freedom for the track fit.
1139 cout << " *AliTrack::SetNdf* Invalid ndf value : " << ndf << endl;
1146 ///////////////////////////////////////////////////////////////////////////
1147 Float_t AliTrack::GetChi2() const
1149 // Provide the chi-squared value of the track fit.
1152 ///////////////////////////////////////////////////////////////////////////
1153 Int_t AliTrack::GetNdf() const
1155 // Provide the number of degrees of freedom for the track fit.
1158 ///////////////////////////////////////////////////////////////////////////
1159 void AliTrack::SetParticleCode(Int_t code)
1161 // Set the user defined particle id code (e.g. the PDF convention).
1164 ///////////////////////////////////////////////////////////////////////////
1165 Int_t AliTrack::GetParticleCode() const
1167 // Provide the user defined particle id code.
1170 ///////////////////////////////////////////////////////////////////////////
1171 void AliTrack::SetParentTrack(AliTrack* t)
1173 // Set pointer to the parent track.
1176 ///////////////////////////////////////////////////////////////////////////
1177 AliTrack* AliTrack::GetParentTrack()
1179 // Provide pointer to the parent track.
1182 ///////////////////////////////////////////////////////////////////////////
1183 void AliTrack::SetProb(Double_t prob)
1185 // Set hypothesis probability for this track.
1188 ///////////////////////////////////////////////////////////////////////////
1189 Float_t AliTrack::GetProb() const
1191 // Provide the hypothesis probability for this track.
1194 ///////////////////////////////////////////////////////////////////////////
1195 TObject* AliTrack::Clone(const char* name) const
1197 // Make a deep copy of the current object and provide the pointer to the copy.
1198 // This memberfunction enables automatic creation of new objects of the
1199 // correct type depending on the object type, a feature which may be very useful
1200 // for containers when adding objects in case the container owns the objects.
1201 // This feature allows e.g. AliJet to store either AliTrack objects or
1202 // objects derived from AliTrack via the AddTrack memberfunction, provided
1203 // these derived classes also have a proper Clone memberfunction.
1205 AliTrack* trk=new AliTrack(*this);
1208 if (strlen(name)) trk->SetName(name);
1212 ///////////////////////////////////////////////////////////////////////////