Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
21public:
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=nullptr) ;
26 TObject* clone(const char* newname) const override { return new RooCachedPdf(*this,newname); }
27
28 void preferredObservableScanOrder(const RooArgSet& obs, RooArgSet& orderedObs) const override ;
29
30protected:
31
32 /// Return the base name for cache objects, in this case the name of the cached p.d.f
33 const char* inputBaseName() const override {
34 return pdf.arg().GetName() ;
35 } ;
37 RooFit::OwningPtr<RooArgSet> actualParameters(const RooArgSet& nset) const override ;
38 void fillCacheObject(PdfCacheElem& cachePdf) const override ;
39 double evaluate() const override {
40 // Dummy evaluate, it is never called
41 return 0 ;
42 }
43
44 const char* payloadUniqueSuffix() const override { return pdf.arg().aggregateCacheUniqueSuffix() ; }
45
46 RooRealProxy pdf ; ///< Proxy to p.d.f being cached
47 RooSetProxy _cacheObs ; ///< Observable to be cached
48
49private:
50
51 ClassDefOverride(RooCachedPdf,1) // P.d.f class that wraps another p.d.f and caches its output
52
53};
54
55#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
char name[80]
Definition TGX11.cxx:110
const char * aggregateCacheUniqueSuffix() const
Abstract base class for p.d.f.s that need or want to cache their evaluate() output in a RooHistPdf de...
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:40
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
Implementation of RooAbsCachedPdf that can cache any external RooAbsPdf input function provided in th...
RooRealProxy pdf
Proxy to p.d.f being cached.
RooSetProxy _cacheObs
Observable to be cached.
TObject * clone(const char *newname) const override
RooFit::OwningPtr< RooArgSet > actualObservables(const RooArgSet &nset) const override
If this pdf is operated with a fixed set of observables, return the subset of the fixed observables t...
RooFit::OwningPtr< RooArgSet > actualParameters(const RooArgSet &nset) const override
If this p.d.f is operated with a fixed set of observables, return all variables of the external input...
void preferredObservableScanOrder(const RooArgSet &obs, RooArgSet &orderedObs) const override
Defer preferred scan order to cached pdf preference.
void fillCacheObject(PdfCacheElem &cachePdf) const override
Update contents of cache histogram by resampling the input p.d.f.
const char * inputBaseName() const override
Return the base name for cache objects, in this case the name of the cached p.d.f.
const char * payloadUniqueSuffix() const override
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
const T & arg() const
Return reference to object held in proxy.
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
Mother of all ROOT objects.
Definition TObject.h:41
T * OwningPtr
An alias for raw pointers for indicating that the return type of a RooFit function is an owning point...
Definition Config.h:35