Variable Release in Minimizer Interface

A short question, when fixing and releasing variables using the Minimizer Interface (MINUIT2) does one implement the following commands:

ROOT::Math::Minimizer *minim = ROOT::Math::factory::CreateMinimizer(minimType);
ROOT::Math::Functor func( &Likelihood, 5);

minim->SetFunction(func);
minim->SetVariable(0, “C”, 0, 0.1);
minim->SetVariable(1, “A_s”, 0, 0.1);
minim->SetVariable(2, “A_c”, 0, 0.1);
minim->SetVariable(3, “B_s”, 0, 0.1);
minim->SetVariable(4, “B_c”, 0, 0.1);

minim->FixVariable(1);
minim->FixVariable(2);
minim->FixVariable(3);
minim->FixVariable(4);

minim->SetPrintLevel(3);

minim->Minimize();
minim->ReleaseVariable(1);
minim->Minimize();
minim->ReleaseVariable(2);
minim->Minimize();
minim->ReleaseVariable(3);
minim->Minimize();
minim->ReleaseVariable(4);
minim->Minimize();

Hello,

Yes, you should do as you have written to fix and then release the variables. If you have any problems, please let me know.

Best Regards

Lorenzo

Hi Lorenzo,

I tried exactly what I asked about above and received the following error for each call of FixVariable:

error: ‘class ROOT::Math::Minimizer’ has no member named ‘FixVariable’

Hi,

Yes you are right. These new functions (FixVariable/ReleaseVariable) have been added only recently in the 5.34 patches branch. They are not yet in 5.34.18, you will have to take the head of the 5.34 patches (from git) or wait for version 5.34.19 or version 6.00, which will be released next at the end of next week.

Best Regards

Lorenzo