Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooNumConvolution.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitCore                                                       *
0004  *    File: $Id: RooNumConvolution.h,v 1.4 2007/05/11 09:11:30 verkerke Exp $
0005  * Authors:                                                                  *
0006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
0007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
0008  *                                                                           *
0009  * Copyright (c) 2000-2005, Regents of the University of California          *
0010  *                          and Stanford University. All rights reserved.    *
0011  *                                                                           *
0012  * Redistribution and use in source and binary forms,                        *
0013  * with or without modification, are permitted according to the terms        *
0014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0015  *****************************************************************************/
0016 #ifndef ROO_NUM_CONVOLUTION
0017 #define ROO_NUM_CONVOLUTION
0018 
0019 #include "RooAbsPdf.h"
0020 #include "RooRealProxy.h"
0021 #include "RooSetProxy.h"
0022 #include "RooListProxy.h"
0023 #include "RooNumIntConfig.h"
0024 
0025 class RooConvIntegrandBinding ;
0026 class RooAbsIntegrator ;
0027 class TH2 ;
0028 
0029 class RooNumConvolution : public RooAbsReal {
0030 public:
0031 
0032   RooNumConvolution() ;
0033 
0034   RooNumConvolution(const char *name, const char *title,
0035             RooRealVar& convVar, RooAbsReal& pdf, RooAbsReal& resmodel, const RooNumConvolution* proto=nullptr) ;
0036 
0037   RooNumConvolution(const RooNumConvolution& other, const char* name=nullptr) ;
0038 
0039   TObject* clone(const char* newname) const override { return new RooNumConvolution(*this,newname) ; }
0040   ~RooNumConvolution() override ;
0041 
0042   double evaluate() const override ;
0043 
0044   RooNumIntConfig& convIntConfig() { _init = false ; return _convIntConfig ; }
0045   const RooNumIntConfig& convIntConfig() const { _init = false ; return _convIntConfig ; }
0046 
0047   void clearConvolutionWindow() ;
0048   void setConvolutionWindow(RooAbsReal& centerParam, RooAbsReal& widthParam, double widthScaleFactor=1) ;
0049 
0050   void setCallWarning(Int_t threshold=2000) ;
0051   void setCallProfiling(bool flag, Int_t nbinX = 40, Int_t nbinCall = 40, Int_t nCallHigh=1000) ;
0052   const TH2* profileData() const { return _doProf ? _callHist : nullptr ; }
0053 
0054   // Access components
0055   RooRealVar&  var() const { return (RooRealVar&) _origVar.arg() ; }
0056   RooAbsReal&  pdf() const { return (RooAbsReal&) _origPdf.arg() ; }
0057   RooAbsReal&  model() const { return (RooAbsReal&) _origModel.arg() ; }
0058 
0059 protected:
0060 
0061   friend class RooNumConvPdf ;
0062 
0063   mutable bool _init ;
0064   void initialize() const ;
0065   bool redirectServersHook(const RooAbsCollection& newServerList, bool mustReplaceAll, bool nameChange, bool isRecursive) override ;
0066 
0067   void printCompactTreeHook(std::ostream& os, const char* indent="") override ;
0068 
0069   RooNumIntConfig _convIntConfig ; ///< Configuration of numeric convolution integral ;
0070   mutable RooConvIntegrandBinding* _integrand ; ///<! Binding of Convolution Integrand function
0071   mutable std::unique_ptr<RooAbsIntegrator> _integrator ;  ///<! Numeric integrator of convolution integrand
0072 
0073   RooRealProxy _origVar ;         ///< Original convolution variable
0074   RooRealProxy _origPdf ;         ///< Original input PDF
0075   RooRealProxy _origModel ;       ///< Original resolution model
0076 
0077   mutable RooArgSet    _ownedClonedPdfSet ;   ///< Owning set of cloned PDF components
0078   mutable RooArgSet    _ownedClonedModelSet ; ///< Owning set of cloned model components
0079 
0080   mutable RooAbsReal*  _cloneVar ;        ///< Pointer to cloned convolution variable
0081   mutable RooAbsReal*  _clonePdf ;        ///< Pointer to cloned PDF
0082   mutable RooAbsReal*  _cloneModel ;      ///< Pointer to cloned model
0083 
0084   friend class RooConvGenContext ;
0085   RooRealVar&  cloneVar()   const { if (!_init) initialize() ; return (RooRealVar&) *_cloneVar ; }
0086   RooAbsReal&   clonePdf()   const { if (!_init) initialize() ; return (RooAbsReal&)  *_clonePdf ; }
0087   RooAbsReal&   cloneModel() const { if (!_init) initialize() ; return (RooAbsReal&)  *_cloneModel ; }
0088 
0089   bool       _useWindow   ;     ///< Switch to activate window convolution
0090   double     _windowScale ;     ///< Scale factor for window parameter
0091   RooListProxy _windowParam ;     ///< Holder for optional convolution integration window scaling parameter
0092 
0093   Int_t        _verboseThresh ;   ///< Call count threshold for verbose printing
0094   bool       _doProf   ;        ///< Switch to activate profiling option
0095   TH2*         _callHist ;        ///<! Histogram recording number of calls per convolution integral calculation
0096 
0097   ClassDefOverride(RooNumConvolution,1)   // Operator PDF implementing numeric convolution of 2 input functions
0098 };
0099 
0100 #endif