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