Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooSpline.h
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 * Author:
4 * Ruggero Turra <ruggero.turra@cern.ch>, 2016
5 *
6 * Copyright (c) 2023, CERN
7 *
8 * Redistribution and use in source and binary forms,
9 * with or without modification, are permitted according to the terms
10 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
11 */
12
13#ifndef RooFit_RooSpline_h
14#define RooFit_RooSpline_h
15
16#include <RooAbsReal.h>
17#include <RooRealProxy.h>
18
19#include <TSpline.h>
20
21#include <ROOT/RSpan.hxx>
22
23#include <vector>
24
25class TGraph;
26
27class RooSpline : public RooAbsReal {
28public:
29 RooSpline() = default;
30 RooSpline(const char *name, const char *title, RooAbsReal &x, std::span<const double> x0, std::span<const double> y0,
31 int order = 3, bool logx = false, bool logy = false);
32 RooSpline(const char *name, const char *title, RooAbsReal &x, const TGraph &gr, int order = 3, bool logx = false,
33 bool logy = false);
34 RooSpline(const RooSpline &other, const char *name = nullptr);
35
36 /// Virtual copy constructor.
37 /// \param[in] newname The name of the cloned object (optional).
38 TObject *clone(const char *newname) const override { return new RooSpline(*this, newname); }
39
40protected:
41 double evaluate() const override;
42
43private:
44 std::unique_ptr<TSpline> _spline; ///< The spline object.
45 RooRealProxy _x; ///< The independent variable.
46 bool _logx = false; ///< Flag indicating logarithmic scaling of x values.
47 bool _logy = false; ///< Flag indicating logarithmic scaling of y values.
48
49 ClassDefOverride(RooSpline, 1); // A RooFit class for creating spline functions
50};
51#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
char name[80]
Definition TGX11.cxx:110
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
A RooFit class for creating spline functions.
Definition RooSpline.h:27
bool _logx
Flag indicating logarithmic scaling of x values.
Definition RooSpline.h:46
double evaluate() const override
Evaluate the spline function at the current point.
RooSpline()=default
RooRealProxy _x
The independent variable.
Definition RooSpline.h:45
std::unique_ptr< TSpline > _spline
The spline object.
Definition RooSpline.h:44
bool _logy
Flag indicating logarithmic scaling of y values.
Definition RooSpline.h:47
TObject * clone(const char *newname) const override
Virtual copy constructor.
Definition RooSpline.h:38
A TGraph is an object made of two arrays X and Y with npoints each.
Definition TGraph.h:41
Mother of all ROOT objects.
Definition TObject.h:41
Double_t x[n]
Definition legend1.C:17
TGraphErrors * gr
Definition legend1.C:25