ROOT  6.06/09
Reference Guide
RooAbsCacheElement.cxx
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 
17 //////////////////////////////////////////////////////////////////////////////
18 //
19 // BEGIN_HTML
20 // RooAbsCacheElement is the abstract base class for objects to be stored
21 // in RooAbsCache cache manager objects. Each storage element has an
22 // interface to pass on calls for server redirection, operation mode
23 // change calls and constant term optimization management calls
24 // END_HTML
25 //
26 //
27 //
28 
29 
30 #include "RooFit.h"
31 #include "RooAbsCacheElement.h"
32 #include "RooAbsArg.h"
33 #include "RooArgList.h"
34 
35 using namespace std;
36 
38  ;
39 
40 
41 ////////////////////////////////////////////////////////////////////////////////
42 /// Interface for server redirect calls
43 
44 Bool_t RooAbsCacheElement::redirectServersHook(const RooAbsCollection& /*newServerList*/, Bool_t /*mustReplaceAll*/,
45  Bool_t /*nameChange*/, Bool_t /*isRecursive*/)
46 {
47  return kFALSE ;
48 }
49 
50 
51 
52 ////////////////////////////////////////////////////////////////////////////////
53 /// Hook function to print cache guts in tree printing mode of RooAbsArgs
54 
55 void RooAbsCacheElement::printCompactTreeHook(std::ostream&, const char *, Int_t , Int_t )
56 {
57 }
58 
59 
60 
61 ////////////////////////////////////////////////////////////////////////////////
62 /// Interface for operation mode change calls
63 
65 {
66 }
67 
68 
69 
70 ////////////////////////////////////////////////////////////////////////////////
71 /// Interface for cache optimization calls. The default implementation is to forward all these
72 /// calls to all contained RooAbsArg objects as publicized through containedArg()
73 
74 void RooAbsCacheElement::optimizeCacheMode(const RooArgSet& obs, RooArgSet& optNodes, RooLinkedList& processedNodes)
75 {
76  RooArgList list = containedArgs(OptimizeCaching) ;
77  TIterator* iter = list.createIterator() ;
78  RooAbsArg* arg ;
79  while((arg=(RooAbsArg*)iter->Next())) {
80  arg->optimizeCacheMode(obs, optNodes, processedNodes) ;
81  }
82  delete iter ;
83 }
84 
85 
86 
87 ////////////////////////////////////////////////////////////////////////////////
88 /// Interface for constant term optimization calls. The default implementation is to forward all these
89 /// calls to all contained RooAbsArg objects as publicized through containedArg()
90 
91 void RooAbsCacheElement::findConstantNodes(const RooArgSet& obs, RooArgSet& cacheList, RooLinkedList& processedNodes)
92 {
93  RooArgList list = containedArgs(FindConstantNodes) ;
94  TIterator* iter = list.createIterator() ;
95  RooAbsArg* arg ;
96  while((arg=(RooAbsArg*)iter->Next())) {
97  arg->findConstantNodes(obs,cacheList, processedNodes) ;
98  }
99  delete iter ;
100 }
virtual void optimizeCacheMode(const RooArgSet &observables)
Activate cache mode optimization with given definition of observables.
Definition: RooAbsArg.cxx:1578
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
STL namespace.
Iterator abstract base class.
Definition: TIterator.h:32
virtual void printCompactTreeHook(std::ostream &, const char *, Int_t curElem, Int_t totElem)
Hook function to print cache guts in tree printing mode of RooAbsArgs.
std::map< std::string, std::string >::const_iterator iter
Definition: TAlienJob.cxx:54
TIterator * createIterator(Bool_t dir=kIterForward) const
virtual void optimizeCacheMode(const RooArgSet &obs, RooArgSet &optNodes, RooLinkedList &processedNodes)
Interface for cache optimization calls.
Bool_t findConstantNodes(const RooArgSet &observables, RooArgSet &cacheList)
Find branch nodes with all-constant parameters, and add them to the list of nodes that can be cached ...
Definition: RooAbsArg.cxx:1643
virtual void findConstantNodes(const RooArgSet &obs, RooArgSet &cacheList, RooLinkedList &processedNodes)
Interface for constant term optimization calls.
virtual TObject * Next()=0
virtual Bool_t redirectServersHook(const RooAbsCollection &, Bool_t, Bool_t, Bool_t)
Interface for server redirect calls.
ClassImp(RooAbsCacheElement)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:66
virtual void operModeHook(RooAbsArg::OperMode)
Interface for operation mode change calls.