Problem with fitting ATan function

fasi.txt (1.8 KB)
main.cpp (663 Bytes)
macro.cpp (534 Bytes)

I’m trying to fit a set of data but (even after initialising the parameters) i’m getting this error several times:

Error in TFormula::Eval: Formula is invalid and not ready to execute
TMath::Pi is unknown.
Tmath::Pi is unknown.
TMath::ATan is unknown.

I don’t understand why it shouldn’t work since i’ve always fitted my data like this. I’ve tried both running the code on root for windows (interpreted macro.cpp) and linux (compiled main.cpp) but i’m always getting the same error.

Sometimes i get some fit results but they are clearly wrong (i’m expecting p0 to be approximately 1 and p1 to be around 10^-5 or 10^-6, and i get results of 10^3 with an uncertainty of around 10^4. Sometimes it plots a straight line on the zero (the picture shows the straight line on the zero, it comes from the same dataset with the same code for the fit)

Does anyone have an idea of why it behaves like this?

Thank you very much for your help

ROOT Version: 8.18/04 for win32, 6.22/02 for linuxx8664gcc

Edit: “Attesa” is the function generated with the data i’ve collected in the laboratory, and it reminds of the shape of the experimental data so i don’t understand why it can’t fit

Tmath should be TMath

1 Like