Release and fix parameters in the same code

Dear experts,

I am trying to do a 2-step fit procedure wherein I need to fix and release some parameters (let’s say a and b). In the first step, I want to fit the data and get the values of b with fixed a . Then I want to fix the values of b, thus obtained (from the fit) and release a and then fit the data again.

I am currently referring to this example and this answer and I am now able to fix the parameters using b.setConstant(kTRUE), but I don’t know how to release the parameter a, which was earlier fixed as RooRealVar a("a","a",0);

Will you please look into it.

Regards,
Sanjeeda

Hi @sanjeeda
we need @moneta or @jonas 's help here, let’s ping them.

Cheers,
Enrico

Thanks @eguiraud,
I tried the following and it did what I wanted. Not sure if this is the right way.
To fix: <parameter_name>.setConstant(kTRUE);
To release: <parameter_name>.setConstant(kFALSE);

Hi,
Yes this is the right way to do it for releasing a parameter, call <parameter_name>.setConstant(false);

Lorenzo

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.