RooWorkspace with overloaded functions

The factory in a RooWorkspace appears unable to handle overloaded PDF function constructors, at least this is the case for RooCrystalBall. Fortunately, in this case, I can easily workaround it and use one of the other constructors, but I was curious whether this was a bug or a known limitation.


Reproducer:

In [1]: import ROOT as r

In [3]: ws = r.RooWorkspace()

RooFit v3.60 -- Developed by Wouter Verkerke and David Kirkby 
                Copyright (C) 2000-2013 NIKHEF, University of California & Stanford University
                All rights reserved, please read http://roofit.sourceforge.net/license.txt


In [4]: ws.factory("CrystalBall::test1(x[0, 100], mu[40, 60], s[5], s, a[10], n[50], a, n)")
[#0] WARNING:InputArguments -- The parameter 's' with range [-1e+30, 1e+30] of the RooCrystalBall 'test1' exceeds the safe range of (0, inf). Advise to limit its range.
[#0] WARNING:InputArguments -- The parameter 's' with range [-1e+30, 1e+30] of the RooCrystalBall 'test1' exceeds the safe range of (0, inf). Advise to limit its range.
[#0] WARNING:InputArguments -- The parameter 'a' with range [-1e+30, 1e+30] of the RooCrystalBall 'test1' exceeds the safe range of (0, inf). Advise to limit its range.
[#0] WARNING:InputArguments -- The parameter 'a' with range [-1e+30, 1e+30] of the RooCrystalBall 'test1' exceeds the safe range of (0, inf). Advise to limit its range.
[#0] WARNING:InputArguments -- The parameter 'n' with range [-1e+30, 1e+30] of the RooCrystalBall 'test1' exceeds the safe range of (0, inf). Advise to limit its range.
[#0] WARNING:InputArguments -- The parameter 'n' with range [-1e+30, 1e+30] of the RooCrystalBall 'test1' exceeds the safe range of (0, inf). Advise to limit its range.
Out[4]: <cppyy.gbl.RooCrystalBall object at 0x7fc40da37a00>

In [5]: ws.factory("CrystalBall::test2(x, mu, s, a, n)")
[#0] ERROR:ObjectHandling -- RooFactoryWSTool::createArg() ERROR number of arguments provided (5) for class is invalid, RooCrystalBall expects 8
[#0] ERROR:ObjectHandling -- RooFactoryWSTool::processExpression() ERRORS detected, transaction to workspace aborted, no objects committed
Out[5]: <cppyy.gbl.RooAbsArg object at 0x0>

In [6]: ws.factory("CrystalBall::test2(x, mu, s, a, n, true)")
[#0] ERROR:ObjectHandling -- RooFactoryWSTool::createArg() ERROR number of arguments provided (6) for class is invalid, RooCrystalBall expects 8
[#0] ERROR:ObjectHandling -- RooFactoryWSTool::processExpression() ERRORS detected, transaction to workspace aborted, no objects committed
Out[6]: <cppyy.gbl.RooAbsArg object at 0x0>

In [7]: r.gROOT.GetVersion()
Out[7]: '6.24/00'

Hi,

I think this is a limitation of the factory WS tool to use only the first constructor. For example a similar thing is happening for RooArgusBG where only the constructor with 2 RooAbsReal can be used.
We should create a GitHub issue on this and eventually remove this limitation.

Cheers

Lorenzo

A GitHub issue is already existing, see root-project/root#7965

Thank you for clarifying!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.