Save complicated TF1

Hi Experts,
I have question concering TF1 class. I have a complicated class that plot my function in form of TF1, one of those complicated classes used complicated math (integrals) to calculate value of the function, another class have analytical form.
Both classes are drawn and looks ok, however when I save my canvas as root file this complicated class is drawn as zero. I do not want to send entire code, but I would like to know how TF1 is saved, as a points? or as a function that is evaluated? This would help me solve issue with saving functions.


Please read tips for efficient and successful posting and posting code

Please fill also the fields below. Note that root -b -q will tell you this info, and starting from 6.28/06 upwards, you can call .forum bug from the ROOT prompt to pre-populate a topic.

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


I think there is an option in TH1::Fit, (maybe '+' but I might be wrong…). @moneta knows better

Hi,
If the TF1 is implemented as C++ code it will be saved just as a set of points to be displayed in the figure. If TF1 is built as a formula (i.e. using a string), then the expression will be saved fully and for example one can later modify the function (for example changing the parameter values).
I hope this helps

Best,
Lorenzo

1 Like

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