Logo ROOT   6.08/07
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 // 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 const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
virtual const char * name() const
Definition: RooAbsProxy.h:42
RooAbsPdf * bindPdf(const char *name, CFUNCD1D func, RooAbsReal &x)
Double_t getVal(const RooArgSet *set=0) const
Definition: RooAbsReal.h:64
int Int_t
Definition: RtypesCore.h:41
STL namespace.
Double_t x[n]
Definition: legend1.C:17
bool BeginsWith(const std::string &theString, const std::string &theSubstring)
Double_t evaluate() const
RooAbsArg * at(Int_t idx) const
Definition: RooArgList.h:84
A 3-Dim function with parameters.
Definition: TF3.h:30
RooAbsProxy is the abstact interface for proxy classes.
Definition: RooAbsProxy.h:32
A 2-Dim function with parameters.
Definition: TF2.h:33
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:1196
#define ClassImp(name)
Definition: Rtypes.h:279
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
RooAbsProxy * getProxy(Int_t index) const
Return the nth proxy from the proxy list.
Definition: RooAbsArg.cxx:1254
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
Int_t numProxies() const
Return the number of registered proxies.
Definition: RooAbsArg.cxx:1267
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
1-Dim function class
Definition: TF1.h:149
void printArgs(std::ostream &os) const
Print object arguments, ie its proxies.
RooListProxy _list
virtual void print(std::ostream &os, Bool_t addContents=kFALSE) const
Print proxy name.
Definition: RooAbsProxy.cxx:75
char name[80]
Definition: TGX11.cxx:109
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:52