148 |
|
} |
149 |
|
|
150 |
|
// add errors due to Gaussians outside histogram |
151 |
< |
double eps = 0.1; // accuracy set for this function |
151 |
> |
double eps = 0.01; // accuracy set for this function |
152 |
|
for (int i = 0; i < ngauss; i++) { |
153 |
|
double *pval = xval+i*(mdef->get_formula()->GetNpar()); |
154 |
|
double par_x = pval[mdef->get_indiv_max_x()]; |
486 |
|
void fill_histo_with_vec(TH2 *hist, vector< vector<double> > &vec) { |
487 |
|
for (int i = 0; i < vec.size(); i++) { |
488 |
|
for (int j = 0; j < vec[i].size(); j++) { |
489 |
< |
hist->Fill(i+1, j+1, vec[i][j]); |
489 |
> |
hist->SetBinContent(i+1, j+1, vec[i][j]); |
490 |
|
} |
491 |
|
} |
492 |
|
} |
499 |
|
if (ngauss <= mdef->get_n_special_par_sets()) { |
500 |
|
init_spec_pars = true; |
501 |
|
for (int k = 0; k < ngauss; k++) { |
502 |
< |
int ipar0 = k*mdef->get_formula()->GetNpar(); // index of par 0 |
502 |
> |
int ipar0 = k*mdef->get_formula()->GetNpar(); // index of indiv par 0 |
503 |
|
for (int l = 0; l < mdef->get_formula()->GetNpar(); l++) { |
504 |
|
int ipar = ipar0 + l; |
505 |
|
if (ipar < npar) |
528 |
|
double y = static_cast<double>(j)*(energy.Yhi - energy.Ylo) |
529 |
|
/ static_cast<double>(energy.bins[i].size()) + energy.Ylo; |
530 |
|
if (ngauss > 1) { |
531 |
< |
// subtract 4*sigma plus integral of fit function |
531 |
> |
// subtract integral of fit function |
532 |
|
try { |
533 |
|
int npval_other = r.pval.at(r.pval.size()-1).size(); |
534 |
|
if (npval_other > 256) { |
541 |
|
ngauss--; |
542 |
|
double nu = fit_fcn(x, y, pval_other) * XbinSize * YbinSize; |
543 |
|
ngauss++; |
544 |
< |
sub_energy[i][j] = energy.bins[i][j] - nu |
545 |
< |
- 2.2*mdef->chisquare_error(nu); |
544 |
> |
sub_energy[i][j] = energy.bins[i][j] - nu; |
545 |
|
} |
546 |
|
catch (exception ex) { |
547 |
|
cerr << "Exception in par_init" << endl; |