I have two questions aboutROOT::Math::Minimizer class:
minimization provides a vector of parameters x [0], x [1] …
in my case the SetLimitedVariable [1] depends on x [0], that is to say : at each iteration I have a new x [0], my limits ss_low, ss_up (see the example below /* … */) depends on the value x [0] given by the minimization.
Can I do a second “min->Minimize();” after recovering my parameters, something like what I write below
ROOT::Math::Minimizer* min = ROOT::Math::Factory::CreateMinimizer("Minuit2", "Migrad");
min->SetMaxFunctionCalls(1000000);//1000000
min->SetMaxIterations(10000);
min->SetTolerance(0.001);
min->SetPrintLevel(3);//3 au lieu de -1 pour afficher tout
ROOT::Math::Functor f(&Fcn, 4);
.....
min->SetLimitedVariable(0,"ll", variable[0], step[0], ll_low, ll_up);
min->SetLimitedVariable(1,"ss", variable[1], step[1],ss_low, ss_up);
....
// do the minimization
min->Minimize();
const double *xs = min->X();
cout<<"par[0] ="<< xs[0]<<" !par[1] ="<< xs[1]....
/* I want to do somthing like:
ss_low = xs[0] - 3;
ss_up = xs[0] + 3;
min->SetLimitedVariable(0,"ll", variable[0], step[0], ll_low, ll_up);
min->SetLimitedVariable(1,"ss", variable[1], step[1],ss_low, ss_up);
min->Minimize(); */
Thank you for your answer Lorenzo,
so there is no problem if I make two minimizations as below? (First method)
what I want to do is get the variable [0] after the first iteration and use it in the variable [1] like what I write in the second method (see below), is that possible?: