Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooDerivative.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id$
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16#ifndef ROO_DERIVATIVE
17#define ROO_DERIVATIVE
18
19#include "RooAbsReal.h"
20#include "RooRealProxy.h"
21#include "RooSetProxy.h"
22
23namespace ROOT{ namespace Math {
24class RichardsonDerivator;
25}}
26
27class RooRealVar;
28class RooArgList ;
29
30class RooDerivative : public RooAbsReal {
31public:
32
34 RooDerivative(const char *name, const char *title, RooAbsReal& func, RooRealVar& x, Int_t order=1, double eps=0.001) ;
35 RooDerivative(const char *name, const char *title, RooAbsReal& func, RooRealVar& x, const RooArgSet& nset, Int_t order=1, double eps=0.001) ;
36 ~RooDerivative() override ;
37
38 RooDerivative(const RooDerivative& other, const char* name = nullptr);
39 TObject* clone(const char* newname=nullptr) const override { return new RooDerivative(*this, newname); }
40
41 Int_t order() const { return _order ; }
42
43 double eps() const { return _eps ; }
44
45 RooArgSet const &getNset() const { return _nset; }
46
47 RooAbsReal const &getX() const { return *_x; }
48
49 RooAbsReal const &getFunc() const { return *_func; }
50
51 void setEps(double e) { _eps = e ; }
52
53 bool redirectServersHook(const RooAbsCollection& /*newServerList*/, bool /*mustReplaceAll*/, bool /*nameChange*/, bool /*isRecursive*/) override ;
54
55protected:
56
57 Int_t _order = 1; ///< Derivation order
58 double _eps = 1e-7; ///< Precision
59 RooSetProxy _nset ; ///< Normalization set (optional)
60 RooRealProxy _func ; ///< Input function
61 RooRealProxy _x ; ///< Observable
62 mutable std::unique_ptr<RooFunctor> _ftor; ///<! Functor binding of RooAbsReal
63 mutable std::unique_ptr<ROOT::Math::RichardsonDerivator> _rd; ///<! Derivator
64
65 double evaluate() const override;
66
67 ClassDefOverride(RooDerivative,1) // Representation of derivative of any RooAbsReal
68};
69
70#endif
#define e(i)
Definition RSha256.hxx:103
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
char name[80]
Definition TGX11.cxx:110
Abstract container object that can hold multiple RooAbsArg objects.
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:63
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Represents the first, second, or third order derivative of any RooAbsReal as calculated (numerically)...
TObject * clone(const char *newname=nullptr) const override
double eps() const
RooAbsReal const & getX() const
std::unique_ptr< ROOT::Math::RichardsonDerivator > _rd
! Derivator
Int_t order() const
~RooDerivative() override
RooArgSet const & getNset() const
RooDerivative()
Default constructor.
RooAbsReal const & getFunc() const
double _eps
Precision.
std::unique_ptr< RooFunctor > _ftor
! Functor binding of RooAbsReal
void setEps(double e)
RooSetProxy _nset
Normalization set (optional)
bool redirectServersHook(const RooAbsCollection &, bool, bool, bool) override
Zap functor and derivator ;.
Int_t _order
Derivation order.
double evaluate() const override
Calculate value.
RooRealProxy _func
Input function.
RooRealProxy _x
Observable.
Variable that can be changed from the outside.
Definition RooRealVar.h:37
Mother of all ROOT objects.
Definition TObject.h:41
Double_t x[n]
Definition legend1.C:17
Namespace for new Math classes and functions.