Logo ROOT  
Reference Guide
RooRealBinding Class Reference

Lightweight interface adaptor that binds a RooAbsReal object to a subset of its servers and present it as a simple array oriented interface.

Definition at line 29 of file RooRealBinding.h.

Public Member Functions

 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'. More...
 
 RooRealBinding (const RooRealBinding &other, const RooArgSet *nset=nullptr)
 Construct a lightweight function binding of RooAbsReal func to variables 'vars'. More...
 
 ~RooRealBinding () override
 Destructor. More...
 
std::list< double > * binBoundaries (Int_t) const override
 
double getMaxLimit (UInt_t dimension) const override
 Return upper limit on i-th variable. More...
 
double getMinLimit (UInt_t dimension) const override
 Return lower limit on i-th variable. More...
 
const char * getName () const override
 Return name of function. More...
 
virtual RooSpan< const doublegetValues (std::vector< RooSpan< const double > > coordinates) const
 Evaluate the bound object at all locations indicated by the data in coordinates. More...
 
RooSpan< const doublegetValuesOfBoundFunction (RooBatchCompute::RunContext &evalData) const
 Evaluate the bound object at all locations indicated by the data in evalData. More...
 
TClassIsA () const override
 
RooAbsRealLValueobservable (unsigned int i) const
 Return a pointer to the observable that defines the i-th dimension of the function. More...
 
double operator() (const double xvector[]) const override
 Evaluate the bound RooAbsReal at the variable values provided in xvector. More...
 
std::list< double > * plotSamplingHint (RooAbsRealLValue &, double, double) const override
 Interface for returning an optional hint for initial sampling points when constructing a curve projected on observable. More...
 
void restoreXVec () const override
 Restore value of all variables to previously saved values by saveXVec() More...
 
void saveXVec () const override
 Save value of all variables. More...
 
void Streamer (TBuffer &) override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from RooAbsFunc
 RooAbsFunc (const RooAbsFunc &other)
 
 RooAbsFunc (UInt_t dimension)
 
virtual ~RooAbsFunc ()
 
virtual std::list< double > * binBoundaries (Int_t) const
 
UInt_t getDimension () const
 
virtual double getMaxLimit (UInt_t dimension) const =0
 
virtual double getMinLimit (UInt_t dimension) const =0
 
virtual const char * getName () const
 Name of function binding. More...
 
virtual TClassIsA () const
 
bool isValid () const
 
Int_t numCall () const
 Return number of function calls since last reset. More...
 
virtual double operator() (const double xvector[]) const =0
 
virtual std::list< double > * plotSamplingHint (RooAbsRealLValue &, double, double) const
 Interface for returning an optional hint for initial sampling points when constructing a curve projected on observable. More...
 
void resetNumCall () const
 Reset function call counter. More...
 
virtual void restoreXVec () const
 
virtual void saveXVec () const
 
virtual void Streamer (TBuffer &)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from RooAbsFunc
static TClassClass ()
 
static const char * Class_Name ()
 
static Version_t Class_Version ()
 
static const char * DeclFileName ()
 

Protected Member Functions

void loadValues (const double xvector[]) const
 Load the vector of variable values into the RooRealVars associated as variables with the bound RooAbsReal function. More...
 

Protected Attributes

bool _clipInvalid
 
std::vector< RooAbsReal * > _compList
 ! More...
 
std::vector< double_compSave
 ! More...
 
std::unique_ptr< RooBatchCompute::RunContext_evalData
 Memory for batch evaluations. More...
 
const RooAbsReal_func
 
double _funcSave
 ! More...
 
const RooArgSet_nset
 
const TNamed_rangeName
 ! More...
 
std::vector< RooAbsRealLValue * > _vars
 Non-owned pointers to variables. More...
 
double_xsave
 
bool _xvecValid
 
- Protected Attributes inherited from RooAbsFunc
UInt_t _dimension
 Number of observables. More...
 
Int_t _ncall
 Function call counter. More...
 
