31 RH2D histFromVars(xAxis, yAxis);
36 RH2D hist({100, 0., 1.}, {{0., 1., 2., 3., 10.}});
39 hist.Fill({0.01, 1.02});
42 RFunction<2> func([](
const std::array<double, 2> &
x,
const std::span<const double> par) {
43 return par[0] *
x[0] *
x[0] + (par[1] -
x[1]) *
x[1];
46 auto fitResult =
FitTo(hist, func, {{0., 1.}});
49 file->Write(
"TheHist", hist);
Objects used to configure the different axis types.
static RFilePtr Recreate(std::string_view name, const Options_t &opts=Options_t())
Open a file with name for reading and writing.
RFitResult FitTo(const RHist< DIMENSIONS, PRECISION, STAT... > &hist, const RFunction< DIMENSIONS > &func, std::span< const double > paramInit)
RHist< 2, double, RHistStatContent, RHistStatUncertainty > RH2D