How to save histograms created with Histo1D into a root file using RDataFrame


I can draw histograms through the Histo1D method in RDataFrame, but how do I save the
histograms to a root file using RDataFrame methods? I just couldn’t figure out how to save it.
Snapshot method does not seem to do it.


_ROOT Version:6.14.02
_Platform:Fedora 25
_Compiler:gcc 6.4.1

Hi Suyong,
the Histo1D method returns a (smart) pointer to TH1D (a RResultPtr<TH1D> to be more precise). You can do anything you would do with a pointer to TH1D with it, including calling histo_result->Write() to save the histogram in a file.

Hope this helps!

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