Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 "RooAbsReal.h"
22#include "RooArgSet.h"
23#include "RooArgList.h"
24#include "RooAbsCache.h"
25#include "RooAbsCacheElement.h"
26#include "RooCacheManager.h"
27
28
29class RooObjCacheManager : public RooCacheManager<RooAbsCacheElement> {
30
31public:
32
33 RooObjCacheManager(RooAbsArg* owner=nullptr, Int_t maxSize=2, bool clearCacheOnServerRedirect=true, bool allowOptimize=false) ;
34 RooObjCacheManager(const RooObjCacheManager& other, RooAbsArg* owner=nullptr) ;
35 ~RooObjCacheManager() override ;
36
37 bool redirectServersHook(const RooAbsCollection& /*newServerList*/, bool /*mustReplaceAll*/, bool /*nameChange*/, bool /*isRecursive*/) override ;
38 void operModeHook() override ;
39 void optimizeCacheMode(const RooArgSet& /*obs*/, RooArgSet& /*optSet*/, RooLinkedList& /*processedNodes*/) override ;
40 void printCompactTreeHook(std::ostream&, const char *) override ;
41 void findConstantNodes(const RooArgSet& /*obs*/, RooArgSet& /*cacheList*/, RooLinkedList& /*processedNodes*/) override ;
42
43 void insertObjectHook(RooAbsCacheElement&) override ;
44
45 void sterilize() override ;
46
47 static void doClearObsList(bool flag) { _clearObsList = flag ; }
48 static bool clearObsList() { return _clearObsList ; }
49
50 void setClearOnRedirect(bool flag) { _clearOnRedirect = flag ; }
51
52protected:
53
56 bool _optCacheModeSeen ; ///<!
57
58 RooArgSet* _optCacheObservables = nullptr; ///<! current optCacheObservables
59
60 static bool _clearObsList ; ///< Clear obslist on sterilize?
61
62 ClassDefOverride(RooObjCacheManager,3) ///< Cache manager for generic caches that contain RooAbsArg objects
63} ;
64
65
66
67#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:77
Abstract base class for objects to be stored in RooAbsCache cache manager objects.
Abstract container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Manages the storage of any type of data indexed on the choice of normalization and optionally the set...
Collection class for internal use, storing a collection of RooAbsArg pointers in a doubly linked list...
Implementation of a RooCacheManager<RooAbsCacheElement> that specializes in the storage of cache elem...
void operModeHook() override
Intercept changes to cache operation mode and forward to cache elements.
static void doClearObsList(bool flag)
~RooObjCacheManager() override
Destructor.
void insertObjectHook(RooAbsCacheElement &) override
Set owner link on all object inserted into cache.
void printCompactTreeHook(std::ostream &, const char *) override
Add details on cache contents when printing in tree mode.
static bool clearObsList()
bool redirectServersHook(const RooAbsCollection &, bool, bool, bool) override
Intercept server redirect calls.
static bool _clearObsList
Clear obslist on sterilize?
void setClearOnRedirect(bool flag)
void findConstantNodes(const RooArgSet &, RooArgSet &, RooLinkedList &) override
If clearOnRedirect is false, forward constant term optimization calls to cache elements.
RooArgSet * _optCacheObservables
! current optCacheObservables
void sterilize() override
Clear the cache payload but retain slot mapping w.r.t to normalization and integration sets.
void optimizeCacheMode(const RooArgSet &, RooArgSet &, RooLinkedList &) override
Intercept calls to perform automatic optimization of cache mode operation.