68 _cacheMgr(other._cacheMgr,this),
69 _ipOrder(other._ipOrder),
70 _disableCache(other._disableCache)
116 return cache->
pdf() ;
131 return cache->
hist() ;
157 Int_t sterileIdx(-1) ;
163 cxcoutD(Eval) <<
"RooAbsCachedPdf::getCache(" <<
GetName() <<
") cache " << cache <<
" pdf "
164 << cache->
pdf()->
GetName() <<
" requires recalculation as parameters changed" << endl ;
196 coutI(Caching) <<
"RooAbsCachedPdf::getCache(" <<
GetName() <<
") creating new cache " << cache <<
" with pdf "
197 << cache->
pdf()->
GetName() <<
" for nset " << (nset?*nset:
RooArgSet()) <<
" with code " << code ;
199 ccoutI(Caching) <<
" from preexisting content." ;
215 _pdf(0), _paramTracker(0), _hist(0), _norm(0)
229 hname.
Append(
"_CACHEHIST") ;
247 pdfFinalObs.
add(po) ;
250 pdfFinalObs.
add(*tmp) ;
258 pdfname.
Append(
"_CACHE") ;
261 if (nsetIn && nsetIn->
getSize() > 0) {
263 for (
auto *arg : *nsetIn)
321 name.Append(payloadUS) ;
353 ret.
add(*_paramTracker) ;
372 delete _paramTracker ;
387 os <<
indent <<
"--- RooAbsCachedPdf begin cache ---" << endl ;
391 os <<
Form(
"[%d] Configuration for observables ",curElem) << _nset << endl ;
392 indent2 +=
Form(
"[%d] ",curElem) ;
393 _pdf->printCompactTree(os,indent2) ;
395 os <<
Form(
"[%d] Norm ",curElem) ;
399 if (curElem==maxElem) {
400 os <<
indent <<
"--- RooAbsCachedPdf end cache --- " << endl ;
446 std::vector<Int_t> codeList(2);
473 RooArgSet *allVars(0),*anaVars(0),*normSet2(0),*dummy(0) ;
474 const std::vector<Int_t> codeList =
_anaReg.
retrieve(code-1,allVars,anaVars,normSet2,dummy) ;
485 ret *= arg->
volume(rangeName) ;
static void indent(ostringstream &buf, int indent_level)
char * Form(const char *fmt,...)
const std::vector< Int_t > & retrieve(Int_t masterCode) const
Retrieve the array of integer codes associated with the given master code.
Int_t store(const std::vector< Int_t > &codeList, RooArgSet *set1=0, RooArgSet *set2=0, RooArgSet *set3=0, RooArgSet *set4=0)
Store given arrays of integer codes, and up to four RooArgSets in the registry (each setX pointer may...
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
RooExpensiveObjectCache & expensiveObjectCache() const
virtual Bool_t isFundamental() const
Is this object a fundamental type that can be added to a dataset? Fundamental-type subclasses overrid...
RooArgSet * getVariables(Bool_t stripDisconnected=kTRUE) const
Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
void setValueDirty()
Mark the element dirty. This forces a re-evaluation when a value is requested.
void addServerList(RooAbsCollection &serverList, Bool_t valueProp=kTRUE, Bool_t shapeProp=kFALSE)
Register a list of RooAbsArg as servers to us by calling addServer() for each arg in the list.
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
virtual RooArgList containedArgs(Action)
Returns all RooAbsArg objects contained in the cache element.
RooChangeTracker * paramTracker()
PdfCacheElem(const RooAbsCachedPdf &self, const RooArgSet *nset)
Constructor of cache object which owns RooDataHist cache histogram, RooHistPdf pdf that represents is...
virtual ~PdfCacheElem()
Cache element destructor.
RooChangeTracker * _paramTracker
virtual void printCompactTreeHook(std::ostream &, const char *, Int_t, Int_t)
Print contents of cache when printing self as part of object tree.
RooAbsCachedPdf is the abstract base class for p.d.f.s that need or want to cache their evaluate() ou...
Int_t getInterpolationOrder() const
virtual Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Implements internal (analytical) integration capabilities.
TString cacheNameSuffix(const RooArgSet &nset) const
Construct string with unique suffix for cache objects based on observable names that define cache con...
virtual RooAbsArg & pdfObservable(RooAbsArg &histObservable) const
virtual PdfCacheElem * createCache(const RooArgSet *nset) const
void setInterpolationOrder(Int_t order)
Change the interpolation order that is used in RooHistPdf cache representation smoothing the RooDataH...
virtual RooArgSet * actualParameters(const RooArgSet &nset) const =0
virtual TString histNameSuffix() const
virtual const char * binningName() const
virtual const char * inputBaseName() const =0
virtual Double_t getValV(const RooArgSet *set=0) const
Implementation of getVal() overriding default implementation of RooAbsPdf.
Bool_t _disableCache
Map for analytical integration codes.
PdfCacheElem * getCache(const RooArgSet *nset, Bool_t recalculate=kTRUE) const
Retrieve cache object associated with given choice of observables.
virtual Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const
Advertises internal (analytical) integration capabilities.
virtual ~RooAbsCachedPdf()
Destructor.
virtual Bool_t forceAnalyticalInt(const RooAbsArg &dep) const
Force RooRealIntegral to offer all our actual observable for internal integration.
RooAbsPdf * getCachePdf(const RooArgSet &nset) const
RooDataHist * getCacheHist(const RooArgSet &nset) const
virtual void fillCacheObject(PdfCacheElem &cache) const =0
void clearCacheObject(PdfCacheElem &cache) const
Mark all bins of given cache as unitialized (value -1)
RooObjCacheManager _cacheMgr
virtual const char * payloadUniqueSuffix() const
virtual RooArgSet * actualObservables(const RooArgSet &nset) const =0
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
TIterator * createIterator(Bool_t dir=kIterForward) const
TIterator-style iteration over contained elements.
Abstract base class for objects that are lvalues, i.e.
virtual Double_t volume(const char *rangeName) const =0
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Analytical integral with normalization (see RooAbsReal::analyticalIntegralWN() for further informatio...
virtual Double_t getValV(const RooArgSet *set=0) const
Return current value, normalized by integrating over the observables in nset.
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 ...
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
virtual void preferredObservableScanOrder(const RooArgSet &obs, RooArgSet &orderedObs) const
Interface method for function objects to indicate their preferred order of observables for scanning t...
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Add element to non-owning set.
RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE) override
Add clone of specified element to an owning set.
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
T * getObjByIndex(Int_t index) const
Retrieve payload object by slot index.
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
RooChangeTracker is a meta object that tracks value changes in a given set of RooAbsArgs by registeri...
Bool_t hasChanged(Bool_t clearState)
Returns true if state has changed since last call with clearState=kTRUE.
RooArgSet parameters() const
The RooDataHist is a container class to hold N-dimensional binned data.
virtual void add(const RooArgSet &row, Double_t wgt=1.0)
Add wgt to the bin content enclosed by the coordinates passed in row.
void setAllWeights(Double_t value)
Set all the event weight of all bins to the specified value.
void reset() override
Reset all bin weights to zero.
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...
const TObject * retrieveObject(const char *name, TClass *tclass, const RooArgSet ¶ms)
Retrieve object from cache that was registered under given name with given parameters,...
Bool_t haveUnitNorm() const
void setInterpolationOrder(Int_t order)
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer,...
Iterator abstract base class.
virtual TObject * Next()=0
virtual const char * GetName() const
Returns name of object.
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.