Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooNumConvPdf.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: RooNumConvPdf.h,v 1.2 2007/05/11 10:42:36 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_CONV_PDF
0017 #define ROO_NUM_CONV_PDF
0018 
0019 #include "RooAbsPdf.h"
0020 #include "RooNumConvolution.h"
0021 
0022 class TH2 ;
0023 class RooArgSet ;
0024 class RooDataSet ;
0025 
0026 class RooNumConvPdf : public RooAbsPdf {
0027 public:
0028 
0029   RooNumConvPdf() ;
0030 
0031   RooNumConvPdf(const char *name, const char *title,
0032                 RooRealVar& convVar, RooAbsPdf& pdf, RooAbsPdf& resmodel) ;
0033 
0034   RooNumConvPdf(const RooNumConvPdf& other, const char* name=nullptr) ;
0035 
0036   TObject* clone(const char* newname) const override { return new RooNumConvPdf(*this,newname) ; }
0037   ~RooNumConvPdf() override ;
0038 
0039   double evaluate() const override ;
0040 
0041   // Calls forwarded to RooNumConvolution
0042   inline RooNumIntConfig& convIntConfig() { return conv().convIntConfig() ; }
0043   inline void clearConvolutionWindow() { conv().clearConvolutionWindow() ; }
0044   inline void setConvolutionWindow(RooAbsReal& centerParam, RooAbsReal& widthParam, double widthScaleFactor=1)
0045    { conv().setConvolutionWindow(centerParam,widthParam,widthScaleFactor) ; }
0046   inline void setCallWarning(Int_t threshold=2000) { conv().setCallWarning(threshold) ; }
0047   inline void setCallProfiling(bool flag, Int_t nbinX = 40, Int_t nbinCall = 40, Int_t nCallHigh=1000)
0048    { conv().setCallProfiling(flag,nbinX,nbinCall,nCallHigh) ; }
0049   inline const TH2* profileData() const { return conv().profileData() ; }
0050 
0051   // Access components
0052   RooRealVar&  var() const { return (RooRealVar&)(const_cast<RooAbsReal&>(_origVar.arg())) ; }
0053   RooAbsReal&  pdf() const { return const_cast<RooAbsReal&>(_origPdf.arg()) ; }
0054   RooAbsReal&  model() const { return const_cast<RooAbsReal&>(_origModel.arg()) ; }
0055 
0056   void printMetaArgs(std::ostream& os) const override ;
0057 
0058 protected:
0059 
0060   // WVE Store all properties of RooNumConvolution here so that can be take
0061   // along in the copy constructor.
0062 
0063   RooNumConvolution& conv() const { if (!_init) initialize() ; return *_conv ; }
0064 
0065   mutable bool _init = false; ///<! do not persist
0066   void initialize() const ;
0067   mutable std::unique_ptr<RooNumConvolution> _conv ; ///<! Actual convolution calculation
0068 
0069   RooRealProxy _origVar ;         ///< Original convolution variable
0070   RooRealProxy _origPdf ;         ///< Original input PDF
0071   RooRealProxy _origModel ;       ///< Original resolution model
0072 
0073   RooAbsGenContext* genContext(const RooArgSet &vars, const RooDataSet *prototype=nullptr,
0074                                        const RooArgSet* auxProto=nullptr, bool verbose= false) const override ;
0075 
0076   friend class RooConvGenContext ;
0077 
0078   ClassDefOverride(RooNumConvPdf,1)     // Operator PDF implementing numeric convolution of 2 input PDFs
0079 };
0080 
0081 #endif