29 ring->
SetXYABP(-1.,-1.,-1., -1., -1.);
38 for(
int i = 0; i < nofHits; i++) {
43 vector<double> fpar =
DoFit(hitX, hitY);
52 const vector<double>& fpar)
55 double xc = (fpar[0] + fpar[2])/2.;
56 double yc = (fpar[1] + fpar[3])/2.;
58 double p1 = (fpar[0] - fpar[2])*(fpar[0] - fpar[2]) + (fpar[1] - fpar[3])*(fpar[1] - fpar[3]);
60 ring->
SetXYABP(-1.,-1.,-1., -1., -1.);
65 double c = sqrt ( p1 ) / 2.;
66 double p2 = fpar[4]*fpar[4] - c*
c;
68 ring->
SetXYABP(-1.,-1.,-1., -1., -1.);
72 double b = sqrt ( p2 );
74 double p3 = fpar[2] - fpar[0];
76 ring->
SetXYABP(-1.,-1.,-1., -1., -1.);
80 double k = (fpar[3] - fpar[1]) / (fpar[2] - fpar[0]);
83 ring->
SetXYABP(xc, yc, fpar[4], b, ang);
88 const vector<double>&
x,
89 const vector<double>&
y)
96 for(
int i = 0; i < x.size(); i++) {
101 xf1 = xf1 / x.size() - a;
102 yf1 = yf1 / x.size();
103 double xf2 = xf1 + a;
106 TFitterMinuit theMinuit;
107 theMinuit.SetPrintLevel(-1);
108 theMinuit.SetMinuitFCN(theFCN);
109 theMinuit.SetParameter(0,
"xf1", xf1, 0.1, 1., -1.);
110 theMinuit.SetParameter(1,
"yf1", yf1, 0.1, 1., -1.);
111 theMinuit.SetParameter(2,
"xf2", xf2, 0.1, 1., -1.);
112 theMinuit.SetParameter(3,
"yf2", yf2, 0.1, 1., -1.);
113 theMinuit.SetParameter(4,
"a", a, 0.1, 1., -1.);
114 theMinuit.CreateMinimizer();
115 theMinuit.Minimize();
118 for (
int i = 0; i < 5; i++){
119 fpar.push_back(theMinuit.GetParameter(i));