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) 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 = 1; ///< Derivation order
50 double _eps = 1e-7; ///< Precision
51 RooSetProxy _nset ; ///< Normalization set (optional)
52 RooRealProxy _func ; ///< Input function
53 RooRealProxy _x ; ///< Observable
54 mutable std::unique_ptr<RooFunctor> _ftor; ///<! Functor binding of RooAbsReal
55 mutable std::unique_ptr<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:346
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:59
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)...
double eps() const
std::unique_ptr< ROOT::Math::RichardsonDerivator > _rd
! Derivator
Int_t order() const
~RooDerivative() override
RooDerivative()
Default constructor.
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.
TObject * clone(const char *newname) const override
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.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...