Propagate change of parameters in RooFit

I want to make a 3-dimensional pdf, which is a result of a convolution. I found how to do a 3-dimensional Fourier transform, but now the problem is how to signalize the change of parameters to recompute the transform when needed.

I found examples in RooFFTConvPdf::fillCacheObject and RooAbsCachedPdf::getCache, but I don’t understand their general meaning.
Is there any documentation for that? Are there other classes where I can understand what’s happening when parameters are changed (maybe the fit routine)?

It looks like RooFFTConvPdf::fillCacheObject computes function values for all possible parameters, which is strange.

I don’t understand the meaning of

// Determine if there other observables than the convolution observable in the cache

what could those observables be? What if the function does or does not depend on them?

In RooAbsCachedPdf::getCache there is a line

if (cache->paramTracker()->hasChanged(kTRUE) …)

should I use that paramTracker or RooChangeTracker? If they were they enough, would I need all the other code?

Should I copy that code right from .cxx files, or is there an easier way, a defined interface to implement such parameter change propagation?

I would be thankful for the general review of how RooFit handles variable changes (with references to concrete classes, if possible). Thank you!

Hi @ynikitenko; I am sure @jonas or @moneta can help you with this.

Cheers,
J.

1 Like

Just a quick post to prevent this thread from getting closed, buying myself a little bit more time to answer this question.

1 Like

Hi @ynikitenko!

all the documentation to the RooAbsCachedPdf is there in the source code, in particular in the beginning of the RooAbsCachedPdf.cxx file.

For the general review of how RooFit handles variable changes, I recommend to take a look at the “Caching of values” section in the RooAbsArg documentation.

In an attempt to answer more precisely to your question, I don’t understand exactly what you mean completely, but I’ll try. Maybe we can start from there:

// Determine if there other observables than the convolution observable in the cache
what could those observables be? What if the function does or does not depend on them?

As you see in the documentation of RooAbsCachedPdf::getCache(), it is possible to request cached results for any set of observables. For the convolution, it is possible that one or more of the observables is not the convolution observable. The RooFFTConvPdf is then computing the convolution in “slices” of these other observables (see here the source code).

should I use that paramTracker or RooChangeTracker? If they were they enough, would I need all the other code?

The paramTracker is a RooChangeTracker, so I think we are talking about using the RooChangeTracker in any case.

Should I copy that code right from .cxx files, or is there an easier way, a defined interface to implement such parameter change propagation?

The RooChangeTracker is exactly meant for that, so I think you can indeed copy the code with the RooChangeTracker that you see in RooAbsCachePdf.

I hope this answer is a first start, if you have more precise implementation questions we can also have a look at the code together. Is the code for your 3-dimensional convolution publicly available?

Cheers,
Jonas

Dear Jonas, many thanks for your reply. Now I get the general idea and have the needed references.
I’m not working on that problem at the moment and not sure that I will actually use the 3-dimensional convolution. If I do and if I have questions, I’ll share the code, of course.
Thank you!

I face similar kind of issue last time. But no response from anyone. And still searching for some proper solution.

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