Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooTFnPdfBinding.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * *
4 * This code was autogenerated by RooClassFactory *
5 *****************************************************************************/
6
7/** \class RooTFnPdfBinding
8 \ingroup Roofit
9
10**/
11
12#include "Riostream.h"
13
14#include "RooTFnPdfBinding.h"
15#include "RooAbsCategory.h"
16#include "TF3.h"
17
18using namespace std;
19
21
22////////////////////////////////////////////////////////////////////////////////
23
24RooTFnPdfBinding::RooTFnPdfBinding(const char *name, const char *title, TF1* func, const RooArgList& list) :
25 RooAbsPdf(name,title),
26 _list("params","params",this),
27 _func(func)
28{
29 _list.add(list) ;
30}
31
32////////////////////////////////////////////////////////////////////////////////
33
35 RooAbsPdf(other,name),
36 _list("params",this,other._list),
37 _func(other._func)
38{
39}
40
41////////////////////////////////////////////////////////////////////////////////
42
44{
45 double x = _list.at(0) ? ((RooAbsReal*)_list.at(0))->getVal() : 0 ;
46 double y = _list.at(1) ? ((RooAbsReal*)_list.at(1))->getVal() : 0 ;
47 double z = _list.at(2) ? ((RooAbsReal*)_list.at(2))->getVal() : 0 ;
48 return _func->Eval(x,y,z) ;
49}
50
51////////////////////////////////////////////////////////////////////////////////
52
53void RooTFnPdfBinding::printArgs(ostream& os) const
54{
55 // Print object arguments and name/address of function pointer
56 os << "[ TFn={" << _func->GetName() << "=" << _func->GetTitle() << "} " ;
57 for (Int_t i=0 ; i<numProxies() ; i++) {
58 RooAbsProxy* p = getProxy(i) ;
59 if (!TString(p->name()).BeginsWith("!")) {
60 p->print(os) ;
61 os << " " ;
62 }
63 }
64 os << "]" ;
65}
66
67////////////////////////////////////////////////////////////////////////////////
68
69namespace RooFit {
70
72 return new RooTFnPdfBinding(func->GetName(),func->GetName(),func,x) ;
73 }
74
76 return new RooTFnPdfBinding(func->GetName(),func->GetName(),func,RooArgList(x,y)) ;
77 }
78
80 return new RooTFnPdfBinding(func->GetName(),func->GetName(),func,RooArgList(x,y,z)) ;
81 }
82
83}
RooAbsReal * _func
Definition RooMinuit.h:90
#define ClassImp(name)
Definition Rtypes.h:377
winID h TVirtualViewer3D TVirtualGLPainter p
char name[80]
Definition TGX11.cxx:110
Int_t numProxies() const
Return the number of registered proxies.
RooAbsProxy * getProxy(Int_t index) const
Return the nth proxy from the proxy list.
RooAbsProxy is the abstact interface for proxy classes.
Definition RooAbsProxy.h:37
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition RooAbsReal.h:62
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition RooAbsReal.h:91
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
Definition RooArgList.h:110
bool add(const RooAbsArg &var, bool valueServer, bool shapeServer, bool silent)
Overloaded RooCollection_t::add() method insert object into set and registers object as server to own...
void printArgs(std::ostream &os) const override
Print object arguments, ie its proxies.
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
1-Dim function class
Definition TF1.h:213
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
Definition TF1.cxx:1440
A 2-Dim function with parameters.
Definition TF2.h:29
A 3-Dim function with parameters.
Definition TF3.h:28
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:48
Basic string class.
Definition TString.h:139
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition TString.h:627
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 Common.h:18
RooAbsPdf * bindPdf(const char *name, CFUNCD1D func, RooAbsReal &x)