Logo ROOT  
Reference Guide
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 "RooAbsReal.h"
16 #include "RooAbsCategory.h"
17 #include "TF3.h"
18 
19 using namespace std;
20 
22 
23 ////////////////////////////////////////////////////////////////////////////////
24 
25 RooTFnPdfBinding::RooTFnPdfBinding(const char *name, const char *title, TF1* func, const RooArgList& list) :
26  RooAbsPdf(name,title),
27  _list("params","params",this),
28  _func(func)
29 {
30  _list.add(list) ;
31 }
32 
33 ////////////////////////////////////////////////////////////////////////////////
34 
36  RooAbsPdf(other,name),
37  _list("params",this,other._list),
38  _func(other._func)
39 {
40 }
41 
42 ////////////////////////////////////////////////////////////////////////////////
43 
45 {
46  Double_t x = _list.at(0) ? ((RooAbsReal*)_list.at(0))->getVal() : 0 ;
47  Double_t y = _list.at(1) ? ((RooAbsReal*)_list.at(1))->getVal() : 0 ;
48  Double_t z = _list.at(2) ? ((RooAbsReal*)_list.at(2))->getVal() : 0 ;
49  return _func->Eval(x,y,z) ;
50 }
51 
52 ////////////////////////////////////////////////////////////////////////////////
53 
54 void RooTFnPdfBinding::printArgs(ostream& os) const
55 {
56  // Print object arguments and name/address of function pointer
57  os << "[ TFn={" << _func->GetName() << "=" << _func->GetTitle() << "} " ;
58  for (Int_t i=0 ; i<numProxies() ; i++) {
59  RooAbsProxy* p = getProxy(i) ;
60  if (!TString(p->name()).BeginsWith("!")) {
61  p->print(os) ;
62  os << " " ;
63  }
64  }
65  os << "]" ;
66 }
67 
68 ////////////////////////////////////////////////////////////////////////////////
69 
70 namespace RooFit {
71 
73  return new RooTFnPdfBinding(func->GetName(),func->GetName(),func,x) ;
74  }
75 
77  return new RooTFnPdfBinding(func->GetName(),func->GetName(),func,RooArgList(x,y)) ;
78  }
79 
81  return new RooTFnPdfBinding(func->GetName(),func->GetName(),func,RooArgList(x,y,z)) ;
82  }
83 
84 }
RooAbsProxy::print
virtual void print(std::ostream &os, Bool_t addContents=kFALSE) const
Print proxy name.
Definition: RooAbsProxy.cxx:74
RooAbsArg::numProxies
Int_t numProxies() const
Return the number of registered proxies.
Definition: RooAbsArg.cxx:1290
RooAbsReal.h
RooTFnPdfBinding.h
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TNamed::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
RooTFnPdfBinding::RooTFnPdfBinding
RooTFnPdfBinding()
Definition: RooTFnPdfBinding.h:18
RooArgList
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooAbsReal::getVal
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition: RooAbsReal.h:91
RooAbsProxy::name
virtual const char * name() const
Definition: RooAbsProxy.h:40
x
Double_t x[n]
Definition: legend1.C:17
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
RooAbsArg::getProxy
RooAbsProxy * getProxy(Int_t index) const
Return the nth proxy from the proxy list.
Definition: RooAbsArg.cxx:1277
RooArgList::at
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
Definition: RooArgList.h:70
TString
Basic string class.
Definition: TString.h:136
TF3.h
RooFit
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition: RooCFunction1Binding.h:29
RooTFnPdfBinding::printArgs
void printArgs(std::ostream &os) const
Print object arguments, ie its proxies.
Definition: RooTFnPdfBinding.cxx:54
TF3
A 3-Dim function with parameters.
Definition: TF3.h:28
TString::BeginsWith
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition: TString.h:615
y
Double_t y[n]
Definition: legend1.C:17
RooTFnPdfBinding::_func
TF1 * _func
Definition: RooTFnPdfBinding.h:29
TF2
A 2-Dim function with parameters.
Definition: TF2.h:29
RooTFnPdfBinding::evaluate
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Definition: RooTFnPdfBinding.cxx:44
Double_t
double Double_t
Definition: RtypesCore.h:59
RooAbsCategory.h
TF1::Eval
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:1434
name
char name[80]
Definition: TGX11.cxx:110
RooListProxy::add
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Reimplementation of standard RooArgList::add()
Definition: RooListProxy.cxx:104
RooAbsProxy
RooAbsProxy is the abstact interface for proxy classes.
Definition: RooAbsProxy.h:30
RooAbsPdf
Definition: RooAbsPdf.h:43
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
TF1
1-Dim function class
Definition: TF1.h:213
RooFit::bindPdf
RooAbsPdf * bindPdf(const char *name, CFUNCD1D func, RooAbsReal &x)
Definition: RooCFunction1Binding.cxx:67
RooTFnPdfBinding::_list
RooListProxy _list
Definition: RooTFnPdfBinding.h:28
Riostream.h
RooTFnPdfBinding
Definition: RooTFnPdfBinding.h:16
int