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