I have implemented a class that loads a Minuit2Minimizer and adds variables and in the end performs a minimization. I am performing a minimization on 12 variables with very low statistics and I have noticed that if I try to minimize all 12 variables at once only 2 or 3 of tghem vary and a minimum is “found”.
Therefore I would like to minimize them one by one, fixing the rest. Looking at the Minuit2Minimizer documentation I have not found any function to fix/release existing variables, and the only way I have thought of is to recreate the Minuit2Minimizer instance each time with the fitted values. That doesn’t seem a good idea, so I am probably missing something. Anyone can help me?
Thanks,
Albert
EDIT: I wanted to post this thread in the “Stat and Math Tools” forum. Any way it can be moved?
you can use the methods Minuit2Minimizer::SetVariable to set a free variable and Minuit2Minimizer::SetFixedVariable to set a fixed one. If the variable already exists in the minimizer, it will fix or release the existing one.
Thanks!! As I understand from the docs, I have to provide the “initial” value for the variable, don’t I? I have to get the result from the previous fit and Fix/SetVariable…