subroutine kvtx_unknown_approx(ntrk, list, vtx) * * begin_doc * * Find 3-D vertex for several tracks using a straight line approximation. This * routine is used as a first step in a more accurate procedure. * * Input Parameters: * ntrk integer variable * Number of tracks * * list integer array * List of tracks in track list to use * * Output Parameters: * vtx(3) double precision array * (x,y,z) intersection point. If it cannot be determined, it is * set to (0,0,0). * * Other routines: * * Notes: * * Author: Paul R Avery Created: Mon Jul 28 06:55:56 EDT 1997 * * Major revisions: * * C >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> C The lines are defined by the equation C C x = x0 + eta*r C C where r is a free parameter (length) and eta is a set of direction C cosines. The track parametrization is the noncanonical one, i.e. x0, y0, C z0, nx, ny, nz, rho, p, Q, s. The curvature rho is ignored. C C The intersection is defined as the point which minimizes the sum of C distances**2 to each of the lines: C C d**2 = SUM(i) [ (x-x0(i)**2 - |(x-x0(i))*eta(i)|**2 ] C C The sum is minimized when the x(j) components satisfy C C 0 = SUM(i) [ x(j)-x0(ij) - eta(ij)|(x-x0(i))*eta(i)| ] C C These equations can be rewritten as a single matrix equation C C Ax = b C C x = A(inv) * b C C | N-SUM[eta(i1)**2] -SUM[eta(i1)eta(i2)] -SUM[eta(i1)eta(i3)]| C A = |-SUM[eta(i1)eta(i2)] N-SUM[eta(i2)**2)] -SUM[eta(i2)eta(i3)]| C |-SUM[eta(i1)eta(i3)] -SUM[eta(i2)eta(i3)] N-SUM[eta(i3)**2] | C C C | SUM[x0(i1) - eta(i1)|x0(i)*(eta(i)| ] | C b= | SUM[x0(i2) - eta(i2)|x0(i)*(eta(i)| ] | C | SUM[x0(i3) - eta(i3)|x0(i)*(eta(i)| ] | C C C Dot product multiplication is indicated above by a * C >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> * end_doc