59 _x(
"x",
"Dependent", this,
x),
60 _coefList(
"coefList",
"List of coefficients",this),
61 _boundaryList(
"boundaryList",
"List of boundaries",this),
62 _interpolate(interpolate)
64 for (
auto *coef : coefList) {
66 cout <<
"RooStepFunction::ctor(" <<
GetName() <<
") ERROR: coefficient " << coef->
GetName()
67 <<
" is not of type RooAbsReal" << endl ;
73 for (
auto *boundary : boundaryList) {
75 cout <<
"RooStepFunction::ctor(" <<
GetName() <<
") ERROR: boundary " << boundary->GetName()
76 <<
" is not of type RooAbsReal" << endl ;
83 coutE(InputArguments) <<
"RooStepFunction::ctor(" <<
GetName() <<
") ERROR: Number of boundaries must be number of coefficients plus 1" << endl ;
84 throw string(
"RooStepFunction::ctor() ERROR: Number of boundaries must be number of coefficients plus 1") ;
94 _x(
"x", this, other._x),
95 _coefList(
"coefList",this,other._coefList),
96 _boundaryList(
"boundaryList",this,other._boundaryList),
97 _interpolate(other._interpolate)
110 for (
auto * boundary : static_range_cast<RooAbsReal*>(
_boundaryList)) {
111 b[nb++] = boundary->getVal() ;
115 if ((
_x<
b[0]) || (
_x>
b[nb-1]))
return 0 ;
120 for (
Int_t i=0;i<nb-1;i++){
121 if (
_x>
b[i]&&
_x<=
b[i+1]) {
132 c[0] =
b[0] ;
c[nb] =
b[nb-1] ;
133 for (
Int_t i=0 ; i<nb-1 ; i++) {
134 c[i+1] = (
b[i]+
b[i+1])/2 ;
141 for(
auto * coef : static_range_cast<RooAbsReal*>(
_coefList)) {
142 y[nc++] = coef->getVal() ;
146 for (
Int_t i=0;i<nc-1;i++){
147 if (
_x>
c[i]&&
_x<=
c[i+1]) {
148 double xx[2] ; xx[0]=
c[i] ; xx[1]=
c[i+1] ;
149 double yy[2] ; yy[0]=
y[i] ; yy[1]=
y[i+1] ;
Int_t getSize() const
Return the number of elements in the collection.
Storage_t::size_type size() const
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
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...
static double interpolate(double yArr[], Int_t nOrder, double x)
The Step Function is a binned function whose parameters are the heights of each bin.
RooStepFunction()
Constructor.
RooListProxy _boundaryList
double evaluate() const override
Transfer contents to vector for use below.
const char * GetName() const override
Returns name of object.