Logo ROOT   6.08/07
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 "TString.h"
17 #include "RooAbsReal.h"
18 #include "RooArgList.h"
19 #include "RooListProxy.h"
20 #include "RooAbsPdf.h"
21 #include "RooRealProxy.h"
22 #include "RooMsgService.h"
23 #include <string>
24 #include <map>
25 #include <vector>
26 #include "Math/IFunction.h"
27 
28 
29 namespace RooFit {
30 
31 RooAbsReal* bindFunction(const char* name, const ROOT::Math::IBaseFunctionMultiDim& ftor,const RooArgList& vars) ;
32 RooAbsPdf* bindPdf(const char* name, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars) ;
33 
34 }
35 
36 
37 class RooFunctorBinding : public RooAbsReal {
38 public:
39  RooFunctorBinding() : func(0), x(0) {
40  // Default constructor
41  } ;
42  RooFunctorBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars);
43  RooFunctorBinding(const RooFunctorBinding& other, const char* name=0) ;
44  virtual TObject* clone(const char* newname) const { return new RooFunctorBinding(*this,newname); }
45  inline virtual ~RooFunctorBinding() { delete[] x ; }
46  void printArgs(std::ostream& os) const ;
47 
48 protected:
49 
50  Double_t evaluate() const ;
51 
53  RooListProxy vars ; // Argument reference
54  Double_t* x ; // Argument value array
55 
56 
57 private:
58 
59  ClassDef(RooFunctorBinding,1) // RooAbsReal binding to a ROOT::Math::IBaseFunctionMultiDim
60 };
61 
62 
63 
65 public:
67  // Default constructor
68  } ;
69  RooFunctorPdfBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars);
70  RooFunctorPdfBinding(const RooFunctorPdfBinding& other, const char* name=0) ;
71  virtual TObject* clone(const char* newname) const { return new RooFunctorPdfBinding(*this,newname); }
72  inline virtual ~RooFunctorPdfBinding() { delete[] x ; }
73  void printArgs(std::ostream& os) const ;
74 
75 protected:
76 
77  Double_t evaluate() const ;
78 
80  RooListProxy vars ; // Argument reference
81  Double_t* x ; // Argument value array
82 
83 
84 private:
85 
86  ClassDef(RooFunctorPdfBinding,1) // RooAbsPdf binding to a ROOT::Math::IBaseFunctionMultiDim
87 };
88 
89 
90 #endif
RooAbsPdf * bindPdf(const char *name, CFUNCD1D func, RooAbsReal &x)
virtual ~RooFunctorBinding()
virtual TObject * clone(const char *newname) const
void evaluate(typename Architecture_t::Matrix_t &A, EActivationFunction f)
Apply the given activation function to each value in the given matrix A.
Definition: Functions.h:85
RooAbsReal * bindFunction(const char *name, CFUNCD1D func, RooAbsReal &x)
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
RooCFunction1Binding is a templated implementation of class RooAbsReal that binds generic C(++) funct...
const ROOT::Math::IBaseFunctionMultiDim * func
const ROOT::Math::IBaseFunctionMultiDim * func
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:26
virtual TObject * clone(const char *newname) const
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
double func(double *x, double *p)
Definition: stressTF1.cxx:213
Mother of all ROOT objects.
Definition: TObject.h:37
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
Documentation for the abstract class IBaseFunctionMultiDim.
Definition: IFunction.h:63
char name[80]
Definition: TGX11.cxx:109