source: branches/Mars_use_drstimefiles/mbase/MSpline3.h@ 17989

Last change on this file since 17989 was 9518, checked in by tbretz, 15 years ago
*** empty log message ***
File size: 2.1 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
17 Double_t IntegralBin(Int_t i, Double_t x) const;
18 Double_t IntegralBin(Int_t i) const;
19
20public:
21 MSpline3() { }
22
23 // None equidistant binning (evaluation a bit slower in case of many bins)
24 MSpline3(const TGraph &g,
25 const char *opt=0, Double_t valbeg=0, Double_t valend=0)
26 : TSpline3("MSpline3", &g, opt, valbeg, valend)
27 {
28 }
29
30 MSpline3(const TGraph &g, Double_t freq,
31 const char *opt=0, Double_t valbeg=0, Double_t valend=0)
32 : TSpline3("MSpline3", ConvertGraph(g, freq), opt, valbeg, valend)
33 {
34 }
35
36 MSpline3(const TSpline &s, Double_t freq,
37 const char *opt=0, Double_t valbeg=0, Double_t valend=0)
38 : TSpline3("MSpline3", ConvertSpline(s, freq), opt, valbeg, valend)
39 {
40 }
41
42 MSpline3(const Double_t x[], const Double_t y[], Int_t n, const char *opt=0,
43 Double_t valbeg=0, Double_t valend=0)
44 : TSpline3("MSpline3", const_cast<Double_t*>(x), const_cast<Double_t*>(y), n, opt, valbeg, valend)
45 {
46 }
47
48 // Equidistant binning (evaluation a bit faster in case of many bins)
49
50 // FIXME: In principle TF1 can be evaluated histogram like which should be faster
51 MSpline3(const TF1 &f, const char *opt=0,Double_t valbeg=0, Double_t valend=0);
52 MSpline3(const TF1 &f, Double_t freq, const char *opt=0,Double_t valbeg=0, Double_t valend=0);
53
54 Double_t GetXmin() const { return fXmin; } // Minimum value of abscissa
55 Double_t GetXmax() const { return fXmax; } // Maximum value of abscissa
56
57 Int_t GetNp() const { return fNp; }
58
59 TH1 *GetHistogram() const { return (TH1*)fHistogram; }
60
61 Double_t Integral(Double_t a, Double_t b) const;
62 Double_t Integral() const;
63
64 Double_t IntegralSolidAngle() const;
65
66 ClassDef(MSpline3, 1) // An extension of the TSpline3
67};
68
69#endif
Note: See TracBrowser for help on using the repository browser.