]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Small interface modification
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Sep 2007 09:55:40 +0000 (09:55 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Sep 2007 09:55:40 +0000 (09:55 +0000)
STAT/TKDInterpolator.h

index d1e73d2185a7572a5d4d7d39146f49dc6b5446b3..e1d0ab3115308d991f2a2851bf581bf0ff13a67d 100644 (file)
@@ -14,16 +14,18 @@ public:
        TKDInterpolator(TTree *t, const Char_t *var, const Char_t *cut = 0, UInt_t bsize = 100);
        TKDInterpolator(Int_t npoints, Int_t ndim, UInt_t bsize, Float_t **data);
        ~TKDInterpolator();
-       
-       inline Bool_t   GetEstimate(Int_t node, Float_t *coord, Float_t &val, Float_t &error) const ;
-       Double_t Eval(Float_t *point);
-       void            DrawNodes(Int_t depth = -1, Int_t ax1 = 0, Int_t ax2 = 1);
-       void            DrawNode(Int_t node, Int_t ax1 = 0, Int_t ax2 = 1);
+
+               TKDTreeIF* GetHelper() {return fKDhelper;}
+       inline Bool_t     GetCOGPoint(Int_t node, Float_t *coord, Float_t &val, Float_t &error) const ;
+       inline Bool_t     GetDataPoint(Int_t n, Float_t *p) const;
+               Double_t   Eval(const Double_t *point, Int_t npoints = 12);
+               void       DrawNodes(UInt_t ax1 = 0, UInt_t ax2 = 1, Int_t depth = -1);
+               void       DrawNode(Int_t tnode, UInt_t ax1 = 0, UInt_t ax2 = 1);
 
 private:
        TKDInterpolator(const TKDInterpolator &);
        TKDInterpolator& operator=(const TKDInterpolator &);    
-       void            Build();
+               void       Build();
        
 protected:
        Int_t     fNTNodes;        //Number of evaluation data points
@@ -40,9 +42,9 @@ private:
 };
 
 //__________________________________________________________________
-Bool_t TKDInterpolator::GetEstimate(Int_t node, Float_t *coord, Float_t &val, Float_t &error) const
+Bool_t TKDInterpolator::GetCOGPoint(Int_t node, Float_t *coord, Float_t &val, Float_t &error) const
 {
-       if(node < 0 || node > GetNTerminalNodes()) return kFALSE;
+       if(node < 0 || node > fNTNodes) return kFALSE;
 
        for(int idim=0; idim<fNDim; idim++) coord[idim] = fRefPoints[idim][node];
        val   = fRefValues[node];
@@ -50,5 +52,15 @@ Bool_t       TKDInterpolator::GetEstimate(Int_t node, Float_t *coord, Float_t &val, Fl
        return kTRUE;
 }
 
+//__________________________________________________________________
+Bool_t TKDInterpolator::GetDataPoint(Int_t n, Float_t *p) const
+{
+       if(n < 0 || n >= fNpoints) return kFALSE;
+       
+       for(int i=0; i<fNDim; i++) p[i] = fData[i][n];
+       return kTRUE;
+}
+
+
 #endif