57 std::vector<int>
const&
codes) :
59 _paramList(
"paramList",
"List of paramficients",
this),
62 for (
auto param : paramList) {
64 coutE(InputArguments) <<
"FlexibleInterpVar::ctor(" <<
GetName() <<
") ERROR: paramficient " << param->GetName()
65 <<
" is not of type RooAbsReal" << std::endl ;
73 for (std::size_t i = 0; i <
codes.size(); ++i) {
78 coutE(InputArguments) <<
"FlexibleInterpVar::ctor(" <<
GetName() <<
") invalid input std::vectors " << std::endl;
92 _paramList(
"paramList",
"List of coefficients",
this)
101 _paramList(
"paramList",
this,
other._paramList),
102 _nominal(
other._nominal), _low(
other._low), _high(
other._high), _interpCode(
other._interpCode), _interpBoundary(
other._interpBoundary)
121 coutE(InputArguments) <<
"FlexibleInterpVar::setInterpCode ERROR: " << param.
GetName() <<
" is not in list"
130 for (std::size_t i = 0; i <
_interpCode.size(); ++i) {
139 coutE(InputArguments) <<
"FlexibleInterpVar::setInterpCode ERROR: " << param.
GetName()
140 <<
" with unknown interpolation code " << code <<
", keeping current code "
148 coutE(InputArguments) <<
"FlexibleInterpVar::setInterpCode ERROR: " << param.
GetName()
149 <<
" with unknown interpolation code " << code <<
", defaulting to code 2" << std::endl;
159 coutW(InputArguments) <<
"FlexibleInterpVar::setNominal : nominal is now " <<
newNominal << std::endl ;
170 coutE(InputArguments) <<
"FlexibleInterpVar::setLow ERROR: " << param.
GetName()
171 <<
" is not in list" << std::endl ;
173 coutW(InputArguments) <<
"FlexibleInterpVar::setLow : " << param.
GetName()
174 <<
" is now " <<
newLow << std::endl ;
186 coutE(InputArguments) <<
"FlexibleInterpVar::setHigh ERROR: " << param.
GetName()
187 <<
" is not in list" << std::endl ;
189 coutW(InputArguments) <<
"FlexibleInterpVar::setHigh : " << param.
GetName()
190 <<
" is now " <<
newHigh << std::endl ;
244 for (
unsigned int i = 1; i <
n; i++) {
246 coutE(InputArguments) <<
"FlexibleInterpVar::evaluate ERROR: Code Squashing AD does not yet support having "
247 "different interpolation codes for the same class object "
282 os <<
indent <<
"--- FlexibleInterpVar ---" << std::endl;
288 for (
int i=0;i<(
int)
_low.size();i++) {
290 os << std::setw(36) << param.
GetName()<<
": "<<std::setw(7) <<
_low[i]<<
" "<<std::setw(7) <<
_high[i]
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
static void indent(ostringstream &buf, int indent_level)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
static unsigned int total
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Common abstract base class for objects that represent a value and a "shape" in RooFit.
void setValueDirty()
Mark the element dirty. This forces a re-evaluation when a value is requested.
Int_t index(const RooAbsArg *arg) const
Returns index of given arg, or -1 if arg is not in the collection.
Storage_t::size_type size() const
Abstract base class for objects that represent a real value and implements functionality common to al...
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Structure printing.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
bool add(const RooAbsArg &var, bool valueServer, bool shapeServer, bool silent)
Overloaded RooCollection_t::add() method insert object into set and registers object as server to own...
A class to maintain the context for squashing of RooFit models into code.
std::string buildCall(std::string const &funcname, Args_t const &...args)
Build the code to call the function with name funcname, passing some arguments.
void addResult(RooAbsArg const *key, std::string const &value)
A function to save an expression that includes/depends on the result of the input node.
std::span< const double > at(RooAbsArg const *arg, RooAbsArg const *caller=nullptr)
std::span< double > output()
std::vector< int > _interpCode
void doEval(RooFit::EvalContext &) const override
Base function for computing multiple values of a RooAbsReal.
std::vector< double > _high
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Interface for detailed printing of object.
void setInterpCode(RooAbsReal ¶m, int code)
void printAllInterpCodes()
void setLow(RooAbsReal ¶m, double newLow)
void setInterpCodeForParam(int iParam, int code)
void setHigh(RooAbsReal ¶m, double newHigh)
void translate(RooFit::Detail::CodeSquashContext &ctx) const override
This function defines a translation for each RooAbsReal based object that can be used to express the ...
void setAllInterpCodes(int code)
std::vector< double > _low
double evaluate() const override
Calculate and return value of polynomial.
~FlexibleInterpVar() override
Destructor.
void setNominal(double newNominal)
virtual void printFlexibleInterpVars(std::ostream &os) const
FlexibleInterpVar()
Default constructor.
const char * GetName() const override
Returns name of object.
double flexibleInterpSingle(unsigned int code, double low, double high, double boundary, double nominal, double paramVal, double res)
Namespace for the RooStats classes.
static T Min()
Returns maximum representation for type T.