35 RH2D hist({100, 0., 1.}, {{0., 1., 2., 3., 10.}});
38 hist.Fill({0.01, 1.02});
41 RFunction<2> func([](
const std::array<double, 2> &
x,
const std::span<const double> par) {
42 return par[0] *
x[0] *
x[0] + (par[1] -
x[1]) *
x[1];
45 auto fitResult =
FitTo(hist, func, {{0., 1.}});
47 auto file = RFile::Recreate(
"hist.root");
48 file->Write(
"TheHist", hist);
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Objects used to configure the different axis types.
RFitResult FitTo(const RHist< DIMENSIONS, PRECISION, STAT... > &hist, const RFunction< DIMENSIONS > &func, std::span< const double > paramInit)