1 #ifndef CBM_RICH_RING_FITTER_COP_LIGHT
2 #define CBM_RICH_RING_FITTER_COP_LIGHT 1
63 float M0, Mx, My, Mz, Mxy, Mxx, Myy, Mxz, Myz, Mzz, Mxz2, Myz2, Cov_xy;
64 float A0, A1,
A2, A22;
66 float Dy, xnew, xold, ynew, yold = 10000000.;
80 Mxx = Myy = Mxy = Mxz = Myz = Mzz = 0.;
85 Zi = Xi * Xi + Yi * Yi;
103 Cov_xy = Mxx * Myy - Mxy * Mxy;
107 A2 = 4. * Cov_xy - 3. * Mz * Mz - Mzz;
108 A1 = Mzz * Mz + 4. * Cov_xy * Mz - Mxz2 - Myz2 - Mz * Mz * Mz;
109 A0 = Mxz2 * Myy + Myz2 * Mxx - Mzz * Cov_xy - 2. * Mxz * Myz * Mxy + Mz
117 for (iter = 0; iter < iterMax; iter++) {
118 ynew = A0 + xnew * (A1 + xnew * (A2 + 4. * xnew * xnew));
120 if (fabs(ynew) > fabs(yold)) {
126 Dy = A1 + xnew * (A22 + 16. * xnew * xnew);
128 xnew = xold - ynew /
Dy;
130 if (xnew == 0 || fabs((xnew - xold) / xnew) <
epsilon){
142 float GAM = -Mz - xnew - xnew;
143 float DET = xnew * xnew - xnew * Mz + Cov_xy;
145 centerX = (Mxz * (Myy - xnew) - Myz * Mxy) / DET / 2.;
146 centerY = (Myz * (Mxx - xnew) - Mxz * Mxy) / DET / 2.;
147 radius = sqrt(centerX * centerX + centerY * centerY - GAM);
179 for (
int i = 0; i < fNhits; i++) {
180 Xd2 = Xcenter -
fHitX[i];
181 Yd2 = Ycenter -
fHitY[i];
185 float d = sqrt( Xd2 + Yd2 ) - Radius;