Logo ROOT  
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 \file RooAbsCacheElement.cxx
19 \class RooAbsCacheElement
20 \ingroup Roofitcore
21 
22 RooAbsCacheElement is the abstract base class for objects to be stored
23 in RooAbsCache cache manager objects. Each storage element has an
24 interface to pass on calls for server redirection, operation mode
25 change calls and constant term optimization management calls
26 **/
27 
28 
29 #include "RooFit.h"
30 #include "RooAbsCacheElement.h"
31 #include "RooAbsArg.h"
32 #include "RooArgList.h"
33 
34 using namespace std;
35 
37  ;
38 
39 
40 ////////////////////////////////////////////////////////////////////////////////
41 /// Interface for server redirect calls
42 
43 Bool_t RooAbsCacheElement::redirectServersHook(const RooAbsCollection& /*newServerList*/, Bool_t /*mustReplaceAll*/,
44  Bool_t /*nameChange*/, Bool_t /*isRecursive*/)
45 {
46  return kFALSE ;
47 }
48 
49 
50 
51 ////////////////////////////////////////////////////////////////////////////////
52 /// Hook function to print cache guts in tree printing mode of RooAbsArgs
53 
54 void RooAbsCacheElement::printCompactTreeHook(std::ostream&, const char *, Int_t , Int_t )
55 {
56 }
57 
58 
59 
60 ////////////////////////////////////////////////////////////////////////////////
61 /// Interface for cache optimization calls. The default implementation is to forward all these
62 /// calls to all contained RooAbsArg objects as publicized through containedArg()
63 
64 void RooAbsCacheElement::optimizeCacheMode(const RooArgSet& obs, RooArgSet& optNodes, RooLinkedList& processedNodes)
65 {
66  RooArgList list = containedArgs(OptimizeCaching) ;
67  TIterator* iter = list.createIterator() ;
68  RooAbsArg* arg ;
69  while((arg=(RooAbsArg*)iter->Next())) {
70  arg->optimizeCacheMode(obs, optNodes, processedNodes) ;
71  }
72  delete iter ;
73 }
74 
75 
76 
77 ////////////////////////////////////////////////////////////////////////////////
78 /// Interface for constant term optimization calls. The default implementation is to forward all these
79 /// calls to all contained RooAbsArg objects as publicized through containedArg()
80 
81 void RooAbsCacheElement::findConstantNodes(const RooArgSet& obs, RooArgSet& cacheList, RooLinkedList& processedNodes)
82 {
83  RooArgList list = containedArgs(FindConstantNodes) ;
84  for (const auto arg : list) {
85  arg->findConstantNodes(obs, cacheList, processedNodes);
86  }
87 }
RooAbsCacheElement::printCompactTreeHook
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.
Definition: RooAbsCacheElement.cxx:54
RooFit.h
RooAbsCacheElement.h
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
RooArgList
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooAbsArg.h
RooAbsCacheElement
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
Definition: RooAbsCacheElement.h:26
bool
TIterator
Iterator abstract base class.
Definition: TIterator.h:30
RooAbsCacheElement::findConstantNodes
virtual void findConstantNodes(const RooArgSet &obs, RooArgSet &cacheList, RooLinkedList &processedNodes)
Interface for constant term optimization calls.
Definition: RooAbsCacheElement.cxx:81
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
RooLinkedList
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
Definition: RooLinkedList.h:37
RooAbsCollection::createIterator
TIterator * createIterator(Bool_t dir=kIterForward) const
TIterator-style iteration over contained elements.
Definition: RooAbsCollection.h:133
RooAbsCollection
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
Definition: RooAbsCollection.h:31
RooAbsArg::optimizeCacheMode
virtual void optimizeCacheMode(const RooArgSet &observables)
Activate cache mode optimization with given definition of observables.
Definition: RooAbsArg.cxx:1601
TIterator::Next
virtual TObject * Next()=0
RooAbsCacheElement::optimizeCacheMode
virtual void optimizeCacheMode(const RooArgSet &obs, RooArgSet &optNodes, RooLinkedList &processedNodes)
Interface for cache optimization calls.
Definition: RooAbsCacheElement.cxx:64
RooAbsArg
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition: RooAbsArg.h:72
RooAbsCacheElement::redirectServersHook
virtual Bool_t redirectServersHook(const RooAbsCollection &, Bool_t, Bool_t, Bool_t)
Interface for server redirect calls.
Definition: RooAbsCacheElement.cxx:43
RooArgList.h
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:33
int