Particles are propagated from a starting point to:
libUtil.a
libdata.a
libmapmanager_ro.a
To initialize the package, call:
trk3_xxx(...)
routines, the track is defined as:
vector3_t v; the starting point
vector3_t p; the momentum
int charge; the charge (positive, negative or zero)
trk3p_xxx(...)
routines, the track is defined as:
vector3_t v; the starting point
vector3_t punit; the momentum magnitude
double qp; charge divided by momentum (positive, negative or zero)
trk_xxx(...)
routines, the track is defined as an array of 7 numbers:
(x,y,z,qp,dpx,dpy,dpz),
where x,y,z are the starting point,
qp is q/p - charge divided by momentum magnitude
dpx,dpy,dpz are the momentum unit vector
The functions return 0 if success, non 0 in case if failure.
The track returned by the functions is always the point where the swimming had stopped.
The flags
argument is normally 0. See the include file for more details.
The box
argument defines the boundary volume. Swimming is terminated when the
trajectory leaves this volume. To swim without restrictions, set this argument to NULL
.
dnorm
- normal vector anddpos
- distance from point (0,0,0)
Both 'dpos' and 'dnorm' can be either positive or negative.
The following functions are available:
Notice the lack of trk_swimToCyl
function.
/* Routines to swim a given distance along the track. Distance can be positive or negative */
int trk_swimAway(double trk[],double dist);
int trk3_swimAway(vector3_t *v,vector3_t *p,int charge,double dist,int flags);
int trk3p_swimAway(vector3_t *v,vector3_t *punit,double qp,double dist,int flags);
ptracb
(arc approximation)Staight line approximation is slow and inefficient, but very simple to implement and therefore "bug free". It is used mainly to debug the other methods.
ptracb
is the tracking code written by S.U.Chung and successfully
used to analyze previous MPS experiments. It works fairly well
in a uniform magnetic field. It's main flaws are: lack of interface with
"boundary conditions", errors in defining the "plane" boundary conditions and lack
of variable step size.
The arc approximating method was developed mainly to fix the aforementioned flaws
in ptracb
. It uses the same arc approximation formulaes as ptracb
.
One step of either method will give identical results. The main difference is in the way the variable
step size and the boundary conditions are implemented.
The variable step size is implemented by sampling the magnetic field along the trajectory and will decrease the step size
if it detects "fast changes of the field". If the field "stops changing", the step size
is automatically increased. This feature enables to run with larger step size
(4 cm versus 1 cm in ptracb
). Larger step size means less steps, less calculations
of the magnetic field and faster integration.
The "boundary conditions" are implemented by a goal function, which is minimized along
the trajectory. For example, when swimming to a plane, this function is defined as "the distance from the
current point to the plane". The minimum of the goal function is found by the golden-ratio
algorithm for single variable optimization (see:
trackswim.db
,
which is extensively self documented.
This file defines, among other things, the step size and the trajectory integration technique.
CO 1995-May-07 //end file