56 RooAbsFunc(vars.getSize()), _func(&func), _vars(), _nset(nset), _clipInvalid(clipInvalid), _xsave(0), _rangeName(rangeName), _funcSave(0)
59 for (
unsigned int index=0; index < vars.
size(); ++index) {
62 if(
_vars.back() ==
nullptr) {
64 <<
". Variables need to be assignable, e.g. instances of RooRealVar." << endl ;
68 oocoutW((
TObject*)
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), _xsave(0), _rangeName(other._rangeName), _funcSave(other._funcSave)
115 while ((arg=iter.
next())) {
129 *si = (*ci)->_value ;
154 (*ci)->_value = *si ;
179 _vars[index]->setVal(xvector[index],range);
211 _ncall += coordinates.front().size();
213 bool parametersValid =
true;
223 for (
unsigned int dim=0; dim < coordinates.size(); ++dim) {
231 assert(values.
size() == 1);
235 if (!parametersValid)
242 assert(results.data() == resultsWritable.
data());
243 assert(results.size() == resultsWritable.
size());
246 for (std::size_t coord=0; coord < coordinates.size(); ++coord) {
247 if (coordinates[coord].
size() == 1)
250 for (std::size_t evt=0; evt < coordinates[coord].size(); ++evt) {
251 if (!
_vars[coord]->isValidReal(coordinates[coord][evt]))
252 resultsWritable[evt] = 0.;
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Bool_t dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0, Bool_t valueOnly=kFALSE) const
Test whether we depend on (ie, are served by) any object in the specified collection.
RooArgSet * getComponents() const
Create a RooArgSet with all components (branch nodes) of the expression tree headed by this object.
RooFIter fwdIterator() const
One-time forward iterator.
Storage_t::size_type size() const
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
UInt_t getDimension() const
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
virtual Bool_t isValidReal(Double_t value, Bool_t printError=kFALSE) const
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_t > * binBoundaries(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
Retrieve bin boundaries if this distribution is binned in obs.
virtual RooSpan< const double > getValues(RooBatchCompute::RunContext &evalData, const RooArgSet *normSet=nullptr) const
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &obs, Double_t xlo, Double_t 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.
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
RooAbsArg * next()
Return next element or nullptr if at end.
static const char * str(const TNamed *ptr)
Return C++ string corresponding to given TNamed pointer.
static RooNameReg & instance()
Return reference to singleton instance.
const char * constStr(const TNamed *namePtr)
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...
virtual ~RooRealBinding()
Destructor.
virtual void restoreXVec() const
Restore value of all variables to previously saved values by saveXVec()
void loadValues(const Double_t xvector[]) const
Load the vector of variable values into the RooRealVars associated as variables with the bound RooAbs...
virtual std::list< Double_t > * binBoundaries(Int_t) const
virtual void saveXVec() const
Save value of all variables.
virtual const char * getName() const
Return name of function.
std::vector< RooAbsRealLValue * > _vars
RooRealBinding(const RooAbsReal &func, const RooArgSet &vars, const RooArgSet *nset=0, Bool_t clipInvalid=kFALSE, const TNamed *rangeName=0)
Construct a lightweight function binding of RooAbsReal func to variables 'vars'.
std::vector< RooAbsReal * > _compList
virtual Double_t getMinLimit(UInt_t dimension) const
Return lower limit on i-th variable.
virtual Double_t operator()(const Double_t xvector[]) const
Evaluate the bound RooAbsReal at the variable values provided in xvector.
RooSpan< const double > getValuesOfBoundFunction(RooBatchCompute::RunContext &evalData) const
Evaluate the bound object at all locations indicated by the data in evalData.
std::vector< Double_t > _compSave
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
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
const TNamed * _rangeName
virtual Double_t getMaxLimit(UInt_t dimension) const
Return upper limit on i-th variable.
A simple container to hold a batch of data values.
constexpr std::span< T >::pointer data() const
constexpr std::span< T >::index_type size() const noexcept
The TNamed class is the base class for all named ROOT classes.
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
This struct enables passing computation data around between elements of a computation graph.