Coding conventions
[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;
1a439134 12//class TKDInterpolatorBase;
a3408ed3 13class TKDNodeInfo : public TObject
14{
1a439134 15 //friend class TKDInterpolatorBase;
a3408ed3 16public:
1a439134 17 TKDNodeInfo(Int_t ndim = 0);
18 TKDNodeInfo(const TKDNodeInfo & ref);
19 TKDNodeInfo& operator=(const TKDNodeInfo & ref);
a3408ed3 20 virtual ~TKDNodeInfo();
21 Double_t CookPDF(const Double_t *point, Double_t &result, Double_t &error);
1a439134 22 inline Bool_t Has(const Float_t *p) const;
23 void Print(const Option_t * = "") const;
a3408ed3 24 void Store(const TVectorD &par, const TMatrixD &cov);
25
1a439134 26 Int_t GetSize() const { return fNDim; }
27 Float_t * Data() { return fData; }
28 Float_t * Val() { return fVal; }
29 TMatrixD * Cov() { return fCov; }
30 TVectorD * Par() { return fPar; }
31
a3408ed3 32protected:
1a439134 33 void Build(Int_t ndim);
a3408ed3 34
1a439134 35private:
a3408ed3 36 Int_t fNDim; // 3 times data dimension
37 Float_t *fData; //[fNDim] node's data
38 Float_t fVal[2]; // measured value for node
39 TMatrixD *fCov; // interpolator covariance matrix
40 TVectorD *fPar; // interpolator parameters
41
42 ClassDef(TKDNodeInfo, 1) // node info for interpolator
43};
44
45//_____________________________________________________________________
1a439134 46Bool_t TKDNodeInfo::Has(const Float_t *p) const
a3408ed3 47{
48 Int_t n = 0;
49 Int_t ndim = fNDim/3;
50 for(int id=0; id<ndim; id++) if(p[id]>=fData[ndim+2*id] && p[id]<fData[ndim+2*id+1]) n++;
51 if(n==ndim) return kTRUE;
52 return kFALSE;
53}
54
55
56#endif
57