Logo ROOT  
Reference Guide
RooNumConvPdf.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooNumConvPdf.h,v 1.2 2007/05/11 10:42:36 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_CONV_PDF
17 #define ROO_NUM_CONV_PDF
18 
19 #include "RooAbsPdf.h"
20 #include "RooNumConvolution.h"
21 
22 class TH2 ;
23 class RooArgSet ;
24 class RooDataSet ;
25 
26 class RooNumConvPdf : public RooAbsPdf {
27 public:
28 
29  RooNumConvPdf() ;
30 
31  RooNumConvPdf(const char *name, const char *title,
32  RooRealVar& convVar, RooAbsPdf& pdf, RooAbsPdf& resmodel) ;
33 
34  RooNumConvPdf(const RooNumConvPdf& other, const char* name=0) ;
35 
36  virtual TObject* clone(const char* newname) const { return new RooNumConvPdf(*this,newname) ; }
37  virtual ~RooNumConvPdf() ;
38 
39  virtual Double_t evaluate() const ;
40 
41  // Calls forwarded to RooNumConvolution
42  inline RooNumIntConfig& convIntConfig() { return conv().convIntConfig() ; }
44  inline void setConvolutionWindow(RooAbsReal& centerParam, RooAbsReal& widthParam, Double_t widthScaleFactor=1)
45  { conv().setConvolutionWindow(centerParam,widthParam,widthScaleFactor) ; }
46  inline void setCallWarning(Int_t threshold=2000) { conv().setCallWarning(threshold) ; }
47  inline void setCallProfiling(Bool_t flag, Int_t nbinX = 40, Int_t nbinCall = 40, Int_t nCallHigh=1000)
48  { conv().setCallProfiling(flag,nbinX,nbinCall,nCallHigh) ; }
49  inline const TH2* profileData() const { return conv().profileData() ; }
50 
51  // Access components
52  RooRealVar& var() const { return (RooRealVar&)(const_cast<RooAbsReal&>(_origVar.arg())) ; }
53  RooAbsReal& pdf() const { return const_cast<RooAbsReal&>(_origPdf.arg()) ; }
54  RooAbsReal& model() const { return const_cast<RooAbsReal&>(_origModel.arg()) ; }
55 
56  void printMetaArgs(std::ostream& os) const ;
57 
58 protected:
59 
60  // WVE Store all properties of RooNumConvolution here so that can be take
61  // along in the copy ctor.
62 
63  RooNumConvolution& conv() const { if (!_init) initialize() ; return *_conv ; }
64 
65  mutable Bool_t _init ; //! do not persist
66  void initialize() const ;
67  mutable RooNumConvolution* _conv ; //! Actual convolution calculation
68 
69  RooRealProxy _origVar ; // Original convolution variable
70  RooRealProxy _origPdf ; // Original input PDF
71  RooRealProxy _origModel ; // Original resolution model
72 
73  virtual RooAbsGenContext* genContext(const RooArgSet &vars, const RooDataSet *prototype=0,
74  const RooArgSet* auxProto=0, Bool_t verbose= kFALSE) const ;
75 
76  friend class RooConvGenContext ;
77 
78  ClassDef(RooNumConvPdf,1) // Operator PDF implementing numeric convolution of 2 input PDFs
79 };
80 
81 #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
RooNumConvPdf::setConvolutionWindow
void setConvolutionWindow(RooAbsReal &centerParam, RooAbsReal &widthParam, Double_t widthScaleFactor=1)
Definition: RooNumConvPdf.h:44
RooNumConvPdf::_init
Bool_t _init
Definition: RooNumConvPdf.h:65
RooTemplateProxy::arg
const T & arg() const
Return reference to object held in proxy.
Definition: RooTemplateProxy.h:259
RooNumConvPdf::printMetaArgs
void printMetaArgs(std::ostream &os) const
Customized printing of arguments of a RooNumConvPdf to more intuitively reflect the contents of the p...
Definition: RooNumConvPdf.cxx:223
RooNumConvPdf::convIntConfig
RooNumIntConfig & convIntConfig()
Definition: RooNumConvPdf.h:42
RooNumConvPdf::conv
RooNumConvolution & conv() const
Definition: RooNumConvPdf.h:63
RooNumConvPdf::setCallProfiling
void setCallProfiling(Bool_t flag, Int_t nbinX=40, Int_t nbinCall=40, Int_t nCallHigh=1000)
Definition: RooNumConvPdf.h:47
RooNumConvolution::convIntConfig
RooNumIntConfig & convIntConfig()
Definition: RooNumConvolution.h:44
RooNumConvPdf::_origPdf
RooRealProxy _origPdf
Definition: RooNumConvPdf.h:70
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
RooNumConvPdf::_origVar
RooRealProxy _origVar
Actual convolution calculation.
Definition: RooNumConvPdf.h:69
RooNumConvolution::profileData
const TH2 * profileData() const
Definition: RooNumConvolution.h:52
RooNumConvPdf::_origModel
RooRealProxy _origModel
Definition: RooNumConvPdf.h:71
RooNumConvPdf::var
RooRealVar & var() const
Definition: RooNumConvPdf.h:52
RooNumConvPdf::RooNumConvPdf
RooNumConvPdf()
Definition: RooNumConvPdf.cxx:86
bool
RooNumConvolution
Numeric 1-dimensional convolution operator PDF.
Definition: RooNumConvolution.h:29
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
RooNumConvPdf::profileData
const TH2 * profileData() const
Definition: RooNumConvPdf.h:49
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
TH2
Service class for 2-Dim histogram classes.
Definition: TH2.h:30
RooNumConvPdf::~RooNumConvPdf
virtual ~RooNumConvPdf()
Destructor.
Definition: RooNumConvPdf.cxx:141
RooAbsGenContext
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
Definition: RooAbsGenContext.h:26
RooNumConvPdf::_conv
RooNumConvolution * _conv
Definition: RooNumConvPdf.h:67
RooNumConvPdf::clone
virtual TObject * clone(const char *newname) const
Definition: RooNumConvPdf.h:36
RooTemplateProxy< RooAbsReal >
Double_t
double Double_t
Definition: RtypesCore.h:59
RooNumConvolution.h
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooNumConvPdf::evaluate
virtual Double_t evaluate() const
Calculate and return value of p.d.f.
Definition: RooNumConvPdf.cxx:153
RooNumConvPdf
Numeric 1-dimensional convolution operator PDF.
Definition: RooNumConvPdf.h:26
name
char name[80]
Definition: TGX11.cxx:110
RooNumConvPdf::clearConvolutionWindow
void clearConvolutionWindow()
Definition: RooNumConvPdf.h:43
RooNumConvPdf::model
RooAbsReal & model() const
Definition: RooNumConvPdf.h:54
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooDataSet
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:33
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
RooAbsPdf
Definition: RooAbsPdf.h:43
RooNumConvPdf::initialize
void initialize() const
do not persist
Definition: RooNumConvPdf.cxx:165
RooNumConvPdf::setCallWarning
void setCallWarning(Int_t threshold=2000)
Definition: RooNumConvPdf.h:46
RooRealVar
RooRealVar represents a variable that can be changed from the outside.
Definition: RooRealVar.h:39
RooNumConvPdf::pdf
RooAbsReal & pdf() const
Definition: RooNumConvPdf.h:53
RooNumConvPdf::genContext
virtual RooAbsGenContext * genContext(const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t verbose=kFALSE) const
Return appropriate generator context for this convolved p.d.f.
Definition: RooNumConvPdf.cxx:190
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:29
int