65 _cacheMgr(other._cacheMgr,this),
66 _ipOrder(other._ipOrder),
67 _disableCache(other._disableCache)
127 return new FuncCacheElem(const_cast<RooAbsCachedReal&>(*
this),nset) ;
138 Int_t sterileIdx(-1) ;
142 ccoutD(
Eval) <<
"RooAbsCachedReal::getCache(" <<
GetName() <<
") cached function "
143 << cache->
func()->
GetName() <<
" requires recalculation as parameters changed" << endl ;
155 while ( (arg=iarg.next()) ) {
178 ccoutD(
Caching) <<
"RooAbsCachedReal("<<
this<<
")::getCache(" <<
GetName() <<
") creating new cache " << cache->
func()->
GetName() <<
" for nset " << (nset?*nset:
RooArgSet()) <<
" with code " << code << endl ;
202 self.preferredObservableScanOrder(*nset2,orderedObs) ;
205 TString hname =
self.inputBaseName() ;
206 hname.
Append(
"_CACHEHIST") ;
212 RooArgSet* observables=
self.actualObservables(*nset2) ;
215 TString funcname =
self.inputBaseName() ;
216 funcname.
Append(
"_CACHE") ;
225 RooArgSet* params =
self.actualParameters(orderedObs) ;
246 if (_sourceClone) {
delete _sourceClone ; }
247 delete _paramTracker ;
311 ret.
add(*_paramTracker) ;
313 ret.
add(*_sourceClone) ;
325 os << indent <<
"--- RooAbsCachedReal begin cache ---" << endl ;
329 indent2 +=
Form(
"[%d] ",curElem) ;
330 func()->printCompactTree(os,indent2) ;
332 if (curElem==maxElem) {
333 os << indent <<
"--- RooAbsCachedReal end cache --- " << endl ;
TString cacheNameSuffix(const RooArgSet &nset) const
Construct unique suffix name for cache p.d.f object.
ClassImp(RooAbsCachedReal) RooAbsCachedReal
Constructor.
void setInterpolationOrder(Int_t order)
Set interpolation order of RooHistFunct representing cache histogram.
RooAbsReal * _sourceClone
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
RooChangeTracker * _paramTracker
void setInterpolationOrder(Int_t order)
RooFIter fwdIterator() const
virtual Double_t getValV(const RooArgSet *set=0) const
Implementation of getVal() overriding default implementation of RooAbsReal.
Bool_t _disableCache
Map for analytical integration codes.
virtual FuncCacheElem * createCache(const RooArgSet *nset) const
Interface function to create an internal cache object that represent each cached function configurati...
Bool_t hasChanged(Bool_t clearState)
Returns true if state has changes since last call with clearState=kTRUE If clearState is true...
std::map< Int_t, std::pair< const RooArgSet *, const RooArgSet * > > _anaIntMap
RooExpensiveObjectCache & expensiveObjectCache() const
const TObject * retrieveObject(const char *name, TClass *tclass, const RooArgSet ¶ms)
Retrieve object from cache that was registered under given name with given parameters, if current parameter values match those that were stored in the registry for this object.
Iterator abstract base class.
virtual const RooArgSet * get() const
FuncCacheElem * getCache(const RooArgSet *nset) const
Retrieve cache corresponding to observables in nset.
RooArgSet parameters() const
virtual Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral. ...
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
std::map< std::string, std::string >::const_iterator iter
TIterator * createIterator(Bool_t dir=kIterForward) const
TString & Append(const char *cs)
virtual const char * payloadUniqueSuffix() const
Double_t getVal(const RooArgSet *set=0) const
virtual Double_t getValV(const RooArgSet *set=0) const
Return value of object.
RooChangeTracker * paramTracker()
void addServerList(RooAbsCollection &serverList, Bool_t valueProp=kTRUE, Bool_t shapeProp=kFALSE)
Register a list of RooAbsArg as servers to us by calls addServer() for each arg in the list...
virtual Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const
Variant of getAnalyticalIntegral that is also passed the normalization set that should be applied to ...
Int_t getInterpolationOrder() const
virtual void add(const RooArgSet &row, Double_t wgt=1.0)
char * Form(const char *fmt,...)
virtual RooArgList containedArgs(Action)
Return list of contained RooAbsArg objects.
friend class FuncCacheElem
virtual const char * GetName() const
Returns name of object.
static void indent(ostringstream &buf, int indent_level)
FuncCacheElem(const RooAbsCachedReal &self, const RooArgSet *nset)
Constructor of cache storage unit class.
void clearCacheObject(FuncCacheElem &cache) const
Mark all bins as unitialized (value -1)
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
double func(double *x, double *p)
Int_t _ipOrder
The cache manager.
RooObjCacheManager _cacheMgr
void setValueDirty() const
virtual void fillCacheObject(FuncCacheElem &cache) const =0
virtual void printCompactTreeHook(std::ostream &, const char *, Int_t, Int_t)
Print contents of cache when printing self as part of object tree.
T * getObjByIndex(Int_t index) const
virtual void reset()
Reset all bin weights to zero.
virtual Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const
Return analytical integration capabilities of the RooHistFunc that corresponds to the set of observab...
virtual TObject * Next()=0
OperMode operMode() const
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE)
Change cache operation mode to given mode.
virtual const char * binningName() const
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
void setAllWeights(Double_t value)
Set all the event weight of all bins to the specified value.
virtual ~RooAbsCachedReal()
Destructor.
virtual Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Forward call to implementation in relevant RooHistFunc instance.
Bool_t registerObject(const char *ownerName, const char *objectName, TObject &cacheObject, TIterator *paramIter)
Register object associated with given name and given associated parameters with given values in cache...