Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooCacheManager< T > Class Template Reference

template<class T>
class RooCacheManager< T >

Template class RooCacheManager manages the storage of any type of data indexed on the choice of normalization and optionally the set of integrated observables.

The purpose of this class is to faciliate storage of intermediate results in operator p.d.f.s whose value and inner working are often highly dependent on the user provided choice of normalization in getVal().

For efficiency reasons these normalization set pointer are derefenced as little as possible. This class contains a lookup table for RooArgSet pointer pairs -> normalization lists. Distinct pointer pairs that represent the same normalization/projection are recognized and will all point to the same normalization list. Lists for up to 'maxSize' different normalization/ projection configurations can be cached.

Definition at line 35 of file RooCacheManager.h.

Public Member Functions

 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
 
T * getObj (const RooArgSet *nset, const RooArgSet *iset, Int_t *sterileIdx, const char *isetRangeName)
 
T * 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.
 
T * getObj (const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
 
T * getObjByIndex (Int_t index) const
 Retrieve payload object by slot index.
 
virtual void insertObjectHook (T &)
 
Int_t lastIndex () const
 
const RooNameSetnameSet1ByIndex (Int_t index) const
 Retrieve RooNameSet associated with slot at given index.
 
const RooNameSetnameSet2ByIndex (Int_t index) const
 Retrieve RooNameSet associated with slot at given index.
 
virtual void operModeHook ()
 Interface for operation mode changes.
 
virtual void printCompactTreeHook (std::ostream &, const char *)
 Interface for printing of cache guts in tree mode printing.
 
virtual Bool_t redirectServersHook (const RooAbsCollection &, Bool_t, Bool_t, Bool_t)
 Interface for server redirect calls.
 
void reset ()
 Clear the cache.
 
Int_t setObj (const RooArgSet *nset, const RooArgSet *iset, T *obj, const TNamed *isetRangeName=0)
 Insert payload object 'obj' in cache indexed on nset,iset and isetRangeName.
 
Int_t setObj (const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
 
virtual void sterilize ()
 Clear the cache payload but retain slot mapping w.r.t to normalization and integration sets.
 
void wireCache ()
 
- Public Member Functions inherited from RooAbsCache
 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.
 
virtual void findConstantNodes (const RooArgSet &, RooArgSet &, RooLinkedList &)
 Interface for constant term node finding calls.
 
virtual void optimizeCacheMode (const RooArgSet &, RooArgSet &, RooLinkedList &)
 Interface for processing of cache mode optimization calls.
 

Protected Attributes

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

#include <RooCacheManager.h>

Inheritance diagram for RooCacheManager< T >:
[legend]

Constructor & Destructor Documentation

◆ RooCacheManager() [1/3]

template<class T >
RooCacheManager< T >::RooCacheManager ( Int_t  maxSize = 2)

Constructor for simple caches without RooAbsArg payload.

A cache made with this constructor is not registered with its owner and will not receive information on server redirects and cache operation mode changes.

Definition at line 124 of file RooCacheManager.h.

◆ RooCacheManager() [2/3]

template<class T >
RooCacheManager< T >::RooCacheManager ( RooAbsArg owner,
Int_t  maxSize = 2 
)

Constructor for simple caches with RooAbsArg derived payload.

A cache made with this constructor is registered with its owner and will receive information on server redirects and cache operation mode changes.

Definition at line 138 of file RooCacheManager.h.

◆ RooCacheManager() [3/3]

template<class T >
RooCacheManager< T >::RooCacheManager ( const RooCacheManager< T > &  other,
RooAbsArg owner = 0 
)

Copy constructor.

Definition at line 157 of file RooCacheManager.h.

◆ ~RooCacheManager()

template<class T >
RooCacheManager< T >::~RooCacheManager
virtual

Destructor.

Definition at line 182 of file RooCacheManager.h.

Member Function Documentation

◆ cacheSize()

template<class T >
Int_t RooCacheManager< T >::cacheSize ( ) const
inline

Definition at line 69 of file RooCacheManager.h.

◆ getObj() [1/3]

template<class T >
T * RooCacheManager< T >::getObj ( const RooArgSet nset,
const RooArgSet iset,
Int_t sterileIdx,
const char *  isetRangeName 
)
inline

Definition at line 54 of file RooCacheManager.h.

◆ getObj() [2/3]

template<class T >
T * RooCacheManager< T >::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.

Definition at line 277 of file RooCacheManager.h.

◆ getObj() [3/3]

template<class T >
T * RooCacheManager< T >::getObj ( const RooArgSet nset,
Int_t sterileIndex = 0,
const TNamed isetRangeName = 0 
)
inline

Definition at line 44 of file RooCacheManager.h.

◆ getObjByIndex()

template<class T >
T * RooCacheManager< T >::getObjByIndex ( Int_t  index) const

Retrieve payload object by slot index.

Definition at line 308 of file RooCacheManager.h.

◆ insertObjectHook()

template<class T >
virtual void RooCacheManager< T >::insertObjectHook ( T &  )
inlinevirtual

Reimplemented in RooObjCacheManager.

Definition at line 90 of file RooCacheManager.h.

◆ lastIndex()

template<class T >
Int_t RooCacheManager< T >::lastIndex ( ) const
inline

Definition at line 65 of file RooCacheManager.h.

◆ nameSet1ByIndex()

template<class T >
const RooNameSet * RooCacheManager< T >::nameSet1ByIndex ( Int_t  index) const

Retrieve RooNameSet associated with slot at given index.

Definition at line 321 of file RooCacheManager.h.

◆ nameSet2ByIndex()

template<class T >
const RooNameSet * RooCacheManager< T >::nameSet2ByIndex ( Int_t  index) const

Retrieve RooNameSet associated with slot at given index.

Definition at line 334 of file RooCacheManager.h.

◆ operModeHook()

template<class T >
virtual void RooCacheManager< T >::operModeHook ( )
inlinevirtual

Interface for operation mode changes.

Reimplemented from RooAbsCache.

Reimplemented in RooObjCacheManager.

Definition at line 79 of file RooCacheManager.h.

◆ printCompactTreeHook()

template<class T >
virtual void RooCacheManager< T >::printCompactTreeHook ( std::ostream &  ,
const char *   
)
inlinevirtual

Interface for printing of cache guts in tree mode printing.

Reimplemented from RooAbsCache.

Reimplemented in RooObjCacheManager.

Definition at line 82 of file RooCacheManager.h.

◆ redirectServersHook()

template<class T >
virtual Bool_t RooCacheManager< T >::redirectServersHook ( const RooAbsCollection ,
Bool_t  ,
Bool_t  ,
Bool_t   
)
inlinevirtual

Interface for server redirect calls.

Reimplemented from RooAbsCache.

Reimplemented in RooObjCacheManager.

Definition at line 74 of file RooCacheManager.h.

◆ reset()

template<class T >
void RooCacheManager< T >::reset

Clear the cache.

Definition at line 192 of file RooCacheManager.h.

◆ setObj() [1/2]

template<class T >
Int_t RooCacheManager< T >::setObj ( const RooArgSet nset,
const RooArgSet iset,
T *  obj,
const TNamed isetRangeName = 0 
)

Insert payload object 'obj' in cache indexed on nset,iset and isetRangeName.

Definition at line 219 of file RooCacheManager.h.

◆ setObj() [2/2]

template<class T >
Int_t RooCacheManager< T >::setObj ( const RooArgSet nset,
T *  obj,
const TNamed isetRangeName = 0 
)
inline

Definition at line 49 of file RooCacheManager.h.

◆ sterilize()

template<class T >
void RooCacheManager< T >::sterilize
virtual

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

Reimplemented in RooObjCacheManager.

Definition at line 207 of file RooCacheManager.h.

◆ wireCache()

template<class T >
void RooCacheManager< T >::wireCache ( )
inlinevirtual

Reimplemented from RooAbsCache.

Definition at line 94 of file RooCacheManager.h.

Member Data Documentation

◆ _lastIndex

template<class T >
Int_t RooCacheManager< T >::_lastIndex
protected

Actual use.

Definition at line 109 of file RooCacheManager.h.

◆ _maxSize

template<class T >
Int_t RooCacheManager< T >::_maxSize
protected

Definition at line 107 of file RooCacheManager.h.

◆ _nsetCache

template<class T >
std::vector<RooNormSetCache> RooCacheManager< T >::_nsetCache
protected

Last slot accessed.

Definition at line 111 of file RooCacheManager.h.

◆ _object

template<class T >
std::vector<T*> RooCacheManager< T >::_object
protected

Normalization/Integration set manager.

Definition at line 112 of file RooCacheManager.h.

◆ _size

template<class T >
Int_t RooCacheManager< T >::_size
protected

Maximum size.

Definition at line 108 of file RooCacheManager.h.

◆ _wired

template<class T >
Bool_t RooCacheManager< T >::_wired
protected

Payload.

Definition at line 113 of file RooCacheManager.h.

  • roofit/roofitcore/inc/RooCacheManager.h