1 #ifndef ROOT_TKDNodeInfo
2 #define ROOT_TKDNodeInfo
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;
20 class TKDNodeInfo : public TObject
22 //friend class TKDInterpolatorBase;
24 class TKDNodeDraw : public TBox {
28 void Draw(Option_t* option = "");
29 void SetNode(TKDNodeInfo*, UChar_t s, UChar_t ax1=0, UChar_t ax2=1);
31 TKDNodeDraw(const TKDNodeDraw & ref);
32 TKDNodeDraw& operator=(const TKDNodeDraw & ref);
34 TMarker fCOG; // COG of the node
36 ClassDef(TKDNodeDraw, 1) // graphical representation of TKDNodeInfo
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);
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; }
55 void Build(Int_t ndim);
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
64 ClassDef(TKDNodeInfo, 1) // node info for interpolator
67 //_____________________________________________________________________
68 Bool_t TKDNodeInfo::Has(const Float_t *p) const
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;