how does one iterate an instance of RooFitResult? I want to obtain a list of each value name, actual value and error after the fit without knowing the names a priori. I am thinking of something similar to:
You can get a RooArgList of the parameters using RooFitResult::floatParsFinal(), as you already found out. However, RooArgList does not have a begin or end defined, so simple iterating using a C++ auto loop does not work. You have to do it manually, as far as I know:
auto pars = myFitResult->floatParsFinal();
RooRealVar *p;
for (int i = 0; i < pars->getSize(); i++)
{
p = (RooRealVar *)pars->at(i);
cout << p->getTitle() << endl;
cout << p->getVal() << endl;
cout << p->getError() << endl;
}