43std::span<double const> values(
RooListProxy const &listProxy, std::vector<double> &valueCache)
45 valueCache.resize(listProxy.
size());
46 for (std::size_t i = 0; i < listProxy.
size(); ++i) {
47 valueCache[i] =
static_cast<RooAbsReal &
>(listProxy[i]).getVal(listProxy.
nset());
60 _x(
"x",
"Dependent", this,
x),
61 _coefList(
"coefList",
"List of coefficients",this),
69 coutE(InputArguments) <<
"RooStepFunction::ctor(" << GetName() <<
") ERROR: Number of boundaries must be number of coefficients plus 1" << std::endl ;
70 throw std::invalid_argument(
"RooStepFunction::ctor() ERROR: Number of boundaries must be number of coefficients plus 1") ;
80 _x(
"x", this, other.
_x),
97 if ((
_x<
b[0]) || (
_x>
b[nb-1]))
return 0 ;
102 for (
int i=0;i<nb-1;i++){
103 if (
_x>
b[i]&&
_x<=
b[i+1]) {
116 c[0] =
b[0] ;
c[nb] =
b[nb-1] ;
117 for (
int i=0 ; i<nb-1 ; i++) {
118 c[i+1] = (
b[i]+
b[i+1])/2 ;
126 y[nc++] = coef->getVal() ;
130 for (
int i=0;i<nc-1;i++){
131 if (
_x>
c[i]&&
_x<=
c[i+1]) {
132 double xx[2] ; xx[0]=
c[i] ; xx[1]=
c[i+1] ;
133 double yy[2] ; yy[0]=
y[i] ; yy[1]=
y[i+1] ;
RooCollectionProxy< RooArgList > RooListProxy
ROOT::RRangeCast< T, false, Range_t > static_range_cast(Range_t &&coll)
const TNamed * namePtr() const
De-duplicated pointer to this object's name.
Storage_t::size_type size() const
const RooArgSet * nset() const
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...
RooAbsReal()
coverity[UNINIT_CTOR] Default constructor
bool matchArgs(const RooArgSet &allDeps, RooArgSet &analDeps, const RooArgProxy &a, const Proxies &... proxies) const
RooArgList is a container object that can hold multiple RooAbsArg objects.
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)
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 stepFunctionIntegral(double xmin, double xmax, std::size_t nBins, DoubleArray boundaries, DoubleArray coefs)