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. | |
void | findConstantNodes (const RooArgSet &, RooArgSet &, RooLinkedList &) override |
If clearOnRedirect is false, forward constant term optimization calls to cache elements. | |
void | insertObjectHook (RooAbsCacheElement &) override |
Set owner link on all object inserted into cache. | |
TClass * | IsA () const override |
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 | setClearOnRedirect (bool flag) |
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) |
![]() | |
RooCacheManager (const RooCacheManager &other, RooAbsArg *owner=nullptr) | |
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. | |
~RooCacheManager () override | |
Destructor. | |
Int_t | cacheSize () const |
Return size of cache. | |
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=nullptr, const TNamed *isetRangeName=nullptr) |
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=nullptr, const TNamed *isetRangeName=nullptr) |
Getter function without integration set. | |
RooAbsCacheElement * | getObjByIndex (Int_t index) const |
Retrieve payload object by slot index. | |
Int_t | lastIndex () const |
Return index of slot used in last get or set operation. | |
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. | |
Int_t | setObj (const RooArgSet *nset, const RooArgSet *iset, RooAbsCacheElement *obj, const TNamed *isetRangeName=nullptr) |
Insert payload object 'obj' in cache indexed on nset,iset and isetRangeName. | |
Int_t | setObj (const RooArgSet *nset, RooAbsCacheElement *obj, const TNamed *isetRangeName=nullptr) |
Setter function without integration set. | |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
void | wireCache () override |
![]() | |
RooAbsCache (const RooAbsCache &, RooAbsArg *owner=nullptr) | |
Copy constructor. Takes owner as argument and registers cache with owne. | |
RooAbsCache (RooAbsArg *owner=nullptr) | |
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. | |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
Static Public Member Functions | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static bool | clearObsList () |
static const char * | DeclFileName () |
static void | doClearObsList (bool flag) |
![]() | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
![]() | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
Protected Attributes | |
bool | _allowOptimize |
bool | _clearOnRedirect |
bool | _optCacheModeSeen |
! | |
RooArgSet * | _optCacheObservables = nullptr |
! current optCacheObservables | |
![]() | |
Int_t | _lastIndex |
! Last slot accessed | |
Int_t | _maxSize |
! Maximum size | |
std::vector< RooNormSetCache > | _nsetCache |
! Normalization/Integration set manager | |
std::vector< RooAbsCacheElement * > | _object |
! Payload | |
Int_t | _size |
! Actual use | |
bool | _wired |
! In wired mode, there is a single payload which is returned always | |
![]() | |
RooAbsArg * | _owner |
Pointer to owning RooAbsArg. | |
Static Protected Attributes | |
static bool | _clearObsList |
Clear obslist on sterilize? | |
#include <RooObjCacheManager.h>
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 47 of file RooObjCacheManager.cxx.
RooObjCacheManager::RooObjCacheManager | ( | const RooObjCacheManager & | other, |
RooAbsArg * | owner = nullptr |
||
) |
Copy constructor.
Definition at line 59 of file RooObjCacheManager.cxx.
|
override |
Destructor.
Definition at line 71 of file RooObjCacheManager.cxx.
|
static |
|
inlinestaticconstexpr |
Definition at line 62 of file RooObjCacheManager.h.
|
inlinestatic |
Definition at line 48 of file RooObjCacheManager.h.
|
inlinestatic |
Definition at line 62 of file RooObjCacheManager.h.
|
inlinestatic |
Definition at line 47 of file RooObjCacheManager.h.
|
overridevirtual |
If clearOnRedirect is false, forward constant term optimization calls to cache elements.
Reimplemented from RooAbsCache.
Definition at line 209 of file RooObjCacheManager.cxx.
|
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 175 of file RooObjCacheManager.cxx.
|
inlineoverridevirtual |
Reimplemented from RooCacheManager< RooAbsCacheElement >.
Definition at line 62 of file RooObjCacheManager.h.
|
overridevirtual |
Intercept changes to cache operation mode and forward to cache elements.
Reimplemented from RooCacheManager< RooAbsCacheElement >.
Definition at line 108 of file RooObjCacheManager.cxx.
|
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 129 of file RooObjCacheManager.cxx.
|
overridevirtual |
Add details on cache contents when printing in tree mode.
Reimplemented from RooCacheManager< RooAbsCacheElement >.
Definition at line 194 of file RooObjCacheManager.cxx.
|
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 84 of file RooObjCacheManager.cxx.
|
inline |
Definition at line 50 of file RooObjCacheManager.h.
|
overridevirtual |
Clear the cache payload but retain slot mapping w.r.t to normalization and integration sets.
Reimplemented from RooCacheManager< RooAbsCacheElement >.
Definition at line 152 of file RooObjCacheManager.cxx.
|
overridevirtual |
Reimplemented from RooCacheManager< RooAbsCacheElement >.
|
inline |
Definition at line 62 of file RooObjCacheManager.h.
|
protected |
Definition at line 55 of file RooObjCacheManager.h.
|
staticprotected |
Clear obslist on sterilize?
Definition at line 60 of file RooObjCacheManager.h.
|
protected |
Definition at line 54 of file RooObjCacheManager.h.
|
protected |
!
Definition at line 56 of file RooObjCacheManager.h.
|
protected |
! current optCacheObservables
Definition at line 58 of file RooObjCacheManager.h.