rename Interpolator to PDF, add new class TKDInterpolator and
[u/mrichter/AliRoot.git] / STAT / TKDNodeInfo.h
CommitLineData
a3408ed3 1#ifndef ROOT_TKDNodeInfo
2#define ROOT_TKDNodeInfo
3
4#ifndef ROOT_TObject
5#include "TObject.h"
6#endif
7
8template <typename Value> class TVectorT;
9typedef struct TVectorT<Double_t> TVectorD;
10template <typename Value> class TMatrixT;
11typedef class TMatrixT<Double_t> TMatrixD;
12class TKDInterpolatorBase;
13class TKDNodeInfo : public TObject
14{
15friend class TKDInterpolatorBase;
16public:
17 TKDNodeInfo(const Int_t ndim = 0);
18 TKDNodeInfo(const TKDNodeInfo &);
19 TKDNodeInfo& operator=(const TKDNodeInfo &);
20 virtual ~TKDNodeInfo();
21 Double_t CookPDF(const Double_t *point, Double_t &result, Double_t &error);
22 inline Bool_t Has(const Float_t *p);
23 void Print();
24 void Store(const TVectorD &par, const TMatrixD &cov);
25
26protected:
27 void Build(const Int_t ndim);
28
29public:
30 Int_t fNDim; // 3 times data dimension
31 Float_t *fData; //[fNDim] node's data
32 Float_t fVal[2]; // measured value for node
33 TMatrixD *fCov; // interpolator covariance matrix
34 TVectorD *fPar; // interpolator parameters
35
36 ClassDef(TKDNodeInfo, 1) // node info for interpolator
37};
38
39//_____________________________________________________________________
40Bool_t TKDNodeInfo::Has(const Float_t *p)
41{
42 Int_t n = 0;
43 Int_t ndim = fNDim/3;
44 for(int id=0; id<ndim; id++) if(p[id]>=fData[ndim+2*id] && p[id]<fData[ndim+2*id+1]) n++;
45 if(n==ndim) return kTRUE;
46 return kFALSE;
47}
48
49
50#endif
51