Logo ROOT  
Reference Guide
RooFunctorBinding.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id$
5  * Authors: *
6  * WV, Wouter Verkerke, NIKHEF, verkerke@nikhef.nl *
7  * *
8  * Copyright (c) 2000-2008, NIKHEF, Regents of the University of California *
9  * and Stanford University. All rights reserved. *
10  * *
11  *****************************************************************************/
12 
13 #ifndef ROOFUNCTORBINDING
14 #define ROOFUNCTORBINDING
15 
16 #include "RooAbsReal.h"
17 #include "RooArgList.h"
18 #include "RooListProxy.h"
19 #include "RooAbsPdf.h"
20 #include "RooRealProxy.h"
21 #include "RooMsgService.h"
22 #include "Math/IFunction.h"
23 
24 namespace RooFit {
25 
26 RooAbsReal* bindFunction(const char* name, const ROOT::Math::IBaseFunctionMultiDim& ftor,const RooArgList& vars) ;
27 RooAbsPdf* bindPdf(const char* name, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars) ;
28 
29 }
30 
31 class RooFunctorBinding : public RooAbsReal {
32 public:
33  RooFunctorBinding() : func(0), x(0) {
34  // Default constructor
35  } ;
36  RooFunctorBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars);
37  RooFunctorBinding(const RooFunctorBinding& other, const char* name=0) ;
38  virtual TObject* clone(const char* newname) const { return new RooFunctorBinding(*this,newname); }
39  inline virtual ~RooFunctorBinding() { delete[] x ; }
40  void printArgs(std::ostream& os) const ;
41 
42 protected:
43 
44  Double_t evaluate() const ;
45 
47  RooListProxy vars ; // Argument reference
48  Double_t* x ; // Argument value array
49 
50 
51 private:
52 
53  ClassDef(RooFunctorBinding,1) // RooAbsReal binding to a ROOT::Math::IBaseFunctionMultiDim
54 };
55 
56 
57 
59 public:
61  // Default constructor
62  } ;
63  RooFunctorPdfBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars);
64  RooFunctorPdfBinding(const RooFunctorPdfBinding& other, const char* name=0) ;
65  virtual TObject* clone(const char* newname) const { return new RooFunctorPdfBinding(*this,newname); }
66  inline virtual ~RooFunctorPdfBinding() { delete[] x ; }
67  void printArgs(std::ostream& os) const ;
68 
69 protected:
70 
71  Double_t evaluate() const ;
72 
74  RooListProxy vars ; // Argument reference
75  Double_t* x ; // Argument value array
76 
77 
78 private:
79 
80  ClassDef(RooFunctorPdfBinding,1) // RooAbsPdf binding to a ROOT::Math::IBaseFunctionMultiDim
81 };
82 
83 
84 #endif
RooFunctorBinding::~RooFunctorBinding
virtual ~RooFunctorBinding()
Definition: RooFunctorBinding.h:39
RooFunctorPdfBinding::clone
virtual TObject * clone(const char *newname) const
Definition: RooFunctorBinding.h:65
RooFunctorBinding::printArgs
void printArgs(std::ostream &os) const
Print object arguments, ie its proxies.
Definition: RooFunctorBinding.cxx:82
RooAbsReal.h
RooMsgService.h
IFunction.h
RooArgList
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
RooFunctorBinding::x
Double_t * x
Definition: RooFunctorBinding.h:48
RooFunctorBinding::func
const ROOT::Math::IBaseFunctionMultiDim * func
Definition: RooFunctorBinding.h:46
RooFunctorPdfBinding::x
Double_t * x
Definition: RooFunctorBinding.h:75
RooFunctorBinding::evaluate
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Definition: RooFunctorBinding.cxx:96
RooFit::bindFunction
RooAbsReal * bindFunction(const char *name, CFUNCD1D func, RooAbsReal &x)
Definition: RooCFunction1Binding.cxx:59
RooFunctorPdfBinding::printArgs
void printArgs(std::ostream &os) const
Print object arguments, ie its proxies.
Definition: RooFunctorBinding.cxx:137
RooFit
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition: RooCFunction1Binding.h:29
RooAbsPdf.h
RooFunctorBinding::vars
RooListProxy vars
Definition: RooFunctorBinding.h:47
RooRealProxy.h
RooFunctorPdfBinding::RooFunctorPdfBinding
RooFunctorPdfBinding()
Definition: RooFunctorBinding.h:60
RooFunctorPdfBinding::func
const ROOT::Math::IBaseFunctionMultiDim * func
Definition: RooFunctorBinding.h:73
RooListProxy
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:24
RooFunctorBinding
RooFunctorBinding makes math functions from ROOT usable in RooFit.
Definition: RooFunctorBinding.h:31
RooFunctorBinding::RooFunctorBinding
RooFunctorBinding()
Definition: RooFunctorBinding.h:33
RooFunctorPdfBinding
RooFunctorPdfBinding makes math functions from ROOT usable as PDFs in RooFit.
Definition: RooFunctorBinding.h:58
RooListProxy.h
Double_t
double Double_t
Definition: RtypesCore.h:59
RooFunctorPdfBinding::vars
RooListProxy vars
Definition: RooFunctorBinding.h:74
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
RooFunctorPdfBinding::evaluate
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Definition: RooFunctorBinding.cxx:151
RooFunctorBinding::clone
virtual TObject * clone(const char *newname) const
Definition: RooFunctorBinding.h:38
RooAbsPdf
Definition: RooAbsPdf.h:43
ROOT::Math::IBaseFunctionMultiDimTempl< double >
RooFunctorPdfBinding::~RooFunctorPdfBinding
virtual ~RooFunctorPdfBinding()
Definition: RooFunctorBinding.h:66
RooFit::bindPdf
RooAbsPdf * bindPdf(const char *name, CFUNCD1D func, RooAbsReal &x)
Definition: RooCFunction1Binding.cxx:67
RooArgList.h