47 for (std::size_t i = 0; i <
listProxy.size(); ++i) {
61 _x(
"x",
"Dependent",
this,
x),
62 _coefList(
"coefList",
"List of coefficients",
this),
63 _boundaryList(
"boundaryList",
"List of boundaries",
this),
64 _interpolate(interpolate)
70 coutE(InputArguments) <<
"RooStepFunction::ctor(" <<
GetName() <<
") ERROR: Number of boundaries must be number of coefficients plus 1" << std::endl ;
71 throw std::invalid_argument(
"RooStepFunction::ctor() ERROR: Number of boundaries must be number of coefficients plus 1") ;
82 _coefList(
"coefList",
this,
other._coefList),
83 _boundaryList(
"boundaryList",
this,
other._boundaryList),
84 _interpolate(
other._interpolate)
98 if ((
_x<
b[0]) || (
_x>
b[
nb-1]))
return 0 ;
103 for (
int i=0;i<
nb-1;i++){
104 if (
_x>
b[i]&&
_x<=
b[i+1]) {
118 for (
int i=0 ; i<
nb-1 ; i++) {
119 c[i+1] = (
b[i]+
b[i+1])/2 ;
127 y[nc++] = coef->getVal() ;
131 for (
int i=0;i<nc-1;i++){
132 if (
_x>
c[i]&&
_x<=
c[i+1]) {
133 double xx[2] ;
xx[0]=
c[i] ;
xx[1]=
c[i+1] ;
134 double yy[2] ;
yy[0]=
y[i] ;
yy[1]=
y[i+1] ;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
const TNamed * namePtr() const
De-duplicated pointer to this object's name.
Storage_t::size_type size() const
bool addTyped(const RooAbsCollection &list, bool silent=false)
Adds elements of a given RooAbsCollection to the container if they match the specified type.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
Abstract base class for objects that represent a real value and implements functionality common to al...
bool matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
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.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
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.
std::vector< double > _boundaryCache
int getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
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...
std::vector< double > _coefCache
double analyticalIntegral(int code, const char *rangeName=nullptr) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
double max(const char *rname=nullptr) const
Query upper limit of range. This requires the payload to be RooAbsRealLValue or derived.
double min(const char *rname=nullptr) const
Query lower limit of range. This requires the payload to be RooAbsRealLValue or derived.
const char * GetName() const override
Returns name of object.
double stepFunctionIntegral(double xmin, double xmax, std::size_t nBins, double const *boundaries, double const *coefs)