Logo ROOT  
Reference Guide
RooNormSetCache Class Reference

Class RooNormSet cache manage the bookkeeping of multiple instances of sets of integration and normalization observables that effectively have the same definition.

In complex function expression many RooArgSets with the same contents may be passed to an object that caches intermediate results dependent on the normalization/integration set To avoid unnecessary cache faulting, This class tracks all instances with the same contents and reports to the owner if the present nset/iset is truely different from the current reference. Class RooNormSet only evaluates each RooArgSet pointer once, it therefore assumes that RooArgSets with normalization and/or integration sets are not changes during their lifetime.

Definition at line 25 of file RooNormSetCache.h.

Classes

class  Pair
 

Public Member Functions

 RooNormSetCache (std::size_t max=32)
 
void add (const RooArgSet *set1, const RooArgSet *set2=nullptr)
 Add given pair of RooArgSet pointers to our store. More...
 
bool autoCache (const RooAbsArg *self, const RooArgSet *set1, const RooArgSet *set2=nullptr, const TNamed *set2RangeName=nullptr, bool autoRefill=true)
 If RooArgSets set1 and set2 or sets with similar contents have been seen by this cache manager before return false If not, return true. More...
 
void clear ()
 Clear contents. More...
 
bool contains (const RooArgSet *set1, const RooArgSet *set2=nullptr, const TNamed *set2RangeName=nullptr)
 
bool containsSet1 (const RooArgSet *set1)
 
std::size_t entries () const
 
int index (const RooArgSet *set1, const RooArgSet *set2=nullptr, const TNamed *set2RangeName=nullptr)
 
void initialize (const RooNormSetCache &other)
 
const std::string & nameSet1 () const
 
const std::string & nameSet2 () const
 

Private Types

typedef std::map< Pair, std::size_t > PairIdxMapType
 
typedef std::vector< PairPairVectType
 

Private Attributes

std::size_t _max
 ! More...
 
std::string _name1
 ! More...
 
std::string _name2
 ! More...
 
std::size_t _next = 0
 ! More...
 
PairVectType _pairs
 ! More...
 
PairIdxMapType _pairToIdx
 ! More...
 
TNamed_set2RangeName = nullptr
 ! More...
 

#include <RooNormSetCache.h>

Member Typedef Documentation

◆ PairIdxMapType

typedef std::map<Pair, std::size_t> RooNormSetCache::PairIdxMapType
private

Definition at line 42 of file RooNormSetCache.h.

◆ PairVectType

typedef std::vector<Pair> RooNormSetCache::PairVectType
private

Definition at line 41 of file RooNormSetCache.h.

Constructor & Destructor Documentation

◆ RooNormSetCache()

RooNormSetCache::RooNormSetCache ( std::size_t  max = 32)
inline

Definition at line 45 of file RooNormSetCache.h.

Member Function Documentation

◆ add()

void RooNormSetCache::add ( const RooArgSet set1,
const RooArgSet set2 = nullptr 
)

Add given pair of RooArgSet pointers to our store.

Definition at line 57 of file RooNormSetCache.cxx.

◆ autoCache()

bool RooNormSetCache::autoCache ( const RooAbsArg self,
const RooArgSet set1,
const RooArgSet set2 = nullptr,
const TNamed set2RangeName = nullptr,
bool  doRefill = true 
)

If RooArgSets set1 and set2 or sets with similar contents have been seen by this cache manager before return false If not, return true.

If sets have not been seen and doRefill is true, update cache reference to current input sets.

Definition at line 90 of file RooNormSetCache.cxx.

◆ clear()

void RooNormSetCache::clear ( )

Clear contents.

Definition at line 41 of file RooNormSetCache.cxx.

◆ contains()

bool RooNormSetCache::contains ( const RooArgSet set1,
const RooArgSet set2 = nullptr,
const TNamed set2RangeName = nullptr 
)
inline

Definition at line 62 of file RooNormSetCache.h.

◆ containsSet1()

bool RooNormSetCache::containsSet1 ( const RooArgSet set1)
inline

Definition at line 66 of file RooNormSetCache.h.

◆ entries()

std::size_t RooNormSetCache::entries ( ) const
inline

Definition at line 83 of file RooNormSetCache.h.

◆ index()

int RooNormSetCache::index ( const RooArgSet set1,
const RooArgSet set2 = nullptr,
const TNamed set2RangeName = nullptr 
)
inline

Definition at line 49 of file RooNormSetCache.h.

◆ initialize()

void RooNormSetCache::initialize ( const RooNormSetCache other)
inline

Definition at line 85 of file RooNormSetCache.h.

◆ nameSet1()

const std::string & RooNormSetCache::nameSet1 ( ) const
inline

Definition at line 75 of file RooNormSetCache.h.

◆ nameSet2()

const std::string & RooNormSetCache::nameSet2 ( ) const
inline

Definition at line 76 of file RooNormSetCache.h.

Member Data Documentation

◆ _max

std::size_t RooNormSetCache::_max
private

!

Definition at line 91 of file RooNormSetCache.h.

◆ _name1

std::string RooNormSetCache::_name1
private

!

Definition at line 94 of file RooNormSetCache.h.

◆ _name2

std::string RooNormSetCache::_name2
private

!

Definition at line 95 of file RooNormSetCache.h.

◆ _next

std::size_t RooNormSetCache::_next = 0
private

!

Definition at line 92 of file RooNormSetCache.h.

◆ _pairs

PairVectType RooNormSetCache::_pairs
private

!

Definition at line 89 of file RooNormSetCache.h.

◆ _pairToIdx

PairIdxMapType RooNormSetCache::_pairToIdx
private

!

Definition at line 90 of file RooNormSetCache.h.

◆ _set2RangeName

TNamed* RooNormSetCache::_set2RangeName = nullptr
private

!

Definition at line 96 of file RooNormSetCache.h.

Libraries for RooNormSetCache:
[legend]

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