45static inline double fast_fma(
46 const double x,
const double y,
const double z)
noexcept
48#if defined(FP_FAST_FMA)
49 return std::fma(
x,
y, z);
53#pragma STDC FP_CONTRACT ON
60enum class Kind :
int { First = 1, Second = 2 };
67template <
typename T, Kind KIND>
68class ChebychevIterator {
76 constexpr ChebychevIterator() =
default;
78 ChebychevIterator(
const ChebychevIterator &) =
default;
80 ChebychevIterator(ChebychevIterator &&) =
default;
82 constexpr ChebychevIterator(
const T &
x)
83 : _curr(static_cast<int>(KIND) *
x), _twox(2 *
x)
87 ChebychevIterator &
operator=(
const ChebychevIterator &) =
default;
89 ChebychevIterator &
operator=(ChebychevIterator &&) =
default;
92 constexpr inline T operator*() const noexcept {
return _last; }
94 constexpr inline T lookahead() const noexcept {
return _curr; }
96 inline ChebychevIterator &operator++() noexcept
98 T newval = fast_fma(_twox, _curr, -_last);
104 inline ChebychevIterator operator++(
int)
noexcept
106 ChebychevIterator retVal(*
this);
125 _x(
"x",
"Dependent", this,
x),
126 _coefList(
"coefficients",
"List of coefficients",this),
133 std::cerr <<
"RooChebychev::ctor(" <<
GetName() <<
134 ") ERROR: coefficient " << coef->
GetName() <<
135 " is not of type RooAbsReal" << std::endl ;
148 _x(
"x", this, other._x),
149 _coefList(
"coefList",this,other._coefList),
150 _refRangeName(other._refRangeName)
178 using size_type =
typename RooListProxy::Storage_t::size_type;
182 ChebychevIterator<double, Kind::First> chit(
x);
184 for (size_type i = 0; iend != i; ++i, ++chit) {
227 using size_type =
typename RooListProxy::Storage_t::size_type;
236 ChebychevIterator<double, Kind::First> bit(
b), ait(
a);
239 for (size_type i = 1; iend != i; ++i) {
242 const double term2 = (*bit - *ait) / nminus1;
243 ++bit, ++ait, ++nminus1;
244 const double term1 = (bit.lookahead() - ait.lookahead()) / (nminus1 + 1.);
245 const double intTn = 0.5 * (term1 - term2);
Binding & operator=(OUT(*fun)(void))
TTime operator*(const TTime &t1, const TTime &t2)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Storage_t::size_type size() const
TIterator * createIterator(Bool_t dir=kIterForward) const R__SUGGEST_ALTERNATIVE("begin()
TIterator-style iteration over contained elements.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Bool_t matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Chebychev polynomial p.d.f.
virtual void selectNormalizationRange(const char *rangeName=0, Bool_t force=kFALSE)
Interface function to force use of a given normalization range to interpret function value.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Double_t evalAnaInt(const Double_t a, const Double_t b) const
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Reimplementation of standard RooArgList::add()
const TNamed * constPtr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
static RooNameReg & instance()
Return reference to singleton instance.
Double_t min(const char *rname=0) const
Double_t max(const char *rname=0) const
Iterator abstract base class.
virtual TObject * Next()=0
The TNamed class is the base class for all named ROOT classes.
virtual const char * GetName() const
Returns name of object.
static long int sum(long int i)