Logo ROOT   6.10/09
Reference Guide
RooCachedPdf.h
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 #ifndef ROOCACHEDPDF
13 #define ROOCACHEDPDF
14 
15 #include "RooAbsCachedPdf.h"
16 #include "RooRealProxy.h"
17 #include "RooAbsReal.h"
18 
19 
20 class RooCachedPdf : public RooAbsCachedPdf {
21 public:
22  RooCachedPdf() {} ;
23  RooCachedPdf(const char *name, const char *title, RooAbsPdf& _pdf, const RooArgSet& cacheObs);
24  RooCachedPdf(const char *name, const char *title, RooAbsPdf& _pdf);
25  RooCachedPdf(const RooCachedPdf& other, const char* name=0) ;
26  virtual TObject* clone(const char* newname) const { return new RooCachedPdf(*this,newname); }
27  virtual ~RooCachedPdf() ;
28 
29  virtual void preferredObservableScanOrder(const RooArgSet& obs, RooArgSet& orderedObs) const ;
30 
31 protected:
32 
33  virtual const char* inputBaseName() const {
34  // Return the base name for cache objects, in this case the name of the cached p.d.f
35  return pdf.arg().GetName() ;
36  } ;
37  virtual RooArgSet* actualObservables(const RooArgSet& nset) const ;
38  virtual RooArgSet* actualParameters(const RooArgSet& nset) const ;
39  virtual void fillCacheObject(PdfCacheElem& cachePdf) const ;
40  virtual Double_t evaluate() const {
41  // Dummy evaluate, it is never called
42  return 0 ;
43  }
44 
45  virtual const char* payloadUniqueSuffix() const { return pdf.arg().aggregateCacheUniqueSuffix() ; }
46 
47  RooRealProxy pdf ; // Proxy to p.d.f being cached
48  RooSetProxy _cacheObs ; // Observable to be cached
49 
50 private:
51 
52  ClassDef(RooCachedPdf,1) // P.d.f class that wraps another p.d.f and caches its output
53 
54 };
55 
56 #endif
RooCachedPdf is an implementation of RooAbsCachedPdf that can cache any external RooAbsPdf input func...
Definition: RooCachedPdf.h:20
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
virtual TObject * clone(const char *newname) const
Definition: RooCachedPdf.h:26
#define ClassDef(name, id)
Definition: Rtypes.h:297
RooSetProxy _cacheObs
Definition: RooCachedPdf.h:48
virtual const char * payloadUniqueSuffix() const
Definition: RooCachedPdf.h:45
virtual void preferredObservableScanOrder(const RooArgSet &obs, RooArgSet &orderedObs) const
Defer preferred scan order to cached pdf prefernece.
RooRealProxy pdf
Definition: RooCachedPdf.h:47
virtual ~RooCachedPdf()
Destructor.
RooAbsCachedPdf is the abstract base class for p.d.f.s that need or want to cache their evaluate() ou...
virtual RooArgSet * actualObservables(const RooArgSet &nset) const
If this pdf is operated with a fixed set of observables, return the subset of the fixed observables t...
double Double_t
Definition: RtypesCore.h:55
virtual void fillCacheObject(PdfCacheElem &cachePdf) const
Update contents of cache histogram by resampling the input p.d.f.
Mother of all ROOT objects.
Definition: TObject.h:37
virtual RooArgSet * actualParameters(const RooArgSet &nset) const
If this p.d.f is operated with a fixed set of observables, return all variables of the external input...
virtual Double_t evaluate() const
Definition: RooCachedPdf.h:40
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
RooSetProxy is the concrete proxy for RooArgSet objects.
Definition: RooSetProxy.h:24
RooRealProxy is the concrete proxy for RooAbsReal objects A RooRealProxy is the general mechanism to ...
Definition: RooRealProxy.h:23
const RooAbsReal & arg() const
Definition: RooRealProxy.h:43
const char * aggregateCacheUniqueSuffix() const
Definition: RooAbsArg.cxx:2354
virtual const char * inputBaseName() const
Definition: RooCachedPdf.h:33