How to disable both constant term and cache-and-track optimisation

Hi,
is there a way to disable all caching optimisations for a given pdf component only?
Best,
Vincenzo

HI,

I think the optimizations can be enabled/disabled at the log-likelihood level, using the command option in createNLL or fitTo, RooFit::Optimize(flag) or directly in RooMinimizer::optmizeConst(flag)

Lorenzo

Hi,
in addition to what Lorenzo said, you might get away doing this:

RooRealVar x("x", "x", 1, 0, 10)
x.setAttribute("NOCacheAndTrack")

I’m not sure if that disables all what you want, but it will prevent caching of this component.

Hi Lorenzo,
yes, using Optimize(0) disables both const term and cache-and-track, but that is for every component. But I need to disable them for only one specific component, not for everything.

Concerning Stefan’s suggestion, I already tried that. Apparently it turns of cache-and-track, at least this is reported in debug messages, but then running the fit I’m not sure it actually works. And in any case, it does not turn off the const term optimisation. For that I also tried to set the attribute NeverConstant, but I’m not sure it works either, as the behaviour of the fit is very different when turning off the optimisations with Optimize(0)

So the straight question is: does anybody know of a reliable way to turn off all optimisations for a given component only?

The other way round is to turn off everything and then turn on selectively. In such a case, a simple example on how to do that for every component in one shot (we are talking of a model with several hundreds of components) would be very helpful.

Cheers,
Vincenzo

Hi Vincenzo,

You may try to set the attribute NeverConstant. I found it by grepping the code a bit, but I couldn’t test it.

Thanks Stephan, I already tried also that – I’m grepping the code as well, but the logics is not entirely linear. However, it does not seem to work well either. I’m still struggling. As soon as I find a way which works, I will post the solution to the forum. (Unless by any chance Wouter knows the answer and comes first…) :slight_smile:

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