RooNumConvolution.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooNumConvolution.h,v 1.4 2007/05/11 09:11:30 verkerke Exp $
00005  * Authors:                                                                  *
00006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
00007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
00008  *                                                                           *
00009  * Copyright (c) 2000-2005, Regents of the University of California          *
00010  *                          and Stanford University. All rights reserved.    *
00011  *                                                                           *
00012  * Redistribution and use in source and binary forms,                        *
00013  * with or without modification, are permitted according to the terms        *
00014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
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   // Access components
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 ; // Configuration of numeric convolution integral ;
00070   mutable RooConvIntegrandBinding* _integrand ; //! Binding of Convolution Integrand function
00071   mutable RooAbsIntegrator* _integrator ;  //! Numeric integrator of convolution integrand
00072 
00073   RooRealProxy _origVar ;         // Original convolution variable
00074   RooRealProxy _origPdf ;         // Original input PDF
00075   RooRealProxy _origModel ;       // Original resolution model
00076 
00077   mutable RooArgSet    _ownedClonedPdfSet ;   // Owning set of cloned PDF components
00078   mutable RooArgSet    _ownedClonedModelSet ; // Owning set of cloned model components
00079 
00080   mutable RooAbsReal*  _cloneVar ;        // Pointer to cloned convolution variable
00081   mutable RooAbsReal*  _clonePdf ;        // Pointer to cloned PDF 
00082   mutable RooAbsReal*  _cloneModel ;      // Pointer to cloned model
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   ;     // Switch to activate window convolution
00090   Double_t     _windowScale ;     // Scale factor for window parameter
00091   RooListProxy _windowParam ;     // Holder for optional convolution integration window scaling parameter
00092 
00093   Int_t        _verboseThresh ;   // Call count threshold for verbose printing
00094   Bool_t       _doProf   ;        // Switch to activate profiling option
00095   TH2*         _callHist ;        //! Histogram recording number of calls per convolution integral calculation
00096 
00097   ClassDef(RooNumConvolution,1)   // Operator PDF implementing numeric convolution of 2 input functions
00098 };
00099 
00100 #endif

Generated on Tue Jul 5 14:26:15 2011 for ROOT_528-00b_version by  doxygen 1.5.1