source: trunk/MagicSoft/Mars/mbase/MSpline3.h@ 9386

Last change on this file since 9386 was 9367, checked in by tbretz, 16 years ago
*** empty log message ***
File size: 1.9 KB
Line 
1#ifndef MARS_MSpline3
2#define MARS_MSpline3
3
4#ifndef ROOT_TSpline
5#include <TSpline.h>
6#endif
7
8class MArrayD;
9
10class MSpline3 : public TSpline3
11{
12private:
13 TGraph *ConvertSpline(const TSpline &s, Float_t freq) const;
14 TGraph *ConvertGraph(const TGraph &s, Float_t freq) const;
15 MArrayD &ConvertFunc(const TF1 &f, Float_t freq) const;
16
17public:
18 MSpline3() { }
19
20 // None equidistant binning (evaluation a bit slower in case of many bins)
21 MSpline3(const TGraph &g,
22 const char *opt=0, Double_t valbeg=0, Double_t valend=0)
23 : TSpline3("MSpline3", &g, opt, valbeg, valend)
24 {
25 }
26
27 MSpline3(const TGraph &g, Double_t freq,
28 const char *opt=0, Double_t valbeg=0, Double_t valend=0)
29 : TSpline3("MSpline3", ConvertGraph(g, freq), opt, valbeg, valend)
30 {
31 }
32
33 MSpline3(const TSpline &s, Double_t freq,
34 const char *opt=0, Double_t valbeg=0, Double_t valend=0)
35 : TSpline3("MSpline3", ConvertSpline(s, freq), opt, valbeg, valend)
36 {
37 }
38
39 MSpline3(const Double_t x[], const Double_t y[], Int_t n, const char *opt=0,
40 Double_t valbeg=0, Double_t valend=0)
41 : TSpline3("MSpline3", const_cast<Double_t*>(x), const_cast<Double_t*>(y), n, opt, valbeg, valend)
42 {
43 }
44
45 // Equidistant binning (evaluation a bit faster in case of many bins)
46
47 // FIXME: In principle TF1 can be evaluated histogram like which should be faster
48 MSpline3(const TF1 &f, const char *opt=0,Double_t valbeg=0, Double_t valend=0);
49 MSpline3(const TF1 &f, Double_t freq, const char *opt=0,Double_t valbeg=0, Double_t valend=0);
50
51 Double_t GetXmin() const { return fXmin; } // Minimum value of abscissa
52 Double_t GetXmax() const { return fXmax; } // Maximum value of abscissa
53
54 Int_t GetNp() const { return fNp; }
55
56 TH1 *GetHistogram() const { return (TH1*)fHistogram; }
57
58 ClassDef(MSpline3, 1) // An extension of the TSpline3
59};
60
61#endif
Note: See TracBrowser for help on using the repository browser.