RDataFrame to RooDataSet one column "Book" Failed

Hi, sorry if this is a very stupid error, but I just modified a bit the example ROOT: tutorials/roofit/rf408_RDataFrameToRooFit.py File Reference, for 1 column,
as follows

d = ROOT.RDataFrame(2000000)
dd = d.Define("x", "gRandom->Uniform(-5.,  5.)")
x = ROOT.RooRealVar("x", "x", -5.0, 5.0)
rooDataSet = dd.Book(ROOT.std.move(ROOT.RooDataSetHelper("dataset", "dataset", ROOT.RooArgSet(x))), "x")

and I got the following :frowning:

 Traceback (most recent call last)
Input In [45], in <cell line: 1>()
----> 1 rooDataSet = dd.Book(ROOT.std.move(ROOT.RooDataSetHelper("dataset", "dataset", ROOT.RooArgSet(x))), "x")
TypeError: Template method resolution failed:
  Failed to instantiate "Book(RooAbsDataHelper<RooDataSet>&&,std::string)"

thanks

Hi @Marcgh04 ,
Book takes a list of columns as last argument, so it should be ["x"] instead of "x".

Does that help?

Cheers,
Enrico

Thanks :sweat_smile: :smile:

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