Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
RooObjCacheManager Class Reference

Implementation of a RooCacheManager<RooAbsCacheElement> that specializes in the storage of cache elements that contain RooAbsArg objects.

Caches with RooAbsArg derived payload require special care as server redirects cache operation mode changes and constant term optimization calls may need to be forwarded to such cache payload. This cache manager takes care of all these operations by forwarding these calls to the RooAbsCacheElement interface functions, which have a sensible default implementation.

Definition at line 29 of file RooObjCacheManager.h.

Public Member Functions

 RooObjCacheManager (const RooObjCacheManager &other, RooAbsArg *owner=nullptr)
 Copy constructor.
 RooObjCacheManager (RooAbsArg *owner=nullptr, Int_t maxSize=2, bool clearCacheOnServerRedirect=true, bool allowOptimize=false)
 Constructor of object cache manager for given owner.
 ~RooObjCacheManager () override
 Destructor.
Int_t cacheSize () const
 Return size of cache.
void findConstantNodes (const RooArgSet &, RooArgSet &, RooLinkedList &) override
 If clearOnRedirect is false, forward constant term optimization calls to cache elements.
RooAbsCacheElementgetObj (const RooArgSet *nset, Int_t *sterileIndex=nullptr, const TNamed *isetRangeName=nullptr)
 Getter function without integration set.
RooAbsCacheElementgetObjByIndex (Int_t index) const
 Retrieve payload object by slot index.
void insertObjectHook (RooAbsCacheElement &) override
 Set owner link on all object inserted into cache.
TClassIsA () const override
Int_t lastIndex () const
 Return index of slot used in last get or set operation.
void operModeHook () override
 Intercept changes to cache operation mode and forward to cache elements.
void optimizeCacheMode (const RooArgSet &, RooArgSet &, RooLinkedList &) override
 Intercept calls to perform automatic optimization of cache mode operation.
void printCompactTreeHook (std::ostream &, const char *) override
 Add details on cache contents when printing in tree mode.
bool redirectServersHook (const RooAbsCollection &, bool, bool, bool) override
 Intercept server redirect calls.
void reset ()
 Clear the cache.
RooArgSet selectFromSet1 (RooArgSet const &argSet, int index) const
 Create RooArgSet containing the objects that are both in the cached set 1 with a given index and an input argSet.
RooArgSet selectFromSet2 (RooArgSet const &argSet, int index) const
 Create RooArgSet containing the objects that are both in the cached set 2 with a given index and an input argSet.
void setClearOnRedirect (bool flag)
Int_t setObj (const RooArgSet *nset, RooAbsCacheElement *obj, const TNamed *isetRangeName=nullptr)
 Setter function without integration set.
void setOwner (RooAbsArg *owner)
 Reset the owner, triggering the owner to register this cache in its list of caches.
void sterilize () override
 Clear the cache payload but retain slot mapping w.r.t to normalization and integration sets.
void Streamer (TBuffer &) override
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
void wireCache () override

Static Public Member Functions

static TClassClass ()
static const char * Class_Name ()
static constexpr Version_t Class_Version ()
static bool clearObsList ()
static const char * DeclFileName ()
static void doClearObsList (bool flag)

Protected Attributes

bool _allowOptimize
bool _clearOnRedirect
Int_t _lastIndex
 ! Last slot accessed
Int_t _maxSize
 ! Maximum size
std::vector< RooNormSetCache_nsetCache
 ! Normalization/Integration set manager
std::vector< RooAbsCacheElement * > _object
 ! Payload
bool _optCacheModeSeen
 !
RooArgSet_optCacheObservables = nullptr
 ! current optCacheObservables
RooAbsArg_owner
 Pointer to owning RooAbsArg.
Int_t _size
 ! Actual use
bool _wired
 ! In wired mode, there is a single payload which is returned always

Static Protected Attributes

static bool _clearObsList
 Clear obslist on sterilize?

#include <RooObjCacheManager.h>

Inheritance diagram for RooObjCacheManager:
RooCacheManager< RooAbsCacheElement > RooAbsCache

Constructor & Destructor Documentation

◆ RooObjCacheManager() [1/2]

RooObjCacheManager::RooObjCacheManager ( RooAbsArg * owner = nullptr,
Int_t maxSize = 2,
bool clearCacheOnServerRedirect = true,
bool allowOptimize = false )

Constructor of object cache manager for given owner.

If clearCacheOnServerRedirect is true all cache elements will be cleared when a server redirect is intercepted by the cache manager. This is the default strategy and should only be overridden when you really understand what you're doing as properly implementing server redirect in cache elements can get very complicated, especially if there are (cyclical) reference back to the owning object

