106 |
|
double y = (static_cast<double>(j) + 0.5)*ystep + ylo; |
107 |
|
double sig_cut = 1.0e-5; |
108 |
|
double nu = XbinSize * YbinSize * fit_fcn(x, y, xval); |
109 |
< |
double sigma = mdef->chisquare_error(nu) < sig_cut |
109 |
> |
double sigma = fabs(mdef->chisquare_error(nu)) < sig_cut |
110 |
|
? sig_cut : mdef->chisquare_error(nu); |
111 |
|
|
112 |
|
fsum += xstep * ystep * mdef->get_formula()->Eval(x, y) |
136 |
|
/ static_cast<double>(energy.bins.at(i).size()) + energy.Ylo; |
137 |
|
double nu = fit_fcn(x, y, xval) * XbinSize * YbinSize; |
138 |
|
double sig_cut = 1.0e-5; |
139 |
< |
if (mdef->chisquare_error(nu) > sig_cut || !ignorezero) |
139 |
> |
if (fabs(mdef->chisquare_error(nu)) > sig_cut || !ignorezero) |
140 |
|
chisquare += pow(energy.bins.at(i).at(j) - nu, 2.0) |
141 |
|
/ pow(mdef->chisquare_error(nu), 2.0); |
142 |
|
else |
158 |
|
bool left = par_x < energy.Xlo + cutoff_rad; |
159 |
|
bool right = par_x > energy.Xhi - cutoff_rad; |
160 |
|
bool top = par_y > energy.Yhi - cutoff_rad; |
161 |
< |
bool bottom = par_y > energy.Ylo + cutoff_rad; |
161 |
> |
bool bottom = par_y < energy.Ylo + cutoff_rad; |
162 |
|
|
163 |
|
if (left) { |
164 |
|
double xlo = par_x - cutoff_rad; |
766 |
|
} |
767 |
|
ndof -= npar; |
768 |
|
|
769 |
+ |
r.chisquare.push_back(chisquare); |
770 |
|
double P = prob(chisquare, ndof); |
770 |
– |
cout << "P = "<<P << endl; |
771 |
|
if (P > P_cutoff_val) { |
772 |
|
break; |
773 |
|
} |