bindFunction::ERROR No matching RooCFunction1PdfBinding<>

Hi,

I’m having a bit of trouble with the RooFit.bindFunction(Pdf) methods. Below is a simple example inspired from root.cern.ch/root/html/tutorials … ing.C.html

I have tried the equivalent code in CINT and it works.

from ROOT import RooFit, RooRealVar from ROOT import TF1 from ROOT import RooFit, RooWorkspace, RooArgList, RooRealVar #@UnusedImport @UnresolvedImport from ROOT import gSystem gSystem.Load( "libRooFit" ) fcn = TF1('fcn', 'sin(x)/x', 0, 10) x = RooRealVar('x', 'x', 0, 10) roofcn = RooFit.bindPdf('test', fcn, x) print roofcn

output:

[code]lxplus245 16:35 python temp.py

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

[#0] ERROR:InputArguments – bindFunction::ERROR CINT cannot resolve name of function 0xe800ad0
[#0] ERROR:InputArguments – bindFunction::ERROR CINT cannot resolve name of function 0xe800ad0
[#0] ERROR:InputArguments – bindFunction::ERROR No matching RooCFunction1PdfBinding<> class found for function <ROOT.RooAbsPdf object at 0x(nil)>[/code]

any idea what is going on here?

cheers

I am using ROOT 5.30.00

The problem is that the wrong function signature is used,

need to use,

RooAbsPdf* bindPdf(TF1* func, RooAbsReal& x)
not

BUT, the confusing bit,

The correct signature is not found if the RooFit library is loaded after RooFit is imported. Related post: Where are the RooFit::bindFunction()s in PyRoot?

Corrected code, note order in import statements,

from ROOT import gSystem gSystem.Load( "libRooFit" ) from ROOT import RooFit, RooRealVar from ROOT import TF1 from ROOT import RooFit, RooWorkspace, RooArgList, RooRealVar #@UnusedImport @UnresolvedImport fcn = TF1('fcn', 'sin(x)/x', 0, 10) x = RooRealVar('x', 'x', 0, 10) roofcn = RooFit.bindPdf(fcn, x) print roofcn