Logo ROOT  
Reference Guide
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 care of all these operations by forwarding these calls to the RooAbsCacheElement interface functions, which have a sensible default implementation.

Definition at line 30 of file RooObjCacheManager.h.

Public Member Functions

 RooObjCacheManager (const RooObjCacheManager &other, RooAbsArg *owner=0)
 Copy constructor. More...
 
 RooObjCacheManager (RooAbsArg *owner=0, Int_t maxSize=2, bool clearCacheOnServerRedirect=true, bool allowOptimize=false)
 Constructor of object cache manager for given owner. More...
 
 ~RooObjCacheManager () override
 Destructor. More...
 
void findConstantNodes (const RooArgSet &, RooArgSet &, RooLinkedList &) override
 If clearOnRedirect is false, forward constant term optimization calls to cache elements. More...
 
void insertObjectHook (RooAbsCacheElement &) override
 Set owner link on all object inserted into cache. More...
 
TClassIsA () const override
 
void operModeHook () override
 Intercept changes to cache operation mode and forward to cache elements. More...
 
void optimizeCacheMode (const RooArgSet &, RooArgSet &, RooLinkedList &) override
 Intercept calls to perform automatic optimization of cache mode operation. More...
 
void printCompactTreeHook (std::ostream &, const char *) override
 Add details on cache contents when printing in tree mode. More...
 
bool redirectServersHook (const RooAbsCollection &, bool, bool, bool) override
 Intercept server redirect calls. More...
 
void setClearOnRedirect (bool flag)
 
void sterilize () override
 Clear the cache payload but retain slot mapping w.r.t to normalization and integration sets. More...
 
void Streamer (TBuffer &) override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from RooCacheManager< RooAbsCacheElement >
 RooCacheManager (const RooCacheManager &other, RooAbsArg *owner=0)
 Copy constructor. More...
 
 RooCacheManager (Int_t maxSize=2)
 Constructor for simple caches without RooAbsArg payload. More...
 
 RooCacheManager (RooAbsArg *owner, Int_t maxSize=2)
 Constructor for simple caches with RooAbsArg derived payload. More...
 
 ~RooCacheManager () override
 Destructor. More...
 
Int_t cacheSize () const
 Return size of cache. More...
 
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)
 Retrieve payload object indexed on nset,uset amd isetRangeName If sterileIdx is not null, it is set to the index of the sterile slot in cacse such a slot is recycled. More...
 
