Using pyROOT

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?

Hi,.

what about documenting pyROOT?

Some initial documentation has been added to the ROOT manual and is growing:

cern.ch/wlav/pyroot

where can I find signatures of the functions…

Just look at the C++ signatures:

root.cern.ch/root/htmldoc/ClassIndex.html

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.

Cheers,
Wim

Hi,

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.

Update: working code should appear in CVS shortly.

Cheers,
Wim