Definition at line 46 of file RooObjCacheManager.cxx.

◆ RooObjCacheManager() [2/2]

RooObjCacheManager::RooObjCacheManager ( const RooObjCacheManager & other,
RooAbsArg * owner = nullptr )

Copy constructor.

Definition at line 58 of file RooObjCacheManager.cxx.

◆ ~RooObjCacheManager()

RooObjCacheManager::~RooObjCacheManager ( )
override

Destructor.

Definition at line 70 of file RooObjCacheManager.cxx.

Member Function Documentation

◆ cacheSize()

Int_t RooCacheManager< RooAbsCacheElement >::cacheSize ( ) const
inlineinherited

Return size of cache.

Definition at line 88 of file RooCacheManager.h.

◆ Class()

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

◆ Class_Name()

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

◆ Class_Version()

constexpr Version_t RooObjCacheManager::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 62 of file RooObjCacheManager.h.

◆ clearObsList()

bool RooObjCacheManager::clearObsList ( )
inlinestatic

Definition at line 48 of file RooObjCacheManager.h.

◆ DeclFileName()

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

Definition at line 62 of file RooObjCacheManager.h.

◆ doClearObsList()

void RooObjCacheManager::doClearObsList ( bool flag)
inlinestatic

Definition at line 47 of file RooObjCacheManager.h.

◆ findConstantNodes()

void RooObjCacheManager::findConstantNodes ( const RooArgSet & obs,
RooArgSet & cacheList,
RooLinkedList & processedNodes )
overridevirtual

If clearOnRedirect is false, forward constant term optimization calls to cache elements.

Reimplemented from RooAbsCache.

Definition at line 208 of file RooObjCacheManager.cxx.

◆ getObj()

RooAbsCacheElement * RooCacheManager< RooAbsCacheElement >::getObj ( const RooArgSet * nset,
Int_t * sterileIndex = nullptr,
const TNamed * isetRangeName = nullptr )
inlineinherited

Getter function without integration set.

Definition at line 63 of file RooCacheManager.h.

◆ getObjByIndex()

RooAbsCacheElement * RooCacheManager< RooAbsCacheElement >::getObjByIndex ( Int_t index) const
inherited

Retrieve payload object by slot index.

Definition at line 104 of file RooCacheManager.h.

◆ insertObjectHook()

void RooObjCacheManager::insertObjectHook ( RooAbsCacheElement & obj)
overridevirtual

Set owner link on all object inserted into cache.

Also if cache mode optimization was requested, apply it now to cache element being inserted

Reimplemented from RooCacheManager< RooAbsCacheElement >.

Definition at line 174 of file RooObjCacheManager.cxx.

◆ IsA()

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

Reimplemented from RooCacheManager< RooAbsCacheElement >.

Definition at line 62 of file RooObjCacheManager.h.

◆ lastIndex()

Int_t RooCacheManager< RooAbsCacheElement >::lastIndex ( ) const
inlineinherited

Return index of slot used in last get or set operation.

Definition at line 84 of file RooCacheManager.h.

◆ operModeHook()

void RooObjCacheManager::operModeHook ( )
overridevirtual

Intercept changes to cache operation mode and forward to cache elements.

Reimplemented from RooCacheManager< RooAbsCacheElement >.

Definition at line 107 of file RooObjCacheManager.cxx.

◆ optimizeCacheMode()

void RooObjCacheManager::optimizeCacheMode ( const RooArgSet & obs,
RooArgSet & optNodes,
RooLinkedList & processedNodes )
overridevirtual

Intercept calls to perform automatic optimization of cache mode operation.

Forward calls to existing cache elements and save configuration of cache mode optimization so that it can be applied on new cache elements upon insertion

Reimplemented from RooAbsCache.

Definition at line 128 of file RooObjCacheManager.cxx.

◆ printCompactTreeHook()

void RooObjCacheManager::printCompactTreeHook ( std::ostream & os,
const char * indent )
overridevirtual

Add details on cache contents when printing in tree mode.

Reimplemented from RooCacheManager< RooAbsCacheElement >.

Definition at line 193 of file RooObjCacheManager.cxx.

◆ redirectServersHook()

bool RooObjCacheManager::redirectServersHook ( const RooAbsCollection & newServerList,
bool mustReplaceAll,
bool nameChange,
bool isRecursive )
overridevirtual

Intercept server redirect calls.

If clearOnRedirect was set, sterilize the cache (i.e. keep the structure but delete all contents). If not forward serverRedirect to cache elements

Reimplemented from RooCacheManager< RooAbsCacheElement >.

