Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooFit::EvalContext Class Reference

Definition at line 85 of file EvalContext.h.

Public Types

enum class  OffsetMode { WithoutOffset , WithOffset , OnlyOffset }
 

Public Member Functions

std::span< const doubleat (RooAbsArg const *arg, RooAbsArg const *caller=nullptr)
 
template<class T >
std::span< const doubleat (RooTemplateProxy< T > const &proxy)
 
RooBatchCompute::Config config (RooAbsArg const *arg) const
 
void deferAction (std::function< void()> action)
 Register an action to be run after the evaluation of the full computation graph, when all potentially asynchronous computations and data transfers have completed.
 
void enableVectorBuffers (bool enable)
 
std::size_t inputGeneration () const
 A counter that is incremented every time new input data is loaded into the evaluation context.
 
std::span< doubleoutput ()
 
void resetVectorBuffers ()
 
void resize (std::size_t n)
 
void set (RooAbsArg const *arg, std::span< const double > const &span)
 
void setConfig (RooAbsArg const *arg, RooBatchCompute::Config const &config)
 
void setOutputWithOffset (RooAbsArg const *arg, ROOT::Math::KahanSum< double > val, ROOT::Math::KahanSum< double > const &offset)
 Sets the output value with an offset.
 
auto size () const
 

Private Attributes

std::size_t _bufferIdx = 0
 
std::vector< std::vector< double > > _buffers
 
std::vector< RooBatchCompute::Config_cfgs
 
std::vector< std::span< const double > > _ctx
 
std::span< double_currentOutput
 
std::vector< std::function< void()> > _deferredActions
 
bool _enableVectorBuffers = false
 
std::size_t _inputGeneration = 1
 
OffsetMode _offsetMode = OffsetMode::WithoutOffset
 

Friends

class Evaluator
 

#include <RooFit/EvalContext.h>

Member Enumeration Documentation

◆ OffsetMode

Enumerator
WithoutOffset 
WithOffset 
OnlyOffset 

Definition at line 87 of file EvalContext.h.

Member Function Documentation

◆ at() [1/2]

std::span< const double > RooFit::EvalContext::at ( RooAbsArg const * arg,
RooAbsArg const * caller = nullptr )

Definition at line 35 of file EvalContext.cxx.

◆ at() [2/2]

template<class T >
std::span< const double > RooFit::EvalContext::at ( RooTemplateProxy< T > const & proxy)
inline

Definition at line 105 of file EvalContext.h.

◆ config()

RooBatchCompute::Config RooFit::EvalContext::config ( RooAbsArg const * arg) const

Definition at line 73 of file EvalContext.cxx.

◆ deferAction()

void RooFit::EvalContext::deferAction ( std::function< void()> action)
inline

Register an action to be run after the evaluation of the full computation graph, when all potentially asynchronous computations and data transfers have completed.

Used to defer work that depends on results that are read back from the GPU without synchronization, like the logging of evaluation error counts.

Definition at line 132 of file EvalContext.h.

◆ enableVectorBuffers()

void RooFit::EvalContext::enableVectorBuffers ( bool enable)
inline

Definition at line 120 of file EvalContext.h.

◆ inputGeneration()

std::size_t RooFit::EvalContext::inputGeneration ( ) const
inline

A counter that is incremented every time new input data is loaded into the evaluation context.

Reducer nodes can use it as a cache invalidation key for quantities that only depend on the input data, like the sum of event weights. The counter values are unique across all evaluation contexts in the process, so cached values can not be wrongly validated by an unrelated context.

Definition at line 118 of file EvalContext.h.

◆ output()

std::span< double > RooFit::EvalContext::output ( )
inline

Definition at line 122 of file EvalContext.h.

◆ resetVectorBuffers()

void RooFit::EvalContext::resetVectorBuffers ( )
inline

Definition at line 121 of file EvalContext.h.

◆ resize()

void RooFit::EvalContext::resize ( std::size_t n)

Definition at line 82 of file EvalContext.cxx.

◆ set()

void RooFit::EvalContext::set ( RooAbsArg const * arg,
std::span< const double > const & span )
inline

Definition at line 92 of file EvalContext.h.

◆ setConfig()

void RooFit::EvalContext::setConfig ( RooAbsArg const * arg,
RooBatchCompute::Config const & config )

Definition at line 65 of file EvalContext.cxx.

◆ setOutputWithOffset()

void RooFit::EvalContext::setOutputWithOffset ( RooAbsArg const * arg,
ROOT::Math::KahanSum< double > val,
ROOT::Math::KahanSum< double > const & offset )

Sets the output value with an offset.

This function sets the output value with an offset for the given argument. It should only be used in reducer nodes. Depending on the current OffsetMode, the result will either be just the value, the value minus the offset, of just the offset.

Parameters
argPointer to the RooAbsArg object.
valThe value to be set.
offsetThe offset value.
Exceptions
std::runtime_errorif the argument is not a reducer node.

Definition at line 100 of file EvalContext.cxx.

◆ size()

auto RooFit::EvalContext::size ( ) const
inline

Definition at line 89 of file EvalContext.h.

Friends And Related Symbol Documentation

◆ Evaluator

friend class Evaluator
friend

Definition at line 135 of file EvalContext.h.

Member Data Documentation

◆ _bufferIdx

std::size_t RooFit::EvalContext::_bufferIdx = 0
private

Definition at line 143 of file EvalContext.h.

◆ _buffers

std::vector<std::vector<double> > RooFit::EvalContext::_buffers
private

Definition at line 142 of file EvalContext.h.

◆ _cfgs

std::vector<RooBatchCompute::Config> RooFit::EvalContext::_cfgs
private

Definition at line 144 of file EvalContext.h.

◆ _ctx

std::vector<std::span<const double> > RooFit::EvalContext::_ctx
private

Definition at line 140 of file EvalContext.h.

◆ _currentOutput

std::span<double> RooFit::EvalContext::_currentOutput
private

Definition at line 139 of file EvalContext.h.

◆ _deferredActions

std::vector<std::function<void()> > RooFit::EvalContext::_deferredActions
private

Definition at line 145 of file EvalContext.h.

◆ _enableVectorBuffers

bool RooFit::EvalContext::_enableVectorBuffers = false
private

Definition at line 141 of file EvalContext.h.

◆ _inputGeneration

std::size_t RooFit::EvalContext::_inputGeneration = 1
private

Definition at line 138 of file EvalContext.h.

◆ _offsetMode

OffsetMode RooFit::EvalContext::_offsetMode = OffsetMode::WithoutOffset
private

Definition at line 137 of file EvalContext.h.

Libraries for RooFit::EvalContext:

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