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...
121 ///////////////////////////////////////////////////////////////////////////
122 AliTrack::~AliTrack()
124 // Destructor to delete memory allocated for decay tracks array.
125 // This destructor automatically cleares the pointer of this AliTrack
126 // from all the link slots of the related AliSignal objects.
128 Int_t nsig=GetNsignals();
129 for (Int_t i=1; i<=nsig; i++)
131 AliSignal* s=GetSignal(i);
132 if (s) s->ResetLinks(this);
192 ///////////////////////////////////////////////////////////////////////////
193 AliTrack::AliTrack(const AliTrack& t) : TNamed(t),Ali4Vector(t)
200 if (t.fBegin) fBegin=new AliPositionObj(*(t.fBegin));
201 if (t.fEnd) fEnd=new AliPositionObj(*(t.fEnd));
202 if (t.fRef) fRef=new AliPositionObj(*(t.fRef));
203 if (t.fImpactXY) fImpactXY=new AliPositionObj(*(t.fImpactXY));
204 if (t.fImpactXZ) fImpactXZ=new AliPositionObj(*(t.fImpactXZ));
205 if (t.fImpactYZ) fImpactYZ=new AliPositionObj(*(t.fImpactYZ));
206 if (t.fClosest) fClosest=new AliPositionObj(*(t.fClosest));
207 if (t.fFit) fFit=t.fFit->Clone();
214 Int_t ndec=t.GetNdecay();
217 fDecays=new TObjArray(ndec);
219 for (Int_t it=1; it<=ndec; it++)
221 AliTrack* tx=t.GetDecayTrack(it);
222 fDecays->Add(new AliTrack(*tx));
226 Int_t nsig=t.GetNsignals();
229 fSignals=new TObjArray(nsig);
230 for (Int_t is=1; is<=nsig; is++)
232 AliSignal* sx=t.GetSignal(is);
237 Int_t nhyp=t.GetNhypotheses();
240 fHypotheses=new TObjArray(nhyp);
241 fHypotheses->SetOwner();
242 for (Int_t ih=1; ih<=nhyp; ih++)
244 AliTrack* tx=t.GetTrackHypothesis(ih);
245 fHypotheses->Add(new AliTrack(*tx));
249 ///////////////////////////////////////////////////////////////////////////
250 void AliTrack::Reset()
252 // Reset all variables to 0 and delete all auto-generated decay tracks.
259 Double_t a[4]={0,0,0,0};
319 ///////////////////////////////////////////////////////////////////////////
320 void AliTrack::Set3Momentum(Ali3Vector& p)
322 // Set the track parameters according to the 3-momentum p.
323 // In case the mass was not yet set, the energy is set to correspond to m=0.
325 Double_t inv=GetInvariant();
326 if (inv<0) SetMass(0.);
328 ///////////////////////////////////////////////////////////////////////////
329 void AliTrack::Set4Momentum(Ali4Vector& p)
331 // Set the track parameters according to the 4-momentum p
332 Double_t E=p.GetScalar();
333 Double_t dE=p.GetResultError();
334 Ali3Vector pv=p.Get3Vector();
338 ///////////////////////////////////////////////////////////////////////////
339 void AliTrack::SetMass(Double_t m,Double_t dm)
341 // Set the particle mass
342 // The default value for the error dm is 0.
343 Double_t inv=pow(m,2);
344 Double_t dinv=fabs(2.*m*dm);
345 SetInvariant(inv,dinv);
347 ///////////////////////////////////////////////////////////////////////////
348 void AliTrack::SetCharge(Float_t q)
350 // Set the particle charge
353 ///////////////////////////////////////////////////////////////////////////
354 void AliTrack::Data(TString f)
356 // Provide track information within the coordinate frame f
357 Double_t m=GetMass();
358 Double_t dm=GetResultError();
359 const char* name=GetName();
360 const char* title=GetTitle();
362 cout << " *" << ClassName() << "::Data*";
363 if (strlen(name)) cout << " Name : " << name;
364 if (strlen(title)) cout << " Title : " << title;
366 cout << " Id : " << fUserId << " Code : " << fCode
367 << " m : " << m << " dm : " << dm << " Charge : " << fQ
368 << " p : " << GetMomentum() << endl;
369 cout << " Nhypotheses : " << GetNhypotheses() << " Ndecay-tracks : " << GetNdecay()
370 << " Nsignals : " << GetNsignals() << endl;
373 cout << " Parent track Id : " << fParent->GetId() << " Code : " << fParent->GetParticleCode()
374 << " m : " << fParent->GetMass() << " Q : " << fParent->GetCharge()
375 << " p : " << fParent->GetMomentum();
376 const char* pname=fParent->GetName();
377 const char* ptitle=fParent->GetTitle();
378 if (strlen(pname)) cout << " Name : " << pname;
379 if (strlen(ptitle)) cout << " Title : " << ptitle;
384 cout << " Fit details present in object of class " << fFit->ClassName() << endl;
385 if (fFit->InheritsFrom("AliSignal")) ((AliSignal*)fFit)->List(-1);
389 ///////////////////////////////////////////////////////////////////////////
390 void AliTrack::List(TString f)
392 // Provide current track and decay level 1 information within coordinate frame f
394 Data(f); // Information of the current track
396 // Decay products of this track
398 for (Int_t id=1; id<=GetNdecay(); id++)
400 td=GetDecayTrack(id);
403 cout << " ---Level 1 sec. track no. " << id << endl;
408 cout << " *AliTrack::List* Error : Empty decay track slot." << endl;
412 ///////////////////////////////////////////////////////////////////////////
413 void AliTrack::ListAll(TString f)
415 // Provide complete track and decay information within the coordinate frame f
417 Data(f); // Information of the current track
418 if (fBegin) { cout << " Begin-point :"; fBegin->Data(f); }
419 if (fEnd) { cout << " End-point :"; fEnd->Data(f); }
420 if (fRef) { cout << " Ref-point :"; fRef->Data(f); }
422 Int_t nhyp=GetNhypotheses();
425 cout << " List of the " << nhyp << " track hypotheses : " << endl;
426 for (Int_t ih=1; ih<=nhyp; ih++)
428 AliTrack* tx=GetTrackHypothesis(ih);
433 Int_t nsig=GetNsignals();
436 cout << " List of the corresponding slots for the " << nsig
437 << " related signals : " << endl;
441 for (Int_t is=1; is<=nsig; is++)
443 AliSignal* sx=GetSignal(is);
446 nrefs=sx->GetIndices(this,slotarr,0);
447 for (Int_t jref=0; jref<nrefs; jref++)
449 jslot=slotarr.At(jref);
460 Dumps(t,1,f); // Information of all decay products
462 //////////////////////////////////////////////////////////////////////////
463 void AliTrack::Dumps(AliTrack* t,Int_t n,TString f)
465 // Recursively provide the info of all decay levels of this track
467 for (Int_t id=1; id<=t->GetNdecay(); id++)
469 td=t->GetDecayTrack(id);
472 cout << " ---Level " << n << " sec. track no. " << id << endl;
475 Int_t nhyp=td->GetNhypotheses();
478 cout << " List of the " << nhyp << " track hypotheses : " << endl;
479 for (Int_t ih=1; ih<=nhyp; ih++)
481 AliTrack* tx=td->GetTrackHypothesis(ih);
486 Int_t nsig=td->GetNsignals();
489 cout << " List of the " << nsig << " related signals : " << endl;
490 for (Int_t is=1; is<=nsig; is++)
492 AliSignal* sx=td->GetSignal(is);
497 // Go for next decay level of this decay track recursively
502 cout << " *AliTrack::Dumps* Error : Empty decay track slot." << endl;
506 //////////////////////////////////////////////////////////////////////////
507 Double_t AliTrack::GetMomentum()
509 // Provide the value of the track 3-momentum.
510 // The error can be obtained by invoking GetResultError() after
511 // invokation of GetMomentum().
512 Double_t norm=fV.GetNorm();
513 fDresult=fV.GetResultError();
516 ///////////////////////////////////////////////////////////////////////////
517 Ali3Vector AliTrack::Get3Momentum() const
519 // Provide the track 3-momentum
520 return (Ali3Vector)Get3Vector();
522 ///////////////////////////////////////////////////////////////////////////
523 Double_t AliTrack::GetMass()
525 // Provide the particle mass.
526 // The error can be obtained by invoking GetResultError() after
527 // invokation of GetMass().
528 Double_t inv=GetInvariant();
529 Double_t dinv=GetResultError();
533 Double_t m=sqrt(inv);
534 if (m) dm=dinv/(2.*m);
540 cout << "*AliTrack::GetMass* Unphysical situation m**2 = " << inv << endl;
541 cout << " Value 0 will be returned." << endl;
546 ///////////////////////////////////////////////////////////////////////////
547 Float_t AliTrack::GetCharge() const
549 // Provide the particle charge
552 ///////////////////////////////////////////////////////////////////////////
553 Double_t AliTrack::GetEnergy()
555 // Provide the particle's energy.
556 // The error can be obtained by invoking GetResultError() after
557 // invokation of GetEnergy().
558 Double_t E=GetScalar();
565 cout << "*AliTrack::GetEnergy* Unphysical situation E = " << E << endl;
566 cout << " Value 0 will be returned." << endl;
570 ///////////////////////////////////////////////////////////////////////////
571 void AliTrack::Decay(Double_t m1,Double_t m2,Double_t thcms,Double_t phicms)
573 // Perform 2-body decay of current track
574 // m1 : mass of decay product 1
575 // m2 : mass of decay product 2
576 // thcms : cms theta decay angle (in rad.) of m1
577 // phicms : cms phi decay angle (in rad.) of m1
579 Double_t M=GetMass();
581 // Compute the 4-momenta of the decay products in the cms
582 // Note : p2=p1=pnorm for a 2-body decay
584 if (M) e1=((M*M)+(m1*m1)-(m2*m2))/(2.*M);
586 if (M) e2=((M*M)+(m2*m2)-(m1*m1))/(2.*M);
587 Double_t pnorm=(e1*e1)-(m1*m1);
602 p.SetVector(a,"sph");
605 pprim1.SetVector(e1,p);
606 pprim1.SetInvariant(m1*m1);
610 pprim2.SetVector(e2,p);
611 pprim2.SetInvariant(m2*m2);
613 // Determine boost parameters from the parent particle
614 Double_t E=GetEnergy();
622 Ali4Vector p1=q.Inverse(pprim1); // Boost decay product 1
623 Ali4Vector p2=q.Inverse(pprim2); // Boost decay product 2
625 // Enter the boosted data into the decay tracks array
631 fDecays=new TObjArray(2);
634 fDecays->Add(new AliTrack);
635 ((AliTrack*)fDecays->At(0))->Set4Momentum(p1);
636 ((AliTrack*)fDecays->At(0))->SetMass(m1);
637 fDecays->Add(new AliTrack);
638 ((AliTrack*)fDecays->At(1))->Set4Momentum(p2);
639 ((AliTrack*)fDecays->At(1))->SetMass(m2);
641 ///////////////////////////////////////////////////////////////////////////
642 Int_t AliTrack::GetNdecay() const
644 // Provide the number of decay produced tracks
646 if (fDecays) ndec=fDecays->GetEntries();
649 ///////////////////////////////////////////////////////////////////////////
650 AliTrack* AliTrack::GetDecayTrack(Int_t j) const
652 // Provide decay produced track number j
653 // Note : j=1 denotes the first decay track
656 cout << " *AliTrack::GetDecayTrack* No tracks present." << endl;
661 if ((j >= 1) && (j <= GetNdecay()))
663 return (AliTrack*)fDecays->At(j-1);
667 cout << " *AliTrack* decay track number : " << j << " out of range."
668 << " Ndec = " << GetNdecay() << endl;
673 ///////////////////////////////////////////////////////////////////////////
674 void AliTrack::RemoveDecays()
676 // Remove all decay tracks from this track.
683 ///////////////////////////////////////////////////////////////////////////
684 void AliTrack::AddSignal(AliSignal& s)
686 // Relate an AliSignal object to this track.
687 if (!fSignals) fSignals=new TObjArray(1);
689 // Check if this signal is already stored for this track
690 Int_t nsig=GetNsignals();
691 for (Int_t i=0; i<nsig; i++)
693 if (&s==fSignals->At(i)) return;
698 ///////////////////////////////////////////////////////////////////////////
699 void AliTrack::RemoveSignal(AliSignal& s)
701 // Remove related AliSignal object from this track.
704 AliSignal* test=(AliSignal*)fSignals->Remove(&s);
705 if (test) fSignals->Compress();
708 ///////////////////////////////////////////////////////////////////////////
709 void AliTrack::RemoveSignals()
711 // Remove all related AliSignal objects from this track.
719 ///////////////////////////////////////////////////////////////////////////
720 Int_t AliTrack::GetNsignals() const
722 // Provide the number of related AliSignals.
724 if (fSignals) nsig=fSignals->GetEntries();
727 ///////////////////////////////////////////////////////////////////////////
728 AliSignal* AliTrack::GetSignal(Int_t j) const
730 // Provide the related AliSignal number j.
731 // Note : j=1 denotes the first signal.
734 cout << " *AliTrack::GetSignal* No signals present." << endl;
739 if ((j >= 1) && (j <= GetNsignals()))
741 return (AliSignal*)fSignals->At(j-1);
745 cout << " *AliTrack* signal number : " << j << " out of range."
746 << " Nsig = " << GetNsignals() << endl;
751 ///////////////////////////////////////////////////////////////////////////
752 void AliTrack::AddTrackHypothesis(AliTrack& t)
754 // Relate a track hypothesis to this track.
755 // Note : a private copy of the input track will be made via the Clone()
759 fHypotheses=new TObjArray(1);
760 fHypotheses->SetOwner();
762 fHypotheses->Add(t.Clone());
764 ///////////////////////////////////////////////////////////////////////////
765 void AliTrack::AddTrackHypothesis(Double_t prob,Double_t m,Double_t dm)
767 // Add a track hypothesis by explicitly setting the mass and probability.
768 // This will affect e.g. the hypothesis track's energy, since the momentum
769 // and all other attributes will be copied from the current track.
773 // prob=probalility m=mass value dm=error on the mass value.
774 // The default value for the mass error dm is 0.
778 t.RemoveTrackHypotheses();
780 t.SetTitle("Mass hypothesis");
783 AddTrackHypothesis(t);
785 ///////////////////////////////////////////////////////////////////////////
786 void AliTrack::RemoveTrackHypothesis(AliTrack& t)
788 // Remove the specified track hypothesis from this track.
791 AliTrack* test=(AliTrack*)fHypotheses->Remove(&t);
792 if (test) fHypotheses->Compress();
795 ///////////////////////////////////////////////////////////////////////////
796 void AliTrack::RemoveTrackHypotheses()
798 // Remove all track hypotheses from this track.
805 ///////////////////////////////////////////////////////////////////////////
806 Int_t AliTrack::GetNhypotheses() const
808 // Provide the number of track hypotheses.
810 if (fHypotheses) nhyp=fHypotheses->GetEntries();
813 ///////////////////////////////////////////////////////////////////////////
814 AliTrack* AliTrack::GetTrackHypothesis(Int_t j) const
816 // Provide the j-th track hypothesis.
817 // Note : j=1 denotes the first hypothesis.
818 // Default : j=0 ==> Hypothesis with highest probability.
820 if (!fHypotheses) return 0;
822 Int_t nhyp=GetNhypotheses();
824 // Check validity of index j
827 cout << " *AliTrack* hypothesis number : " << j << " out of range."
828 << " Nhyp = " << nhyp << endl;
834 if (j==0) // Provide track hypothesis with highest probability
837 t=(AliTrack*)fHypotheses->At(0);
838 if (t) prob=t->GetProb();
840 for (Int_t ih=1; ih<nhyp; ih++)
842 AliTrack* tx=(AliTrack*)fHypotheses->At(ih);
846 if (probx > prob) t=tx;
851 else // Provide requested j-th track hypothesis
853 return (AliTrack*)fHypotheses->At(j-1);
856 ///////////////////////////////////////////////////////////////////////////
857 void AliTrack::SetBeginPoint(AliPosition& p)
859 // Store the position of the track begin-point.
862 fBegin=new AliPositionObj(p);
869 ///////////////////////////////////////////////////////////////////////////
870 AliPosition* AliTrack::GetBeginPoint()
872 // Provide the position of the track begin-point.
875 ///////////////////////////////////////////////////////////////////////////
876 void AliTrack::SetEndPoint(AliPosition& p)
878 // Store the position of the track end-point.
881 fEnd=new AliPositionObj(p);
888 ///////////////////////////////////////////////////////////////////////////
889 AliPosition* AliTrack::GetEndPoint()
891 // Provide the position of the track end-point.
894 ///////////////////////////////////////////////////////////////////////////
895 void AliTrack::SetReferencePoint(AliPosition& p)
897 // Store the position of the track reference-point.
898 // The reference-point is the point on the track in which the
899 // 3-momentum vector components have been defined.
900 // This reference point is the preferable point to start track extrapolations
901 // etc... which are sensitive to the components of the 3-momentum vector.
904 fRef=new AliPositionObj(p);
911 ///////////////////////////////////////////////////////////////////////////
912 AliPosition* AliTrack::GetReferencePoint()
914 // Provide the position of the track reference-point.
915 // The reference-point is the point on the track in which the
916 // 3-momentum vector components have been defined.
917 // This reference point is the preferable point to start track extrapolations
918 // etc... which are sensitive to the components of the 3-momentum vector.
921 ///////////////////////////////////////////////////////////////////////////
922 void AliTrack::SetMass()
924 // Set the mass and error to the value of the hypothesis with highest prob.
928 // Select mass hypothesis with highest probability
929 AliTrack* t=GetTrackHypothesis(0);
933 dm=t->GetResultError();
938 cout << " *AliTrack::SetMass()* No hypothesis present => No action." << endl;
941 ///////////////////////////////////////////////////////////////////////////
942 Double_t AliTrack::GetPt()
944 // Provide trans. momentum value w.r.t. z-axis.
945 // The error on the value can be obtained by GetResultError()
946 // after invokation of GetPt().
949 Double_t norm=v.GetNorm();
950 fDresult=v.GetResultError();
954 ///////////////////////////////////////////////////////////////////////////
955 Double_t AliTrack::GetPl()
957 // Provide long. momentum value w.r.t. z-axis.
958 // Note : the returned value can also be negative.
959 // The error on the value can be obtained by GetResultError()
960 // after invokation of GetPl().
964 Double_t pl=v.GetNorm();
965 fDresult=v.GetResultError();
968 v.GetVector(a,"sph");
969 if (cos(a[1])<0) pl=-pl;
973 ///////////////////////////////////////////////////////////////////////////
974 Double_t AliTrack::GetEt()
976 // Provide trans. energy value w.r.t. z-axis.
977 // The error on the value can be obtained by GetResultError()
978 // after invokation of GetEt().
979 Double_t et=GetScaTrans();
983 ///////////////////////////////////////////////////////////////////////////
984 Double_t AliTrack::GetEl()
986 // Provide long. energy value w.r.t. z-axis.
987 // Note : the returned value can also be negative.
988 // The error on the value can be obtained by GetResultError()
989 // after invokation of GetEl().
990 Double_t el=GetScaLong();
994 ///////////////////////////////////////////////////////////////////////////
995 Double_t AliTrack::GetMt()
997 // Provide transverse mass value w.r.t. z-axis.
998 // The error on the value can be obtained by GetResultError()
999 // after invokation of GetMt().
1000 Double_t pt=GetPt();
1001 Double_t dpt=GetResultError();
1002 Double_t m=GetMass();
1003 Double_t dm=GetResultError();
1005 Double_t mt=sqrt(pt*pt+m*m);
1007 if (mt) dmt2=(pow((pt*dpt),2)+pow((m*dm),2))/(mt*mt);
1009 fDresult=sqrt(dmt2);
1012 ///////////////////////////////////////////////////////////////////////////
1013 Double_t AliTrack::GetRapidity()
1015 // Provide rapidity value w.r.t. z-axis.
1016 // The error on the value can be obtained by GetResultError()
1017 // after invokation of GetRapidity().
1018 // Note : Also GetPseudoRapidity() is available since this class is
1019 // derived from Ali4Vector.
1020 Double_t e=GetEnergy();
1021 Double_t de=GetResultError();
1022 Double_t pl=GetPl();
1023 Double_t dpl=GetResultError();
1027 Double_t y=9999,dy2=0;
1028 if (sum && dif) y=0.5*log(sum/dif);
1030 if (sum*dif) dy2=(1./(sum*dif))*(pow((pl*de),2)+pow((e*dpl),2));
1035 ///////////////////////////////////////////////////////////////////////////
1036 void AliTrack::SetImpactPoint(AliPosition& p,TString q)
1038 // Store the position of the impact-point in the plane "q=0".
1039 // Here q denotes one of the axes X, Y or Z.
1040 // Note : The character to denote the axis may be entered in lower or
1043 if (q=="x" || q=="X") axis=1;
1044 if (q=="y" || q=="Y") axis=2;
1045 if (q=="z" || q=="Z") axis=3;
1049 case 1: // Impact-point in the plane X=0
1052 fImpactYZ=new AliPositionObj(p);
1060 case 2: // Impact-point in the plane Y=0
1063 fImpactXZ=new AliPositionObj(p);
1071 case 3: // Impact-point in the plane Z=0
1074 fImpactXY=new AliPositionObj(p);
1082 default: // Unsupported axis
1083 cout << "*AliTrack::SetImpactPoint* Unsupported axis : " << q << endl
1084 << " Possible axes are 'X', 'Y' and 'Z'." << endl;
1088 ///////////////////////////////////////////////////////////////////////////
1089 AliPosition* AliTrack::GetImpactPoint(TString q)
1091 // Provide the position of the impact-point in the plane "q=0".
1092 // Here q denotes one of the axes X, Y or Z.
1093 // Note : The character to denote the axis may be entered in lower or
1096 if (q=="x" || q=="X") axis=1;
1097 if (q=="y" || q=="Y") axis=2;
1098 if (q=="z" || q=="Z") axis=3;
1102 case 1: // Impact-point in the plane X=0
1105 case 2: // Impact-point in the plane Y=0
1108 case 3: // Impact-point in the plane Z=0
1111 default: // Unsupported axis
1112 cout << "*AliTrack::GetImpactPoint* Unsupported axis : " << q << endl
1113 << " Possible axes are 'X', 'Y' and 'Z'." << endl;
1117 ///////////////////////////////////////////////////////////////////////////
1118 void AliTrack::SetId(Int_t id)
1120 // Set a user defined unique identifier for this track.
1123 ///////////////////////////////////////////////////////////////////////////
1124 Int_t AliTrack::GetId() const
1126 // Provide the user defined unique identifier of this track.
1129 ///////////////////////////////////////////////////////////////////////////
1130 void AliTrack::SetClosestPoint(AliPosition& p)
1132 // Set position p as the point of closest approach w.r.t. some reference
1135 fClosest=new AliPositionObj(p);
1142 ///////////////////////////////////////////////////////////////////////////
1143 AliPosition* AliTrack::GetClosestPoint()
1145 // Provide the point of closest approach w.r.t. some reference
1148 ///////////////////////////////////////////////////////////////////////////
1149 void AliTrack::SetChi2(Float_t chi2)
1151 // Set the chi-squared value of the track fit.
1154 cout << " *AliTrack::SetChi2* Invalid chi2 value : " << chi2 << endl;
1161 ///////////////////////////////////////////////////////////////////////////
1162 void AliTrack::SetNdf(Int_t ndf)
1164 // Set the number of degrees of freedom for the track fit.
1167 cout << " *AliTrack::SetNdf* Invalid ndf value : " << ndf << endl;
1174 ///////////////////////////////////////////////////////////////////////////
1175 Float_t AliTrack::GetChi2() const
1177 // Provide the chi-squared value of the track fit.
1180 ///////////////////////////////////////////////////////////////////////////
1181 Int_t AliTrack::GetNdf() const
1183 // Provide the number of degrees of freedom for the track fit.
1186 ///////////////////////////////////////////////////////////////////////////
1187 void AliTrack::SetParticleCode(Int_t code)
1189 // Set the user defined particle id code (e.g. the PDF convention).
1192 ///////////////////////////////////////////////////////////////////////////
1193 Int_t AliTrack::GetParticleCode() const
1195 // Provide the user defined particle id code.
1198 ///////////////////////////////////////////////////////////////////////////
1199 void AliTrack::SetParentTrack(AliTrack* t)
1201 // Set pointer to the parent track.
1204 ///////////////////////////////////////////////////////////////////////////
1205 AliTrack* AliTrack::GetParentTrack()
1207 // Provide pointer to the parent track.
1210 ///////////////////////////////////////////////////////////////////////////
1211 void AliTrack::SetProb(Double_t prob)
1213 // Set hypothesis probability for this track.
1216 ///////////////////////////////////////////////////////////////////////////
1217 Float_t AliTrack::GetProb() const
1219 // Provide the hypothesis probability for this track.
1222 ///////////////////////////////////////////////////////////////////////////
1223 void AliTrack::SetFitDetails(TObject* obj)
1225 // Enter the object containing the fit details.
1226 // In case an object to hold fit details was already present, this
1227 // will be deleted first before the new one is stored.
1228 // This means that SetFitDetails(0) can be used to just remove the
1229 // existing object with the fit details.
1230 // All objects derived from TObject can be entered in this way.
1231 // Obvious candidates for objects containing detailed fit information
1232 // are functions (e.g. TF1) and histograms (e.g. TH1F).
1233 // However, using an AliDevice object provides a very versatile facility
1234 // to store the parameters of various fit procedures.
1235 // In such a case the AliDevice can be used to provide the various fit
1236 // definitions and the corresponding fit parameters can be entered as
1237 // separate AliSignal objects which are stored as hits to the AliDevice.
1238 // In addition various functions and histograms can be linked to the
1239 // various AliSignal instances
1240 // The latter procedure is based on the original idea of Adam Bouchta.
1242 // Note : The entered object is owned by this AliTrack instance.
1243 // As such, a private copy of obj will be stored using the Clone()
1245 // In case the entered object contains pointers to other objects,
1246 // the user has to provide the appropriate Clone() memberfunction
1247 // for the class to which the entered object belongs.
1248 // An example can be seen from AliTrack::Clone().
1256 if (obj) fFit=obj->Clone();
1258 ///////////////////////////////////////////////////////////////////////////
1259 TObject* AliTrack::GetFitDetails()
1261 // Provide the pointer to the object containing the fit details.
1264 ///////////////////////////////////////////////////////////////////////////
1265 TObject* AliTrack::Clone(const char* name) const
1267 // Make a deep copy of the current object and provide the pointer to the copy.
1268 // This memberfunction enables automatic creation of new objects of the
1269 // correct type depending on the object type, a feature which may be very useful
1270 // for containers when adding objects in case the container owns the objects.
1271 // This feature allows e.g. AliJet to store either AliTrack objects or
1272 // objects derived from AliTrack via the AddTrack memberfunction, provided
1273 // these derived classes also have a proper Clone memberfunction.
1275 AliTrack* trk=new AliTrack(*this);
1278 if (strlen(name)) trk->SetName(name);
1282 ///////////////////////////////////////////////////////////////////////////