Filling RHist using RDataFrame.
void hist101_RDataFrame_Hist()
{
auto dfX = df.Define("x",
double v = std::exp(0.1 *
e);
return std::fmod(
v, 20.0);
},
{"rdfentry_"});
auto hist = dfX.Hist(40, {0.0, 20.0}, "x");
std::cout << "entries = " << hist->GetNEntries();
std::cout << ", mean = " << hist->ComputeMean();
std::cout << ", stddev = " << hist->ComputeStdDev();
std::cout << "\n";
auto *
c =
new TCanvas(
"c",
"", 10, 10, 900, 500);
}
unsigned long long ULong64_t
Portable unsigned long integer 8 bytes.
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
std::unique_ptr< TH1D > ConvertToTH1D(const RHistEngine< double > &engine)
Convert a one-dimensional histogram to TH1D.
- Date
- February 2026
- Author
- The ROOT Team
Definition in file hist101_RDataFrame_Hist.C.