Logo ROOT   6.10/09
Reference Guide
List of all members | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
RooObjCacheManager Class Reference

Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and 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 are of all these operations by forwarding these calls to the RooAbsCacheElement interface functions, which have a sensible default implementation.

Definition at line 33 of file RooObjCacheManager.h.

Public Member Functions

 RooObjCacheManager (RooAbsArg *owner=0, Int_t maxSize=2, Bool_t clearCacheOnServerRedirect=kTRUE, Bool_t allowOptimize=kFALSE)
 Constructor of object cache manager for given owner. More...
 
 RooObjCacheManager (const RooObjCacheManager &other, RooAbsArg *owner=0)
 Copy constructor. More...
 
virtual ~RooObjCacheManager ()
 Destructor. More...
 
virtual void findConstantNodes (const RooArgSet &, RooArgSet &, RooLinkedList &)
 If clearOnRedirect is false, forward constant term optimization calls to cache elements. More...
 
virtual void insertObjectHook (RooAbsCacheElement &)
 Set owner link on all object inserted into cache. More...
 
virtual void operModeHook ()
 Intercept changes to cache operation mode and forward to cache elements. More...
 
virtual void optimizeCacheMode (const RooArgSet &, RooArgSet &, RooLinkedList &)
 Intercept calls to perform automatic optimization of cache mode operation. More...
 
virtual void printCompactTreeHook (std::ostream &, const char *)
 Add details on cache contents when printing in tree mode. More...
 
virtual Bool_t redirectServersHook (const RooAbsCollection &, Bool_t, Bool_t, Bool_t)
 Intercept server redirect calls. More...
 
void setClearOnRedirect (Bool_t flag)
 
void sterilize ()
 
- Public Member Functions inherited from RooCacheManager< RooAbsCacheElement >
 RooCacheManager (Int_t maxSize=2)
 
 RooCacheManager (RooAbsArg *owner, Int_t maxSize=2)
 
 RooCacheManager (const RooCacheManager &other, RooAbsArg *owner=0)
 
virtual ~RooCacheManager ()
 
Int_t cacheSize () const
 
