Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooTFnBinding.h
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 *
4 * Copyright (c) 2023, CERN
5 *
6 * Redistribution and use in source and binary forms,
7 * with or without modification, are permitted according to the terms
8 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
9 */
10
11#ifndef ROOTFNBINDING
12#define ROOTFNBINDING
13
14#include "RooAbsReal.h"
15#include "RooListProxy.h"
16class TF1 ;
17class TF2 ;
18class TF3 ;
19
20class RooTFnBinding : public RooAbsReal {
21public:
22 RooTFnBinding() = default;
23 RooTFnBinding(const char *name, const char *title, TF1* func, const RooArgList& list);
24 RooTFnBinding(const char *name, const char *title, TF1* func, const RooArgList& list, const RooArgList& plist);
25 RooTFnBinding(const RooTFnBinding& other, const char* name=nullptr) ;
26 TObject* clone(const char* newname) const override { return new RooTFnBinding(*this,newname); }
27
28 void printArgs(std::ostream& os) const override ;
29
30 const RooArgList& observables() const { return _olist;}
31 const RooArgList& parameters() const { return _plist; }
32 const TF1& function() const { return *_func; }
33
34protected:
35
38 TF1* _func = nullptr;
39
40 double evaluate() const override ;
41
42private:
43
44 ClassDefOverride(RooTFnBinding,1) // RooAbsReal binding to ROOT TF[123] functions
45};
46
47
48namespace RooFit {
49
53
54RooAbsReal* bindFunction(TF1* func,RooAbsReal& x, const RooArgList& params) ;
55RooAbsReal* bindFunction(TF2* func,RooAbsReal& x, RooAbsReal& y, const RooArgList& params) ;
57
58}
59
60
61#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
char name[80]
Definition TGX11.cxx:110
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
Use TF1, TF2, TF3 functions as RooFit objects.
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
const TF1 & function() const
RooListProxy _plist
const RooArgList & parameters() const
RooTFnBinding()=default
void printArgs(std::ostream &os) const override
Print object arguments, ie its proxies.
TObject * clone(const char *newname) const override
RooListProxy _olist
const RooArgList & observables() const
1-Dim function class
Definition TF1.h:233
A 2-Dim function with parameters.
Definition TF2.h:29
A 3-Dim function with parameters.
Definition TF3.h:28
Mother of all ROOT objects.
Definition TObject.h:41
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition CodegenImpl.h:64
RooAbsReal * bindFunction(const char *name, CFUNCD1D func, RooAbsReal &x)