How to use RDataFrame::Histo2D with predefine TH2D

_ROOT Version:6.15

if I defind TH2D first
TH2D * h2 = new TH2D();
how can I use the pre defined histogram in RDataFrame?
RDataFrame d…
d.Histo2D(*h2, “x”, “y”);


you should use a histo model (, that is

RDataFrame d…
auto myHist2d = d.Histo2D({*h2}, “x”, “y”);

note that h2 is taken as a model and a new histogram is returned wrapped in a RResultPtr.


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