Docs | All | Real | Category | PDF | DataSet | Plot | Container | Misc | Aux | User

RooFit Toolkit for Data Modeling
#include "RooNumConvolution.hh"

RooNumConvolution


class description - source file - inheritance tree (.pdf)

class RooNumConvolution : public RooAbsReal

Inheritance Chart:
TObject
<-
TNamed
RooPrintable
<-
RooAbsArg
<-
RooAbsReal
<-
RooNumConvolution

    protected:
RooAbsReal& cloneModel() const RooAbsReal& clonePdf() const RooRealVar& cloneVar() const void initialize() const virtual void printCompactTreeHook(ostream& os, const char* indent = "") virtual Bool_t redirectServersHook(const RooAbsCollection& newServerList, Bool_t mustReplaceAll, Bool_t nameChange, Bool_t isRecursive) public:
RooNumConvolution(const char* name, const char* title, RooRealVar& convVar, RooAbsReal& pdf, RooAbsReal& resmodel, const RooNumConvolution* proto = 0) RooNumConvolution(const RooNumConvolution& other, const char* name = "0") virtual ~RooNumConvolution() static TClass* Class() void clearConvolutionWindow() virtual TObject* clone(const char* newname) const RooNumIntConfig& convIntConfig() const RooNumIntConfig& convIntConfig() const virtual Double_t evaluate() const virtual TClass* IsA() const RooAbsReal& model() const RooAbsReal& pdf() const const TH2* profileData() const void setCallProfiling(Bool_t flag, Int_t nbinX = 40, Int_t nbinCall = 40, Int_t nCallHigh = 1000) void setCallWarning(Int_t threshold = 2000) void setConvolutionWindow(RooAbsReal& centerParam, RooAbsReal& widthParam, Double_t widthScaleFactor = 1) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) RooRealVar& var() const

Data Members


    protected:
Bool_t _init RooNumIntConfig _convIntConfig Configuration of numeric convolution integral ; RooConvIntegrandBinding* _integrand ! Binding of Convolution Integrand function RooAbsIntegrator* _integrator ! Numeric integrator of convolution integrand RooRealProxy _origVar Original convolution variable RooRealProxy _origPdf Original input PDF RooRealProxy _origModel Original resolution model RooArgSet _ownedClonedPdfSet Owning set of cloned PDF components RooArgSet _ownedClonedModelSet Owning set of cloned model components RooAbsReal* _cloneVar Pointer to cloned convolution variable RooAbsReal* _clonePdf Pointer to cloned PDF RooAbsReal* _cloneModel Pointer to cloned model Bool_t _useWindow Switch to activate window convolution Double_t _windowScale Scale factor for window parameter RooListProxy _windowParam Holder for optional convolution integration window scaling parameter Int_t _verboseThresh Call count threshold for verbose printing Bool_t _doProf Switch to activate profiling option TH2* _callHist ! Histogram recording number of calls per convolution integral calculation

Class Description

 Numeric 1-dimensional convolution operator PDF. This class can convolve any PDF
 with any other PDF

 This class should not be used blindly as numeric convolution is computing
 intensive and prone to stability fitting problems. If an analytic convolution
 can be calculated, you should use that or implement it if not available.
 RooNumConvolution implements reasonable defaults that should convolve most
 functions reasonably well, but results strongly depend on the shape of your
 input PDFS so always check your result.

 The default integration engine for the numeric convolution is the
 adaptive Gauss-Kronrod method, which empirically seems the most robust
 for this task. You can override the convolution integration settings via
 the RooNumIntConfig object reference returned by the convIntConfig() member
 function

 By default the numeric convolution is integrated from -infinity to
 +infinity through a x -> 1/x coordinate transformation of the
 tails. For convolution with a very small bandwidth it may be
 advantageous (for both CPU consumption and stability) if the
 integration domain is limited to a finite range. The function
 setConvolutionWindow(mean,width,scale) allows to set a sliding
 window around the x value to be calculated taking a RooAbsReal
 expression for an offset and a width to be taken around the x
 value. These input expression can be RooFormulaVars or other
 function objects although the 3d 'scale' argument 'scale'
 multiplies the width RooAbsReal expression given in the 2nd
 argument, allowing for an appropriate window definition for most
 cases without need for a RooFormulaVar object: e.g. a Gaussian
 resolution PDF do setConvolutionWindow(gaussMean,gaussSigma,5)
 Note that for a 'wide' Gaussian the -inf to +inf integration
 may converge more quickly than that over a finite range!

 The default numeric precision is 1e-7, i.e. the global default for
 numeric integration but you should experiment with this value to
 see if it is sufficient for example by studying the number of function
 calls that MINUIT needs to fit your function as function of the
 convolution precision.

RooNumConvolution(const char *name, const char *title, RooRealVar& convVar, RooAbsReal& pdf, RooAbsReal& resmodel, const RooNumConvolution* proto) : RooAbsReal(name,title), _init(kFALSE), _convIntConfig(RooNumIntConfig::defaultConfig()), _integrand(0), _integrator(0), _origVar("origVar","Original Convolution variable",this,convVar), _origPdf("origPdf","Original Input PDF",this,pdf), _origModel("origModel","Original Resolution model",this,resmodel), _ownedClonedPdfSet("ownedClonePdfSet"), _ownedClonedModelSet("ownedCloneModelSet"), _cloneVar(0), _clonePdf(0), _cloneModel(0), _useWindow(kFALSE), _windowScale(1), _windowParam("windowParam","Convolution window parameter",this,kFALSE), _verboseThresh(2000), _doProf(kFALSE), _callHist(0)
 Constructor of convolution operator PDF

 convVar  :  convolution variable (on which both pdf and resmodel should depend)
 pdf      :  input 'physics' pdf
 resmodel :  input 'resultion' pdf

 output is pdf(x) (X) resmodel(x) = Int [ pdf(x') resmodel (x-x') ] dx'


RooNumConvolution(const RooNumConvolution& other, const char* name) : RooAbsReal(other,name), _init(kFALSE), _convIntConfig(other._convIntConfig), _integrand(0), _integrator(0), _origVar("origVar",this,other._origVar), _origPdf("origPdf",this,other._origPdf), _origModel("origModel",this,other._origModel), _ownedClonedPdfSet("ownedClonePdfSet"), _ownedClonedModelSet("ownedCloneModelSet"), _cloneVar(0), _clonePdf(0), _cloneModel(0), _useWindow(other._useWindow), _windowScale(other._windowScale), _windowParam("windowParam",this,other._windowParam), _verboseThresh(other._verboseThresh), _doProf(other._doProf), _callHist(other._callHist)
 Copy constructor

void initialize() const
 Initialization function -- create clone of convVar (x') and deep-copy clones of pdf and
 model that are connected to x' rather than x (convVar)

~RooNumConvolution()
 Destructor

Double_t evaluate() const
 Calculate convolution integral

Bool_t redirectServersHook(const RooAbsCollection& /*newServerList*/, Bool_t /*mustReplaceAll*/, Bool_t /*nameChange*/, Bool_t /*isRecursive*/)
 Intercept server redirects. Throw away cache, as figuring out redirections on the cache is an unsolvable problem.

void clearConvolutionWindow()
 Removes previously defined convolution window, reverting to convolution from -inf to +inf

void setConvolutionWindow(RooAbsReal& centerParam, RooAbsReal& widthParam, Double_t widthScaleFactor)
 Restrict convolution integral to finite range [ x - C - S*W, x - C + S*W ]
 where x is current value of convolution variablem, C = centerParam, W=widthParam and S = widthScaleFactor
 Inputs centerParam and withParam can be function expressions (RooAbsReal, RooFormulaVar) etc.

void setCallWarning(Int_t threshold)
 Activate warning messages if number of function calls needed for evaluation of convolution integral
 exceeds given threshold

void setCallProfiling(Bool_t flag, Int_t nbinX, Int_t nbinCall, Int_t nCallHigh)
 Activate call profile if flag is set to true. A 2-D histogram is kept that stores the required number
 of function calls versus the value of x, the convolution variable

 All clones of RooNumConvolution objects will keep logging to the histogram of the original class
 so that performance of temporary object clones, such as used in e.g. fitting, plotting and generating
 are all logged in a single place.

 Function caller should take ownership of profiling histogram as it is not deleted at the RooNumConvolution dtor

 Calling this function with flag set to false will deactivate call profiling and delete the profiling histogram

void printCompactTreeHook(ostream& os, const char* indent)
 Hook function to intercept printCompactTree() calls so that it can print out
 the content of its private cache in the print sequence



Inline Functions


                      TObject* clone(const char* newname) const
              RooNumIntConfig& convIntConfig()
        const RooNumIntConfig& convIntConfig() const
                    const TH2* profileData() const
                   RooRealVar& var() const
                   RooAbsReal& pdf() const
                   RooAbsReal& model() const
                   RooRealVar& cloneVar() const
                   RooAbsReal& clonePdf() const
                   RooAbsReal& cloneModel() const
                       TClass* Class()
                       TClass* IsA() const
                          void ShowMembers(TMemberInspector& insp, char* parent)
                          void Streamer(TBuffer& b)
                          void StreamerNVirtual(TBuffer& b)
Last CVS Update: v 1.5 2005/06/20 15:44:55 wverkerke Top
Copyright © 2000-2005 University of California, Stanford University

Page maintained by Wouter Verkerke and David Kirkby

SourceForge.net Logo