@@ -131,7 +131,32 @@ PiecewiseInterpolation::PiecewiseInterpolation(const char *name, const char *tit
131131 TRACE_CREATE ;
132132}
133133
134-
134+ // //////////////////////////////////////////////////////////////////////////////
135+ // / Construct a new interpolation and set the interpolation code for each
136+ // / parameter by position.
137+ // / \param name Name of the object.
138+ // / \param title Title (for e.g. plotting).
139+ // / \param nominal Nominal value of the function.
140+ // / \param lowSet Set of down variations.
141+ // / \param highSet Set of up variations.
142+ // / \param paramSet Parameters that control the interpolation.
143+ // / \param interpolationCodes Interpolation code for each parameter.
144+ PiecewiseInterpolation::PiecewiseInterpolation (const char *name, const char *title, const RooAbsReal &nominal,
145+ const RooArgList &lowSet, const RooArgList &highSet,
146+ const RooArgList ¶mSet, const std::vector<int > &interpolationCodes)
147+ : PiecewiseInterpolation(name, title, nominal, lowSet, highSet, paramSet)
148+ {
149+ if (interpolationCodes.size () != _paramSet.size ()) {
150+ coutE (InputArguments) << " PiecewiseInterpolation::ctor(" << GetName ()
151+ << " ) ERROR: interpolation code vector should have the same length as the parameter list"
152+ << std::endl;
153+ RooErrorHandler::softAbort ();
154+ return ;
155+ }
156+ for (std::size_t i = 0 ; i < interpolationCodes.size (); ++i) {
157+ setInterpCodeForParam (i, interpolationCodes[i]);
158+ }
159+ }
135160
136161// //////////////////////////////////////////////////////////////////////////////
137162// / Copy constructor
0 commit comments