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. | |
RooObjCacheManager (RooAbsArg *owner=0, Int_t maxSize=2, Bool_t clearCacheOnServerRedirect=kTRUE, Bool_t allowOptimize=kFALSE) | |
Constructor of object cache manager for given owner. | |
virtual | ~RooObjCacheManager () |
Destructor. | |
virtual void | findConstantNodes (const RooArgSet &, RooArgSet &, RooLinkedList &) |
If clearOnRedirect is false, forward constant term optimization calls to cache elements. | |
virtual void | insertObjectHook (RooAbsCacheElement &) |
Set owner link on all object inserted into cache. | |
virtual void | operModeHook () |
Intercept changes to cache operation mode and forward to cache elements. | |
virtual void | optimizeCacheMode (const RooArgSet &, RooArgSet &, RooLinkedList &) |
Intercept calls to perform automatic optimization of cache mode operation. | |
virtual void | printCompactTreeHook (std::ostream &, const char *) |
Add details on cache contents when printing in tree mode. | |
virtual Bool_t | redirectServersHook (const RooAbsCollection &, Bool_t, Bool_t, Bool_t) |
Intercept server redirect calls. | |
void | setClearOnRedirect (Bool_t flag) |
void | sterilize () |
Clear the cache payload but retain slot mapping w.r.t to normalization and integration sets. | |
![]() | |
RooCacheManager (const RooCacheManager &other, RooAbsArg *owner=0) | |
Copy constructor. | |
RooCacheManager (Int_t maxSize=2) | |
Constructor for simple caches without RooAbsArg payload. | |
RooCacheManager (RooAbsArg *owner, Int_t maxSize=2) | |
Constructor for simple caches with RooAbsArg derived payload. | |
virtual | ~RooCacheManager () |
Destructor. | |
Int_t | cacheSize () const |
RooAbsCacheElement * | getObj (const RooArgSet *nset, const RooArgSet *iset, Int_t *sterileIdx, const char *isetRangeName) |
RooAbsCacheElement * | getObj (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. | |
RooAbsCacheElement * | getObj (const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0) |
RooAbsCacheElement * | getObjByIndex (Int_t index) const |
Retrieve payload object by slot index. | |
Int_t | lastIndex () const |
void | reset () |
Clear the cache. | |
RooArgSet | selectFromSet1 (RooArgSet const &argSet, int index) const |
Create RooArgSet contatining the objects that are both in the cached set 1. | |
RooArgSet | selectFromSet2 (RooArgSet const &argSet, int index) const |
Create RooArgSet contatining the objects that are both in the cached set 2. | |
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. | |
Int_t | setObj (const RooArgSet *nset, RooAbsCacheElement *obj, const TNamed *isetRangeName=0) |
void | wireCache () |
![]() | |
RooAbsCache (const RooAbsCache &, RooAbsArg *owner=0) | |
Copy constructor. Takes owner as argument and registers cache with owne. | |
RooAbsCache (RooAbsArg *owner=0) | |
Constructor. Takes owner as argument and register cache with owner. | |
virtual | ~RooAbsCache () |
Destructor. Unregisters cache with owner. | |
void | setOwner (RooAbsArg *owner) |
Reset the owner, triggering the owner to register this cache in its list of caches. | |
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 |
![]() | |
Int_t | _lastIndex |
Actual use. | |
Int_t | _maxSize |
std::vector< RooNormSetCache > | _nsetCache |
Last slot accessed. | |
std::vector< RooAbsCacheElement * > | _object |
Normalization/Integration set manager. | |
Int_t | _size |
Maximum size. | |
Bool_t | _wired |
Payload. | |
![]() | |
RooAbsArg * | _owner |
Static Protected Attributes | |
static Bool_t | _clearObsList |
current optCacheObservables | |
#include <RooObjCacheManager.h>
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::RooObjCacheManager | ( | const RooObjCacheManager & | other, |
RooAbsArg * | owner = 0 |
||
) |
Copy constructor.
Definition at line 65 of file RooObjCacheManager.cxx.
|
virtual |
Destructor.
Definition at line 78 of file RooObjCacheManager.cxx.
|
inlinestatic |
Definition at line 49 of file RooObjCacheManager.h.
Definition at line 48 of file RooObjCacheManager.h.
|
virtual |
If clearOnRedirect is false, forward constant term optimization calls to cache elements.
Reimplemented from RooAbsCache.
Definition at line 216 of file RooObjCacheManager.cxx.
|
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.
|
virtual |
Intercept changes to cache operation mode and forward to cache elements.
Reimplemented from RooCacheManager< RooAbsCacheElement >.
Definition at line 115 of file RooObjCacheManager.cxx.
|
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.
|
virtual |
Add details on cache contents when printing in tree mode.
Reimplemented from RooCacheManager< RooAbsCacheElement >.
Definition at line 201 of file RooObjCacheManager.cxx.
|
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.
Definition at line 51 of file RooObjCacheManager.h.
|
virtual |
Clear the cache payload but retain slot mapping w.r.t to normalization and integration sets.
Reimplemented from RooCacheManager< RooAbsCacheElement >.
Definition at line 159 of file RooObjCacheManager.cxx.
|
protected |
Definition at line 56 of file RooObjCacheManager.h.
|
staticprotected |
current optCacheObservables
Definition at line 61 of file RooObjCacheManager.h.
|
protected |
Definition at line 55 of file RooObjCacheManager.h.
|
protected |
Definition at line 57 of file RooObjCacheManager.h.
|
protected |
Definition at line 59 of file RooObjCacheManager.h.