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