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 // Representation and extrapolation of AliTracks in a magnetic field.
22 // This class is meant to provide a means to display and extrapolate
23 // AliTrack objects in the presence of a constant homogeneous magnetic field.
25 // For track/event displays the line width, colour etc... can be set using the
26 // standard facilities (see TAttLine).
27 // By default the linewith is set to 2 and the colour set to -1 in the constructor.
28 // The latter results in an automatic colour coding according to the track charge
29 // with the convention positive=red neutral=green negative=blue.
31 // To indicate the track starting point, the memberfunction SetMarker()
33 // By default no marker will be displayed.
38 // Display and extrapolation of individual tracks
39 // ----------------------------------------------
48 // r1.SetVector(vec,"car");
53 // p.SetVector(vec,"car");
56 // t.SetBeginPoint(r1);
60 // // The magnetic field vector in Tesla
65 // b.SetVector(vec,"car");
67 // AliHelix* helix=new AliHelix();
69 // helix->SetTofmax(1e-7);
71 // TCanvas* c1=new TCanvas("c1","c1");
72 // TView* view=new TView(1);
73 // view->SetRange(-1000,-1000,-1000,1000,1000,1000);
77 // Double_t range[2]={0,600};
78 // helix->Display(&t,range,3);
79 // t.SetCharge(-t.GetCharge());
80 // helix->Display(&t);
82 // // Track extrapolation
83 // Double_t pars[3]={550,0.001,3};
84 // AliPosition* rext=helix->Extrapolate(&t,pars);
85 // if (rext) rext->Data();
86 // ======================================================================
88 // Online display of events generated via AliCollider
89 // --------------------------------------------------
90 // Int_t nevents=5; // Number of events to be generated
91 // Int_t jrun=1; // The run number of this batch of generated events
93 // cout << " ***" << endl;
94 // cout << " *** AliCollider run for " << nevents << " events." << endl;
95 // cout << " ***" << endl;
97 // AliCollider* gen=new AliCollider();
99 // gen->OpenFortranFile(6,"dump.log");
101 // gen->SetVertexMode(2);
102 // gen->SetResolution(1e-4);
104 // gen->SetRunNumber(jrun);
105 // gen->SetPrintFreq(1);
107 // gen->SetSpectatorPmin(0.01);
114 // gen->Init("fixt",zp,ap,zt,at,158);
116 // AliHelix* helix=new AliHelix();
117 // Float_t vec[3]={0,2,0};
119 // b.SetVector(vec,"car");
122 // helix->Refresh(-1); // Refresh display after each event
124 // TCanvas* c1=new TCanvas("c1","c1");
125 // TView* view=new TView(1);
126 // view->SetRange(-200,-200,-200,200,200,200);
129 // // Prepare random number sequence for this run
130 // // to obtain the number of participants for each event
131 // AliRandom rndm(abs(jrun));
132 // Float_t* rans=new Float_t[nevents];
133 // rndm.Uniform(rans,nevents,2,ap+at);
136 // for (Int_t i=0; i<nevents; i++)
139 // gen->MakeEvent(npart);
140 // AliEvent* evt=gen->GetEvent();
143 // helix->Display(evt);
145 // gSystem->Sleep(5000); // Some delay to keep the display on screen
148 // ======================================================================
150 //--- Author: Nick van Eijndhoven 17-jun-2004 Utrecht University
151 //- Modified: NvE $Date$ Utrecht University
152 ///////////////////////////////////////////////////////////////////////////
154 #include "AliHelix.h"
155 #include "Riostream.h"
157 ClassImp(AliHelix) // Class implementation to enable ROOT I/O
159 AliHelix::AliHelix() : THelix()
161 // Default constructor
174 ///////////////////////////////////////////////////////////////////////////
175 AliHelix::~AliHelix()
177 // Destructor to delete dynamically allocated memory.
189 ///////////////////////////////////////////////////////////////////////////
190 AliHelix::AliHelix(const AliHelix& h) : THelix(h)
201 ///////////////////////////////////////////////////////////////////////////
202 void AliHelix::SetB(Ali3Vector& b)
204 // Set the magnetic field vector in Tesla.
210 fB.GetVector(axis,"car");
214 ///////////////////////////////////////////////////////////////////////////
215 Ali3Vector& AliHelix::GetB()
217 // Provide the magnetic field vector in Tesla.
220 ///////////////////////////////////////////////////////////////////////////
221 void AliHelix::SetTofmax(Float_t tof)
223 // Set the maximum time of flight for straight tracks in seconds.
224 // This maximum tof will be used for drawing etc... in case no begin
225 // and endpoints can be determined from the track info.
228 // 1) In case the user specifies an explicit range, it will override
229 // the maximum tof limit.
230 // 2) By default the tofmax is set to 10 ns in the AliHelix constructor.
233 ///////////////////////////////////////////////////////////////////////////
234 Float_t AliHelix::GetTofmax() const
236 // Provide the maximum time of flight for straight tracks in seconds.
239 ///////////////////////////////////////////////////////////////////////////
240 void AliHelix::SetMarker(Int_t style,Float_t size,Int_t col)
242 // Specify the marker (style, size and colour) to indicate the starting point
243 // of a track in a display.
244 // In case col<0 the marker will have the same color as the track itself.
246 // Defaults are style=8, size=0.2 and col=-1.
252 ///////////////////////////////////////////////////////////////////////////
253 void AliHelix::UseEndPoint(Int_t mode)
255 // Select usage of track endpoint in drawing and extrapolation.
256 // This allows correct event displays even for very long tracks.
258 // mode = 0 : Do not use the track endpoint
259 // 1 : Use the track endpoint
261 // The default value is mode=1 (which is also set in the constructor).
263 if (mode==0 || mode==1) fEnduse=mode;
265 ///////////////////////////////////////////////////////////////////////////
266 void AliHelix::MakeCurve(AliTrack* t,Double_t* range,Int_t iaxis,Double_t scale)
268 // Make the helix curve for the specified AliTrack.
269 // Detailed information of all the helix points can be obtained via the
270 // GetN() and GetP() memberfunctions of TPolyLine3D.
271 // In case one wants to display or extrapolate an AliTrack it is preferable
272 // to use the Display() or Extrapolate() memberfunctions.
273 // It is assumed that the track charge is stored in elementary units
274 // (i.e. charge=1 for a proton) and that the track energy is stored in GeV.
275 // The input argument "scale" specifies the unit scale for the various
276 // locations where scale=0.01 indicates unit scales in cm etc...
277 // In case scale<=0, the unit scale for locations is determined from the
278 // begin, reference or endpoint of the track. If neither of these
279 // positions is present, all locations are assumed to be given in cm.
280 // The lower and upper bounds for the range are specified by range[0] and
281 // range[1] and the argument "iaxis" indicates along which axis this range
283 // The range can be specified either in the LAB frame or in the Helix frame.
284 // The latter is the frame in which the Z axis points in the B direction.
286 // The conventions for the "iaxis" argument are the following :
287 // iaxis = 1 ==> X axis in the LAB frame
288 // 2 ==> Y axis in the LAB frame
289 // 3 ==> Z axis in the LAB frame
290 // -1 ==> X axis in the Helix frame
291 // -2 ==> Y axis in the Helix frame
292 // -3 ==> Z axis in the Helix frame
294 // In case range=0 the begin/end/reference points of the AliTrack and the
295 // maximum time of flight (see the SetTofmax() memberfunction) will be used
296 // and an appropriate choice for the iaxis parameter will be made automatically
297 // based on the track kinematics.
298 // In case the reference point is not present, the begin or endpoint will be used
299 // as reference point for the 3-momentum specification. If neither of these positions
300 // is present, (0,0,0) will be taken as the reference point.
302 // The default values are range=0, iaxis=3 and scale=-1.
304 SetPolyLine(0); // Reset the polyline data points
306 if (!t || (range && !iaxis)) return;
308 Double_t energy=t->GetEnergy();
309 Double_t betanorm=t->GetBeta();
311 if (energy<=0 || betanorm<=0) return;
313 AliPosition* rbeg=t->GetBeginPoint();
315 if (fEnduse) rend=t->GetEndPoint();
316 AliPosition* rref=t->GetReferencePoint();
318 // Magnetic field vector or default Z-direction
319 Double_t bvec[3]={0,0,1};
320 if (fB.GetNorm()>0) fB.GetVector(bvec,"car");
322 // The unit scale for locations if not specified by the user
325 scale=0.01; // Set default to cm
328 scale=rbeg->GetUnitScale();
332 scale=rend->GetUnitScale();
336 scale=rref->GetUnitScale();
340 Double_t c=2.99792458e8/scale; // Lightspeed in the selected unit scale
342 // The helix angular frequency
343 Double_t w=9e7*(t->GetCharge()*fB.GetNorm())/energy;
345 // The particle velocity in the LAB frame
346 Ali3Vector beta=t->GetBetaVector();
349 v.GetVector(vel,"car");
351 // The particle velocity in the Helix frame
352 Ali3Vector betaprim=beta.GetPrimed(fRotMat);
353 v=v.GetPrimed(fRotMat);
355 v.GetVector(velprim,"car");
357 // Check compatibility of velocity and range specification.
361 if (iaxis>0) beta.GetVector(betavec,"car");
362 if (iaxis<0) betaprim.GetVector(betavec,"car");
363 if (fabs(betavec[abs(iaxis)-1])/betanorm<1e-10) return;
366 // The LAB location in which the velocity of the particle is defined
367 Double_t loc[3]={0,0,0};
372 rx=(Ali3Vector*)rref;
373 scalex=rref->GetUnitScale();
377 rx=(Ali3Vector*)rbeg;
378 scalex=rbeg->GetUnitScale();
382 rx=(Ali3Vector*)rend;
383 scalex=rend->GetUnitScale();
388 if (scalex/scale>1.1 || scale/scalex>1.1) (*rx)*=scalex/scale;
389 rx->GetVector(loc,"car");
392 // Initialisation of Helix kinematics
393 SetHelix(loc,vel,w,0,kUnchanged,bvec);
396 if (fabs(w)>0 && fabs(fVt)>0) bend=1;
398 // Flight time boundaries.
399 // The time origin t=0 is chosen to indicate the position in which
400 // the particle velocity was defined.
401 // The total flight time is initialised to the (user specified) tofmax.
402 Double_t tmin=0,tmax=0;
403 Double_t tof=fTofmax;
406 // The trajectory begin and end points
407 Double_t vec1[3]={0,0,0};
408 Double_t vec2[3]={0,0,0};
411 Double_t scale1=0.01;
412 Double_t scale2=0.01;
416 ////////////////////////////////////////
417 // Treatment of straight trajectories //
418 ////////////////////////////////////////
420 if (range) // Specified range allows for exact flight time boundaries
424 tmin=(range[0]-loc[iaxis-1])/vel[iaxis-1];
425 tmax=(range[1]-loc[iaxis-1])/vel[iaxis-1];
432 tmin=(range[0]-loc[abs(iaxis)-1])/velprim[abs(iaxis)-1];
433 tmax=(range[1]-loc[abs(iaxis)-1])/velprim[abs(iaxis)-1];
441 // Make the 'curve' in the LAB frame and exit.
442 // Use the parametrisation : r(t)=r0+t*v
443 // using the range based flight time boundaries.
444 // An additional point in the middle of the trajectory is
445 // generated in view of accuracy in the case of extrapolations.
451 r1.GetVector(vec1,"car");
452 SetNextPoint(float(vec1[0]),float(vec1[1]),float(vec1[2]));
455 r2.GetVector(vec2,"car");
456 SetNextPoint(float(vec2[0]),float(vec2[1]),float(vec2[2]));
459 r2.GetVector(vec2,"car");
460 SetNextPoint(float(vec2[0]),float(vec2[1]),float(vec2[2]));
462 else // Automatic range determination
464 // Initially the point with Z=0 in the Helix frame is taken as a starting point.
465 // In case this point can't be reached, the point in which the particle velocity
466 // was defined is taken as the starting point.
467 // The endpoint is initially obtained by applying the tofmax from the start point.
469 if (fabs(fVz)>0) tmin=-fZ0/fVz;
475 // Override the initial begin and endpoint settings by the track data
478 r1=(Ali3Vector)(*rbeg);
479 scale1=rbeg->GetUnitScale();
480 // All coordinates in the selected unit scale
481 if (scale1/scale>1.1 || scale/scale1>1.1) r1*=scale1/scale;
488 r2=(Ali3Vector)(*rend);
489 scale2=rend->GetUnitScale();
490 // All coordinates in the selected unit scale
491 if (scale2/scale>1.1 || scale/scale2>1.1) r2*=scale2/scale;
494 r1.GetVector(vec1,"car");
495 r2.GetVector(vec2,"car");
497 // Make the 'curve' in the LAB frame and exit.
498 SetNextPoint(float(vec1[0]),float(vec1[1]),float(vec1[2]));
499 SetNextPoint(float(vec2[0]),float(vec2[1]),float(vec2[2]));
504 //////////////////////////////////////
505 // Treatment of curved trajectories //
506 //////////////////////////////////////
508 // Initialisation of the flight time boundaries.
509 // Based on the constant motion of the particle along the Helix Z-axis,
510 // the parametrisation z(t)=z0+fVz*t in the Helix frame is used.
511 // If possible the point with Z=0 in the Helix frame is taken as a starting point.
512 // In case this point can't be reached, the point in which the particle velocity
513 // was defined is taken as the starting point.
515 if (fabs(fVz)>0) tmin=-fZ0/fVz;
525 // Determination of the range in the helix frame
527 if (!range) // Automatic range determination
533 r1=rbeg->GetPrimed(fRotMat);
534 scale1=rbeg->GetUnitScale();
535 // All coordinates in the selected unit scale
536 if (scale1/scale>1.1 || scale/scale1>1.1) r1*=scale1/scale;
537 // Re-calculate the tmin for this new starting point
538 r1.GetVector(vec1,"car");
539 if (fabs(fVz)>0) tmin=(vec1[2]-fZ0)/fVz;
544 r2=rend->GetPrimed(fRotMat);
545 scale2=rend->GetUnitScale();
546 // All coordinates in the selected unit scale
547 if (scale2/scale>1.1 || scale/scale2>1.1) r2*=scale2/scale;
548 r2.GetVector(vec2,"car");
549 if (fabs(fVz)>0) tmax=(vec2[2]-fZ0)/fVz;
551 // Make the curve on basis of the flight time boundaries and exit
558 SetRange(tmin,tmax,kHelixT);
560 else // User explicitly specified range
562 vec1[abs(iaxis)-1]=range[0];
563 vec2[abs(iaxis)-1]=range[1];
564 r1.SetVector(vec1,"car");
565 r2.SetVector(vec2,"car");
566 if (iaxis>0) // Range specified in LAB frame
568 r1=r1.GetPrimed(fRotMat);
569 r1.GetVector(vec1,"car");
570 r2=r2.GetPrimed(fRotMat);
571 r2.GetVector(vec2,"car");
573 // Determination of the axis component with the
574 // largest range difference
578 for (Int_t i=0; i<3; i++)
580 test=fabs(vec1[i]-vec2[i]);
588 Double_t rmin=vec1[imax];
589 Double_t rmax=vec2[imax];
597 // The kinematic range boundaries in the helix frame
598 Double_t xmin=fX0-fVt/fW;
599 Double_t xmax=fX0+fVt/fW;
600 Double_t ymin=fY0-fVt/fW;
601 Double_t ymax=fY0+fVt/fW;
616 // Set the range for the helix
617 if (imax==2 && dmax>0) SetRange(rmin,rmax,kHelixZ);
620 // Limit range to kinematic boundaries if needed
621 if (rmin<=ymin) rmin=ymin+1e-6*dmax;
622 if (rmax>=ymax) rmax=ymax-1e-6*dmax;
623 if (rmin<rmax) SetRange(rmin,rmax,kHelixY);
627 // Limit range to kinematic boundaries if needed
628 if (rmin<=xmin) rmin=xmin+1e-6*dmax;
629 if (rmax>=xmax) rmax=xmax-1e-6*dmax;
630 if (rmin<rmax) SetRange(rmin,rmax,kHelixX);
636 ///////////////////////////////////////////////////////////////////////////
637 void AliHelix::Display(AliTrack* t,Double_t* range,Int_t iaxis,Double_t scale)
639 // Display the helix curve of an AliTrack.
640 // Various curves can be displayed together or individually; please refer to
641 // the memberfunction Refresh() for further details.
642 // It is assumed that the track charge is stored in elementary units
643 // (i.e. charge=1 for a proton) and that the track energy is stored in GeV.
644 // The input argument "scale" specifies the unit scale for the various
645 // locations where scale=0.01 indicates unit scales in cm etc...
646 // In case scale<=0, the unit scale for locations is determined from the
647 // begin, reference or endpoint of the track. If neither of these
648 // positions is present, all locations are assumed to be given in cm.
649 // The lower and upper bounds for the range are specified by range[0] and
650 // range[1] and the argument "iaxis" indicates along which axis this range
652 // The range can be specified either in the LAB frame or in the Helix frame.
653 // The latter is the frame in which the Z axis points in the B direction.
655 // The conventions for the "iaxis" argument are the following :
656 // iaxis = 1 ==> X axis in the LAB frame
657 // 2 ==> Y axis in the LAB frame
658 // 3 ==> Z axis in the LAB frame
659 // -1 ==> X axis in the Helix frame
660 // -2 ==> Y axis in the Helix frame
661 // -3 ==> Z axis in the Helix frame
663 // In case range=0 the begin/end/reference points of the AliTrack and the
664 // maximum time of flight (see the SetTofmax() memberfunction) will be used
665 // and an appropriate choice for the iaxis parameter will be made automatically
666 // based on the track kinematics.
667 // In case the reference point is not present, the begin or endpoint will be used
668 // as reference point for the 3-momentum specification. If neither of these positions
669 // is present, (0,0,0) will be taken as the reference point.
671 // The default values are range=0, iaxis=3 and scale=-1.
675 // Before any display activity, a TCanvas and a TView have to be initiated
676 // first by the user like for instance
678 // TCanvas* c1=new TCanvas("c1","c1");
679 // TView* view=new TView(1);
680 // view->SetRange(-1000,-1000,-1000,1000,1000,1000);
683 if (!t || (range && !iaxis)) return;
685 MakeCurve(t,range,iaxis,scale);
687 if (fRefresh>0) Refresh(fRefresh);
692 Float_t* points=GetP();
693 TPolyLine3D* curve=new TPolyLine3D(np,points);
695 curve->SetLineWidth(fLineWidth);
698 Float_t q=t->GetCharge();
699 curve->SetLineColor(kGreen);
700 if (q>0) curve->SetLineColor(kRed);
701 if (q<0) curve->SetLineColor(kBlue);
705 curve->SetLineColor(fLineColor);
711 fCurves=new TObjArray();
716 // Display the marker for the track starting point
719 TPolyMarker3D* m=new TPolyMarker3D();
720 m->SetPoint(0,points[0],points[1],points[2]);
721 m->SetMarkerStyle(fMstyle);
722 m->SetMarkerSize(fMsize);
723 Int_t col=curve->GetLineColor();
724 if (fMcol>0) col=fMcol;
725 m->SetMarkerColor(col);
730 ///////////////////////////////////////////////////////////////////////////
731 void AliHelix::Refresh(Int_t mode)
733 // Refresh the display screen before showing the next curve.
735 // mode = 0 : refreshing fully under user control.
736 // 1 : the display screen will be refreshed automatically
737 // at each individual track display.
738 // -1 : the display screen will be refreshed automatically
739 // at each event display.
741 // The default is mode=0.
743 if (abs(mode)<2) fRefresh=mode;
744 if (fCurves) fCurves->Delete();
746 ///////////////////////////////////////////////////////////////////////////
747 void AliHelix::Display(AliEvent* evt,Double_t* range,Int_t iaxis,Double_t scale)
749 // Display the helix curves of all tracks of the specified event.
750 // Various events can be displayed together or individually; please refer to
751 // the memberfunction Refresh() for further details.
752 // Please refer to the track display memberfunction for further details
753 // on the input arguments.
755 // The default values are range=0, iaxis=3 and scale=-1.
759 // Before any display activity, a TCanvas and a TView have to be initiated
760 // first by the user like for instance
762 // TCanvas* c1=new TCanvas("c1","c1");
763 // TView* view=new TView(1);
764 // view->SetRange(-1000,-1000,-1000,1000,1000,1000);
769 if (fRefresh<0) Refresh(fRefresh);
771 Int_t ntk=evt->GetNtracks();
772 for (Int_t jtk=1; jtk<=ntk; jtk++)
774 AliTrack* tx=evt->GetTrack(jtk);
775 if (tx) Display(tx,range,iaxis,scale);
778 ///////////////////////////////////////////////////////////////////////////
779 void AliHelix::Display(TObjArray* arr,Double_t* range,Int_t iaxis,Double_t scale)
781 // Display the helix curves of all tracks in the specified array.
782 // A convenient way to obtain an array with selected tracks from e.g. an AliEvent
783 // is to make use of its GetTracks() selection facility.
784 // Various arrays can be displayed together or individually; please refer to
785 // the memberfunction Refresh() for further details.
786 // Please refer to the track display memberfunction for further details
787 // on the input arguments.
789 // The default values are range=0, iaxis=3 and scale=-1.
793 // Before any display activity, a TCanvas and a TView have to be initiated
794 // first by the user like for instance
796 // TCanvas* c1=new TCanvas("c1","c1");
797 // TView* view=new TView(1);
798 // view->SetRange(-1000,-1000,-1000,1000,1000,1000);
803 Int_t ntk=arr->GetEntries();
804 for (Int_t jtk=0; jtk<ntk; jtk++)
806 TObject* obj=arr->At(jtk);
808 if (!(obj->InheritsFrom("AliTrack"))) continue;
809 AliTrack* tx=(AliTrack*)obj;
810 Display(tx,range,iaxis,scale);
813 ///////////////////////////////////////////////////////////////////////////
814 AliPosition* AliHelix::Extrapolate(AliTrack* t,Double_t* pars,Double_t scale)
816 // Extrapolate an AliTrack according to the corresponding helix curve
817 // and provide a pointer to the impact position w.r.t. a specified plane.
818 // In case the track can never reach the specified plane, the returned
819 // position pointer is zero.
820 // Detailed information of all the helix points used in the extrapolation
821 // can be obtained via the GetN() and GetP() memberfunctions of TPolyLine3D.
822 // It is assumed that the track charge is stored in elementary units
823 // (i.e. charge=1 for a proton) and that the track energy is stored in GeV.
824 // The input argument "scale" specifies the unit scale for the various
825 // locations where scale=0.01 indicates unit scales in cm etc...
826 // In case scale<=0, the unit scale for locations is determined from the
827 // begin, reference or endpoint of the track. If neither of these
828 // positions is present, all locations are assumed to be given in cm.
829 // The extrapolation parameters for the impact plane and required accuracy
830 // are specified by pars[0], pars[1] and pars[2], respectively.
831 // pars[0] = coordinate value of the plane for the impact point
832 // pars[1] = required accuracy on the specified impact plane coordinate
833 // pars[2] = the axis along which the value of par[0] is specified
835 // The parameters can be specified either w.r.t. the LAB frame or the Helix frame.
836 // The latter is the frame in which the Z axis points in the B direction.
838 // The conventions for the par[2] argument are the following :
839 // par[2] = 1 ==> X axis in the LAB frame
840 // 2 ==> Y axis in the LAB frame
841 // 3 ==> Z axis in the LAB frame
842 // -1 ==> X axis in the Helix frame
843 // -2 ==> Y axis in the Helix frame
844 // -3 ==> Z axis in the Helix frame
848 // To obtain an extrapolation to the plane Z=0 in the LAB frame
849 // with an accuracy of 0.001 cm the input arguments would be
850 // pars[0]=0 pars[1]=0.001 pars[2]=3 scale=0.01
852 // Note : The default value for the scale is -1.
860 if (!t || !pars) return fExt;
862 AliPosition* rbeg=t->GetBeginPoint();
863 AliPosition* rend=t->GetEndPoint();
864 AliPosition* rref=t->GetReferencePoint();
866 // The unit scale for locations if not specified by the user
869 scale=0.01; // Set default to cm
872 scale=rbeg->GetUnitScale();
876 scale=rend->GetUnitScale();
880 scale=rref->GetUnitScale();
885 range[0]=pars[0]-fabs(pars[1])/2.;
886 range[1]=pars[0]+fabs(pars[1])/2.;
888 Int_t iaxis=int(pars[2]);
890 MakeCurve(t,range,iaxis,scale);
893 if (!np) return fExt;
895 Float_t* points=GetP();
897 // First point of the curve around the impact
899 Float_t first[3]={points[3*ip],points[3*ip+1],points[3*ip+2]};
901 // Last point of the curve around the impact
903 Float_t last[3]={points[3*ip],points[3*ip+1],points[3*ip+2]};
905 // The accuracy on the impact point
907 err[0]=fabs(first[0]-last[0]);
908 err[1]=fabs(first[1]-last[1]);
909 err[2]=fabs(first[2]-last[2]);
911 // Take the middle point as impact location
913 Float_t imp[3]={points[3*ip],points[3*ip+1],points[3*ip+2]};
915 fExt=new AliPosition();
916 fExt->SetUnitScale(scale);
917 fExt->SetPosition(imp,"car");
918 fExt->SetPositionErrors(err,"car");
922 ///////////////////////////////////////////////////////////////////////////