Precision of TF1::GetMaximumX

Hello,

I am using method TF1::GetMaximumX to find the x-coordinate corresponding to the maximum of a TF1 function used to fit a histogram.
What is the precision of this method? I looked into the class reference (ROOT: TF1 Class Reference) but I could not find this information.

Many thanks in advance!

Regards


ROOT Version: 6.20/04
Platform: Ubuntu x86_64 x86_64 x86_64 GNU/Linux
Compiler: Not Provided


Hi,
The precision of the method is the epsilon parameter passed in TF1::GetMaximumX. The same value is used both as absolute and relative precision.
For more control you can always use directly the BrentMinimizer class that is used in the TF1 implementation of GetMaximumX.

Best regards

Lorenzo

Hello Lorenzo,

thanks for the reply.
But in this sentence: “epsilon (default = 1.E-10) controls the relative accuracy (if |x| > 1 ) and absolute (if |x| < 1)” what does |x| refers to?

Best regards
Davide

Hello,
that x is the value you want to compute, i.e in this case the function value x for which f(x) is a maximum.

Are you having some issues using TF1::GetMaximumX ?

Best,

Lorenzo

Hello,

TF1::GetMaximumX works fine, I just wanted to know which error I should quote for the result.
In my case |x|<1 and hence I deduce that the error is relative and equal to 1.E-10 (I used the default value for epsilon).

Regards
Davide

Hi,
1.E-10 is an upper value, if |x| < 1 , you can quote a maximum error on x of 1.E-10.

Best,

Lorenzo

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