void simple()
{
RAxisConfig xAxis(100, 0., 1.);
RAxisConfig yAxis({0., 1., 2., 3., 10.});
RH2D histFromVars(xAxis, yAxis);
RH2D hist({100, 0., 1.}, {{0., 1., 2., 3., 10.}});
hist.Fill({0.01, 1.02});
RFunction<2> func([](
const std::array<double, 2> &
x,
const std::span<const double> par) {
return par[0] *
x[0] *
x[0] + (par[1] -
x[1]) *
x[1];
});
auto fitResult =
FitTo(hist, func, {{0., 1.}});
auto file = RFile::Recreate(
"hist.root");
file->Write(
"TheHist", hist);
}
RHist< 2, double, RHistStatContent, RHistStatUncertainty > RH2D
RFitResult FitTo(const RHist< DIMENSIONS, PRECISION, STAT... > &hist, const RFunction< DIMENSIONS > &func, std::span< const double > paramInit)
- Date
- 2015-03-22
- Warning
- This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
- Author
- Axel Naumann axel@.nosp@m.cern.nosp@m..ch
Definition in file simple.cxx.