Definition at line 83 of file RooObjCacheManager.cxx.

◆ reset()

void RooCacheManager< RooAbsCacheElement >::reset ( )
inherited

Clear the cache.

Definition at line 80 of file RooCacheManager.h.

◆ selectFromSet1()

RooArgSet RooCacheManager< RooAbsCacheElement >::selectFromSet1 ( RooArgSet const & argSet,
int index ) const
inherited

Create RooArgSet containing the objects that are both in the cached set 1 with a given index and an input argSet.

Definition at line 105 of file RooCacheManager.h.

◆ selectFromSet2()

RooArgSet RooCacheManager< RooAbsCacheElement >::selectFromSet2 ( RooArgSet const & argSet,
int index ) const
inherited

Create RooArgSet containing the objects that are both in the cached set 2 with a given index and an input argSet.

Definition at line 106 of file RooCacheManager.h.

◆ setClearOnRedirect()

void RooObjCacheManager::setClearOnRedirect ( bool flag)
inline

Definition at line 50 of file RooObjCacheManager.h.

◆ setObj()

Int_t RooCacheManager< RooAbsCacheElement >::setObj ( const RooArgSet * nset,
RooAbsCacheElement * obj,
const TNamed * isetRangeName = nullptr )
inlineinherited

Setter function without integration set.

Definition at line 68 of file RooCacheManager.h.

◆ setOwner()

void RooAbsCache::setOwner ( RooAbsArg * owner)
inherited

Reset the owner, triggering the owner to register this cache in its list of caches.

Definition at line 37 of file RooAbsCache.cxx.

◆ sterilize()

void RooObjCacheManager::sterilize ( )
overridevirtual

Clear the cache payload but retain slot mapping w.r.t to normalization and integration sets.

Reimplemented from RooCacheManager< RooAbsCacheElement >.

Definition at line 151 of file RooObjCacheManager.cxx.

◆ Streamer()

void RooObjCacheManager::Streamer ( TBuffer & )
overridevirtual

◆ StreamerNVirtual()

void RooObjCacheManager::StreamerNVirtual ( TBuffer & ClassDef_StreamerNVirtual_b)
inline

Definition at line 62 of file RooObjCacheManager.h.

◆ wireCache()

void RooCacheManager< RooAbsCacheElement >::wireCache ( )
inlineoverridevirtualinherited

Reimplemented from RooAbsCache.

Definition at line 112 of file RooCacheManager.h.

Member Data Documentation

◆ _allowOptimize

bool RooObjCacheManager::_allowOptimize
protected

Definition at line 55 of file RooObjCacheManager.h.

◆ _clearObsList

bool RooObjCacheManager::_clearObsList
staticprotected

Clear obslist on sterilize?

Definition at line 60 of file RooObjCacheManager.h.

◆ _clearOnRedirect

bool RooObjCacheManager::_clearOnRedirect
protected

Definition at line 54 of file RooObjCacheManager.h.

◆ _lastIndex

Int_t RooCacheManager< RooAbsCacheElement >::_lastIndex
protectedinherited

! Last slot accessed

Definition at line 127 of file RooCacheManager.h.

◆ _maxSize

Int_t RooCacheManager< RooAbsCacheElement >::_maxSize
protectedinherited

! Maximum size

Definition at line 125 of file RooCacheManager.h.

◆ _nsetCache

std::vector<RooNormSetCache> RooCacheManager< RooAbsCacheElement >::_nsetCache
protectedinherited

! Normalization/Integration set manager

Definition at line 129 of file RooCacheManager.h.

◆ _object

std::vector<RooAbsCacheElement*> RooCacheManager< RooAbsCacheElement >::_object
protectedinherited

! Payload

Definition at line 130 of file RooCacheManager.h.

◆ _optCacheModeSeen

bool RooObjCacheManager::_optCacheModeSeen
protected

!

Definition at line 56 of file RooObjCacheManager.h.

◆ _optCacheObservables

RooArgSet* RooObjCacheManager::_optCacheObservables = nullptr
protected

! current optCacheObservables

Definition at line 58 of file RooObjCacheManager.h.

◆ _owner

RooAbsArg* RooAbsCache::_owner
protectedinherited

Pointer to owning RooAbsArg.

Definition at line 61 of file RooAbsCache.h.

◆ _size

Int_t RooCacheManager< RooAbsCacheElement >::_size
protectedinherited

! Actual use

Definition at line 126 of file RooCacheManager.h.

◆ _wired

bool RooCacheManager< RooAbsCacheElement >::_wired
protectedinherited

! In wired mode, there is a single payload which is returned always

Definition at line 131 of file RooCacheManager.h.


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