53 fhErrorA =
new TH1D(
"fhErrorA",
"fhErrorA;dA [cm];Counter", 100, -2., 2.);
54 fhErrorB =
new TH1D(
"fhErrorB",
"fhErrorB;B [cm];Counter", 100, -2., 2.);
55 fhErrorX =
new TH1D(
"fhErrorX",
"fhErrorX;X [cm];Counter", 100, -2., 2.);
56 fhErrorY =
new TH1D(
"fhErrorY",
"fhErrorY;Y [cm];Counter", 100, -2., 2.);
57 fhErrorPhi =
new TH1D(
"fhErrorPhi",
"fhErrorPhi;d#Phi [rad];Counter", 100, -2., 2.);
59 fhA =
new TH1D(
"fhA",
"fhA;A [cm];Counter", 100, 5., 7.);
60 fhB =
new TH1D(
"fhB",
"fhB;B [cm];Counter", 100, 5., 7.);
61 fhX =
new TH1D(
"fhX",
"fhX;X [cm];Counter", 100, -1., 1.);
62 fhY =
new TH1D(
"fhY",
"fhY;Y [cm];Counter", 100, -1., 1.);
63 Double_t
pi = TMath::Pi();
64 fhPhi =
new TH1D(
"fhPhi",
"fhPhi;#Phi [rad];Counter", 100, - pi/2. - pi/6. , pi/2. + pi/6.);
67 fhRadiusErr =
new TH1D(
"fhRadiusErr",
"fhRadiusErr;dR [cm];Counter", 100, -2., 2.);
68 fhCircleXcErr =
new TH1D(
"fhCircleXcErr",
"fhCircleXcErr;dXc [cm];Counter", 100, -2., 2.);
69 fhCircleYcErr =
new TH1D(
"fhCircleYcErr",
"fhCircleYcErr;dYc [cm];Counter", 100, -2., 2.);
70 fhRadius =
new TH1D(
"fhRadius",
"fhRadius;Radius [cm];Counter", 100, 4., 8.);
71 fhCircleXc =
new TH1D(
"fhCircleXc",
"fhCircleXc;Xc [cm];Counter", 100, -2., 2.);
72 fhCircleYc =
new TH1D(
"fhCircleYc",
"fhCircleYc;Yc [cm];Counter", 100, -2., 2.);
73 fhRadiusPool =
new TH1D(
"fhRadiusPool",
"fhRadiusPool;Pool R;Counter", 100, -5., 5.);
74 fhCircleXcPool =
new TH1D(
"fhCircleXcPool",
"fhCircleXcPool;Pool Xc;Counter", 100, -5., 5.);
75 fhCircleYcPool =
new TH1D(
"fhCircleYcPool",
"fhCircleYcPool;Pool Yc;Counter", 100, -5., 5.);
90 Double_t sigmaError = 0.2;
99 for (Int_t iR = 0; iR < 50000; iR++){
101 ellipse.
SetXYABP(X0, Y0, A, B, phi);
102 for (Int_t iH = 0; iH < nofHits; iH++){
103 Double_t alfa = gRandom->Rndm()*2.*TMath::Pi();
105 Double_t errorX = gRandom->Gaus(0, sigmaError);
106 Double_t errorY = gRandom->Gaus(0, sigmaError);
108 Double_t
hx = A *
cos(alfa);
109 Double_t
hy = B * sin(alfa);
111 Double_t hitXRot = hx *
cos(phi) - hy * sin(phi);
112 Double_t hitYRot = hx * sin(phi) + hy *
cos(phi);
118 fitEllipse->
DoFit(&ellipse);
131 fitCircle->
DoFit(&ellipse);
134 Double_t mcR = (A + B) / 2.;
147 cout << nofBadFit << endl;
152 TCanvas *
c =
new TCanvas(
"rich_fitter_errors",
"rich_fitter_errors", 900, 600);
171 TCanvas *
c2 =
new TCanvas(
"rich_fitter_params",
"rich_fitter_params", 900, 600);
184 TCanvas *
c3 =
new TCanvas(
"rich_fitter_circle",
"rich_fitter_circle", 900, 900);
217 for (Int_t i = 0; i < 3; i++){
220 for (Int_t j = 0; j < 3; j++){
229 for (Int_t iHit = 0; iHit < ring->
GetNofHits(); iHit++) {
230 Double_t xi = ring->
GetHit(iHit).
fX;
231 Double_t yi = ring->
GetHit(iHit).
fY;
232 Double_t ri = sqrt((xi - xc) * (xi - xc) + (yi - yc) * (yi - yc));
233 Double_t
err = sigma;
235 Double_t f1 = (-1.0 * (xi - xc)) / (ri *
err);
236 Double_t
f2 = (-1.0 * (yi - yc))/(ri *
err);
237 Double_t f3 = (-1.) /
err;
238 Double_t Y = (R - ri) / err;
240 cov(0,0) =
cov(0,0) + f1*f1;
242 cov(0,2) =
cov(0,2) + f1*f3;
246 cov(1,2) =
cov(1,2) + f2*f3;
250 cov(2,2) =
cov(2,2) + f3*f3;
252 HY3(0,0) = HY3(0,0) + Y*f1;
253 HY3(1,0) = HY3(1,0) + Y*
f2;
254 HY3(2,0) = HY3(2,0) + Y*f3;