Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooDerivative.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitCore                                                       *
0004  *    File: $Id$
0005  * Authors:                                                                  *
0006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
0007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
0008  *                                                                           *
0009  * Copyright (c) 2000-2005, Regents of the University of California          *
0010  *                          and Stanford University. All rights reserved.    *
0011  *                                                                           *
0012  * Redistribution and use in source and binary forms,                        *
0013  * with or without modification, are permitted according to the terms        *
0014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
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) const override { return new RooDerivative(*this, newname); }
0040 
0041   Int_t order() const { return _order ; }
0042   double eps() const { return _eps ; }
0043   void setEps(double e) { _eps = e ; }
0044 
0045   bool redirectServersHook(const RooAbsCollection& /*newServerList*/, bool /*mustReplaceAll*/, bool /*nameChange*/, bool /*isRecursive*/) override ;
0046 
0047 protected:
0048 
0049   Int_t _order = 1;                                       ///< Derivation order
0050   double _eps = 1e-7;                                     ///< Precision
0051   RooSetProxy  _nset ;                                    ///< Normalization set (optional)
0052   RooRealProxy _func ;                                    ///< Input function
0053   RooRealProxy _x     ;                                   ///< Observable
0054   mutable std::unique_ptr<RooFunctor> _ftor;                   ///<! Functor binding of RooAbsReal
0055   mutable std::unique_ptr<ROOT::Math::RichardsonDerivator> _rd; ///<! Derivator
0056 
0057   double evaluate() const override;
0058 
0059   ClassDefOverride(RooDerivative,1) // Representation of derivative of any RooAbsReal
0060 };
0061 
0062 #endif