Logo ROOT  
Reference Guide
RooAbsCachedPdf.cxx
Go to the documentation of this file.
1  /*****************************************************************************
2  * Project: RooFit *
3  * *
4  * Copyright (c) 2000-2005, Regents of the University of California *
5  * and Stanford University. All rights reserved. *
6  * *
7  * Redistribution and use in source and binary forms, *
8  * with or without modification, are permitted according to the terms *
9  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
10  *****************************************************************************/
11 
12 /**
13 \file RooAbsCachedPdf.cxx
14 \class RooAbsCachedPdf
15 \ingroup Roofitcore
16 
17 RooAbsCachedPdf is the abstract base class for p.d.f.s that need or
18 want to cache their evaluate() output in a RooHistPdf defined in
19 terms of the used observables. This base class manages the creation
20 and storage of all RooHistPdf cache p.d.fs and the RooDataHists
21 that define their shape. Implementations of RooAbsCachedPdf must
22 define member function fillCacheObject() which serves to fill an
23 already created RooDataHist with the p.d.fs function values. In
24 addition the member functions actualObservables() and
25 actualParameters() must be define which report what the actual
26 observables to be cached are for a given set of observables passed
27 by the user to getVal() and on which parameters need to be tracked
28 for changes to trigger a refilling of the cache histogram.
29 **/
30 
31 #include "Riostream.h"
32 using namespace std ;
33 
34 #include "RooFit.h"
35 #include "TString.h"
36 #include "RooAbsCachedPdf.h"
37 #include "RooAbsReal.h"
38 #include "RooMsgService.h"
39 #include "RooDataHist.h"
40 #include "RooHistPdf.h"
41 #include "RooGlobalFunc.h"
42 #include "RooRealVar.h"
43 #include "RooChangeTracker.h"
45 
47 
48 
49 
50 ////////////////////////////////////////////////////////////////////////////////
51 /// Constructor
52 
53 RooAbsCachedPdf::RooAbsCachedPdf(const char *name, const char *title, Int_t ipOrder) :
54  RooAbsPdf(name,title),
55  _cacheMgr(this,10),
56  _ipOrder(ipOrder),
57  _disableCache(kFALSE)
58  {
59  }
60 
61 
62 
63 ////////////////////////////////////////////////////////////////////////////////
64 /// Copy constructor
65 
67  RooAbsPdf(other,name),
68  _cacheMgr(other._cacheMgr,this),
69  _ipOrder(other._ipOrder),
70  _disableCache(other._disableCache)
71  {
72  }
73 
74 
75 
76 ////////////////////////////////////////////////////////////////////////////////
77 /// Destructor
78 
80 {
81 }
82 
83 
84 
85 ////////////////////////////////////////////////////////////////////////////////
86 /// Implementation of getVal() overriding default implementation
87 /// of RooAbsPdf. Return normalized value stored in cache p.d.f
88 /// rather than return value of evaluate() which is undefined
89 /// for RooAbsCachedPdf
90 
92 {
93  if (_disableCache) {
94  return RooAbsPdf::getValV(nset) ;
95  }
96 
97  // Calculate current unnormalized value of object
98  PdfCacheElem* cache = getCache(nset) ;
99 
100  Double_t value = cache->pdf()->getVal(nset) ;
101 
102  _value = value ;
103  return _value ;
104 }
105 
106 
107 
108 ////////////////////////////////////////////////////////////////////////////////
109 /// Return pointer to RooHistPdf cache pdf for given choice of observables
110 
112 {
113  PdfCacheElem* cache = getCache(nset) ;
114 
115  if (cache) {
116  return cache->pdf() ;
117  } else {
118  return 0 ;
119  }
120 }
121 
122 
123 ////////////////////////////////////////////////////////////////////////////////
124 /// Return pointer to RooDataHist cache histogram for given choice of observables
125 
127 {
128  PdfCacheElem* cache = getCache(nset) ;
129 
130  if (cache) {
131  return cache->hist() ;
132  } else {
133  return 0 ;
134  }
135 }
136 
137 
138 ////////////////////////////////////////////////////////////////////////////////
139 /// Mark all bins of given cache as unitialized (value -1)
140 
142 {
143  cache.hist()->setAllWeights(-1) ;
144 }
145 
146 
147 
148 ////////////////////////////////////////////////////////////////////////////////
149 /// Retrieve cache object associated with given choice of observables. If cache object
150 /// does not exist, create and fill and register it on the fly. If recalculate=false
151 /// recalculation of cache contents of existing caches that are marked dirty due to
152 /// dependent parameter changes is suppressed.
153 
155 {
156  // Check if this configuration was created becfore
157  Int_t sterileIdx(-1) ;
158  PdfCacheElem* cache = (PdfCacheElem*) _cacheMgr.getObj(nset,0,&sterileIdx) ;
159 
160  // Check if we have a cache histogram in the global expensive object cache
161  if (cache) {
162  if (cache->paramTracker()->hasChanged(kTRUE) && (recalculate || !cache->pdf()->haveUnitNorm()) ) {
163  cxcoutD(Eval) << "RooAbsCachedPdf::getCache(" << GetName() << ") cache " << cache << " pdf "
164  << cache->pdf()->GetName() << " requires recalculation as parameters changed" << endl ;
165  fillCacheObject(*cache) ;
166  cache->pdf()->setValueDirty() ;
167  }
168  return cache ;
169  }
170 
171  // Create and fill cache
172  cache = createCache(nset) ;
173 
174  // Check if we have contents registered already in global expensive object cache
176 
177  if (htmp) {
178 
179  cache->hist()->reset() ;
180  cache->hist()->add(*htmp) ;
181 
182  } else {
183 
184  fillCacheObject(*cache) ;
185 
186  RooDataHist* eoclone = new RooDataHist(*cache->hist()) ;
187  eoclone->removeSelfFromDir() ;
188  expensiveObjectCache().registerObject(GetName(),cache->hist()->GetName(),*eoclone,cache->paramTracker()->parameters()) ;
189 
190  }
191 
192 
193  // Store this cache configuration
194  Int_t code = _cacheMgr.setObj(nset,0,((RooAbsCacheElement*)cache),0) ;
195 
196  coutI(Caching) << "RooAbsCachedPdf::getCache(" << GetName() << ") creating new cache " << cache << " with pdf "
197  << cache->pdf()->GetName() << " for nset " << (nset?*nset:RooArgSet()) << " with code " << code ;
198  if (htmp) {
199  ccoutI(Caching) << " from preexisting content." ;
200  }
201  ccoutI(Caching) << endl ;
202 
203  return cache ;
204 }
205 
206 
207 
208 
209 ////////////////////////////////////////////////////////////////////////////////
210 /// Constructor of cache object which owns RooDataHist cache histogram,
211 /// RooHistPdf pdf that represents is shape and RooChangeTracker meta
212 /// object that tracks changes in listed dependent parameter of cache.
213 
215  _pdf(0), _paramTracker(0), _hist(0), _norm(0)
216 {
217  // Create cache object itself -- Default implementation is a RooHistPdf
218  RooArgSet* nset2 = self.actualObservables(nsetIn?*nsetIn:RooArgSet()) ;
219 
220  RooArgSet orderedObs ;
221  if (nset2) {
222  self.preferredObservableScanOrder(*nset2,orderedObs) ;
223  }
224 
225  // Create RooDataHist
226  TString hname = self.GetName() ;
227  hname.Append("_") ;
228  hname.Append(self.inputBaseName()) ;
229  hname.Append("_CACHEHIST") ;
230  hname.Append(self.cacheNameSuffix(orderedObs)) ;
231  hname.Append(self.histNameSuffix()) ;
232  _hist = new RooDataHist(hname,hname,orderedObs,self.binningName()) ;
234 
235  //RooArgSet* observables= self.getObservables(orderedObs) ;
236  // cout << "orderedObs = " << orderedObs << " observables = " << *observables << endl ;
237 
238  // Get set of p.d.f. observable corresponding to set of histogram observables
239  RooArgSet pdfObs ;
240  RooArgSet pdfFinalObs ;
241  TIterator* iter = orderedObs.createIterator() ;
242  RooAbsArg* harg ;
243  while((harg=(RooAbsArg*)iter->Next())) {
244  RooAbsArg& po = self.pdfObservable(*harg) ;
245  pdfObs.add(po) ;
246  if (po.isFundamental()) {
247  pdfFinalObs.add(po) ;
248  } else {
249  RooArgSet* tmp = po.getVariables() ;
250  pdfFinalObs.add(*tmp) ;
251  delete tmp ;
252  }
253  }
254  delete iter ;
255 
256  // Create RooHistPdf
257  TString pdfname = self.inputBaseName() ;
258  pdfname.Append("_CACHE") ;
259  pdfname.Append(self.cacheNameSuffix(pdfFinalObs)) ;
260  _pdf = new RooHistPdf(pdfname,pdfname,pdfObs,orderedObs,*_hist,self.getInterpolationOrder()) ;
261  if (nsetIn) {
262  _nset.addClone(*nsetIn) ;
263  }
264 
265  // Create pseudo-object that tracks changes in parameter values
266 
267  RooArgSet* params = self.actualParameters(pdfFinalObs) ;
268  params->remove(pdfFinalObs,kTRUE,kTRUE) ;
269 
270  string name= Form("%s_CACHEPARAMS",_pdf->GetName()) ;
271  _paramTracker = new RooChangeTracker(name.c_str(),name.c_str(),*params,kTRUE) ;
272  _paramTracker->hasChanged(kTRUE) ; // clear dirty flag as cache is up-to-date upon creation
273 
274  // Introduce formal dependency of RooHistPdf on parameters so that const optimization code
275  // makes the correct decisions
276  _pdf->addServerList(*params) ;
277 
278  // Set initial state of cache to dirty
279  _pdf->setValueDirty() ;
280 
281  //delete observables ;
282  delete params ;
283  delete nset2 ;
284 
285 }
286 
287 
288 
289 ////////////////////////////////////////////////////////////////////////////////
290 /// Construct string with unique suffix for cache objects based on
291 /// observable names that define cache configuration
292 
294 {
295  TString name ;
296  name.Append("_Obs[") ;
297  if (nset.getSize()>0) {
298  TIterator* iter = nset.createIterator() ;
299  RooAbsArg* arg ;
300  Bool_t first(kTRUE) ;
301  while((arg=(RooAbsArg*)iter->Next())) {
302  if (first) {
303  first=kFALSE ;
304  } else {
305  name.Append(",") ;
306  }
307  name.Append(arg->GetName()) ;
308  }
309  delete iter ;
310  }
311 
312  name.Append("]") ;
313  const char* payloadUS = payloadUniqueSuffix() ;
314  if (payloadUS) {
315  name.Append(payloadUS) ;
316  }
317  return name ;
318 }
319 
320 
321 
322 ////////////////////////////////////////////////////////////////////////////////
323 /// Change the interpolation order that is used in RooHistPdf cache
324 /// representation smoothing the RooDataHist shapes.
325 
327 {
328  _ipOrder = order ;
329 
330  Int_t i ;
331  for (i=0 ; i<_cacheMgr.cacheSize() ; i++) {
333  if (cache) {
334  cache->pdf()->setInterpolationOrder(order) ;
335  }
336  }
337 }
338 
339 
340 
341 ////////////////////////////////////////////////////////////////////////////////
342 /// Returns all RooAbsArg objects contained in the cache element
343 
345 {
346  RooArgList ret(*_pdf) ;
347  ret.add(*_paramTracker) ;
348  if (_norm) ret.add(*_norm) ;
349  return ret ;
350 }
351 
352 
353 
354 ////////////////////////////////////////////////////////////////////////////////
355 /// Cache element destructor
356 
358 {
359  if (_norm) {
360  delete _norm ;
361  }
362  if (_pdf) {
363  delete _pdf ;
364  }
365  if (_paramTracker) {
366  delete _paramTracker ;
367  }
368  if (_hist) {
369  delete _hist ;
370  }
371 }
372 
373 
374 
375 ////////////////////////////////////////////////////////////////////////////////
376 /// Print contents of cache when printing self as part of object tree
377 
378 void RooAbsCachedPdf::PdfCacheElem::printCompactTreeHook(ostream& os, const char* indent, Int_t curElem, Int_t maxElem)
379 {
380  if (curElem==0) {
381  os << indent << "--- RooAbsCachedPdf begin cache ---" << endl ;
382  }
383 
384  TString indent2(indent) ;
385  os << Form("[%d] Configuration for observables ",curElem) << _nset << endl ;
386  indent2 += Form("[%d] ",curElem) ;
387  _pdf->printCompactTree(os,indent2) ;
388  if (_norm) {
389  os << Form("[%d] Norm ",curElem) ;
391  }
392 
393  if (curElem==maxElem) {
394  os << indent << "--- RooAbsCachedPdf end cache --- " << endl ;
395  }
396 }
397 
398 
399 
400 ////////////////////////////////////////////////////////////////////////////////
401 /// Force RooRealIntegral to offer all our actual observable for internal
402 /// integration
403 
405 {
406  RooArgSet* actObs = actualObservables(dep) ;
407  Bool_t ret = (actObs->getSize()>0) ;
408  delete actObs ;
409  return ret ;
410 }
411 
412 
413 
414 ////////////////////////////////////////////////////////////////////////////////
415 /// Advertises internal (analytical) integration capabilities. Call
416 /// is forwarded to RooHistPdf cache p.d.f of cache that is used for
417 /// given choice of observables
418 
419 Int_t RooAbsCachedPdf::getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, const RooArgSet* normSet, const char* rangeName) const
420 {
421  if (allVars.getSize()==0) {
422  return 0 ;
423  }
424 
425  PdfCacheElem* cache = getCache(normSet?normSet:&allVars) ;
426  Int_t code = cache->pdf()->getAnalyticalIntegralWN(allVars,analVars,normSet,rangeName) ;
427 
428  if (code==0) {
429  return 0 ;
430  }
431 
432  RooArgSet* all = new RooArgSet ;
433  RooArgSet* ana = new RooArgSet ;
434  RooArgSet* nrm = new RooArgSet ;
435  all->addClone(allVars) ;
436  ana->addClone(analVars) ;
437  if (normSet) {
438  nrm->addClone(*normSet) ;
439  }
440  std::vector<Int_t> codeList(2);
441  codeList[0] = code ;
442  codeList[1] = cache->pdf()->haveUnitNorm() ? 1 : 0 ;
443  Int_t masterCode = _anaReg.store(codeList,all,ana,nrm)+1 ; // takes ownership of all sets
444 
445 
446  // Mark all observables as internally integrated
447  if (cache->pdf()->haveUnitNorm()) {
448  analVars.add(allVars,kTRUE) ;
449  }
450 
451  return masterCode ;
452 }
453 
454 
455 
456 ////////////////////////////////////////////////////////////////////////////////
457 /// Implements internal (analytical) integration capabilities. Call
458 /// is forwarded to RooHistPdf cache p.d.f of cache that is used for
459 /// given choice of observables
460 
461 Double_t RooAbsCachedPdf::analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName) const
462 {
463  if (code==0) {
464  return getVal(normSet) ;
465  }
466 
467  RooArgSet *allVars(0),*anaVars(0),*normSet2(0),*dummy(0) ;
468  const std::vector<Int_t> codeList = _anaReg.retrieve(code-1,allVars,anaVars,normSet2,dummy) ;
469 
470  PdfCacheElem* cache = getCache(normSet2?normSet2:anaVars,kFALSE) ;
471  Double_t ret = cache->pdf()->analyticalIntegralWN(codeList[0],normSet,rangeName) ;
472 
473  if (codeList[1]>0) {
474  RooArgSet factObs(*allVars) ;
475  factObs.remove(*anaVars,kTRUE,kTRUE) ;
476  TIterator* iter = factObs.createIterator() ;
477  RooAbsLValue* arg ;
478  while((arg=dynamic_cast<RooAbsLValue*>(iter->Next()))) {
479  ret *= arg->volume(rangeName) ;
480  }
481  delete iter ;
482  }
483 
484  return ret ;
485 }
486 
487 
488 
489 
490 
RooAbsCachedPdf::fillCacheObject
virtual void fillCacheObject(PdfCacheElem &cache) const =0
RooExpensiveObjectCache::registerObject
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...
Definition: RooExpensiveObjectCache.cxx:110
RooCacheManager::cacheSize
Int_t cacheSize() const
Definition: RooCacheManager.h:69
RooCacheManager::setObj
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
Definition: RooCacheManager.h:49
RooAbsCachedPdf::createCache
virtual PdfCacheElem * createCache(const RooArgSet *nset) const
Definition: RooAbsCachedPdf.h:99
RooAbsCachedPdf::clearCacheObject
void clearCacheObject(PdfCacheElem &cache) const
Mark all bins of given cache as unitialized (value -1)
Definition: RooAbsCachedPdf.cxx:141
RooAbsCachedPdf::RooAbsCachedPdf
RooAbsCachedPdf()
Definition: RooAbsCachedPdf.h:28
first
Definition: first.py:1
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
RooAbsReal.h
RooMsgService.h
RooDataHist::setAllWeights
void setAllWeights(Double_t value)
Set all the event weight of all bins to the specified value.
Definition: RooDataHist.cxx:1833
RooAbsLValue::volume
virtual Double_t volume(const char *rangeName) const =0
RooFit.h
RooAbsCachedPdf::~RooAbsCachedPdf
virtual ~RooAbsCachedPdf()
Destructor.
Definition: RooAbsCachedPdf.cxx:79
RooCacheManager::getObj
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
Definition: RooCacheManager.h:44
RooAbsCachedPdf::PdfCacheElem::pdf
RooHistPdf * pdf()
Definition: RooAbsCachedPdf.h:72
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
Form
char * Form(const char *fmt,...)
RooAbsCachedPdf::_ipOrder
Int_t _ipOrder
Definition: RooAbsCachedPdf.h:110
RooHistPdf::haveUnitNorm
Bool_t haveUnitNorm() const
Definition: RooHistPdf.h:72
RooAbsCachedPdf::getCachePdf
RooAbsPdf * getCachePdf(const RooArgSet &nset) const
Definition: RooAbsCachedPdf.h:41
RooAbsCachedPdf::PdfCacheElem::PdfCacheElem
PdfCacheElem(const RooAbsCachedPdf &self, const RooArgSet *nset)
Constructor of cache object which owns RooDataHist cache histogram, RooHistPdf pdf that represents is...
Definition: RooAbsCachedPdf.cxx:214
RooAbsCachedPdf::getValV
virtual Double_t getValV(const RooArgSet *set=0) const
Implementation of getVal() overriding default implementation of RooAbsPdf.
Definition: RooAbsCachedPdf.cxx:91
RooAbsCachedPdf::setInterpolationOrder
void setInterpolationOrder(Int_t order)
Change the interpolation order that is used in RooHistPdf cache representation smoothing the RooDataH...
Definition: RooAbsCachedPdf.cxx:326
RooAbsCachedPdf::_anaReg
RooAICRegistry _anaReg
Definition: RooAbsCachedPdf.h:119
RooArgList
Definition: RooArgList.h:21
RooAbsCachedPdf::_cacheMgr
RooObjCacheManager _cacheMgr
Definition: RooAbsCachedPdf.h:109
RooAbsReal::getVal
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition: RooAbsReal.h:91
RooAbsPdf::getValV
virtual Double_t getValV(const RooArgSet *set=0) const
Return current value, normalized by integrating over the observables in nset.
Definition: RooAbsPdf.cxx:278
RooAbsCachedPdf::getAnalyticalIntegralWN
virtual Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const
Advertises internal (analytical) integration capabilities.
Definition: RooAbsCachedPdf.cxx:419
RooAbsCollection::remove
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
Definition: RooAbsCollection.cxx:584
coutI
#define coutI(a)
Definition: RooMsgService.h:30
indent
static void indent(ostringstream &buf, int indent_level)
Definition: TClingCallFunc.cxx:87
RooArgSet::add
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
Definition: RooArgSet.h:88
RooAbsCachedPdf::cacheNameSuffix
TString cacheNameSuffix(const RooArgSet &nset) const
Construct string with unique suffix for cache objects based on observable names that define cache con...
Definition: RooAbsCachedPdf.cxx:293
RooAbsCacheElement
Definition: RooAbsCacheElement.h:26
TString
Definition: TString.h:136
RooAbsArg::expensiveObjectCache
RooExpensiveObjectCache & expensiveObjectCache() const
Definition: RooAbsArg.cxx:2170
RooExpensiveObjectCache::retrieveObject
const TObject * retrieveObject(const char *name, TClass *tclass, const RooArgSet &params)
Retrieve object from cache that was registered under given name with given parameters,...
Definition: RooExpensiveObjectCache.cxx:132
RooAbsCachedPdf::actualObservables
virtual RooArgSet * actualObservables(const RooArgSet &nset) const =0
TString.h
bool
TIterator
Definition: TIterator.h:30
RooAbsCachedPdf::getCache
PdfCacheElem * getCache(const RooArgSet *nset, Bool_t recalculate=kTRUE) const
Retrieve cache object associated with given choice of observables.
Definition: RooAbsCachedPdf.cxx:154
RooAbsCachedPdf::PdfCacheElem::paramTracker
RooChangeTracker * paramTracker()
Definition: RooAbsCachedPdf.h:75
RooDataHist::add
virtual void add(const RooArgSet &row, Double_t wgt=1.0)
Definition: RooDataHist.h:66
RooChangeTracker
Definition: RooChangeTracker.h:26
ccoutI
#define ccoutI(a)
Definition: RooMsgService.h:38
RooAbsCachedPdf::getCacheHist
RooDataHist * getCacheHist(const RooArgSet &nset) const
Definition: RooAbsCachedPdf.h:45
RooAICRegistry::store
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...
Definition: RooAICRegistry.cxx:100
RooChangeTracker::parameters
RooArgSet parameters() const
Definition: RooChangeTracker.cxx:216
RooDataHist
Definition: RooDataHist.h:39
RooPrintable::kName
@ kName
Definition: RooPrintable.h:33
RooCacheManager::getObjByIndex
T * getObjByIndex(Int_t index) const
Retrieve payload object by slot index.
Definition: RooCacheManager.h:308
RooDataHist::removeSelfFromDir
void removeSelfFromDir()
Definition: RooDataHist.h:140
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TString::Append
TString & Append(const char *cs)
Definition: TString.h:564
RooAbsPdf::analyticalIntegralWN
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Analytical integral with normalization (see RooAbsReal::analyticalIntegralWN() for further informatio...
Definition: RooAbsPdf.cxx:408
RooDataHist.h
RooAbsCachedPdf::PdfCacheElem::hist
RooDataHist * hist()
Definition: RooAbsCachedPdf.h:73
RooAbsCachedPdf::PdfCacheElem::~PdfCacheElem
virtual ~PdfCacheElem()
Cache element destructor.
Definition: RooAbsCachedPdf.cxx:357
RooAbsCollection::createIterator
TIterator * createIterator(Bool_t dir=kIterForward) const
TIterator-style iteration over contained elements.
Definition: RooAbsCollection.h:118
RooPrintable::kArgs
@ kArgs
Definition: RooPrintable.h:33
RooAbsArg::RooArgSet
friend class RooArgSet
Definition: RooAbsArg.h:579
RooAbsCachedPdf::histNameSuffix
virtual TString histNameSuffix() const
Definition: RooAbsCachedPdf.h:113
RooAbsCollection::add
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Definition: RooAbsCollection.cxx:437
RooAbsCachedPdf::payloadUniqueSuffix
virtual const char * payloadUniqueSuffix() const
Definition: RooAbsCachedPdf.h:92
RooAbsCachedPdf::binningName
virtual const char * binningName() const
Definition: RooAbsCachedPdf.h:95
RooAbsReal::_value
Double_t _value
Definition: RooAbsReal.h:450
RooAbsCachedPdf::getInterpolationOrder
Int_t getInterpolationOrder() const
Definition: RooAbsCachedPdf.h:53
RooChangeTracker::hasChanged
Bool_t hasChanged(Bool_t clearState)
Returns true if state has changed since last call with clearState=kTRUE.
Definition: RooChangeTracker.cxx:120
RooRealVar.h
RooAbsCachedPdf
Definition: RooAbsCachedPdf.h:25
RooAbsCachedPdf::analyticalIntegralWN
virtual Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Implements internal (analytical) integration capabilities.
Definition: RooAbsCachedPdf.cxx:461
TIterator::Next
virtual TObject * Next()=0
RooAbsCachedPdf::PdfCacheElem::_nset
RooArgSet _nset
Definition: RooAbsCachedPdf.h:82
RooExpensiveObjectCache.h
RooAbsCachedPdf::PdfCacheElem
Definition: RooAbsCachedPdf.h:63
RooGlobalFunc.h
RooAbsArg::isFundamental
virtual Bool_t isFundamental() const
Is this object a fundamental type that can be added to a dataset? Fundamental-type subclasses overrid...
Definition: RooAbsArg.h:243
RooHistPdf.h
RooAbsCachedPdf.h
RooAbsReal::getAnalyticalIntegralWN
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 ...
Definition: RooAbsReal.cxx:372
Double_t
double Double_t
Definition: RtypesCore.h:59
RooAbsCachedPdf::PdfCacheElem::_hist
RooDataHist * _hist
Definition: RooAbsCachedPdf.h:81
RooAbsCachedPdf::forceAnalyticalInt
virtual Bool_t forceAnalyticalInt(const RooAbsArg &dep) const
Force RooRealIntegral to offer all our actual observable for internal integration.
Definition: RooAbsCachedPdf.cxx:404
RooChangeTracker.h
dummy
static RooMathCoreReg dummy
Definition: RooMathCoreReg.cxx:27
RooAbsPdf::_norm
RooAbsReal * _norm
Definition: RooAbsPdf.h:320
RooHistPdf::setInterpolationOrder
void setInterpolationOrder(Int_t order)
Definition: RooHistPdf.h:47
RooAbsCacheElement::Action
Action
Definition: RooAbsCacheElement.h:39
RooDataHist::reset
virtual void reset()
Reset all bin weights to zero.
Definition: RooDataHist.cxx:1767
name
char name[80]
Definition: TGX11.cxx:110
RooAbsCachedPdf::PdfCacheElem::_pdf
RooHistPdf * _pdf
Definition: RooAbsCachedPdf.h:79
RooPrintable::printStream
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,...
Definition: RooPrintable.cxx:75
RooAbsCachedPdf::PdfCacheElem::_paramTracker
RooChangeTracker * _paramTracker
Definition: RooAbsCachedPdf.h:80
RooAbsArg::RooHistPdf
friend class RooHistPdf
Definition: RooAbsArg.h:602
RooPrintable::kSingleLine
@ kSingleLine
Definition: RooPrintable.h:34
RooFit::Caching
@ Caching
Definition: RooGlobalFunc.h:68
RooAbsCachedPdf::inputBaseName
virtual const char * inputBaseName() const =0
RooAbsArg
Definition: RooAbsArg.h:73
RooAbsArg::setValueDirty
void setValueDirty()
Mark the element dirty. This forces a re-evaluation when a value is requested.
Definition: RooAbsArg.h:505
RooArgSet::addClone
virtual void addClone(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling addOwned() for each element in the source...
Definition: RooArgSet.h:96
RooAbsPdf
Definition: RooAbsPdf.h:40
RooAbsLValue
Definition: RooAbsLValue.h:26
RooAbsCachedPdf::_disableCache
Bool_t _disableCache
Map for analytical integration codes.
Definition: RooAbsCachedPdf.h:133
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:53
RooAbsArg::getVariables
RooArgSet * getVariables(Bool_t stripDisconnected=kTRUE) const
Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
Definition: RooAbsArg.cxx:1911
RooAICRegistry::retrieve
const std::vector< Int_t > & retrieve(Int_t masterCode) const
Retrieve the array of integer codes associated with the given master code.
Definition: RooAICRegistry.cxx:153
Class
void Class()
Definition: Class.C:29
RooFit::Eval
@ Eval
Definition: RooGlobalFunc.h:68
Riostream.h
RooAbsArg::addServerList
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.
Definition: RooAbsArg.cxx:392
RooAbsCollection::getSize
Int_t getSize() const
Definition: RooAbsCollection.h:171
RooArgSet
Definition: RooArgSet.h:28
RooAbsCachedPdf::PdfCacheElem::printCompactTreeHook
virtual void printCompactTreeHook(std::ostream &, const char *, Int_t, Int_t)
Print contents of cache when printing self as part of object tree.
Definition: RooAbsCachedPdf.cxx:378
cxcoutD
#define cxcoutD(a)
Definition: RooMsgService.h:81
int
RooAbsCachedPdf::PdfCacheElem::containedArgs
virtual RooArgList containedArgs(Action)
Returns all RooAbsArg objects contained in the cache element.
Definition: RooAbsCachedPdf.cxx:344