RooDerivative.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooDerivative.h 28259 2009-04-16 16:21:16Z wouter $
00005  * Authors:                                                                  *
00006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
00007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
00008  *                                                                           *
00009  * Copyright (c) 2000-2005, Regents of the University of California          *
00010  *                          and Stanford University. All rights reserved.    *
00011  *                                                                           *
00012  * Redistribution and use in source and binary forms,                        *
00013  * with or without modification, are permitted according to the terms        *
00014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
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& /*newServerList*/, Bool_t /*mustReplaceAll*/, Bool_t /*nameChange*/, Bool_t /*isRecursive*/) ;  
00047 
00048 protected:
00049 
00050   Int_t _order ;                         // Derivation order
00051   Double_t _eps ;                        // Precision
00052   RooSetProxy  _nset ;                   // Normalization set (optional)
00053   RooRealProxy _func ;                   // Input function
00054   RooRealProxy _x     ;                  // Observable
00055   mutable RooFunctor*  _ftor ;                   //! Functor binding of RooAbsReal
00056   mutable ROOT::Math::RichardsonDerivator *_rd ; //! Derivator     
00057 
00058   Double_t evaluate() const;
00059 
00060   ClassDef(RooDerivative,1) // Representation of derivative of any RooAbsReal
00061 };
00062 
00063 #endif

Generated on Tue Jul 5 14:26:09 2011 for ROOT_528-00b_version by  doxygen 1.5.1