It seems like there is some kind of memory corruption going on when I fit a user defined
function in python. I am using root 4.01/02, python 2.3.3, and Linux 2.4.21. I appended
an example which is admittedly very convoluted. Simpler fits crash
also, but not as easily so it is harder to find an example for demonstration purposes.
The problem seems to occur as soon as I fit a user defined python function. When I define
TF1 with a TFormula that does the same thing as the python function, it works.
By the way, the example fit below will work if I move the line s=TF1(“s”,gax,-10.,10.,3)
two lines up (outside the function definition). This does not solve the problem though, it
just makes it more subtle.
PS: How can I use TMath::Erfc directly in python?
from ROOT import TH1D,TF1
from math import sqrt,exp
Just a Gaussian
def gax(y, q):
Function that integrates user defined Gaussian
def ga(x, p):
fill a histogram and fit