1 | // ESAF : Euso Simulation and Analysis Framework |
---|
2 | // $Id: MedianFit.hh 1946 2005-06-14 14:56:04Z pesce $ |
---|
3 | // R. Pesce created Jan, 29 2004 |
---|
4 | |
---|
5 | /***************************************************************************** |
---|
6 | * ESAF: Euso Simulation and Analysis Framework * |
---|
7 | * * |
---|
8 | * Id: MedianFit * |
---|
9 | * Package: Fitting * |
---|
10 | * Coordinator: <coordinator> * |
---|
11 | * * |
---|
12 | *****************************************************************************/ |
---|
13 | |
---|
14 | #ifndef __MEDIANFIT_HH_ |
---|
15 | #define __MEDIANFIT_HH_ |
---|
16 | |
---|
17 | #include <vector> |
---|
18 | #include "euso.hh" |
---|
19 | |
---|
20 | //////////////////////////////////////////////////////////////////////////////// |
---|
21 | // // |
---|
22 | // MedianFit // |
---|
23 | // // |
---|
24 | // Implementation of the median fit for robust data analysis. // |
---|
25 | // See the "Numerical Recipes in C" for further details // |
---|
26 | // // |
---|
27 | //////////////////////////////////////////////////////////////////////////////// |
---|
28 | |
---|
29 | class MedianFit { |
---|
30 | public: |
---|
31 | // ctor |
---|
32 | MedianFit( Int_t numpoints, vector<Double_t> x, vector<Double_t> y ); |
---|
33 | |
---|
34 | // dtor |
---|
35 | virtual ~MedianFit(); |
---|
36 | |
---|
37 | // getters |
---|
38 | inline Double_t GetSlope() { return fSlope; } |
---|
39 | inline Double_t GetOffset() { return fOffset; } |
---|
40 | inline Double_t GetAbsoluteDeviation() { return fAbsoluteDeviation; } |
---|
41 | inline Int_t GetNumPoints() { return fNumPoints; } |
---|
42 | |
---|
43 | private: |
---|
44 | |
---|
45 | Int_t fNumPoints; |
---|
46 | |
---|
47 | vector<Double_t> fPointsX; |
---|
48 | vector<Double_t> fPointsY; |
---|
49 | |
---|
50 | Double_t fSlope; |
---|
51 | Double_t fOffset; |
---|
52 | Double_t fAbsoluteDeviation; |
---|
53 | |
---|
54 | // method of median fit |
---|
55 | void Do(); |
---|
56 | |
---|
57 | Double_t RoFunc( Double_t b ); |
---|
58 | Double_t Select( Int_t k, vector<Double_t> vec ); |
---|
59 | ClassDef(MedianFit,0) |
---|
60 | }; |
---|
61 | |
---|
62 | #endif /* __MEDIANFIT_HH_ */ |
---|
63 | |
---|