00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef ROO_NUM_CONVOLUTION
00017 #define ROO_NUM_CONVOLUTION
00018
00019 #include "RooAbsPdf.h"
00020 #include "RooRealProxy.h"
00021 #include "RooSetProxy.h"
00022 #include "RooListProxy.h"
00023 #include "RooNumIntConfig.h"
00024
00025 class RooConvIntegrandBinding ;
00026 class RooAbsIntegrator ;
00027 class TH2 ;
00028
00029 class RooNumConvolution : public RooAbsReal {
00030 public:
00031
00032 RooNumConvolution() ;
00033
00034 RooNumConvolution(const char *name, const char *title,
00035 RooRealVar& convVar, RooAbsReal& pdf, RooAbsReal& resmodel, const RooNumConvolution* proto=0) ;
00036
00037 RooNumConvolution(const RooNumConvolution& other, const char* name=0) ;
00038
00039 virtual TObject* clone(const char* newname) const { return new RooNumConvolution(*this,newname) ; }
00040 virtual ~RooNumConvolution() ;
00041
00042 Double_t evaluate() const ;
00043
00044 RooNumIntConfig& convIntConfig() { _init = kFALSE ; return _convIntConfig ; }
00045 const RooNumIntConfig& convIntConfig() const { _init = kFALSE ; return _convIntConfig ; }
00046
00047 void clearConvolutionWindow() ;
00048 void setConvolutionWindow(RooAbsReal& centerParam, RooAbsReal& widthParam, Double_t widthScaleFactor=1) ;
00049
00050 void setCallWarning(Int_t threshold=2000) ;
00051 void setCallProfiling(Bool_t flag, Int_t nbinX = 40, Int_t nbinCall = 40, Int_t nCallHigh=1000) ;
00052 const TH2* profileData() const { return _doProf ? _callHist : 0 ; }
00053
00054
00055 RooRealVar& var() const { return (RooRealVar&) _origVar.arg() ; }
00056 RooAbsReal& pdf() const { return (RooAbsReal&) _origPdf.arg() ; }
00057 RooAbsReal& model() const { return (RooAbsReal&) _origModel.arg() ; }
00058
00059 protected:
00060
00061 friend class RooNumConvPdf ;
00062
00063 mutable Bool_t _init ;
00064 void initialize() const ;
00065 Bool_t redirectServersHook(const RooAbsCollection& newServerList, Bool_t mustReplaceAll, Bool_t nameChange, Bool_t isRecursive) ;
00066
00067 virtual void printCompactTreeHook(ostream& os, const char* indent="") ;
00068
00069 RooNumIntConfig _convIntConfig ;
00070 mutable RooConvIntegrandBinding* _integrand ;
00071 mutable RooAbsIntegrator* _integrator ;
00072
00073 RooRealProxy _origVar ;
00074 RooRealProxy _origPdf ;
00075 RooRealProxy _origModel ;
00076
00077 mutable RooArgSet _ownedClonedPdfSet ;
00078 mutable RooArgSet _ownedClonedModelSet ;
00079
00080 mutable RooAbsReal* _cloneVar ;
00081 mutable RooAbsReal* _clonePdf ;
00082 mutable RooAbsReal* _cloneModel ;
00083
00084 friend class RooConvGenContext ;
00085 RooRealVar& cloneVar() const { if (!_init) initialize() ; return (RooRealVar&) *_cloneVar ; }
00086 RooAbsReal& clonePdf() const { if (!_init) initialize() ; return (RooAbsReal&) *_clonePdf ; }
00087 RooAbsReal& cloneModel() const { if (!_init) initialize() ; return (RooAbsReal&) *_cloneModel ; }
00088
00089 Bool_t _useWindow ;
00090 Double_t _windowScale ;
00091 RooListProxy _windowParam ;
00092
00093 Int_t _verboseThresh ;
00094 Bool_t _doProf ;
00095 TH2* _callHist ;
00096
00097 ClassDef(RooNumConvolution,1)
00098 };
00099
00100 #endif