11 #ifndef CBM_RICH_RING_FITTER_ELLIPSE_BASE
12 #define CBM_RICH_RING_FITTER_ELLIPSE_BASE
61 double xf1 = ring->
GetXF1();
62 double yf1 = ring->
GetYF1();
63 double xf2 = ring->
GetXF2();
64 double yf2 = ring->
GetYF2();
68 for(
int iHit = 0; iHit < nofHits; iHit++){
72 double d1 = sqrt( (x-xf1)*(x-xf1) + (y-yf1)*(y-yf1) );
73 double d2 = sqrt( (x-xf2)*(x-xf2) + (y-yf2)*(y-yf2) );
75 chi2 += (d1 + d2 - 2.*axisA)*(d1 + d2 - 2.*axisA);
105 for(
int iHit = 0; iHit < nofHits; iHit++){
109 double d1 = fabs(A*x*x + B*x*y + C*y*y + D*x + E*y + F);
110 double d2 = sqrt( pow(2*A*x + B*y + D, 2) + pow(B*x + 2*C*y + E, 2) );
112 chi2 += (d1*d1)/(d2*d2);