RooDataSet plot failure

There seems to be a problem with plotting RooDataSet’s in PyROOT:

from ROOT import *
x = RooRealVar(“x”, “x”, 0.0, 10.0)
data = RooDataSet(“data”, “data”, RooArgSet(x))
frame = x.frame()
data.plotOn(frame)
Traceback (most recent call last):
File “”, line 1, in
TypeError: none of the 2 overloaded methods succeeded. Full details:
RooPlot* RooTreeData::plotOn(RooPlot* frame, const RooLinkedList& cmdList) =>
takes at least 2 arguments (1 given)
RooPlot* RooTreeData::plotOn(RooPlot* frame, RooTreeData::PlotOpt o) =>
takes at least 2 arguments (1 given)

you can try passing it plot options, but then it crashes, for example:

data.plotOn(frame, RooFit.LineColor(kBlue))
*** Break *** segmentation violation
/Users/mschmid7/Physics/alpGenPdfs/3502: No such file or directory.
Attaching to process 3502.
Reading symbols for shared libraries . done
Reading symbols for shared libraries … done
0x90029f07 in wait4 ()

========== STACKS OF ALL THREADS ==========

I’m using ROOT version 5.18/00 (downloaded binaries), python version 2.5, and I’m running on Mac OS-X 10.4. I have no problems plotting anything else in ROOT or RooFit, and a similar script written in C produces the desired blank RooPlot

Thanks

Mike,

the first overload fails b/c the “using” statement is still not properly handled in the bindings, and so the plotOn method with a single argument is not considered. Has been on my TODO for quite some time. :frowning:

The second crashes b/c the class name LineColor exists, but no dictionary for it has been generated (it should be a PlotOpt, and unknown classes are, as a last option, allowed to passed through unknown pointers). A change here would require an update of the LinkDef’s in roofitcore, to have the dictionaries of these classes generated.

Best option for now is to either use the first public plotOn with a default cmdlist argument, or call the base class one that isn’t directly available b/c of no support for using (yet). Thus, either of:

data.plotOn(frame,RooLinkedList()) RooAbsData.plotOn(data,frame) super(RooTreeData,data).plotOn(frame)
should do the trick.

HTH,
Wim

Hi,

the reason that the using statement works with CINT, is that CINT does not apply the C++ hiding rule, so the base class method is found for the overload match, using or no.

Ciao,
Wim

Great, thanks so much!