RooAbsCacheElementgetObj (const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
 
RooAbsCacheElementgetObj (const RooArgSet *nset, const RooArgSet *iset, Int_t *sterileIdx, const char *isetRangeName)
 
RooAbsCacheElementgetObj (const RooArgSet *nset, const RooArgSet *iset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
 
RooAbsCacheElementgetObjByIndex (Int_t index) const
 
Int_t lastIndex () const
 
const RooNameSetnameSet1ByIndex (Int_t index) const
 
const RooNameSetnameSet2ByIndex (Int_t index) const
 
void reset ()
 
Int_t setObj (const RooArgSet *nset, RooAbsCacheElement *obj, const TNamed *isetRangeName=0)
 
Int_t setObj (const RooArgSet *nset, const RooArgSet *iset, RooAbsCacheElement *obj, const TNamed *isetRangeName=0)
 
void wireCache ()
 
- Public Member Functions inherited from RooAbsCache
 RooAbsCache (RooAbsArg *owner=0)
 Constructor. Takes owner as argument and register cache with owner. More...
 
 RooAbsCache (const RooAbsCache &, RooAbsArg *owner=0)
 Copy constructor. Takes owner as argument and registers cache with owne. More...
 
virtual ~RooAbsCache ()
 Destructor. Unregisters cache with owner. More...
 

Static Public Member Functions

static Bool_t clearObsList ()
 
static void doClearObsList (Bool_t flag)
 

Protected Attributes

Bool_t _allowOptimize
 
Bool_t _clearOnRedirect
 
Bool_t _optCacheModeSeen
 
RooArgSet_optCacheObservables
 
- Protected Attributes inherited from RooCacheManager< RooAbsCacheElement >
Int_t _lastIndex
 Actual use. More...
 
Int_t _maxSize
 
std::vector< RooNormSetCache_nsetCache
 Last slot accessed. More...
 
std::vector< RooAbsCacheElement *> _object
 Normalization/Integration set manager. More...
 
Int_t _size
 Maximum size. More...
 
Bool_t _wired
 Payload. More...
 
- Protected Attributes inherited from RooAbsCache
RooAbsArg_owner
 

Static Protected Attributes

static Bool_t _clearObsList
 current optCacheObservables More...
 

#include <RooObjCacheManager.h>

Inheritance diagram for RooObjCacheManager:
[legend]

Constructor & Destructor Documentation

◆ RooObjCacheManager() [1/2]

RooObjCacheManager::RooObjCacheManager ( RooAbsArg owner = 0,
Int_t  maxSize = 2,
Bool_t  clearCacheOnServerRedirect = kTRUE,
Bool_t  allowOptimize = kFALSE 
)

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 52 of file RooObjCacheManager.cxx.

◆ RooObjCacheManager() [2/2]

RooObjCacheManager::RooObjCacheManager ( const RooObjCacheManager other,
RooAbsArg owner = 0 
)

Copy constructor.

Definition at line 65 of file RooObjCacheManager.cxx.

◆ ~RooObjCacheManager()

RooObjCacheManager::~RooObjCacheManager ( )
virtual

Destructor.

Definition at line 78 of file RooObjCacheManager.cxx.

Member Function Documentation

◆ clearObsList()

static Bool_t RooObjCacheManager::clearObsList ( )
inlinestatic

Definition at line 52 of file RooObjCacheManager.h.

◆ doClearObsList()

static void RooObjCacheManager::doClearObsList ( Bool_t  flag)
inlinestatic

Definition at line 51 of file RooObjCacheManager.h.

◆ findConstantNodes()

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

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

Reimplemented from RooAbsCache.

Definition at line 216 of file RooObjCacheManager.cxx.

◆ insertObjectHook()

void RooObjCacheManager::insertObjectHook ( RooAbsCacheElement obj)
virtual

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 182 of file RooObjCacheManager.cxx.

◆ operModeHook()

void RooObjCacheManager::operModeHook ( )
virtual

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

Reimplemented from RooCacheManager< RooAbsCacheElement >.

Definition at line 115 of file RooObjCacheManager.cxx.

◆ optimizeCacheMode()

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

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 136 of file RooObjCacheManager.cxx.

◆ printCompactTreeHook()

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

Add details on cache contents when printing in tree mode.

Reimplemented from RooCacheManager< RooAbsCacheElement >.

Definition at line 201 of file RooObjCacheManager.cxx.

◆ redirectServersHook()

Bool_t RooObjCacheManager::redirectServersHook ( const RooAbsCollection newServerList,
Bool_t  mustReplaceAll,
Bool_t  nameChange,
Bool_t  isRecursive 
)
virtual

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 91 of file RooObjCacheManager.cxx.

◆ setClearOnRedirect()

void RooObjCacheManager::setClearOnRedirect ( Bool_t  flag)
inline

Definition at line 54 of file RooObjCacheManager.h.

◆ sterilize()

void RooObjCacheManager::sterilize ( )
virtual

Reimplemented from RooCacheManager< RooAbsCacheElement >.

Definition at line 159 of file RooObjCacheManager.cxx.

Member Data Documentation

◆ _allowOptimize

Bool_t RooObjCacheManager::_allowOptimize
protected

Definition at line 59 of file RooObjCacheManager.h.

◆ _clearObsList

Bool_t RooObjCacheManager::_clearObsList
staticprotected

current optCacheObservables

Definition at line 64 of file RooObjCacheManager.h.

◆ _clearOnRedirect

Bool_t RooObjCacheManager::_clearOnRedirect
protected

Definition at line 58 of file RooObjCacheManager.h.

◆ _optCacheModeSeen

Bool_t RooObjCacheManager::_optCacheModeSeen
protected

Definition at line 60 of file RooObjCacheManager.h.

◆ _optCacheObservables

RooArgSet* RooObjCacheManager::_optCacheObservables
protected

Definition at line 62 of file RooObjCacheManager.h.


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