Logo ROOT  
Reference Guide
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 
26 class RooAbsIntegrator ;
27 class TH2 ;
28 
29 class RooNumConvolution : public RooAbsReal {
30 public:
31 
33 
34  RooNumConvolution(const char *name, const char *title,
35  RooRealVar& convVar, RooAbsReal& pdf, RooAbsReal& resmodel, const RooNumConvolution* proto=0) ;
36 
37  RooNumConvolution(const RooNumConvolution& other, const char* name=0) ;
38 
39  virtual TObject* clone(const char* newname) const { return new RooNumConvolution(*this,newname) ; }
40  virtual ~RooNumConvolution() ;
41 
42  Double_t evaluate() const ;
43 
45  const RooNumIntConfig& convIntConfig() const { _init = kFALSE ; return _convIntConfig ; }
46 
47  void clearConvolutionWindow() ;
48  void setConvolutionWindow(RooAbsReal& centerParam, RooAbsReal& widthParam, Double_t widthScaleFactor=1) ;
49 
50  void setCallWarning(Int_t threshold=2000) ;
51  void setCallProfiling(Bool_t flag, Int_t nbinX = 40, Int_t nbinCall = 40, Int_t nCallHigh=1000) ;
52  const TH2* profileData() const { return _doProf ? _callHist : 0 ; }
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 
59 protected:
60 
61  friend class RooNumConvPdf ;
62 
63  mutable Bool_t _init ;
64  void initialize() const ;
65  Bool_t redirectServersHook(const RooAbsCollection& newServerList, Bool_t mustReplaceAll, Bool_t nameChange, Bool_t isRecursive) ;
66 
67  virtual void printCompactTreeHook(std::ostream& os, const char* indent="") ;
68 
69  RooNumIntConfig _convIntConfig ; // Configuration of numeric convolution integral ;
70  mutable RooConvIntegrandBinding* _integrand ; //! Binding of Convolution Integrand function
71  mutable 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_t _useWindow ; // Switch to activate window convolution
90  Double_t _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_t _doProf ; // Switch to activate profiling option
95  TH2* _callHist ; //! Histogram recording number of calls per convolution integral calculation
96 
97  ClassDef(RooNumConvolution,1) // Operator PDF implementing numeric convolution of 2 input functions
98 };
99 
100 #endif
RooNumConvolution::setCallProfiling
void setCallProfiling(Bool_t flag, Int_t nbinX=40, Int_t nbinCall=40, Int_t nCallHigh=1000)
Activate call profile if flag is set to true.
Definition: RooNumConvolution.cxx:330
RooNumConvolution::_useWindow
Bool_t _useWindow
Definition: RooNumConvolution.h:89
RooNumConvolution::_convIntConfig
RooNumIntConfig _convIntConfig
Definition: RooNumConvolution.h:69
RooNumConvolution::cloneModel
RooAbsReal & cloneModel() const
Definition: RooNumConvolution.h:87
RooNumIntConfig.h
RooTemplateProxy::arg
const T & arg() const
Return reference to object held in proxy.
Definition: RooTemplateProxy.h:259
RooNumConvolution::_origModel
RooRealProxy _origModel
Definition: RooNumConvolution.h:75
RooNumConvolution::clone
virtual TObject * clone(const char *newname) const
Definition: RooNumConvolution.h:39
RooNumConvolution::convIntConfig
RooNumIntConfig & convIntConfig()
Definition: RooNumConvolution.h:44
RooNumConvolution::_cloneModel
RooAbsReal * _cloneModel
Definition: RooNumConvolution.h:82
RooNumConvolution::initialize
void initialize() const
One-time initialization of object.
Definition: RooNumConvolution.cxx:176
RooNumConvolution::~RooNumConvolution
virtual ~RooNumConvolution()
Destructor.
Definition: RooNumConvolution.cxx:220
indent
static void indent(ostringstream &buf, int indent_level)
Definition: TClingCallFunc.cxx:87
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
RooNumConvolution::_callHist
TH2 * _callHist
Definition: RooNumConvolution.h:95
RooSetProxy.h
RooNumConvolution::profileData
const TH2 * profileData() const
Definition: RooNumConvolution.h:52
RooNumConvolution::clonePdf
RooAbsReal & clonePdf() const
Definition: RooNumConvolution.h:86
bool
RooNumConvolution::evaluate
Double_t evaluate() const
Calculate convolution integral.
Definition: RooNumConvolution.cxx:229
RooNumConvolution
Numeric 1-dimensional convolution operator PDF.
Definition: RooNumConvolution.h:29
RooNumConvolution::_clonePdf
RooAbsReal * _clonePdf
Definition: RooNumConvolution.h:81
RooNumConvolution::pdf
RooAbsReal & pdf() const
Definition: RooNumConvolution.h:56
RooAbsPdf.h
RooConvGenContext
RooConvGenContext is an efficient implementation of the generator context specific for RooAbsAnaConvP...
Definition: RooConvGenContext.h:31
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooNumConvolution::setCallWarning
void setCallWarning(Int_t threshold=2000)
Activate warning messages if number of function calls needed for evaluation of convolution integral e...
Definition: RooNumConvolution.cxx:308
RooRealProxy.h
TH2
Service class for 2-Dim histogram classes.
Definition: TH2.h:30
RooNumConvolution::_integrand
RooConvIntegrandBinding * _integrand
Definition: RooNumConvolution.h:70
RooAbsCollection
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
Definition: RooAbsCollection.h:31
RooNumConvolution::model
RooAbsReal & model() const
Definition: RooNumConvolution.h:57
RooConvIntegrandBinding
Implementation of RooAbsFunc that represent the the integrand of a generic (numeric) convolution A (x...
Definition: RooConvIntegrandBinding.h:25
RooListProxy
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:24
RooNumConvolution::var
RooRealVar & var() const
Definition: RooNumConvolution.h:55
proto
const char * proto
Definition: civetweb.c:16604
RooNumConvolution::redirectServersHook
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 unsolva...
Definition: RooNumConvolution.cxx:268
RooListProxy.h
RooTemplateProxy< RooAbsReal >
Double_t
double Double_t
Definition: RtypesCore.h:59
RooNumConvolution::_windowScale
Double_t _windowScale
Definition: RooNumConvolution.h:90
RooNumConvolution::_ownedClonedModelSet
RooArgSet _ownedClonedModelSet
Definition: RooNumConvolution.h:78
RooNumConvolution::cloneVar
RooRealVar & cloneVar() const
Definition: RooNumConvolution.h:85
RooNumConvolution::_origPdf
RooRealProxy _origPdf
Definition: RooNumConvolution.h:74
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooNumConvolution::_init
Bool_t _init
Definition: RooNumConvolution.h:63
RooNumConvPdf
Numeric 1-dimensional convolution operator PDF.
Definition: RooNumConvPdf.h:26
name
char name[80]
Definition: TGX11.cxx:110
RooNumConvolution::setConvolutionWindow
void setConvolutionWindow(RooAbsReal &centerParam, RooAbsReal &widthParam, Double_t widthScaleFactor=1)
Restrict convolution integral to finite range [ x - C - S*W, x - C + S*W ] where x is current value o...
Definition: RooNumConvolution.cxx:293
RooNumConvolution::clearConvolutionWindow
void clearConvolutionWindow()
Removes previously defined convolution window, reverting to convolution from -inf to +inf.
Definition: RooNumConvolution.cxx:280
RooNumIntConfig
RooNumIntConfig holds the configuration parameters of the various numeric integrators used by RooReal...
Definition: RooNumIntConfig.h:25
RooNumConvolution::RooNumConvolution
RooNumConvolution()
Definition: RooNumConvolution.cxx:83
RooNumConvolution::convIntConfig
const RooNumIntConfig & convIntConfig() const
Definition: RooNumConvolution.h:45
RooNumConvolution::_verboseThresh
Int_t _verboseThresh
Definition: RooNumConvolution.h:93
RooAbsIntegrator
RooAbsIntegrator is the abstract interface for integrators of real-valued functions that implement th...
Definition: RooAbsIntegrator.h:22
RooNumConvolution::_ownedClonedPdfSet
RooArgSet _ownedClonedPdfSet
Definition: RooNumConvolution.h:77
RooNumConvolution::printCompactTreeHook
virtual void printCompactTreeHook(std::ostream &os, const char *indent="")
Hook function to intercept printCompactTree() calls so that it can print out the content of its priva...
Definition: RooNumConvolution.cxx:356
RooRealVar
RooRealVar represents a variable that can be changed from the outside.
Definition: RooRealVar.h:39
RooNumConvolution::_windowParam
RooListProxy _windowParam
Definition: RooNumConvolution.h:91
RooNumConvolution::_cloneVar
RooAbsReal * _cloneVar
Definition: RooNumConvolution.h:80
RooNumConvolution::_integrator
RooAbsIntegrator * _integrator
Binding of Convolution Integrand function.
Definition: RooNumConvolution.h:71
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:29
RooNumConvolution::_doProf
Bool_t _doProf
Definition: RooNumConvolution.h:94
RooNumConvolution::_origVar
RooRealProxy _origVar
Numeric integrator of convolution integrand.
Definition: RooNumConvolution.h:73
int