Recently I found an issue when I want to clone a TF1. The TF1 object is created from a TGraph. While after cloning, the evaluated value changes. I’m not sure why this would happen. Please have a look at my example code below.
Please also find the test graph file attached. I’m asking this question is because I wanted to import this graph-created TF1 into an RooWorkspace. While I found that after importing, the values changed, that’s because the import() function will clone the object.
I would appreciate a lot you have any helpful suggestions. Thanks a lot!
Cheers,
Kunlin Ran
_ROOT Version: v6-18-04 or v6-22-06testGraph.root (5.4 KB)
The reason I want to use the TF1 is that I’d like to make graph interpolations and import such an interpolation into an RooWorkspace, where one of the RooRealVar should be the “x” defined in the function. So basically I need to transfer TGraph → TF1 → RooTFnBinding. I found that before importing TF1 or RooTFnBinding into the workspace, the evaluations are as expected. While after importing, I tried to get the RooTFnBinding from the workspace with “ws->obj(TFnBindingName)” and printed out the evaluations. I was surprised that the values changed. That’s due to this clone issue, because the import() function will clone the corresponding object.
Yeah, I fully agree that the differences are quite small, mostly at 0.1% level. So I also guess it might be related to the precision issue. Let’s see what other experts think.