53 , fhCircleXcPool(NULL)
54 , fhCircleYcPool(NULL) {
55 fhErrorA =
new TH1D(
"fhErrorA",
"fhErrorA;dA [cm];Counter", 100, -2., 2.);
56 fhErrorB =
new TH1D(
"fhErrorB",
"fhErrorB;B [cm];Counter", 100, -2., 2.);
57 fhErrorX =
new TH1D(
"fhErrorX",
"fhErrorX;X [cm];Counter", 100, -2., 2.);
58 fhErrorY =
new TH1D(
"fhErrorY",
"fhErrorY;Y [cm];Counter", 100, -2., 2.);
60 new TH1D(
"fhErrorPhi",
"fhErrorPhi;d#Phi [rad];Counter", 100, -2., 2.);
62 fhA =
new TH1D(
"fhA",
"fhA;A [cm];Counter", 100, 5., 7.);
63 fhB =
new TH1D(
"fhB",
"fhB;B [cm];Counter", 100, 5., 7.);
64 fhX =
new TH1D(
"fhX",
"fhX;X [cm];Counter", 100, -1., 1.);
65 fhY =
new TH1D(
"fhY",
"fhY;Y [cm];Counter", 100, -1., 1.);
67 fhPhi =
new TH1D(
"fhPhi",
68 "fhPhi;#Phi [rad];Counter",
75 new TH1D(
"fhRadiusErr",
"fhRadiusErr;dR [cm];Counter", 100, -2., 2.);
77 new TH1D(
"fhCircleXcErr",
"fhCircleXcErr;dXc [cm];Counter", 100, -2., 2.);
79 new TH1D(
"fhCircleYcErr",
"fhCircleYcErr;dYc [cm];Counter", 100, -2., 2.);
80 fhRadius =
new TH1D(
"fhRadius",
"fhRadius;Radius [cm];Counter", 100, 4., 8.);
82 new TH1D(
"fhCircleXc",
"fhCircleXc;Xc [cm];Counter", 100, -2., 2.);
84 new TH1D(
"fhCircleYc",
"fhCircleYc;Yc [cm];Counter", 100, -2., 2.);
86 new TH1D(
"fhRadiusPool",
"fhRadiusPool;Pool R;Counter", 100, -5., 5.);
88 new TH1D(
"fhCircleXcPool",
"fhCircleXcPool;Pool Xc;Counter", 100, -5., 5.);
90 new TH1D(
"fhCircleYcPool",
"fhCircleYcPool;Pool Yc;Counter", 100, -5., 5.);
101 Double_t sigmaError = 0.2;
110 for (Int_t iR = 0; iR < 50000; iR++) {
113 ellipse.
SetXYABP(X0, Y0, A, B, phi);
114 for (Int_t iH = 0; iH < nofHits; iH++) {
115 Double_t alfa = gRandom->Rndm() * 2. *
TMath::Pi();
117 Double_t errorX = gRandom->Gaus(0, sigmaError);
118 Double_t errorY = gRandom->Gaus(0, sigmaError);
120 Double_t hx = A *
cos(alfa);
121 Double_t hy = B *
sin(alfa);
123 Double_t hitXRot = hx *
cos(phi) - hy *
sin(phi);
124 Double_t hitYRot = hx *
sin(phi) + hy *
cos(phi);
130 fitEllipse->
DoFit(&ellipse);
143 fitCircle->
DoFit(&ellipse);
146 Double_t mcR = (A + B) / 2.;
159 cout << nofBadFit << endl;
164 new TCanvas(
"rich_fitter_errors",
"rich_fitter_errors", 900, 600);
184 new TCanvas(
"rich_fitter_params",
"rich_fitter_params", 900, 600);
198 new TCanvas(
"rich_fitter_circle",
"rich_fitter_circle", 900, 900);
228 for (Int_t
i = 0;
i < 3;
i++) {
231 for (Int_t j = 0; j < 3; j++) {
240 for (Int_t iHit = 0; iHit < ring->
GetNofHits(); iHit++) {
241 Double_t xi = ring->
GetHit(iHit).
fX;
242 Double_t yi = ring->
GetHit(iHit).
fY;
243 Double_t ri =
sqrt((xi - xc) * (xi - xc) + (yi - yc) * (yi - yc));
244 Double_t err = sigma;
246 Double_t f1 = (-1.0 * (xi - xc)) / (ri * err);
247 Double_t f2 = (-1.0 * (yi - yc)) / (ri * err);
248 Double_t f3 = (-1.) / err;
249 Double_t Y = (R - ri) / err;
251 cov(0, 0) = cov(0, 0) + f1 * f1;
252 cov(0, 1) = cov(0, 1) + f1 * f2;
253 cov(0, 2) = cov(0, 2) + f1 * f3;
255 cov(1, 0) = cov(0, 1);
256 cov(1, 1) = cov(1, 1) + f2 * f2;
257 cov(1, 2) = cov(1, 2) + f2 * f3;
259 cov(2, 0) = cov(0, 2);
260 cov(2, 1) = cov(1, 2);
261 cov(2, 2) = cov(2, 2) + f3 * f3;
263 HY3(0, 0) = HY3(0, 0) + Y * f1;
264 HY3(1, 0) = HY3(1, 0) + Y * f2;
265 HY3(2, 0) = HY3(2, 0) + Y * f3;