47 _x(
"x",
"Dependent", this,
x),
48 _coefList(
"coefList",
"List of coefficients",this),
49 _boundaryList(
"boundaryList",
"List of boundaries",this),
50 _interpolate(interpolate)
52 for (
auto *coef : coefList) {
54 std::cout <<
"RooStepFunction::ctor(" <<
GetName() <<
") ERROR: coefficient " << coef->
GetName()
55 <<
" is not of type RooAbsReal" << std::endl ;
61 for (
auto *boundary : boundaryList) {
63 std::cout <<
"RooStepFunction::ctor(" <<
GetName() <<
") ERROR: boundary " << boundary->GetName()
64 <<
" is not of type RooAbsReal" << std::endl;
71 coutE(InputArguments) <<
"RooStepFunction::ctor(" <<
GetName() <<
") ERROR: Number of boundaries must be number of coefficients plus 1" << std::endl ;
72 throw std::invalid_argument(
"RooStepFunction::ctor() ERROR: Number of boundaries must be number of coefficients plus 1") ;
82 _x(
"x", this, other._x),
83 _coefList(
"coefList",this,other._coefList),
84 _boundaryList(
"boundaryList",this,other._boundaryList),
85 _interpolate(other._interpolate)
98 for (
auto * boundary : static_range_cast<RooAbsReal*>(
_boundaryList)) {
99 b[nb++] = boundary->getVal() ;
103 if ((
_x<
b[0]) || (
_x>
b[nb-1]))
return 0 ;
108 for (
Int_t i=0;i<nb-1;i++){
109 if (
_x>
b[i]&&
_x<=
b[i+1]) {
120 c[0] =
b[0] ;
c[nb] =
b[nb-1] ;
121 for (
Int_t i=0 ; i<nb-1 ; i++) {
122 c[i+1] = (
b[i]+
b[i+1])/2 ;
129 for(
auto * coef : static_range_cast<RooAbsReal*>(
_coefList)) {
130 y[nc++] = coef->getVal() ;
134 for (
Int_t i=0;i<nc-1;i++){
135 if (
_x>
c[i]&&
_x<=
c[i+1]) {
136 double xx[2] ; xx[0]=
c[i] ; xx[1]=
c[i+1] ;
137 double yy[2] ; yy[0]=
y[i] ; yy[1]=
y[i+1] ;
155 for (
auto *boundary : static_range_cast<RooAbsReal *>(
_boundaryList)) {
const TNamed * namePtr() const
De-duplicated pointer to this object's name.
Storage_t::size_type size() const
void reserve(Storage_t::size_type count)
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
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.
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 std::list< double > * plotSamplingHintForBinBoundaries(std::span< const double > boundaries, double xlo, double xhi)
Returns sampling hints for a histogram with given boundaries.
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.
const RooArgList & boundaries()
RooListProxy _boundaryList
double evaluate() const override
Transfer contents to std::vector for use below.
std::list< double > * plotSamplingHint(RooAbsRealLValue &obs, double xlo, double xhi) const override
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
const char * GetName() const override
Returns name of object.