This routine calculates the covariance or weight matrix of the TKR parameters, as implied by the list of detector layers the particle goes through.
TYPSUR : CHARACTER - type of surface to wich track should be propagated 'CYL' : Cylinder 'PLANE' : Plane 'PERI' : To perigee LAYLIS : List of detector layers hit by particle : LAYLIS(1,i) = number of the i:th hit layer. LAYLIS(2,i) tells if it is a plane or a cylinder, if it measures or not, and if it is the reference layer. LAYLIS(2,i) = 0 : mathematical layer : no material, no measurement. Ignored in all calculations 1 : seen by a cylinder 2 : seen by a plane -1 : particle went through a cylinder, but was not seen by the detector. -2 : particle went through a plane, but was not seen by the detector. 10 : the layer is a reference cylinder 20 : the layer is a reference plane LAYLIS(3,i) = No. of radiation lengths in layer. LAYLIS(1,i) = -1 -> end of list. INCR : transport the weight matrix WGTINT RELOAD : if TRUE, reload ZTTRJ from LAYLIS WGTINT : Internal weight-matrix, read if INCR is true. NB ! Over-written by the resulting matrix.
WGTINT : Internal weight-matrix. ERRARR : Error matrix on track parameters (weight matrix if parameters are at the perigee, else covariance matrix) ERROR : error flag : 0 - no error 1 - intersection with cylinder just outside the requested one in z. Parameters on this cylinder returned instead. 2 - no intersection, perigee parameters returned 3 - other error, no parameters returned 4 - Tan(theta) = 0.0 to machine precission, no error matrix calculated.
from /ZTAUX/ : COSTH,TANTH : Cos and tan (theta) of track; RTRK,RINV : radius of track, and it's inverse; BCONST : c*BFIELD.
to /ZTTRJ/ : NPT, number of detector elements intersected; ICYPL, list of ditto; ITYP, status of ditto.
(To calculate TRacK Weight matrix.)
(To invert a matrix (5X5))