Left/Right Shifts in TFormula

Hi, I’m wondering if there is the functionality to shift the resulting function left or right when using TFormula. For example you have “pol3” which is c0 + x*(c1 + x*(c2 + x*c3)), but is there a simple way to obtain c0 + (x-x0)*(c1 + (x-x0)*(c2 + (x-x0)*c3)))? Obviously for a pol3 it is simple for the user to define it manually, but I am wondering more in general for polN, gaus, expo, etc.

I read the TFormula docs and it does not mention this feature, but maybe there is a trick that can achieve the desired shift?

Jean-François

Hi,

You would need to define an additional parameter in TFormula for doing this. The Gaus and Landau functions have already this pre-defined parameter.
For “expo” you would need to define the function your-self and not use the pre-defined function. Do something like:

TFormula f("f","[0]* exp( [1] * ( x- [2]) )");

This is not supported:

TFormula f("f"," expo( x- [2])");

Best Regards
Lorenzo