4 double wx = 1. - par[4] * TMath::Power(xx + par[5], 2);
5 double xboxe = par[0] * 0.25
6 * (1. + TMath::Erf((xx + par[1] - par[3]) / par[2]))
7 * (1. + TMath::Erf((-xx + par[1] + par[3]) / par[2]));
23 h1 = (TH1*) gROOT->FindObjectAny(hname);
25 TAxis* xaxis = h1->GetXaxis();
26 Double_t Ymin = xaxis->GetXmin();
27 Double_t Ymax = xaxis->GetXmax();
28 TF1* f1 =
new TF1(
"YBox",
f1_xboxe, Ymin, Ymax, 6);
29 Double_t yini = (h1->GetMaximum() + h1->GetMinimum()) * 0.5;
30 f1->SetParameters(yini, Ymax * 0.8, 2., -1., 0., 0.);
35 res[9] = f1->GetChisquare();
37 for (
int i = 0;
i < 6;
i++) {
38 res[
i] = f1->GetParameter(
i);
39 err[
i] = f1->GetParError(
i);
42 cout <<
"YBox Fit of " << hname <<
" ended with chi2 = " << res[9]
43 << Form(
", strip length %7.2f +/- %5.2f, position resolution %7.2f "
44 "+/- %5.2f at y_cen = %7.2f +/- %5.2f",