File indexing completed on 2026-01-08 10:29:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef ROO_DERIVATIVE
0017 #define ROO_DERIVATIVE
0018
0019 #include "RooAbsReal.h"
0020 #include "RooRealProxy.h"
0021 #include "RooSetProxy.h"
0022
0023 namespace ROOT{ namespace Math {
0024 class RichardsonDerivator;
0025 }}
0026
0027 class RooRealVar;
0028 class RooArgList ;
0029
0030 class RooDerivative : public RooAbsReal {
0031 public:
0032
0033 RooDerivative() ;
0034 RooDerivative(const char *name, const char *title, RooAbsReal& func, RooRealVar& x, Int_t order=1, double eps=0.001) ;
0035 RooDerivative(const char *name, const char *title, RooAbsReal& func, RooRealVar& x, const RooArgSet& nset, Int_t order=1, double eps=0.001) ;
0036 ~RooDerivative() override ;
0037
0038 RooDerivative(const RooDerivative& other, const char* name = nullptr);
0039 TObject* clone(const char* newname=nullptr) const override { return new RooDerivative(*this, newname); }
0040
0041 Int_t order() const { return _order ; }
0042
0043 double eps() const { return _eps ; }
0044
0045 RooArgSet const &getNset() const { return _nset; }
0046
0047 RooAbsReal const &getX() const { return *_x; }
0048
0049 RooAbsReal const &getFunc() const { return *_func; }
0050
0051 void setEps(double e) { _eps = e ; }
0052
0053 bool redirectServersHook(const RooAbsCollection& , bool , bool , bool ) override ;
0054
0055 protected:
0056
0057 Int_t _order = 1;
0058 double _eps = 1e-7;
0059 RooSetProxy _nset ;
0060 RooRealProxy _func ;
0061 RooRealProxy _x ;
0062 mutable std::unique_ptr<RooFunctor> _ftor;
0063 mutable std::unique_ptr<ROOT::Math::RichardsonDerivator> _rd;
0064
0065 double evaluate() const override;
0066
0067 ClassDefOverride(RooDerivative,1)
0068 };
0069
0070 #endif