The Quad Fitter implemantation in SNOMAN is fairly basic and is based on the original idea of Bill Frati at Penn. The routine FTQ_FITTER.FOR loops over all EV banks and calls FTQ_FIT_EVENT to do the actual fitting for each. This fitting routine first loads the hit positions and times into a local array skipping over those that have their discard flag set. It then checks to see that the number of hits is between the maximum and minimum set by words 1 and 2 of the TFTQ bank and if so proceeds to carry out the fitting by calling FTQ_QUAD_FIT. The task of this routine breaks into two parts. Firstly a quad cloud is formed by taking combinations of four hits and calculating a vertex position and time for each then this cloud is searched to find its maximum density and this location is returned as the fitted position and time.
A quad point is formed by taking a combination of 4 PMTs and
solving
Once the cloud has been formed then FTQ_QUAD_FIT calls FTQ_AMOEBA to find the 4 dimensional maximum density position within the cloud. This is done by moving a hypersphere around the cloud and counting the number of quad points that lie within it. The downhill simplex method of Nelder and Mead (better known as Amoeba) is used to carry out this maximisation, the code being taken from Numerical Recipes. The radius of the hypersphere and the convergence limit of the Amoeba search are set by words 4 and 5 of the TFTQ bank.