Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooNumConvolution.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooNumConvolution.h,v 1.4 2007/05/11 09:11:30 verkerke Exp $
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16#ifndef ROO_NUM_CONVOLUTION
17#define ROO_NUM_CONVOLUTION
18
19#include "RooAbsPdf.h"
20#include "RooRealProxy.h"
21#include "RooSetProxy.h"
22#include "RooListProxy.h"
23#include "RooNumIntConfig.h"
24
26class RooAbsIntegrator ;
27class TH2 ;
28
30public:
31
33
34 RooNumConvolution(const char *name, const char *title,
35 RooRealVar& convVar, RooAbsReal& pdf, RooAbsReal& resmodel, const RooNumConvolution* proto=nullptr) ;
36
37 RooNumConvolution(const RooNumConvolution& other, const char* name=nullptr) ;
38
39 TObject* clone(const char* newname) const override { return new RooNumConvolution(*this,newname) ; }
40 ~RooNumConvolution() override ;
41
42 double evaluate() const override ;
43
45 const RooNumIntConfig& convIntConfig() const { _init = false ; return _convIntConfig ; }
46
48 void setConvolutionWindow(RooAbsReal& centerParam, RooAbsReal& widthParam, double widthScaleFactor=1) ;
49
50 void setCallWarning(Int_t threshold=2000) ;
51 void setCallProfiling(bool flag, Int_t nbinX = 40, Int_t nbinCall = 40, Int_t nCallHigh=1000) ;
52 const TH2* profileData() const { return _doProf ? _callHist : nullptr ; }
53
54 // Access components
55 RooRealVar& var() const { return (RooRealVar&) _origVar.arg() ; }
56 RooAbsReal& pdf() const { return (RooAbsReal&) _origPdf.arg() ; }
57 RooAbsReal& model() const { return (RooAbsReal&) _origModel.arg() ; }
58
59protected:
60
61 friend class RooNumConvPdf ;
62
63 mutable bool _init ;
64 void initialize() const ;
65 bool redirectServersHook(const RooAbsCollection& newServerList, bool mustReplaceAll, bool nameChange, bool isRecursive) override ;
66
67 void printCompactTreeHook(std::ostream& os, const char* indent="") override ;
68
69 RooNumIntConfig _convIntConfig ; ///< Configuration of numeric convolution integral ;
70 mutable RooConvIntegrandBinding* _integrand ; ///<! Binding of Convolution Integrand function
71 mutable std::unique_ptr<RooAbsIntegrator> _integrator ; ///<! Numeric integrator of convolution integrand
72
73 RooRealProxy _origVar ; ///< Original convolution variable
74 RooRealProxy _origPdf ; ///< Original input PDF
75 RooRealProxy _origModel ; ///< Original resolution model
76
77 mutable RooArgSet _ownedClonedPdfSet ; ///< Owning set of cloned PDF components
78 mutable RooArgSet _ownedClonedModelSet ; ///< Owning set of cloned model components
79
80 mutable RooAbsReal* _cloneVar ; ///< Pointer to cloned convolution variable
81 mutable RooAbsReal* _clonePdf ; ///< Pointer to cloned PDF
82 mutable RooAbsReal* _cloneModel ; ///< Pointer to cloned model
83
84 friend class RooConvGenContext ;
85 RooRealVar& cloneVar() const { if (!_init) initialize() ; return (RooRealVar&) *_cloneVar ; }
86 RooAbsReal& clonePdf() const { if (!_init) initialize() ; return (RooAbsReal&) *_clonePdf ; }
87 RooAbsReal& cloneModel() const { if (!_init) initialize() ; return (RooAbsReal&) *_cloneModel ; }
88
89 bool _useWindow ; ///< Switch to activate window convolution
90 double _windowScale ; ///< Scale factor for window parameter
91 RooListProxy _windowParam ; ///< Holder for optional convolution integration window scaling parameter
92
93 Int_t _verboseThresh ; ///< Call count threshold for verbose printing
94 bool _doProf ; ///< Switch to activate profiling option
95 TH2* _callHist ; ///<! Histogram recording number of calls per convolution integral calculation
96
97 ClassDefOverride(RooNumConvolution,1) // Operator PDF implementing numeric convolution of 2 input functions
98};
99
100#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
static void indent(ostringstream &buf, int indent_level)
char name[80]
Definition TGX11.cxx:110
const char * proto
Definition civetweb.c:17535
Abstract container object that can hold multiple RooAbsArg objects.
Abstract interface for integrators of real-valued functions that implement the RooAbsFunc interface.
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Efficient implementation of the generator context specific for RooAbsAnaConvPdf objects.
Implementation of RooAbsFunc that represent the integrand of a generic (numeric) convolution A (x) B ...
Numeric 1-dimensional convolution operator PDF.
Numeric 1-dimensional convolution operator PDF.
void clearConvolutionWindow()
Removes previously defined convolution window, reverting to convolution from -inf to +inf.
RooArgSet _ownedClonedModelSet
Owning set of cloned model components.
const TH2 * profileData() const
std::unique_ptr< RooAbsIntegrator > _integrator
! Numeric integrator of convolution integrand
RooAbsReal * _cloneModel
Pointer to cloned model.
void setCallProfiling(bool flag, Int_t nbinX=40, Int_t nbinCall=40, Int_t nCallHigh=1000)
Activate call profile if flag is set to true.
~RooNumConvolution() override
Destructor.
bool redirectServersHook(const RooAbsCollection &newServerList, bool mustReplaceAll, bool nameChange, bool isRecursive) override
Intercept server redirects. Throw away cache, as figuring out redirections on the cache is an unsolva...
void initialize() const
One-time initialization of object.
RooRealProxy _origVar
Original convolution variable.
Int_t _verboseThresh
Call count threshold for verbose printing.
RooConvIntegrandBinding * _integrand
! Binding of Convolution Integrand function
TObject * clone(const char *newname) const override
RooRealProxy _origPdf
Original input PDF.
RooAbsReal & cloneModel() const
void printCompactTreeHook(std::ostream &os, const char *indent="") override
Hook function to intercept printCompactTree() calls so that it can print out the content of its priva...
double evaluate() const override
Calculate convolution integral.
RooRealVar & cloneVar() const
RooListProxy _windowParam
Holder for optional convolution integration window scaling parameter.
const RooNumIntConfig & convIntConfig() const
double _windowScale
Scale factor for window parameter.
RooArgSet _ownedClonedPdfSet
Owning set of cloned PDF components.
RooRealVar & var() const
bool _doProf
Switch to activate profiling option.
RooAbsReal * _cloneVar
Pointer to cloned convolution variable.
RooRealProxy _origModel
Original resolution model.
RooAbsReal * _clonePdf
Pointer to cloned PDF.
RooNumIntConfig & convIntConfig()
void setCallWarning(Int_t threshold=2000)
Activate warning messages if number of function calls needed for evaluation of convolution integral e...
RooNumIntConfig _convIntConfig
Configuration of numeric convolution integral ;.
RooAbsReal & model() const
RooAbsReal & pdf() const
TH2 * _callHist
! Histogram recording number of calls per convolution integral calculation
bool _useWindow
Switch to activate window convolution.
void setConvolutionWindow(RooAbsReal &centerParam, RooAbsReal &widthParam, double widthScaleFactor=1)
Restrict convolution integral to finite range [ x - C - S*W, x - C + S*W ] where x is current value o...
RooAbsReal & clonePdf() const
Holds the configuration parameters of the various numeric integrators used by RooRealIntegral.
Variable that can be changed from the outside.
Definition RooRealVar.h:37
const T & arg() const
Return reference to object held in proxy.
Service class for 2-D histogram classes.
Definition TH2.h:30
Mother of all ROOT objects.
Definition TObject.h:41