*-- Author : S.Burke / J.V. Morris
SUBROUTINE FKTRAN(DZ,Z1,S1,S2,D)
**********************************************************************
* *
* Transform track vector (S1) through DZ to (S2) in magnetic field. *
* *
**********************************************************************
*KEEP,FKNPL.
*
* Per-track values can go in H1WORK; note that LTRUE and LFIRST must
* be set at least per event.
*
* This is about 36k words long; the remaining common blocks are
* about 3.6k in total. Some of this could be in /H1WORK/, but the
* blocks would have to be reorganised.
*
* /FKPROJ/
* /FKFILT/
* /FKSMTH/
* /FKINT/
* /FKRSID/
* /FKTRUE/
* /FKDBG/
*KEEP,FKINT.
*KEND.
*KEEP,FKPIDP.
*KEND.
**********************************************************************
*
* Thresholds for various approximations (*** UNOPTIMISED ***)
*
* Max z step over which field is assumed constant
* If Dphi CALL GUFLD(R,B)
* Work out Delta phi (don't re-order these lines!)
* Choose the order of approximation
* Must consider change in field over DZ
* Must take helix (x and y affected by dphi)
* Ignore DPHI
* Ignore change in phi for DX and DY
* End of straight line approx
* Small angle approximations for cos and sin (to order DPHI**2)
* Full expressions
* Remember values
* Change in x and y
* Some more abbreviations ...
* ... and the remaining differential coefficients
* Are corrections for Bx and By required?
*
* Apply 1st order corrections assuming that Bx and By are
* small but non-zero ........ (Bx,By,Bz) is still assumed
* to be constant across DZ ......
*
* If theta = 0, phi is undefined, so CON3 can be set to any value
* Are corrections for field variation required?
* Get field at end point ...
CALL GUFLD(R2,B2)
*
* DB is the mean difference from the assumed field along the trajectory,
* assuming the field components vary linearly with Z over DZ.
* ie B and dB/dZ are non-zero but d2B/dZ2 etc are assumed zero.
*
* Stop values getting too large (i.e. stop overflows)
*