RooAbsCacheElementgetObj (const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
 Getter function without integration set. More...
 
RooAbsCacheElementgetObjByIndex (Int_t index) const
 Retrieve payload object by slot index. More...
 
virtual void insertObjectHook (RooAbsCacheElement &)
 Interface function to perform post-insert operations on cached object. More...
 
TClassIsA () const override
 
Int_t lastIndex () const
 Return index of slot used in last get or set operation. More...
 
void operModeHook () override
 Interface function to intercept cache operation mode changes. More...
 
void printCompactTreeHook (std::ostream &, const char *) override
 Interface function to cache add contents to output in tree printing mode. More...
 
bool redirectServersHook (const RooAbsCollection &, bool, bool, bool) override
 Interface function to intercept server redirects. More...
 
void reset ()
 Clear the cache. More...
 
RooArgSet selectFromSet1 (RooArgSet const &argSet, int index) const
 Create RooArgSet contatining the objects that are both in the cached set 1. More...
 
RooArgSet selectFromSet2 (RooArgSet const &argSet, int index) const
 Create RooArgSet contatining the objects that are both in the cached set 2. More...
 
Int_t setObj (const RooArgSet *nset, const RooArgSet *iset, RooAbsCacheElement *obj, const TNamed *isetRangeName=0)
 Insert payload object 'obj' in cache indexed on nset,iset and isetRangeName. More...
 
Int_t setObj (const RooArgSet *nset, RooAbsCacheElement *obj, const TNamed *isetRangeName=0)
 Setter function without integration set. More...
 
virtual void sterilize ()
 Clear the cache payload but retain slot mapping w.r.t to normalization and integration sets. More...
 
void Streamer (TBuffer &) override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
void wireCache () override
 
- Public Member Functions inherited from RooAbsCache
 RooAbsCache (const RooAbsCache &, RooAbsArg *owner=0)
 Copy constructor. Takes owner as argument and registers cache with owne. More...
 
 RooAbsCache (RooAbsArg *owner=0)
 Constructor. Takes owner as argument and register cache with owner. More...
 
virtual ~RooAbsCache ()
 Destructor. Unregisters cache with owner. More...
 
virtual void findConstantNodes (const RooArgSet &, RooArgSet &, RooLinkedList &)
 Interface for constant term node finding calls. More...
 
virtual TClassIsA () const
 
virtual void operModeHook ()
 Interface for operation mode changes. More...
 
virtual void optimizeCacheMode (const RooArgSet &, RooArgSet &, RooLinkedList &)
 Interface for processing of cache mode optimization calls. More...
 
virtual void printCompactTreeHook (std::ostream &, const char *)
 Interface for printing of cache guts in tree mode printing. More...
 
virtual bool redirectServersHook (const RooAbsCollection &, bool, bool, bool)
 Interface for server redirect calls. More...
 
void setOwner (RooAbsArg *owner)
 Reset the owner, triggering the owner to register this cache in its list of caches. More...
 
virtual void Streamer (TBuffer &)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
virtual void wireCache ()
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static Version_t Class_Version ()
 
static bool clearObsList ()
 
static const char * DeclFileName ()
 
static void doClearObsList (bool flag)
 
- Static Public Member Functions inherited from RooCacheManager< RooAbsCacheElement >
static TClassClass ()
 
static const char * Class_Name ()
 
static Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from RooAbsCache
static TClassClass ()
 
static const char * Class_Name ()
 
static Version_t Class_Version ()
 
static const char * DeclFileName ()
 

Protected Attributes

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

Static Protected Attributes

static bool _clearObsList
 Clear obslist on sterilize? 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  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 51 of file RooObjCacheManager.cxx.

◆ RooObjCacheManager() [2/2]

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

Copy constructor.

Definition at line 64 of file RooObjCacheManager.cxx.

◆ ~RooObjCacheManager()

RooObjCacheManager::~RooObjCacheManager ( )
override

Destructor.

Definition at line 77 of file RooObjCacheManager.cxx.

Member Function Documentation

◆ Class()

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

◆ Class_Name()

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

◆ Class_Version()

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

Definition at line 63 of file RooObjCacheManager.h.

◆ clearObsList()

static bool RooObjCacheManager::clearObsList ( )
inlinestatic

Definition at line 49 of file RooObjCacheManager.h.

◆ DeclFileName()

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

Definition at line 63 of file RooObjCacheManager.h.

◆ doClearObsList()

static void RooObjCacheManager::doClearObsList ( bool  flag)
inlinestatic

Definition at line 48 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 215 of file RooObjCacheManager.cxx.

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

◆ IsA()

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

Reimplemented from RooAbsCache.

Definition at line 63 of file RooObjCacheManager.h.

◆ operModeHook()

void RooObjCacheManager::operModeHook ( )
overridevirtual

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

Reimplemented from RooAbsCache.

Definition at line 114 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 135 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 RooAbsCache.

Definition at line 200 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 RooAbsCache.

Definition at line 90 of file RooObjCacheManager.cxx.

◆ setClearOnRedirect()

void RooObjCacheManager::setClearOnRedirect ( bool  flag)
inline

Definition at line 51 of file RooObjCacheManager.h.

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

◆ Streamer()

void RooObjCacheManager::Streamer ( TBuffer )
overridevirtual

Reimplemented from RooAbsCache.

◆ StreamerNVirtual()

void RooObjCacheManager::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 63 of file RooObjCacheManager.h.

Member Data Documentation

◆ _allowOptimize

bool RooObjCacheManager::_allowOptimize
protected

Definition at line 56 of file RooObjCacheManager.h.

◆ _clearObsList

bool RooObjCacheManager::_clearObsList
staticprotected

Clear obslist on sterilize?

Definition at line 61 of file RooObjCacheManager.h.

◆ _clearOnRedirect

bool RooObjCacheManager::_clearOnRedirect
protected

Definition at line 55 of file RooObjCacheManager.h.

◆ _optCacheModeSeen

bool RooObjCacheManager::_optCacheModeSeen
protected

!

Definition at line 57 of file RooObjCacheManager.h.

◆ _optCacheObservables

RooArgSet* RooObjCacheManager::_optCacheObservables
protected

! current optCacheObservables

Definition at line 59 of file RooObjCacheManager.h.

Libraries for RooObjCacheManager:
[legend]

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