 
 
 
 
 
 
 
  
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
 is formed by taking a combination of 4 PMTs and
solving
 
 and this
rapidly becomes a very large number for quite moderate values of N.
Consequently the quad fitter has the capacity to only use a fraction of the
quad cloud and this is set by word 3 of the TFTQ bank. A particaular 4 PMT
combination will be used if a random uniform deviate is less than this
fraction. FTQ_QUAD_FIT forms this quad cloud by calling FTQ_FINDVTX. This
routine rejects a quad point if its solution is imaginary, the quad time is
later than the earliest of the four PMT times or if the four PMTs are spatially
too close together.
 and this
rapidly becomes a very large number for quite moderate values of N.
Consequently the quad fitter has the capacity to only use a fraction of the
quad cloud and this is set by word 3 of the TFTQ bank. A particaular 4 PMT
combination will be used if a random uniform deviate is less than this
fraction. FTQ_QUAD_FIT forms this quad cloud by calling FTQ_FINDVTX. This
routine rejects a quad point if its solution is imaginary, the quad time is
later than the earliest of the four PMT times or if the four PMTs are spatially
too close together.
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.
 
 
 
 
 
 
