9 #include "CbmRichRingLight.h"
25 if (nofHits < 3)
return;
50 for (
int iHit = 0; iHit < nofHits; iHit++) {
54 b1 += (hx*hx + hy*
hy) * hx;
55 b2 += (hx*hx + hy*
hy) * hy;
56 b3 += (hx*hx + hy*
hy);
70 meanX = meanX/(float)(nofHits);
71 meanY = meanY/(float)(nofHits);
83 c[0] = b1*b22 - b2*b12;
84 c[1] = b1*b32 - b3*b12;
85 c[2] = b2*b32 - b3*b22;
87 a[0][0] = a11*b22 - a21*b12;
88 a[1][0] = a12*b22 - a22*b12;
89 a[2][0] = a13*b22 - a23*b12;
91 a[0][1] = a11*b32 - a31*b12;
92 a[1][1] = a12*b32 - a32*b12;
93 a[2][1] = a13*b32 - a33*b12;
95 a[0][2] = a21*b32-a31*b22;
96 a[1][2] = a22*b32-a32*b22;
97 a[2][2] = a23*b32-a33*b22;
99 float det1 = a[0][0]*a[1][1] - a[0][1]*a[1][0];
101 float x11 = (c[0]*a[1][1] - c[1]*a[1][0]) / det1;
102 float x21 = (a[0][0]*c[1] - a[0][1]*c[0]) / det1;
109 float radius = sqrt((b3 + b32*(x11*x11 + x21*x21) - a31*x11 - a32*x21)/a33);