16 #ifndef ROO_CACHE_MANAGER
17 #define ROO_CACHE_MANAGER
46 return getObj(nset,0,sterileIndex,isetRangeName) ;
51 return setObj(nset,0,obj,isetRangeName) ;
97 }
else if (
_size==1) {
100 }
else if (
_size>1) {
173 for (i=0 ; i<other.
_size ; i++) {
191 for (i=0 ; i<_size ; i++) {
204 for (i=0 ; i<_maxSize ; i++) {
207 _nsetCache[i].clear() ;
222 for (i=0 ; i<_maxSize ; i++) {
236 Int_t sterileIdx(-1) ;
237 if (getObj(nset,iset,&sterileIdx,isetRangeName)) {
245 if (sterileIdx>=_maxSize) {
247 _maxSize = sterileIdx+4;
248 _object.resize(_maxSize,0) ;
249 _nsetCache.resize(_maxSize) ;
253 _object[sterileIdx] =
obj ;
256 insertObjectHook(*obj) ;
261 if (_size>=_maxSize-1) {
264 _object.resize(_maxSize,0) ;
265 _nsetCache.resize(_maxSize) ;
269 _nsetCache[_size].autoCache(_owner,nset,iset,isetRangeName,
kTRUE) ;
270 if (_object[_size]) {
271 delete _object[_size] ;
274 _object[_size] =
obj ;
278 insertObjectHook(*obj) ;
297 if(_object[0]==0 && sterileIdx) *sterileIdx=0 ;
302 for (i=0 ; i<_size ; i++) {
303 if (_nsetCache[i].contains(nset,iset,isetRangeName)==
kTRUE) {
305 if(_object[i]==0 && sterileIdx) *sterileIdx=i ;
310 for (i=0 ; i<_size ; i++) {
311 if (_nsetCache[i].autoCache(_owner,nset,iset,isetRangeName,
kFALSE)==
kFALSE) {
313 if(_object[i]==0 && sterileIdx) *sterileIdx=i ;
328 if (index<0||index>=_size) {
330 << index <<
") out of range [0," << _size-1 <<
"]" << std::endl ;
333 return _object[index] ;
341 if (index<0||index>=_size) {
343 << index <<
") out of range [0," << _size-1 <<
"]" << std::endl ;
346 return &_nsetCache[index].nameSet1() ;
354 if (index<0||index>=_size) {
356 << index <<
") out of range [0," << _size-1 <<
"]" << std::endl ;
359 return &_nsetCache[index].nameSet2() ;
RooCacheManager(Int_t maxSize=2)
virtual void insertObjectHook(T &)
const RooNameSet * nameSet2ByIndex(Int_t index) const
const RooNameSet * nameSet1ByIndex(Int_t index) const
RooAbsCache is the abstract base class for data members of RooAbsArgs that cache other (composite) Ro...
#define ClassDef(name, id)
virtual void printCompactTreeHook(std::ostream &, const char *)
Interface for printing of cache guts in tree mode printing.
The TNamed class is the base class for all named ROOT classes.
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
RooNameSet is a utility class that stores the names the objects in a RooArget.
T * getObj(const RooArgSet *nset, const RooArgSet *iset, Int_t *sterileIdx, const char *isetRangeName)
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
virtual const char * GetName() const
Returns name of object.
virtual ~RooCacheManager()
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects...
virtual void operModeHook()
Interface for operation mode changes.
T * getObjByIndex(Int_t index) const
virtual Bool_t redirectServersHook(const RooAbsCollection &, Bool_t, Bool_t, Bool_t)
Interface for server redirect calls.
Int_t _lastIndex
Actual use.
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
Template class RooCacheManager manages the storage of any type of data indexed on the choice of norma...
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
std::vector< T * > _object
Normalization/Integration set manager.
std::vector< RooNormSetCache > _nsetCache
Last slot accessed.