1 #ifndef ROOT_ALITRDTKDINTERPOLATOR_H
2 #define ROOT_ALITRDTKDINTERPOLATOR_H
17 class AliTRDTKDInterpolator : public TKDTreeIF
30 // Bucket Object class
31 class AliTRDTKDNodeInfo : public TObject
33 friend class AliTRDTKDInterpolator;
36 AliTRDTKDNodeInfo(Int_t ndim = 0);
37 AliTRDTKDNodeInfo(const AliTRDTKDInterpolator::AliTRDTKDNodeInfo &ref);
38 AliTRDTKDInterpolator::AliTRDTKDNodeInfo& operator=(const AliTRDTKDInterpolator::AliTRDTKDNodeInfo &ref);
39 virtual ~AliTRDTKDNodeInfo();
40 Bool_t CookPDF(const Double_t *point, Double_t &result, Double_t &error) const;
41 Bool_t Has(const Float_t *p) const;
42 void Print(const Option_t * = "") const;
43 void Store(TVectorD const *par, TMatrixD const *cov=NULL);
46 Int_t fNDim; // Dimension of Points
47 Int_t fNBounds; // 2* Dimension of Points
48 Int_t fNPar; // Number of Parameters
49 Int_t fNCov; // Size of Cov Matrix
50 Float_t *fData; //[fNDim] Data Point
51 Float_t *fBounds; //[fNBounds] Boundaries
52 Float_t fVal[2]; //measured value for node
53 Double_t *fPar; //[fNPar] interpolator parameters
54 Double_t *fCov; //[fNCov] interpolator covariance matrix
56 ClassDef(AliTRDTKDNodeInfo, 1) // node info for interpolator
61 AliTRDTKDInterpolator();
62 AliTRDTKDInterpolator(Int_t npoints, Int_t ndim, UInt_t bsize, Float_t **data);
63 ~AliTRDTKDInterpolator();
65 Bool_t Eval(const Double_t *point, Double_t &result, Double_t &error);
66 void Print(const Option_t *opt="") const;
68 TH2Poly * Projection(Int_t xdim,Int_t ydim);
70 Int_t GetNDIM() const {return fNDim;}
71 Bool_t GetRange(Int_t idim,Float_t range[2]) const;
73 void SetNPointsInterpolation(Int_t np){fNPointsI=np;};
74 Int_t GetNPointsInterpolation(){return fNPointsI;};
76 void SetUseWeights(Bool_t k=kTRUE){fUseWeights=k;}
77 void SetPDFMode(TRDTKDMode mod){fPDFMode=mod;}
81 void SetUseHelperNodes(Bool_t k){fUseHelperNodes=k;}
85 Int_t GetNodeIndex(const Float_t *p);
86 AliTRDTKDInterpolator::AliTRDTKDNodeInfo* GetNodeInfo(Int_t inode) const;
87 Int_t GetNTNodes() const;
88 void BuildInterpolation();
89 void BuildBoundaryNodes();
90 AliTRDTKDInterpolator(const AliTRDTKDInterpolator &ref);
91 AliTRDTKDInterpolator &operator=(const AliTRDTKDInterpolator &ref);
93 Int_t fNDataNodes; // Number of filled nodes (total-zero nodes)
94 TClonesArray *fNodes; //interpolation nodes
95 UChar_t fLambda; // number of parameters in polynom
96 Int_t fNPointsI; // number of points for interpolation
97 Bool_t fUseHelperNodes; // Build Helper nodes to ensure boundary conditions
98 Bool_t fUseWeights; // Use tricubic weights
99 TRDTKDMode fPDFMode; // Mode for PDF calculation
101 ClassDef(AliTRDTKDInterpolator, 1) // data interpolator based on KD tree