what about documenting pyROOT? where can I find signatures of the functions…
for example I’m trying to make TF1 class with user-defined function i did it like this:
def udf(x,par):
return par[0]
f = TF1(‘background’, udf,-100,100,10000)
it doesn’t work and it tells me that there’s no constructor with this function…
Ok… Main question is how to create user-defined function for fitting histogram using pyROOT… Is there some example or tutorial?
for example I’m trying to make TF1 class with user-defined function i did it like this:
This, unfortunately, doesn’t work. I’ve spend a few days on it to find a generic way,
but I haven’t been able to code anything that was satisfactory.
Ok… Main question is how to create user-defined function for fitting histogram
using pyROOT… Is there some example or tutorial?
You can first code a C++ function, call your python function from there, run CINT
to generate the dictionary for your C++ function, load it into python and then use
it for the TF1 constructor.