Minuit2 Scan with other variables recalculated

[quote=“Pepe Le Pew”][url]Minuit2

Thank you Pepe, for the link http://root.cern.ch/root/html/ROOT__Minuit2__MnScan.html#ROOT__Minuit2__MnScan:MnScan. It discusses ROOT::Minuit2::MnScan. Can you help instruct me on how to integrate that into my code? I don’t know enough ROOT. My code looks like this: ROOT::Minuit2::Minuit2Minimizer min ( ROOT::Minuit2::kMigrad ); ... ROOT::Math::Functor f(&Chi2, Npulls+2); min.SetFunction(f);

ROOT::Minuit2::MnScan objectname; or min.MnScan(…); don’t work.

Update:
To get around this in the short term, I scan manually using a for loop. Before the for loop, I minimize with the active variable free ( SetLimitedVariable(, “title”, …) ). In the for loop, I fixed that variable for each iteration ( SetFixedVariable(, “title”, …) then minimize again). After the for loop, I free the variable with ( SetLimitedVariable(, “title”, …) ), then run Contour(). and “title” are always the same. Unfortunately, when I run Contour(), it still thinks the variable is fixed and fails! Is there a better way?

Thanks!