Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions saga/include/resolution.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,9 @@ vector<double> fitResolution(
vector<double> fitpars;
vector<double> fitparerrs;
for (int aa=0; aa<nparams; aa++) {
fitpars.push_back((double)pars[aa]->getVal());
fitparerrs.push_back((double)pars[aa]->getError());
RooRealVar *fitpar = (RooRealVar*)w->var(pars[aa]->GetName()); //NOTE: Load from workspace since parameters are copied to work space when you import the PDF.
fitpars.push_back((double)fitpar->getVal());
fitparerrs.push_back((double)fitpar->getError());
}

// Compute chi2 from 1D histograms
Expand Down Expand Up @@ -329,7 +330,7 @@ vector<double> fitResolution(

// Create and add legend entries for PDF parameter values and errors
for (int i=0; i<nparams; i++) {
string par_str = Form("%s = %.3g #pm %.3g %s", pars[i]->GetTitle(), pars[i]->getVal(), pars[i]->getError(), parunits[i].c_str());
string par_str = Form("%s = %.3g #pm %.3g %s", pars[i]->GetTitle(), fitpars[i], fitparerrs[i], parunits[i].c_str());
legend->AddEntry((TObject*)0, par_str.c_str(), Form(" %g ",chi2ndfs[i]));
}

Expand Down
4 changes: 2 additions & 2 deletions saga/include/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -646,14 +646,14 @@ vector<double> fitMass(

// Create and add legend entries for signal PDF parameter values and errors
for (int i=0; i<nparams_sg; i++) {
string par_str = Form("%s = %.3g #pm %.3g %s", a_sg[i]->GetTitle(), a_sg[i]->getVal(), a_sg[i]->getError(), massfit_parunits_sg[i].c_str());
string par_str = Form("%s = %.3g #pm %.3g %s", a_sg[i]->GetTitle(), massfit_pars_sg[i], massfit_parerrs_sg[i], massfit_parunits_sg[i].c_str());
legend->AddEntry((TObject*)0, par_str.c_str(), Form(" %g ",int_ds_val));
}

// Optionally create and add legend entries for background PDF parameter values and errors
if (massfit_plot_bg_pars) {
for (int i=0; i<nparams_bg; i++) {
string par_str = Form("%s = %.3g #pm %.3g %s", a_bg[i]->GetTitle(), a_bg[i]->getVal(), a_bg[i]->getError(), massfit_parunits_bg[i].c_str());
string par_str = Form("%s = %.3g #pm %.3g %s", a_bg[i]->GetTitle(), massfit_pars_bg[i], massfit_parerrs_bg[i], massfit_parunits_bg[i].c_str());
legend->AddEntry((TObject*)0, par_str.c_str(), Form(" %g ",int_ds_val));
}
}
Expand Down