00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef ROOFUNCTORBINDING
00014 #define ROOFUNCTORBINDING
00015
00016 #include "TString.h"
00017 #include "RooAbsReal.h"
00018 #include "RooArgList.h"
00019 #include "RooListProxy.h"
00020 #include "RooAbsPdf.h"
00021 #include "RooRealProxy.h"
00022 #include "RooMsgService.h"
00023 #include <string>
00024 #include <map>
00025 #include <vector>
00026 #include "Math/IFunction.h"
00027
00028
00029 namespace RooFit {
00030
00031 RooAbsReal* bindFunction(const char* name, const ROOT::Math::IBaseFunctionMultiDim& ftor,const RooArgList& vars) ;
00032 RooAbsPdf* bindPdf(const char* name, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars) ;
00033
00034 }
00035
00036
00037 class RooFunctorBinding : public RooAbsReal {
00038 public:
00039 RooFunctorBinding() : x(0) {
00040
00041 } ;
00042 RooFunctorBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars);
00043 RooFunctorBinding(const RooFunctorBinding& other, const char* name=0) ;
00044 virtual TObject* clone(const char* newname) const { return new RooFunctorBinding(*this,newname); }
00045 inline virtual ~RooFunctorBinding() { delete[] x ; }
00046 void printArgs(ostream& os) const ;
00047
00048 protected:
00049
00050 Double_t evaluate() const ;
00051
00052 const ROOT::Math::IBaseFunctionMultiDim* func ;
00053 RooListProxy vars ;
00054 Double_t* x ;
00055
00056
00057 private:
00058
00059 ClassDef(RooFunctorBinding,1)
00060 };
00061
00062
00063
00064 class RooFunctorPdfBinding : public RooAbsPdf {
00065 public:
00066 RooFunctorPdfBinding() : x(0) {
00067
00068 } ;
00069 RooFunctorPdfBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars);
00070 RooFunctorPdfBinding(const RooFunctorPdfBinding& other, const char* name=0) ;
00071 virtual TObject* clone(const char* newname) const { return new RooFunctorPdfBinding(*this,newname); }
00072 inline virtual ~RooFunctorPdfBinding() { delete[] x ; }
00073 void printArgs(ostream& os) const ;
00074
00075 protected:
00076
00077 Double_t evaluate() const ;
00078
00079 const ROOT::Math::IBaseFunctionMultiDim* func ;
00080 RooListProxy vars ;
00081 Double_t* x ;
00082
00083
00084 private:
00085
00086 ClassDef(RooFunctorPdfBinding,1)
00087 };
00088
00089
00090 #endif