RooAbsData::createHistogram inaccessible in RooDataSet

Hi all-

I am having a problem accessing the RooAbsData::createHistogram methods from a RooDataSet object.  The following:

import ROOT
aset = ROOT.RooDataSet()
RooFit v3.12 – Developed by Wouter Verkerke and David Kirkby
Copyright © 2000-2009 NIKHEF, University of California & Stanford University
All rights reserved, please read roofit.sourceforge.net/license.txt

aset.createHistogram(“y”, 10, 20)

yields the following error:

Traceback (most recent call last):
File “”, line 1, in
TypeError: none of the 2 overloaded methods succeeded. Full details:
TH2F* RooDataSet::createHistogram(const RooAbsRealLValue& var1, const RooAbsRealLValue& var2, const char* cuts = “”, const char* name = “hist”) =>
could not convert argument 1
TH2F* RooDataSet::createHistogram(const RooAbsRealLValue& var1, const RooAbsRealLValue& var2, Int_t nx, Int_t ny, const char* cuts = “”, const char* name = “hist”) =>
takes at least 4 arguments (3 given)

It seems pyROOT doesn’t catch the functions in the RooAbsData base class. Am I doing something wrong, or perhaps there is a workaround?

Thanks!

Mike

I found a workaround, which was to call the class like:

ROOT.RooAbsData.createHistogram(aset, …)

I swear I had tried this before posting and it failed, but one more shot and I got it to work.

It still seems that this function should be able to be accessed from the child class, will this issue be fixed for pyROOT sometime in future?

Mike,

RooFit makes use of the “using” declaration in a few of its classes, and this is one of those cases. The “using” statements are not made available in the dictionary and hence there’s nothing that can be fixed until they are.

There has been a proposal to bluntly start trying base classes methods until one of them succeeds if all overloads fail. But that then would break the contract in those cases where the base class methods are explicitly hidden. I’m afraid that being explicit in the code by calling the base class method directly, as you have done, is the best option.

Cheers,
Wim