Definition of RDataframe.Histo1D with a fixed number of bins

Hi to everybody, I’d like to define an histogram Histo1D starting from a Rdataframe, but i also would like to specify the number of bins during the creation of this histogram. I tried to use the definition of Histo1D without the number of bins and then the function .SetBins(number of bins, xmin, xmax) but the created histogram has some problems: bin of different size, shape of the histogram that changes depending on the choose of bins or xmin and xmax. I think the problem could be that the histogram is created with a certain number of bins and then is rebinned.
Is there a correct way to specify the number of bins in the definition of Histo1D?
Thanks to all,
Michele

See the “model” part of the example in the documentation:
https://root.cern/doc/master/classROOT_1_1RDF_1_1RInterface.html#af5b79eb05f2ec0b730ec3b378a2d9ef9

2 Likes

Just adding here that in Python this syntax is allowed:

myDf.Histo1D(("histName", "histTitle", 64u, 0., 128.), "myColumn");

Cheers,
Enrico

Thank you very much, now it works perfectly!
Cheers,
Michele