21 ClassImp(RooTFnPdfBinding);
25 RooTFnPdfBinding::RooTFnPdfBinding(
const char *name,
const char *title, TF1* func,
const RooArgList& list) :
26 RooAbsPdf(name,title),
27 _list(
"params",
"params",this),
35 RooTFnPdfBinding::RooTFnPdfBinding(
const RooTFnPdfBinding& other,
const char* name) :
36 RooAbsPdf(other,name),
37 _list(
"params",this,other._list),
44 Double_t RooTFnPdfBinding::evaluate()
const
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) ;
54 void RooTFnPdfBinding::printArgs(ostream& os)
const
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(
"!")) {
72 RooAbsPdf* bindPdf(TF1* func,RooAbsReal& x) {
73 return new RooTFnPdfBinding(func->GetName(),func->GetName(),func,x) ;
76 RooAbsPdf* bindPdf(TF2* func,RooAbsReal& x, RooAbsReal& y) {
77 return new RooTFnPdfBinding(func->GetName(),func->GetName(),func,RooArgList(x,y)) ;
80 RooAbsPdf* bindPdf(TF3* func,RooAbsReal& x, RooAbsReal& y, RooAbsReal& z) {
81 return new RooTFnPdfBinding(func->GetName(),func->GetName(),func,RooArgList(x,y,z)) ;