Logo ROOT   6.07/09
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 #include <list>
29 
30 class RooNameSet ;
31 
32 
33 class RooObjCacheManager : public RooCacheManager<RooAbsCacheElement> {
34 
35 public:
36 
37  RooObjCacheManager(RooAbsArg* owner=0, Int_t maxSize=2, Bool_t clearCacheOnServerRedirect=kTRUE, Bool_t allowOptimize=kFALSE) ;
38  RooObjCacheManager(const RooObjCacheManager& other, RooAbsArg* owner=0) ;
39  virtual ~RooObjCacheManager() ;
40 
41  virtual Bool_t redirectServersHook(const RooAbsCollection& /*newServerList*/, Bool_t /*mustReplaceAll*/, Bool_t /*nameChange*/, Bool_t /*isRecursive*/) ;
42  virtual void operModeHook() ;
43  virtual void optimizeCacheMode(const RooArgSet& /*obs*/, RooArgSet& /*optSet*/, RooLinkedList& /*processedNodes*/) ;
44  virtual void printCompactTreeHook(std::ostream&, const char *) ;
45  virtual void findConstantNodes(const RooArgSet& /*obs*/, RooArgSet& /*cacheList*/, RooLinkedList& /*processedNodes*/) ;
46 
47  virtual void insertObjectHook(RooAbsCacheElement&) ;
48 
49  void sterilize() ;
50 
51  static void doClearObsList(Bool_t flag) { _clearObsList = flag ; }
52  static Bool_t clearObsList() { return _clearObsList ; }
53 
54  void setClearOnRedirect(Bool_t flag) { _clearOnRedirect = flag ; }
55 
56 protected:
57 
61 
62  RooArgSet* _optCacheObservables ; //! current optCacheObservables
63 
64  static Bool_t _clearObsList ; // Clear obslist on sterilize?
65 
66  ClassDef(RooObjCacheManager,3) // Cache manager for generic caches that contain RooAbsArg objects
67 } ;
68 
69 
70 
71 #endif
virtual void findConstantNodes(const RooArgSet &, RooArgSet &, RooLinkedList &)
If clearOnRedirect is false, forward constant term optimization calls to cache elements.
virtual Bool_t redirectServersHook(const RooAbsCollection &, Bool_t, Bool_t, Bool_t)
Intercept server redirect calls.
RooObjCacheManager(RooAbsArg *owner=0, Int_t maxSize=2, Bool_t clearCacheOnServerRedirect=kTRUE, Bool_t allowOptimize=kFALSE)
Constructor of object cache manager for given owner.
virtual ~RooObjCacheManager()
Destructor.
virtual void printCompactTreeHook(std::ostream &, const char *)
Add details on cache contents when printing in tree mode.
static Bool_t clearObsList()
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
static void doClearObsList(Bool_t flag)
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void operModeHook()
Intercept changes to cache operation mode and forward to cache elements.
RooNameSet is a utility class that stores the names the objects in a RooArget.
Definition: RooNameSet.h:24
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
void setClearOnRedirect(Bool_t flag)
virtual void insertObjectHook(RooAbsCacheElement &)
Set owner link on all object inserted into cache.
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
Definition: RooLinkedList.h:35
RooArgSet * _optCacheObservables
static Bool_t _clearObsList
current optCacheObservables
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects...
virtual void optimizeCacheMode(const RooArgSet &, RooArgSet &, RooLinkedList &)
Intercept calls to perform automatic optimization of cache mode operation.
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...
Definition: RooAbsArg.h:66
const Bool_t kTRUE
Definition: Rtypes.h:91