Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 "Math/IFunction.h"
22
23namespace RooFit {
24
26RooAbsPdf* bindPdf(const char* name, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars) ;
27
28}
29
31public:
32 RooFunctorBinding() = default;
33 RooFunctorBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars);
34 RooFunctorBinding(const RooFunctorBinding& other, const char* name=nullptr) ;
35 TObject* clone(const char* newname=nullptr) const override { return new RooFunctorBinding(*this,newname); }
36 inline ~RooFunctorBinding() override { delete[] x ; }
37 void printArgs(std::ostream& os) const override ;
38
40 RooArgList const &variables() const { return vars; }
41
42protected:
43
44 double evaluate() const override ;
45
46 const ROOT::Math::IBaseFunctionMultiDim* func = nullptr; // Functor
47 RooListProxy vars; // Argument reference
48 double *x = nullptr; // Argument value array
49
50 ClassDefOverride(RooFunctorBinding,1) // RooAbsReal binding to a ROOT::Math::IBaseFunctionMultiDim
51};
52
53
54
56public:
58 RooFunctorPdfBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars);
59 RooFunctorPdfBinding(const RooFunctorPdfBinding& other, const char* name=nullptr) ;
60 TObject* clone(const char* newname=nullptr) const override { return new RooFunctorPdfBinding(*this,newname); }
61 inline ~RooFunctorPdfBinding() override { delete[] x ; }
62 void printArgs(std::ostream& os) const override ;
63
65 RooArgList const &variables() const { return vars; }
66
67protected:
68
69 double evaluate() const override ;
70
71 const ROOT::Math::IBaseFunctionMultiDim* func = nullptr; // Functor
72 RooListProxy vars ; // Argument reference
73 double *x = nullptr; // Argument value array
74
75 ClassDefOverride(RooFunctorPdfBinding,1) // RooAbsPdf binding to a ROOT::Math::IBaseFunctionMultiDim
76};
77
78
79#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
char name[80]
Definition TGX11.cxx:110
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:32
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:63
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooFunctorBinding makes math functions from ROOT usable in RooFit.
const ROOT::Math::IBaseFunctionMultiDim * func
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
RooArgList const & variables() const
ROOT::Math::IBaseFunctionMultiDim const * function() const
void printArgs(std::ostream &os) const override
Print object arguments, ie its proxies.
TObject * clone(const char *newname=nullptr) const override
RooFunctorBinding()=default
~RooFunctorBinding() override
RooFunctorPdfBinding makes math functions from ROOT usable as PDFs in RooFit.
RooArgList const & variables() const
void printArgs(std::ostream &os) const override
Print object arguments, ie its proxies.
RooFunctorPdfBinding()=default
const ROOT::Math::IBaseFunctionMultiDim * func
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
ROOT::Math::IBaseFunctionMultiDim const * function() const
TObject * clone(const char *newname=nullptr) const override
Mother of all ROOT objects.
Definition TObject.h:42
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition CodegenImpl.h:71
RooAbsPdf * bindPdf(const char *name, CFUNCD1D func, RooAbsReal &x)
RooAbsReal * bindFunction(const char *name, CFUNCD1D func, RooAbsReal &x)