File indexing completed on 2025-01-18 10:11:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef ROOFUNCTORBINDING
0014 #define ROOFUNCTORBINDING
0015
0016 #include "RooAbsReal.h"
0017 #include "RooArgList.h"
0018 #include "RooListProxy.h"
0019 #include "RooAbsPdf.h"
0020 #include "RooRealProxy.h"
0021 #include "RooMsgService.h"
0022 #include "Math/IFunction.h"
0023
0024 namespace RooFit {
0025
0026 RooAbsReal* bindFunction(const char* name, const ROOT::Math::IBaseFunctionMultiDim& ftor,const RooArgList& vars) ;
0027 RooAbsPdf* bindPdf(const char* name, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars) ;
0028
0029 }
0030
0031 class RooFunctorBinding : public RooAbsReal {
0032 public:
0033 RooFunctorBinding() = default;
0034 RooFunctorBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars);
0035 RooFunctorBinding(const RooFunctorBinding& other, const char* name=nullptr) ;
0036 TObject* clone(const char* newname) const override { return new RooFunctorBinding(*this,newname); }
0037 inline ~RooFunctorBinding() override { delete[] x ; }
0038 void printArgs(std::ostream& os) const override ;
0039
0040 protected:
0041
0042 double evaluate() const override ;
0043
0044 const ROOT::Math::IBaseFunctionMultiDim* func = nullptr;
0045 RooListProxy vars;
0046 double *x = nullptr;
0047
0048
0049 private:
0050
0051 ClassDefOverride(RooFunctorBinding,1)
0052 };
0053
0054
0055
0056 class RooFunctorPdfBinding : public RooAbsPdf {
0057 public:
0058 RooFunctorPdfBinding() = default;
0059 RooFunctorPdfBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars);
0060 RooFunctorPdfBinding(const RooFunctorPdfBinding& other, const char* name=nullptr) ;
0061 TObject* clone(const char* newname) const override { return new RooFunctorPdfBinding(*this,newname); }
0062 inline ~RooFunctorPdfBinding() override { delete[] x ; }
0063 void printArgs(std::ostream& os) const override ;
0064
0065 protected:
0066
0067 double evaluate() const override ;
0068
0069 const ROOT::Math::IBaseFunctionMultiDim* func = nullptr;
0070 RooListProxy vars ;
0071 double *x = nullptr;
0072
0073
0074 private:
0075
0076 ClassDefOverride(RooFunctorPdfBinding,1)
0077 };
0078
0079
0080 #endif