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