00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef ROO_DERIVATIVE
00017 #define ROO_DERIVATIVE
00018
00019 #include "RooAbsReal.h"
00020 #include "RooRealProxy.h"
00021 #include "RooSetProxy.h"
00022
00023
00024 #include "Math/WrappedFunction.h"
00025 #include "Math/RichardsonDerivator.h"
00026
00027
00028 class RooRealVar;
00029 class RooArgList ;
00030
00031 class RooDerivative : public RooAbsReal {
00032 public:
00033
00034 RooDerivative() ;
00035 RooDerivative(const char *name, const char *title, RooAbsReal& func, RooRealVar& x, Int_t order=1, Double_t eps=0.001) ;
00036 RooDerivative(const char *name, const char *title, RooAbsReal& func, RooRealVar& x, const RooArgSet& nset, Int_t order=1, Double_t eps=0.001) ;
00037 virtual ~RooDerivative() ;
00038
00039 RooDerivative(const RooDerivative& other, const char* name = 0);
00040 virtual TObject* clone(const char* newname) const { return new RooDerivative(*this, newname); }
00041
00042 Int_t order() const { return _order ; }
00043 Double_t eps() const { return _eps ; }
00044 void setEps(Double_t e) { _eps = e ; }
00045
00046 Bool_t redirectServersHook(const RooAbsCollection& , Bool_t , Bool_t , Bool_t ) ;
00047
00048 protected:
00049
00050 Int_t _order ;
00051 Double_t _eps ;
00052 RooSetProxy _nset ;
00053 RooRealProxy _func ;
00054 RooRealProxy _x ;
00055 mutable RooFunctor* _ftor ;
00056 mutable ROOT::Math::RichardsonDerivator *_rd ;
00057
00058 Double_t evaluate() const;
00059
00060 ClassDef(RooDerivative,1)
00061 };
00062
00063 #endif