I would like to print the pdf for each given data point, that is why I need to set the RooFit variable for each point (which is ugly in itself, but it is so).
PyROOT automatically casts any object down to its actual type. So you can just get the elements from the RooArgSet and they will be RooRealVar proxies that you can do the usual RooRealVar things with (e.g. getVal()).
I believe my problem was that I transferred that variable to another function, and it was deleted on its way (constants of my fit were deleted). I fixed that later by keeping track of those parameters.
Hi @jonas, thanks for the suggestion.
Unfortunately I don’t get from your function: do you release Python or ROOT ownership?
I would like my fit results to be copied (via Python’s copy.deepcopy). And ideally pickled when needed.
Would your function solve that or should I do something else?
I can open a new topic if needed.
Thank you in advance.
UPD: I created a similar topic on copying and memory management: