Docs | All | Real | Category | PDF | DataSet | Plot | Container | Misc | Aux | User |
RooNumConvolutionclass description - source file - inheritance tree (.pdf) class RooNumConvolution : public RooAbsReal
protected: Data Membersprotected: Class DescriptionNumeric 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 FunctionsTObject* 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)
|
Page maintained by Wouter Verkerke and David Kirkby |