E852 Documentaion : Detectors : LGD : Constrained Fitting

The Old Fitter

For completeness, I will describe how to use the old fitter here. The call is:

float fitTwoGamma(vector4_t* p1, vector4_t* p2, float mass, float sigma1, float sigma2, vector4_t* pFit1, vector4_t* pFit2)

The sigma's are the errors in the energies, in GeV. It returns the chi-square of the fit.

The New Fitter

The principles behind the new fitter, and some results, are given elsewhere. Summerizing, the new fitter fits the opening angle between the photons in addition to the energies. To use it, call

int fitTwoGammaFull(vector3_t vertex, vector4_t* p1, vector4_t* p2, float mass, float sigma1, float sigma2, float sigmaTheta, vector4_t* pFit1, vector4_t* pFit2,float * chisq)

Note that the return type has changed! It now returns a status code, (zero if everything worked). Currently it allways returns zero, but this may change in the future. The correction to the opening angle is applied in the following manner:

The parameter sigmaTheta can usually be set to SIGMA_THETA_DEF (defined in lgdUtil.h). This is currently set to 0.00116 radians. The vertex is in MPS coordinates.

The new fitter is in libUtil.a, and is declared in lgdUtil.h. To use it, you need to link to (on an SGI):

A General Function

To allow easy switching between the two methods, a general routine has been provided :

int fitTwoGammaGen(int mode,vector3_t vertex, vector4_t* p1, vector4_t* p2, float mass, float sigma1, float sigma2, float sigmaTheta, vector4_t* pFit1, vector4_t* pFit2,float * chisq)

Here the mode tells it which fitter to use:

If an invalid mode is passed, it will return 1.
RL, 4 April 1995