75 std::span<const double> y0,
int order,
bool logx,
bool logy)
78 const std::string title_spline = std::string(title) +
"_spline";
79 if (x0.size() != y0.size()) {
80 std::stringstream errMsg;
81 errMsg <<
"RooSpline::ctor(" <<
GetName() <<
") ERROR: size of x and y are not equal";
82 coutE(InputArguments) << errMsg.str() << std::endl;
83 throw std::invalid_argument(errMsg.str());
87 std::vector<double> x0Copy;
88 x0Copy.assign(x0.begin(), x0.end());
89 std::vector<double> y0Copy;
90 y0Copy.assign(y0.begin(), y0.end());
93 for (
auto &xRef : x0Copy) {
94 xRef = std::log(xRef);
98 for (
auto &yRef : y0Copy) {
99 yRef = std::log(yRef);
104 _spline = std::make_unique<TSpline3>(title_spline.c_str(), &x0Copy[0], &y0Copy[0], x0.size());
105 }
else if (order == 5) {
106 _spline = std::make_unique<TSpline5>(title_spline.c_str(), &x0Copy[0], &y0Copy[0], x0.size());
108 std::stringstream errMsg;
109 errMsg <<
"supported orders are 3 or 5";
110 coutE(InputArguments) << errMsg.str() << std::endl;
111 throw std::invalid_argument(errMsg.str());