#ifndef ROO_DERIVATIVE
#define ROO_DERIVATIVE
#include "RooAbsReal.h"
#include "RooRealProxy.h"
#include "RooSetProxy.h"
#include "Math/WrappedFunction.h"
#include "Math/RichardsonDerivator.h"
class RooRealVar;
class RooArgList ;
class RooDerivative : public RooAbsReal {
public:
RooDerivative() ;
RooDerivative(const char *name, const char *title, RooAbsReal& func, RooRealVar& x, Int_t order=1, Double_t eps=0.001) ;
RooDerivative(const char *name, const char *title, RooAbsReal& func, RooRealVar& x, const RooArgSet& nset, Int_t order=1, Double_t eps=0.001) ;
virtual ~RooDerivative() ;
RooDerivative(const RooDerivative& other, const char* name = 0);
virtual TObject* clone(const char* newname) const { return new RooDerivative(*this, newname); }
Int_t order() const { return _order ; }
Double_t eps() const { return _eps ; }
void setEps(Double_t e) { _eps = e ; }
Bool_t redirectServersHook(const RooAbsCollection& , Bool_t , Bool_t , Bool_t ) ;
protected:
Int_t _order ;
Double_t _eps ;
RooSetProxy _nset ;
RooRealProxy _func ;
RooRealProxy _x ;
mutable RooFunctor* _ftor ;
mutable ROOT::Math::RichardsonDerivator *_rd ;
Double_t evaluate() const;
ClassDef(RooDerivative,1)
};
#endif