56 RooAbsFunc(vars.getSize()),
_func(&func), _vars(), _nset(nset), _clipInvalid(clipInvalid), _rangeName(rangeName), _funcSave(0)
62 if(
_vars.back() ==
nullptr) {
63 oocoutE(
nullptr,InputArguments) <<
"RooRealBinding: cannot bind to " << var->
GetName()
64 <<
". Variables need to be assignable, e.g. instances of RooRealVar." << endl ;
68 oocoutW(
nullptr, InputArguments) <<
"RooRealBinding: The function " << func.
GetName() <<
" does not depend on the parameter " <<
_vars[
index]->GetName()
69 <<
". Note that passing copies of the parameters is not supported." << std::endl;
88 RooAbsFunc(other),
_func(other.
_func), _vars(other._vars), _nset(nset?nset:other._nset), _xvecValid(other._xvecValid),
89 _clipInvalid(other._clipInvalid), _rangeName(other._rangeName), _funcSave(other._funcSave)
106 for (
auto* arg : dynamic_range_cast<RooAbsArg*>(*comps)) {
119 *si = (*ci)->_value ;
144 (*ci)->_value = *si ;
201 _ncall += coordinates.front().size();
203 bool parametersValid =
true;
207 _evalData = std::make_unique<RooBatchCompute::RunContext>();
213 for (
unsigned int dim=0; dim < coordinates.size(); ++dim) {
221 assert(values.
size() == 1);
225 if (!parametersValid)
232 assert(results.data() == resultsWritable.
data());
233 assert(results.size() == resultsWritable.
size());
236 for (std::size_t coord=0; coord < coordinates.size(); ++coord) {
237 if (coordinates[coord].
size() == 1)
240 for (std::size_t evt=0; evt < coordinates[coord].size(); ++evt) {
241 if (!
_vars[coord]->isValidReal(coordinates[coord][evt]))
242 resultsWritable[evt] = 0.;
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
bool dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=nullptr, bool valueOnly=false) const
Test whether we depend on (ie, are served by) any object in the specified collection.
RooFit::OwningPtr< RooArgSet > getComponents() const
Create a RooArgSet with all components (branch nodes) of the expression tree headed by this object.
Storage_t::size_type size() const
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
UInt_t _dimension
Number of observables.
Int_t _ncall
Function call counter.
UInt_t getDimension() const
bool _valid
Is binding in valid state?
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
bool isValidReal(double value, bool printError=false) const override
Check if given value is valid.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
virtual std::list< double > * binBoundaries(RooAbsRealLValue &obs, double xlo, double xhi) const
Retrieve bin boundaries if this distribution is binned in obs.
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
virtual RooSpan< const double > getValues(RooBatchCompute::RunContext &evalData, const RooArgSet *normSet=nullptr) const
double _value
Cache for current value of object.
virtual std::list< double > * plotSamplingHint(RooAbsRealLValue &obs, double xlo, double xhi) const
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
static const char * str(const TNamed *ptr)
Return C++ string corresponding to given TNamed pointer.
Lightweight interface adaptor that binds a RooAbsReal object to a subset of its servers and present i...
std::list< double > * plotSamplingHint(RooAbsRealLValue &, double, double) const override
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
double getMinLimit(UInt_t dimension) const override
Return lower limit on i-th variable.
~RooRealBinding() override
std::vector< double > _xsave
double operator()(const double xvector[]) const override
Evaluate the bound RooAbsReal at the variable values provided in xvector.
double getMaxLimit(UInt_t dimension) const override
Return upper limit on i-th variable.
RooRealBinding(const RooAbsReal &func, const RooArgSet &vars, const RooArgSet *nset=nullptr, bool clipInvalid=false, const TNamed *rangeName=nullptr)
Construct a lightweight function binding of RooAbsReal func to variables 'vars'.
void restoreXVec() const override
Restore value of all variables to previously saved values by saveXVec()
std::list< double > * binBoundaries(Int_t) const override
std::vector< RooAbsRealLValue * > _vars
Non-owned pointers to variables.
std::vector< RooAbsReal * > _compList
!
std::vector< double > _compSave
!
const char * getName() const override
Return name of function.
RooSpan< const double > getValuesOfBoundFunction(RooBatchCompute::RunContext &evalData) const
Evaluate the bound object at all locations indicated by the data in evalData.
void loadValues(const double xvector[]) const
Load the vector of variable values into the RooRealVars associated as variables with the bound RooAbs...
virtual RooSpan< const double > getValues(std::vector< RooSpan< const double > > coordinates) const
Evaluate the bound object at all locations indicated by the data in coordinates.
std::unique_ptr< RooBatchCompute::RunContext > _evalData
Memory for batch evaluations.
const TNamed * _rangeName
!
void saveXVec() const override
Save value of all variables.
A simple container to hold a batch of data values.
constexpr std::size_t size() const noexcept
constexpr std::span< T >::pointer data() const
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
This struct enables passing computation data around between elements of a computation graph.