I need to make use of the current errors of the variable parameters (for “weighted” sum of parameter squares) inside my own function:
class MyFcn : public ROOT::Minuit2::FCNBase
{
...
double operator()( const std::vector<double>& par ) const;
...
};
And in my main program I have typical calls:
...
ROOT::Minuit2::MnUserParameters upar;
...
upar.Add(...);
...
MyFcn myfcn(...);
ROOT::Minuit2::MnMigrad migrad( myfcn, upar );
ROOT::Minuit2::FunctionMinimum min = migrad();
...
A standard approach is to implement:
double operator()( const std::vector<double>& par ) const {
...
// but how to reach the errors from here?
...
}
Intuitively, I would instead need:
double operator()( const ROOT::Minuit2::MnUserParameters& params ) const {
...
//now I could reach both parameter values and their errors:
double parVal0 = params.Value("parName0");
double parErr0 = params.Error("parName0");
...
}
But that does not work.
So how can I do this? Many thanks in advance!