bindFunction::ERROR No matching RooCFunction1PdfBinding<>

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