bool _valid
 Is binding in valid state? More...
 

#include <RooRealBinding.h>

Inheritance diagram for RooRealBinding:
[legend]

Constructor & Destructor Documentation

◆ RooRealBinding() [1/2]

RooRealBinding::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'.

Use the provided nset as normalization set to be passed to RooAbsReal::getVal() If rangeName is not null, use the range of with that name as range associated with the variables of this function binding. If clipInvalid is true, values requested to the function binding that are outside the defined range of the variables are clipped to fit in the defined range.

Definition at line 55 of file RooRealBinding.cxx.

◆ RooRealBinding() [2/2]

RooRealBinding::RooRealBinding ( const RooRealBinding other,
const RooArgSet nset = nullptr 
)

Construct a lightweight function binding of RooAbsReal func to variables 'vars'.

Use the provided nset as normalization set to be passed to RooAbsReal::getVal() If rangeName is not null, use the range of with that name as range associated with the variables of this function binding. If clipInvalid is true, values requested to the function binding that are outside the defined range of the variables are clipped to fit in the defined range.

Definition at line 87 of file RooRealBinding.cxx.

◆ ~RooRealBinding()

RooRealBinding::~RooRealBinding ( )
override

Destructor.

Definition at line 98 of file RooRealBinding.cxx.

Member Function Documentation

◆ binBoundaries()

std::list< double > * RooRealBinding::binBoundaries ( Int_t  index) const
overridevirtual

Reimplemented from RooAbsFunc.

Definition at line 311 of file RooRealBinding.cxx.

◆ Class()

static TClass * RooRealBinding::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * RooRealBinding::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static Version_t RooRealBinding::Class_Version ( )
inlinestatic
Returns
Version of this class

Definition at line 67 of file RooRealBinding.h.

◆ DeclFileName()

static const char * RooRealBinding::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 67 of file RooRealBinding.h.

◆ getMaxLimit()

double RooRealBinding::getMaxLimit ( UInt_t  dimension) const
overridevirtual

Return upper limit on i-th variable.

Implements RooAbsFunc.

Definition at line 285 of file RooRealBinding.cxx.

◆ getMinLimit()

double RooRealBinding::getMinLimit ( UInt_t  dimension) const
overridevirtual

Return lower limit on i-th variable.

Implements RooAbsFunc.

Definition at line 274 of file RooRealBinding.cxx.

◆ getName()

const char * RooRealBinding::getName ( ) const
overridevirtual

Return name of function.

Reimplemented from RooAbsFunc.

Definition at line 295 of file RooRealBinding.cxx.

◆ getValues()

RooSpan< const double > RooRealBinding::getValues ( std::vector< RooSpan< const double > >  coordinates) const
virtual

Evaluate the bound object at all locations indicated by the data in coordinates.

If _clipInvalid is set, the function is set to zero at all points in the arguments that are not within the range of the observables.

Parameters
coordinatesVector of spans that contain the points where the function should be evaluated. The ordinal position in the vector corresponds to the ordinal position in the set of {observables, parameters} that were passed to the constructor. The spans can either have a size of n, in which case a batch of n results is returned, or they can have a size of 1. In the latter case, the value in the span is broadcast to all n events.
Returns
Batch of function values for each coordinate given in the input spans. If a parameter is invalid, i.e., out of its range, an empty span is returned. If an observable is invalid, the function value is 0.

Reimplemented in RooDataProjBinding, and RooRealAnalytic.

Definition at line 207 of file RooRealBinding.cxx.

◆ getValuesOfBoundFunction()

RooSpan< const double > RooRealBinding::getValuesOfBoundFunction ( RooBatchCompute::RunContext evalData) const

Evaluate the bound object at all locations indicated by the data in evalData.

See also
RooAbsReal::getValues().
Parameters
[in,out]evalDataStruct with spans pointing to the data to be used for evaluation. The spans can either have a size of n, in which case a batch of n results is returned, or they can have a size of 1. In the latter case, the value in the span is broadcast to all n events.
Returns
Batch of function values for each coordinate given in the input spans.

