Logo ROOT  
Reference Guide
RooObjCacheManager.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id$
5  * Authors: *
6  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7  * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8  * *
9  * Copyright (c) 2000-2005, Regents of the University of California *
10  * and Stanford University. All rights reserved. *
11  * *
12  * Redistribution and use in source and binary forms, *
13  * with or without modification, are permitted according to the terms *
14  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15  *****************************************************************************/
16 #ifndef ROO_OBJ_CACHE_MANAGER
17 #define ROO_OBJ_CACHE_MANAGER
18 
19 #include "Rtypes.h"
20 
21 #include "RooNormSetCache.h"
22 #include "RooAbsReal.h"
23 #include "RooArgSet.h"
24 #include "RooArgList.h"
25 #include "RooAbsCache.h"
26 #include "RooAbsCacheElement.h"
27 #include "RooCacheManager.h"
28 
29 class RooNameSet;
30 
31 
32 class RooObjCacheManager : public RooCacheManager<RooAbsCacheElement> {
33 
34 public:
35 
36  RooObjCacheManager(RooAbsArg* owner=0, Int_t maxSize=2, Bool_t clearCacheOnServerRedirect=kTRUE, Bool_t allowOptimize=kFALSE) ;
37  RooObjCacheManager(const RooObjCacheManager& other, RooAbsArg* owner=0) ;
38  virtual ~RooObjCacheManager() ;
39 
40  virtual Bool_t redirectServersHook(const RooAbsCollection& /*newServerList*/, Bool_t /*mustReplaceAll*/, Bool_t /*nameChange*/, Bool_t /*isRecursive*/) ;
41  virtual void operModeHook() ;
42  virtual void optimizeCacheMode(const RooArgSet& /*obs*/, RooArgSet& /*optSet*/, RooLinkedList& /*processedNodes*/) ;
43  virtual void printCompactTreeHook(std::ostream&, const char *) ;
44  virtual void findConstantNodes(const RooArgSet& /*obs*/, RooArgSet& /*cacheList*/, RooLinkedList& /*processedNodes*/) ;
45 
46  virtual void insertObjectHook(RooAbsCacheElement&) ;
47 
48  void sterilize() ;
49 
50  static void doClearObsList(Bool_t flag) { _clearObsList = flag ; }
51  static Bool_t clearObsList() { return _clearObsList ; }
52 
53  void setClearOnRedirect(Bool_t flag) { _clearOnRedirect = flag ; }
54 
55 protected:
56 
60 
61  RooArgSet* _optCacheObservables ; //! current optCacheObservables
62 
63  static Bool_t _clearObsList ; // Clear obslist on sterilize?
64 
65  ClassDef(RooObjCacheManager,3) // Cache manager for generic caches that contain RooAbsArg objects
66 } ;
67 
68 
69 
70 #endif
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
RooCacheManager.h
RooAbsReal.h
RooObjCacheManager::_clearOnRedirect
Bool_t _clearOnRedirect
Definition: RooObjCacheManager.h:57
RooAbsCacheElement.h
RooArgSet.h
RooObjCacheManager::_optCacheObservables
RooArgSet * _optCacheObservables
Definition: RooObjCacheManager.h:61
RooObjCacheManager::sterilize
void sterilize()
Clear the cache payload but retain slot mapping w.r.t to normalization and integration sets.
Definition: RooObjCacheManager.cxx:159
RooAbsCacheElement
Definition: RooAbsCacheElement.h:26
bool
RooObjCacheManager::doClearObsList
static void doClearObsList(Bool_t flag)
Definition: RooObjCacheManager.h:50
RooNormSetCache.h
RooObjCacheManager::findConstantNodes
virtual void findConstantNodes(const RooArgSet &, RooArgSet &, RooLinkedList &)
If clearOnRedirect is false, forward constant term optimization calls to cache elements.
Definition: RooObjCacheManager.cxx:216
RooObjCacheManager::redirectServersHook
virtual Bool_t redirectServersHook(const RooAbsCollection &, Bool_t, Bool_t, Bool_t)
Intercept server redirect calls.
Definition: RooObjCacheManager.cxx:91
RooObjCacheManager::printCompactTreeHook
virtual void printCompactTreeHook(std::ostream &, const char *)
Add details on cache contents when printing in tree mode.
Definition: RooObjCacheManager.cxx:201
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooObjCacheManager::optimizeCacheMode
virtual void optimizeCacheMode(const RooArgSet &, RooArgSet &, RooLinkedList &)
Intercept calls to perform automatic optimization of cache mode operation.
Definition: RooObjCacheManager.cxx:136
RooLinkedList
Definition: RooLinkedList.h:35
RooAbsCollection
Definition: RooAbsCollection.h:30
RooObjCacheManager::clearObsList
static Bool_t clearObsList()
Definition: RooObjCacheManager.h:51
RooObjCacheManager::operModeHook
virtual void operModeHook()
Intercept changes to cache operation mode and forward to cache elements.
Definition: RooObjCacheManager.cxx:115
RooNameSet
Definition: RooNameSet.h:24
RooObjCacheManager
Definition: RooObjCacheManager.h:32
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooObjCacheManager::insertObjectHook
virtual void insertObjectHook(RooAbsCacheElement &)
Set owner link on all object inserted into cache.
Definition: RooObjCacheManager.cxx:182
RooObjCacheManager::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.
Definition: RooObjCacheManager.cxx:52
RooCacheManager
Definition: RooCacheManager.h:35
RooAbsArg
Definition: RooAbsArg.h:73
RooObjCacheManager::setClearOnRedirect
void setClearOnRedirect(Bool_t flag)
Definition: RooObjCacheManager.h:53
RooAbsCache.h
RooObjCacheManager::_optCacheModeSeen
Bool_t _optCacheModeSeen
Definition: RooObjCacheManager.h:59
RooObjCacheManager::~RooObjCacheManager
virtual ~RooObjCacheManager()
Destructor.
Definition: RooObjCacheManager.cxx:78
RooObjCacheManager::_allowOptimize
Bool_t _allowOptimize
Definition: RooObjCacheManager.h:58
RooArgList.h
Rtypes.h
RooArgSet
Definition: RooArgSet.h:28
RooObjCacheManager::_clearObsList
static Bool_t _clearObsList
current optCacheObservables
Definition: RooObjCacheManager.h:63
int