00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "Riostream.h"
00027 #include "RooCFunction1Binding.h"
00028 #include "RooCintUtils.h"
00029
00030 using namespace std ;
00031
00032 #ifndef ROOFIT_R__NO_CLASS_TEMPLATE_SPECIALIZATION
00033 #define ROOFIT_R__NO_CLASS_TEMPLATE_SPECIALIZATION
00034 templateClassImp(RooCFunction1Binding)
00035 templateClassImp(RooCFunction1Ref)
00036 #endif
00037
00038
00039 template<> RooCFunction1Map<double,double>* RooCFunction1Ref<double,double>::_fmap = 0 ;
00040 template<> RooCFunction1Map<double,int>* RooCFunction1Ref<double,int>::_fmap = 0 ;
00041
00042
00043
00044 namespace RooFit {
00045
00046 RooAbsReal* bindFunction(const char* name,void* func,RooAbsReal& x)
00047 {
00048
00049
00050 if (RooCintUtils::matchFuncPtrArgs(func,"int")) return new RooCFunction1Binding<Double_t,Int_t>(name,name,(CFUNCD1I)func,x) ;
00051 if (RooCintUtils::matchFuncPtrArgs(func,"double")) return new RooCFunction1Binding<Double_t,Double_t>(name,name,(CFUNCD1D)func,x) ;
00052 oocoutE((TObject*)0,InputArguments) << "bindFunction::ERROR No matching RooCFunction1Binding<> class found for function " << RooCintUtils::functionName(func) << endl ;
00053 return 0 ;
00054 }
00055
00056
00057 RooAbsReal* bindFunction(const char* name,CFUNCD1D func,RooAbsReal& x) {
00058 return new RooCFunction1Binding<Double_t,Double_t>(name,name,func,x) ;
00059 }
00060
00061 RooAbsReal* bindFunction(const char* name,CFUNCD1I func,RooAbsReal& x) {
00062 return new RooCFunction1Binding<Double_t,Int_t>(name,name,func,x) ;
00063 }
00064
00065 RooAbsPdf* bindPdf(const char* name,void* func,RooAbsReal& x)
00066 {
00067
00068
00069 if (RooCintUtils::matchFuncPtrArgs(func,"int")) return new RooCFunction1PdfBinding<Double_t,Int_t>(name,name,(CFUNCD1I)func,x) ;
00070 if (RooCintUtils::matchFuncPtrArgs(func,"double")) return new RooCFunction1PdfBinding<Double_t,Double_t>(name,name,(CFUNCD1D)func,x) ;
00071 oocoutE((TObject*)0,InputArguments) << "bindFunction::ERROR No matching RooCFunction1PdfBinding<> class found for function " << RooCintUtils::functionName(func) << endl ;
00072 return 0 ;
00073 }
00074
00075
00076 RooAbsPdf* bindPdf(const char* name,CFUNCD1D func,RooAbsReal& x) {
00077 return new RooCFunction1PdfBinding<Double_t,Double_t>(name,name,func,x) ;
00078 }
00079
00080 RooAbsPdf* bindPdf(const char* name,CFUNCD1I func,RooAbsReal& x) {
00081 return new RooCFunction1PdfBinding<Double_t,Int_t>(name,name,func,x) ;
00082 }
00083
00084 }
00085
00086
00087