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:
- Calculate the new angle.
- Calculate the % change in opening angle. Use this to calculate the correction to the photon positions at the face of the glass.
- Calculate the unit vector between the two photons positions at the face of the glass.
- Change the distance bewteen the two photons, giving 50% of the change to each photon, along the previously calculated unit vector.
- Apply the new energies and make new photons.
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):
- libUtil.a - that's where it lives.
- librclib.a - contains C wrapper routines for MINUIT.
- liblgdGeom.a - so the fitter can get the LGD position. The geometry package must be initialized before calling the fitter!
- libpacklib.a - for MINUIT.
- libftn.a - FORTRAN (blah!) library, required by packlib.
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:
- FIT_ENERGY_ONLY : The old fitter. Ignores values passed for vertex and sigmaTheta.
- FIT_POSITION_1 : The new fitter
If an invalid mode is passed, it will return 1.
RL, 4 April 1995