Update of the RooRealVar after setting it to constant

Dear experts!

I do an iterative fit using RooFit Minuit2.
After the first iteration, if certain conditions are not met, I fix the values of some parameters (RooRealVar) to the values from MC.
I noticed that errors of these parameters for some reason are not set to 0, as I would expect from the fixed constant.
I thought that if the RooRealVar is set constant its error automatically becomes 0.

I see that RooAbsRealLValue::setConstant method calls for the RooAbsArg::setValueDirty. RooAbsArg::setValueDirty should flag when the variables need to be reevaluated. There is an additional condition inside RooAbsArg::setValueDirty: _operMode == Auto && !inhibitDirty(), which in principle by default should be true (not sure).

How to make sure that the Errors of the RooRealVar get reevaluated after rerunning the fit with RooRealVar set to constant? Can it be that something changes the values of _operMode, for example, from the default to something else? Is there a way to check _operMode value and inhibitDirty() value for a specific RooRealVar?

Thank you in advance!

setConstant: https://root.cern.ch/doc/master/RooAbsRealLValue_8h_source.html#l00115
setValueDirty: https://root.cern.ch/doc/master/RooAbsArg_8h_source.html#l00488

Root: 6.18.00

Perhaps @moneta can help

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