]>
Commit | Line | Data |
---|---|---|
a3408ed3 | 1 | #ifndef ROOT_TKDNodeInfo |
2 | #define ROOT_TKDNodeInfo | |
3 | ||
4 | #ifndef ROOT_TObject | |
5 | #include "TObject.h" | |
6 | #endif | |
7 | ||
b6f6b31a | 8 | #ifndef ROOT_TBox |
9 | #include "TBox.h" | |
10 | #endif | |
11 | ||
12 | #ifndef ROOT_TMarker | |
13 | #include "TMarker.h" | |
14 | #endif | |
15 | ||
a3408ed3 | 16 | template <typename Value> class TVectorT; |
17 | typedef struct TVectorT<Double_t> TVectorD; | |
18 | template <typename Value> class TMatrixT; | |
19 | typedef class TMatrixT<Double_t> TMatrixD; | |
a3408ed3 | 20 | class TKDNodeInfo : public TObject |
21 | { | |
1a439134 | 22 | //friend class TKDInterpolatorBase; |
a3408ed3 | 23 | public: |
b6f6b31a | 24 | class TKDNodeDraw : public TBox { |
25 | public: | |
26 | TKDNodeDraw(); | |
27 | ~TKDNodeDraw() {;} | |
28 | void Draw(Option_t* option = ""); | |
29 | void SetNode(TKDNodeInfo*, UChar_t s, UChar_t ax1=0, UChar_t ax2=1); | |
30 | private: | |
31 | TKDNodeDraw(const TKDNodeDraw & ref); | |
32 | TKDNodeDraw& operator=(const TKDNodeDraw & ref); | |
33 | ||
34 | TMarker fCOG; // COG of the node | |
35 | ||
36 | ClassDef(TKDNodeDraw, 1) // graphical representation of TKDNodeInfo | |
37 | }; | |
38 | ||
39 | TKDNodeInfo(Int_t ndim = 0); | |
40 | TKDNodeInfo(const TKDNodeInfo & ref); | |
41 | TKDNodeInfo& operator=(const TKDNodeInfo & ref); | |
42 | virtual ~TKDNodeInfo(); | |
43 | Double_t CookPDF(const Double_t *point, Double_t &result, Double_t &error); | |
44 | inline Bool_t Has(const Float_t *p) const; | |
45 | void Print(const Option_t * = "") const; | |
46 | void Store(const TVectorD &par, const TMatrixD &cov); | |
47 | ||
48 | Int_t GetSize() const { return fNDim; } | |
49 | Float_t * Data() { return fData; } | |
50 | Float_t * Val() { return fVal; } | |
51 | TMatrixD * Cov() { return fCov; } | |
52 | TVectorD * Par() { return fPar; } | |
1a439134 | 53 | |
a3408ed3 | 54 | protected: |
b6f6b31a | 55 | void Build(Int_t ndim); |
a3408ed3 | 56 | |
1a439134 | 57 | private: |
b6f6b31a | 58 | Int_t fNDim; // 3 times data dimension |
59 | Float_t *fData; //[fNDim] node's data | |
60 | Float_t fVal[2]; // measured value for node | |
61 | TMatrixD *fCov; // interpolator covariance matrix | |
62 | TVectorD *fPar; // interpolator parameters | |
a3408ed3 | 63 | |
b6f6b31a | 64 | ClassDef(TKDNodeInfo, 1) // node info for interpolator |
a3408ed3 | 65 | }; |
66 | ||
67 | //_____________________________________________________________________ | |
1a439134 | 68 | Bool_t TKDNodeInfo::Has(const Float_t *p) const |
a3408ed3 | 69 | { |
b6f6b31a | 70 | Int_t n = 0; |
71 | Int_t ndim = fNDim/3; | |
72 | for(int id=0; id<ndim; id++) if(p[id]>=fData[ndim+2*id] && p[id]<fData[ndim+2*id+1]) n++; | |
73 | if(n==ndim) return kTRUE; | |
74 | return kFALSE; | |
a3408ed3 | 75 | } |
76 | ||
77 | ||
78 | #endif | |
79 |