ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RooTFnPdfBinding.cxx
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * *
4  * This code was autogenerated by RooClassFactory *
5  *****************************************************************************/
6 
7 // Your description goes here...
8 
9 #include "Riostream.h"
10 
11 #include "RooTFnPdfBinding.h"
12 #include "RooAbsReal.h"
13 #include "RooAbsCategory.h"
14 #include "TF3.h"
15 
16 using namespace std;
17 
19 
20 RooTFnPdfBinding::RooTFnPdfBinding(const char *name, const char *title, TF1* func, const RooArgList& list) :
21  RooAbsPdf(name,title),
22  _list("params","params",this),
23  _func(func)
24 {
25  _list.add(list) ;
26 }
27 
28 
30  RooAbsPdf(other,name),
31  _list("params",this,other._list),
32  _func(other._func)
33 {
34 }
35 
36 
37 
39 {
40  Double_t x = _list.at(0) ? ((RooAbsReal*)_list.at(0))->getVal() : 0 ;
41  Double_t y = _list.at(1) ? ((RooAbsReal*)_list.at(1))->getVal() : 0 ;
42  Double_t z = _list.at(2) ? ((RooAbsReal*)_list.at(2))->getVal() : 0 ;
43  return _func->Eval(x,y,z) ;
44 }
45 
46 
47 
48 void RooTFnPdfBinding::printArgs(ostream& os) const
49 {
50  // Print object arguments and name/address of function pointer
51  os << "[ TFn={" << _func->GetName() << "=" << _func->GetTitle() << "} " ;
52  for (Int_t i=0 ; i<numProxies() ; i++) {
53  RooAbsProxy* p = getProxy(i) ;
54  if (!TString(p->name()).BeginsWith("!")) {
55  p->print(os) ;
56  os << " " ;
57  }
58  }
59  os << "]" ;
60 }
61 
62 
63 
64 
65 namespace RooFit {
66 
68  return new RooTFnPdfBinding(func->GetName(),func->GetName(),func,x) ;
69  }
70 
72  return new RooTFnPdfBinding(func->GetName(),func->GetName(),func,RooArgList(x,y)) ;
73  }
74 
76  return new RooTFnPdfBinding(func->GetName(),func->GetName(),func,RooArgList(x,y,z)) ;
77  }
78 
79 }
virtual void print(std::ostream &os, Bool_t addContents=kFALSE) const
Print proxy name.
Definition: RooAbsProxy.cxx:75
RooAbsPdf * bindPdf(const char *name, CFUNCD1D func, RooAbsReal &x)
Double_t evaluate() const
Basic string class.
Definition: TString.h:137
ClassImp(RooTFnPdfBinding) RooTFnPdfBinding
int Int_t
Definition: RtypesCore.h:41
RooAbsProxy * getProxy(Int_t index) const
Return the nth proxy from the proxy list.
Definition: RooAbsArg.cxx:1254
Double_t x[n]
Definition: legend1.C:17
bool BeginsWith(const std::string &theString, const std::string &theSubstring)
Double_t getVal(const RooArgSet *set=0) const
Definition: RooAbsReal.h:64
Float_t z[5]
Definition: Ifit.C:16
void printArgs(std::ostream &os) const
Print object arguments, ie its proxies.
Int_t numProxies() const
Return the number of registered proxies.
Definition: RooAbsArg.cxx:1267
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
A 3-Dim function with parameters.
Definition: TF3.h:30
RooAbsProxy is the abstact interface for proxy classes.
Definition: RooAbsProxy.h:32
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
virtual const char * name() const
Definition: RooAbsProxy.h:42
RooAbsArg * at(Int_t idx) const
Definition: RooArgList.h:84
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
Double_t y[n]
Definition: legend1.C:17
double func(double *x, double *p)
Definition: stressTF1.cxx:213
#define name(a, b)
Definition: linkTestLib0.cpp:5
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
RooListProxy _list