Where are the RooFit::bindFunction()s in PyRoot?

Hi,

I can’t find the cool new RooFit bindFunction() methods from the Python side. They are implemented in the RooFit namespace (RooCFunction1Binding and RooTFnBinding files) but are not accessible from within Python.

Doing a

makes available all functions in the RooFit namespace implemented in RooGlobalFunc.h. Apart from the fact that the former are located in roofit and the latter in roofitcore, I can’t spot the difference. Also the implementations in the dictionaries look equivalent to me.

Any ideas?

Thanks,
Jeroen

Jeroen,

looking at the relevant roofit header, it appears to me that the bindFunction is not part of the dictionary set (it doesn’t work from CINT either, AFAICS). Many of the other classes in the files that you mention are bound and appear in the global namespace.

This appears to work (although I don’t know how to use the function, so I haven’t tested that it actually does what it is supposed to do; note that ordering is important b/c of filling of the dictionaries):import ROOT, os ROOT.gROOT.LoadMacro( os.path.join( os.environ[ 'ROOTSYS' ], 'include', 'RooCFunction1Binding.h' ) + '+' ) print ROOT.RooFit.bindFunction
HTH,
Wim

Hi Wim,

I do make dictionaries for the bindFunction() methods. These are however in libRooFit and not in libRooFitCore, thus dictionaries for methods in the namespace RooFit are split over two libraries. Does that perhaps cause problems in pyROOT?

Wouter

Wouter,

thanks, now we’re getting somewhere. Not so much a problem with PyROOT, as some issue in the autoloading. Touching the RooFit namespace causes the loading of libRooFitCore.so only, not of libRooFit.so. Compare the following two RINT sessions:

[code]root [0] RooFit::bindFunction

RooFit v2.91 – Developed by Wouter Verkerke and David Kirkby
Copyright © 2000-2008 NIKHEF, University of California & Stanford University
All rights reserved, please read http://roofit.sourceforge.net/license.txt

Error: Symbol bindFunction is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***
*** Interpreter error recovered ***
root [1] .q[/code]
versus this one, where libRooFit is loaded explicitly first, which causes the loading of libRooFitCore to go with it:[code]root [0] gSystem->Load( “libRooFit.so” )

RooFit v2.91 – Developed by Wouter Verkerke and David Kirkby
Copyright © 2000-2008 NIKHEF, University of California & Stanford University
All rights reserved, please read http://roofit.sourceforge.net/license.txt

(int)0
root [1] RooFit::bindFunction
(const void*)0xb54a2190
root [2].q [/code]
The results in PyROOT are equivalent.

So, for Jeroen, the fix for now is then to load libRooFit:[code]>>> from ROOT import gSystem

gSystem.Load( “libRooFit” )[/code]
Cheers,
Wim