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 "RooCFunction2Binding.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(RooCFunction2Binding)
00035 templateClassImp(RooCFunction2Ref)
00036 #endif
00037
00038
00039 template<> RooCFunction2Map<double,double,double>* RooCFunction2Ref<double,double,double>::_fmap = 0 ;
00040 template<> RooCFunction2Map<double,int,double> *RooCFunction2Ref<double,int,double>::_fmap = 0 ;
00041 template<> RooCFunction2Map<double,unsigned int,double> *RooCFunction2Ref<double,unsigned int,double>::_fmap = 0 ;
00042 template<> RooCFunction2Map<double,double,int> *RooCFunction2Ref<double,double,int>::_fmap = 0 ;
00043 template<> RooCFunction2Map<double,int,int> *RooCFunction2Ref<double,int,int>::_fmap = 0 ;
00044
00045
00046 namespace RooFit {
00047
00048 RooAbsReal* bindFunction(const char* name,void* func,RooAbsReal& x, RooAbsReal& y) {
00049
00050
00051 if (RooCintUtils::matchFuncPtrArgs(func,"double,double")) return new RooCFunction2Binding<Double_t,Double_t,Double_t>(name,name,(CFUNCD2DD)func,x,y) ;
00052 if (RooCintUtils::matchFuncPtrArgs(func,"int,double")) return new RooCFunction2Binding<Double_t,Int_t,Double_t>(name,name,(CFUNCD2ID)func,x,y) ;
00053 if (RooCintUtils::matchFuncPtrArgs(func,"unsigned int,double")) return new RooCFunction2Binding<Double_t,UInt_t,Double_t>(name,name,(CFUNCD2UD)func,x,y) ;
00054 if (RooCintUtils::matchFuncPtrArgs(func,"double,int")) return new RooCFunction2Binding<Double_t,Double_t,Int_t>(name,name,(CFUNCD2DI)func,x,y) ;
00055 if (RooCintUtils::matchFuncPtrArgs(func,"int,int")) return new RooCFunction2Binding<Double_t,Int_t,Int_t>(name,name,(CFUNCD2II)func,x,y) ;
00056 oocoutE((TObject*)0,InputArguments) << "bindFunction::ERROR No matching RooCFunction2Binding<> class found for function " << RooCintUtils::functionName(func) << endl ;
00057 return 0 ;
00058 }
00059
00060 RooAbsReal* bindFunction(const char* name,CFUNCD2DD func,RooAbsReal& x, RooAbsReal& y) {
00061 return new RooCFunction2Binding<Double_t,Double_t,Double_t>(name,name,func,x,y) ;
00062 }
00063
00064 RooAbsReal* bindFunction(const char* name,CFUNCD2ID func,RooAbsReal& x, RooAbsReal& y) {
00065 return new RooCFunction2Binding<Double_t,Int_t,Double_t>(name,name,func,x,y) ;
00066 }
00067
00068 RooAbsReal* bindFunction(const char* name,CFUNCD2UD func,RooAbsReal& x, RooAbsReal& y) {
00069 return new RooCFunction2Binding<Double_t,UInt_t,Double_t>(name,name,func,x,y) ;
00070 }
00071
00072 RooAbsReal* bindFunction(const char* name,CFUNCD2DI func,RooAbsReal& x, RooAbsReal& y) {
00073 return new RooCFunction2Binding<Double_t,Double_t,Int_t>(name,name,func,x,y) ;
00074 }
00075
00076 RooAbsReal* bindFunction(const char* name,CFUNCD2II func,RooAbsReal& x, RooAbsReal& y) {
00077 return new RooCFunction2Binding<Double_t,Int_t,Int_t>(name,name,func,x,y) ;
00078 }
00079
00080 RooAbsPdf* bindPdf(const char* name,void* func,RooAbsReal& x, RooAbsReal& y) {
00081
00082
00083 if (RooCintUtils::matchFuncPtrArgs(func,"double,double")) return new RooCFunction2PdfBinding<Double_t,Double_t,Double_t>(name,name,(CFUNCD2DD)func,x,y) ;
00084 if (RooCintUtils::matchFuncPtrArgs(func,"int,double")) return new RooCFunction2PdfBinding<Double_t,Int_t,Double_t>(name,name,(CFUNCD2ID)func,x,y) ;
00085 if (RooCintUtils::matchFuncPtrArgs(func,"unsigned int,double")) return new RooCFunction2PdfBinding<Double_t,UInt_t,Double_t>(name,name,(CFUNCD2UD)func,x,y) ;
00086 if (RooCintUtils::matchFuncPtrArgs(func,"double,int")) return new RooCFunction2PdfBinding<Double_t,Double_t,Int_t>(name,name,(CFUNCD2DI)func,x,y) ;
00087 if (RooCintUtils::matchFuncPtrArgs(func,"int,int")) return new RooCFunction2PdfBinding<Double_t,Int_t,Int_t>(name,name,(CFUNCD2II)func,x,y) ;
00088 oocoutE((TObject*)0,InputArguments) << "bindPdf::ERROR No matching RooCFunction2PdfBinding<> class found for function " << RooCintUtils::functionName(func) << endl ;
00089 return 0 ;
00090 }
00091
00092 RooAbsPdf* bindPdf(const char* name,CFUNCD2DD func,RooAbsReal& x, RooAbsReal& y) {
00093 return new RooCFunction2PdfBinding<Double_t,Double_t,Double_t>(name,name,func,x,y) ;
00094 }
00095
00096 RooAbsPdf* bindPdf(const char* name,CFUNCD2ID func,RooAbsReal& x, RooAbsReal& y) {
00097 return new RooCFunction2PdfBinding<Double_t,Int_t,Double_t>(name,name,func,x,y) ;
00098 }
00099
00100 RooAbsPdf* bindPdf(const char* name,CFUNCD2UD func,RooAbsReal& x, RooAbsReal& y) {
00101 return new RooCFunction2PdfBinding<Double_t,UInt_t,Double_t>(name,name,func,x,y) ;
00102 }
00103
00104 RooAbsPdf* bindPdf(const char* name,CFUNCD2DI func,RooAbsReal& x, RooAbsReal& y) {
00105 return new RooCFunction2PdfBinding<Double_t,Double_t,Int_t>(name,name,func,x,y) ;
00106 }
00107
00108 RooAbsPdf* bindPdf(const char* name,CFUNCD2II func,RooAbsReal& x, RooAbsReal& y) {
00109 return new RooCFunction2PdfBinding<Double_t,Int_t,Int_t>(name,name,func,x,y) ;
00110 }
00111
00112 }