Definition at line 266 of file RooRealBinding.cxx.

◆ IsA()

TClass * RooRealBinding::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from RooAbsFunc.

Definition at line 67 of file RooRealBinding.h.

◆ loadValues()

void RooRealBinding::loadValues ( const double  xvector[]) const
protected

Load the vector of variable values into the RooRealVars associated as variables with the bound RooAbsReal function.

Warning
This will load as many values as the dimensionality of the function requires. The size of xvector is not checked.

Definition at line 169 of file RooRealBinding.cxx.

◆ observable()

RooAbsRealLValue * RooRealBinding::observable ( unsigned int  i) const
inline

Return a pointer to the observable that defines the i-th dimension of the function.

Definition at line 48 of file RooRealBinding.h.

◆ operator()()

double RooRealBinding::operator() ( const double  xvector[]) const
overridevirtual

Evaluate the bound RooAbsReal at the variable values provided in xvector.

Implements RooAbsFunc.

Definition at line 187 of file RooRealBinding.cxx.

◆ plotSamplingHint()

std::list< double > * RooRealBinding::plotSamplingHint ( RooAbsRealLValue ,
double  ,
double   
) const
overridevirtual

Interface for returning an optional hint for initial sampling points when constructing a curve projected on observable.

Reimplemented from RooAbsFunc.

Definition at line 303 of file RooRealBinding.cxx.

◆ restoreXVec()

void RooRealBinding::restoreXVec ( ) const
overridevirtual

Restore value of all variables to previously saved values by saveXVec()

Reimplemented from RooAbsFunc.

Definition at line 141 of file RooRealBinding.cxx.

◆ saveXVec()

void RooRealBinding::saveXVec ( ) const
overridevirtual

Save value of all variables.

Reimplemented from RooAbsFunc.

Definition at line 108 of file RooRealBinding.cxx.

◆ Streamer()

void RooRealBinding::Streamer ( TBuffer )
overridevirtual

Reimplemented from RooAbsFunc.

◆ StreamerNVirtual()

void RooRealBinding::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 67 of file RooRealBinding.h.

Member Data Documentation

◆ _clipInvalid

bool RooRealBinding::_clipInvalid
protected

Definition at line 58 of file RooRealBinding.h.

◆ _compList

std::vector<RooAbsReal*> RooRealBinding::_compList
mutableprotected

!

Definition at line 62 of file RooRealBinding.h.

◆ _compSave

std::vector<double> RooRealBinding::_compSave
mutableprotected

!

Definition at line 63 of file RooRealBinding.h.

◆ _evalData

std::unique_ptr<RooBatchCompute::RunContext> RooRealBinding::_evalData
mutableprotected

Memory for batch evaluations.

Definition at line 65 of file RooRealBinding.h.

◆ _func

const RooAbsReal* RooRealBinding::_func
protected

Definition at line 54 of file RooRealBinding.h.

◆ _funcSave

double RooRealBinding::_funcSave
mutableprotected

!

Definition at line 64 of file RooRealBinding.h.

◆ _nset

const RooArgSet* RooRealBinding::_nset
protected

Definition at line 56 of file RooRealBinding.h.

◆ _rangeName

const TNamed* RooRealBinding::_rangeName
protected

!

Definition at line 60 of file RooRealBinding.h.

◆ _vars

std::vector<RooAbsRealLValue*> RooRealBinding::_vars
protected

Non-owned pointers to variables.

Definition at line 55 of file RooRealBinding.h.

◆ _xsave

double* RooRealBinding::_xsave
mutableprotected

Definition at line 59 of file RooRealBinding.h.

◆ _xvecValid

bool RooRealBinding::_xvecValid
mutableprotected

Definition at line 57 of file RooRealBinding.h.

Libraries for RooRealBinding:
[legend]

The documentation for this class was generated from the following files: