ROOT   Reference Guide
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 *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
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 = 0);
39 TObject* clone(const char* newname) const override { return new RooDerivative(*this, newname); }
40
41 Int_t order() const { return _order ; }
42 double eps() const { return _eps ; }
43 void setEps(double e) { _eps = e ; }
44
45 bool redirectServersHook(const RooAbsCollection& /*newServerList*/, bool /*mustReplaceAll*/, bool /*nameChange*/, bool /*isRecursive*/) override ;
46
47protected:
48
49 Int_t _order ; ///< Derivation order
50 double _eps ; ///< Precision
51 RooSetProxy _nset ; ///< Normalization set (optional)
52 RooRealProxy _func ; ///< Input function
53 RooRealProxy _x ; ///< Observable
54 mutable RooFunctor* _ftor ; ///<! Functor binding of RooAbsReal
55 mutable ROOT::Math::RichardsonDerivator *_rd ; ///<! Derivator
56
57 double evaluate() const override;
58
59 ClassDefOverride(RooDerivative,1) // Representation of derivative of any RooAbsReal
60};
61
62#endif
#define e(i)
Definition: RSha256.hxx:103
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
char name[80]
Definition: TGX11.cxx:110
User class for calculating the derivatives of a function.
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:64
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:57
RooDerivative represents the first, second, or third order derivative of any RooAbsReal as calculated...
Definition: RooDerivative.h:30
double eps() const
Definition: RooDerivative.h:42
Int_t order() const
Definition: RooDerivative.h:41
~RooDerivative() override
Destructor.
ROOT::Math::RichardsonDerivator * _rd
! Derivator
Definition: RooDerivative.h:55
RooFunctor * _ftor
! Functor binding of RooAbsReal
Definition: RooDerivative.h:54
RooDerivative()
Default constructor.
double _eps
Precision.
Definition: RooDerivative.h:50
void setEps(double e)
Definition: RooDerivative.h:43
RooSetProxy _nset
Normalization set (optional)
Definition: RooDerivative.h:51
bool redirectServersHook(const RooAbsCollection &, bool, bool, bool) override
Zap functor and derivator ;.
Int_t _order
Derivation order.
Definition: RooDerivative.h:49
double evaluate() const override
Calculate value.
RooRealProxy _func
Input function.
Definition: RooDerivative.h:52
TObject * clone(const char *newname) const override
Definition: RooDerivative.h:39
RooRealProxy _x
Observable.
Definition: RooDerivative.h:53
Lightweight interface adaptor that exports a RooAbsPdf as a functor.
Definition: RooFunctor.h:25
RooRealVar represents a variable that can be changed from the outside.
Definition: RooRealVar.h:40
Mother of all ROOT objects.
Definition: TObject.h:37
Double_t x[n]
Definition: legend1.C:17
Namespace for new Math classes and functions.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.