15#ifndef CBM_RICH_RING_FITTER_ELLIPSE_BASE
16#define CBM_RICH_RING_FITTER_ELLIPSE_BASE
63 double xf1 = ring->
GetXF1();
64 double yf1 = ring->
GetYF1();
65 double xf2 = ring->
GetXF2();
66 double yf2 = ring->
GetYF2();
70 for (
int iHit = 0; iHit < nofHits; iHit++) {
74 double d1 =
sqrt((
x - xf1) * (
x - xf1) + (
y - yf1) * (
y - yf1));
75 double d2 =
sqrt((
x - xf2) * (
x - xf2) + (
y - yf2) * (
y - yf2));
77 chi2 += (d1 + d2 - 2. * axisA) * (d1 + d2 - 2. * axisA);
100 for (
int iHit = 0; iHit < nofHits; iHit++) {
104 double d1 = fabs(
A *
x *
x +
B *
x *
y +
C *
y *
y +
D *
x +
E *
y +
F);
105 double d2 =
sqrt(pow(2 *
A *
x +
B *
y +
D, 2) + pow(
B *
x + 2 *
C *
y +
E, 2));
107 chi2 += (d1 * d1) / (d2 * d2);
Abstract base class for concrete Rich Ring fitting algorithms. Each derived class must implement the ...
friend fvec sqrt(const fvec &a)
CbmRichRingFitterBase()
Default constructor.
virtual ~CbmRichRingFitterEllipseBase()
Destructor.
CbmRichRingFitterEllipseBase()
Default constructor.
virtual void CalcChi2(double A, double B, double C, double D, double E, double F, CbmRichRingLight *ring)
Calculate chi2 of the ellipse fitting using parameters of 2D curve.
virtual void CalcChi2(CbmRichRingLight *ring)
Calculate chi2 of the ellipse fit.
double GetXF1() const
Calculate and return X coordinate of the first focus.
double GetYF1() const
Calculate and return Y coordinate of the first focus.
double GetYF2() const
Calculate and return Y coordinate of the second focus.
double GetXF2() const
Calculate and return X coordinate of the second focus.
int GetNofHits() const
Return number of hits in ring.
CbmRichHitLight GetHit(int ind)
Return hit by the index.