Logo ROOT  
Reference Guide
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 34 of file RooCacheManager.h.

Public Member Functions

 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...
 
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. More...
 
T * getObj (const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
 Getter function without integration set. More...
 
T * getObjByIndex (Int_t index) const
 Retrieve payload object by slot index. More...
 
virtual void insertObjectHook (T &)
 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_t redirectServersHook (const RooAbsCollection &, Bool_t, Bool_t, Bool_t) 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, T *obj, const TNamed *isetRangeName=0)
 Insert payload object 'obj' in cache indexed on nset,iset and isetRangeName. More...
 
Int_t setObj (const RooArgSet *nset, T *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_t 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 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

Int_t _lastIndex
 ! Last slot accessed More...
 
Int_t _maxSize
 ! Maximum size More...
 
std::vector< RooNormSetCache_nsetCache
 ! Normalization/Integration set manager More...
 
std::vector< T * > _object
 ! Payload More...
 
Int_t _size
 ! Actual use More...
 
Bool_t _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...
 

#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 123 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 137 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 156 of file RooCacheManager.h.

◆ ~RooCacheManager()

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

Destructor.

Definition at line 181 of file RooCacheManager.h.

Member Function Documentation

◆ cacheSize()

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

Return size of cache.

Definition at line 69 of file RooCacheManager.h.

◆ Class()

template<class T >
static TClass * RooCacheManager< T >::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

template<class T >
static const char * RooCacheManager< T >::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

template<class T >
static Version_t RooCacheManager< T >::Class_Version ( )
inlinestatic
Returns
Version of this class

Definition at line 114 of file RooCacheManager.h.

◆ DeclFileName()

template<class T >
static const char * RooCacheManager< T >::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 114 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 53 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

Getter function without integration set.

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

Interface function to perform post-insert operations on cached object.

Reimplemented in RooObjCacheManager.

Definition at line 90 of file RooCacheManager.h.

◆ IsA()

template<class T >
TClass * RooCacheManager< T >::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from RooAbsCache.

Definition at line 114 of file RooCacheManager.h.

◆ lastIndex()

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

Return index of slot used in last get or set operation.

Definition at line 65 of file RooCacheManager.h.

◆ operModeHook()

template<class T >
void RooCacheManager< T >::operModeHook ( )
inlineoverridevirtual

Interface function to intercept cache operation mode changes.

Reimplemented from RooAbsCache.

Definition at line 79 of file RooCacheManager.h.

◆ printCompactTreeHook()

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

Interface function to cache add contents to output in tree printing mode.

Reimplemented from RooAbsCache.

Definition at line 82 of file RooCacheManager.h.

◆ redirectServersHook()

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

Interface function to intercept server redirects.

Reimplemented from RooAbsCache.

Definition at line 74 of file RooCacheManager.h.

◆ reset()

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

Clear the cache.

Definition at line 191 of file RooCacheManager.h.

◆ selectFromSet1()

template<class T >
RooArgSet RooCacheManager< T >::selectFromSet1 ( RooArgSet const &  argSet,
int  index 
) const

Create RooArgSet contatining the objects that are both in the cached set 1.

Definition at line 322 of file RooCacheManager.h.

◆ selectFromSet2()

template<class T >
RooArgSet RooCacheManager< T >::selectFromSet2 ( RooArgSet const &  argSet,
int  index 
) const

Create RooArgSet contatining the objects that are both in the cached set 2.

Definition at line 331 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 218 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

Setter function without integration set.

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 206 of file RooCacheManager.h.

◆ Streamer()

template<class T >
void RooCacheManager< T >::Streamer ( TBuffer )
overridevirtual

Reimplemented from RooAbsCache.

◆ StreamerNVirtual()

template<class T >
void RooCacheManager< T >::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 114 of file RooCacheManager.h.

◆ wireCache()

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

Reimplemented from RooAbsCache.

Definition at line 93 of file RooCacheManager.h.

Member Data Documentation

◆ _lastIndex

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

! Last slot accessed

Definition at line 108 of file RooCacheManager.h.

◆ _maxSize

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

! Maximum size

Definition at line 106 of file RooCacheManager.h.

◆ _nsetCache

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

! Normalization/Integration set manager

Definition at line 110 of file RooCacheManager.h.

◆ _object

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

! Payload

Definition at line 111 of file RooCacheManager.h.

◆ _size

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

! Actual use

Definition at line 107 of file RooCacheManager.h.

◆ _wired

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

! In wired mode, there is a single payload which is returned always

Definition at line 112 of file RooCacheManager.h.


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