X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=STAT%2FTKDPDF.h;h=e384475dc79146146aa3117f7d541b42d1c6c4b5;hb=b322e06ab6b415689a025efc26a2ba86cd6d3e22;hp=846e3e053404a6aa6ac69dbd94dff834c0dba204;hpb=1a43913423f3802fef48e561f56645271612a0e4;p=u%2Fmrichter%2FAliRoot.git diff --git a/STAT/TKDPDF.h b/STAT/TKDPDF.h index 846e3e05340..e384475dc79 100644 --- a/STAT/TKDPDF.h +++ b/STAT/TKDPDF.h @@ -1,14 +1,14 @@ #ifndef ROOT_TKDPDF #define ROOT_TKDPDF -#ifndef ROOT_TKDTree -#include "TKDTree.h" -#endif - #ifndef ROOT_TKDInterpolatorBase #include "TKDInterpolatorBase.h" #endif +#ifndef ROOT_TKDTree +#include "TKDTree.h" +#endif + // Non parametric interpolation class based on local polinomial regression. // The class can be used to approximate PDF together with TKDTree or for // general regression when the data points are given. @@ -20,39 +20,39 @@ class TLinearFitter; class TKDPDF : public TKDTreeIF, public TKDInterpolatorBase { public: - TKDPDF(); - TKDPDF(TTree *t, const Char_t *var, const Char_t *cut = 0, UInt_t bsize = 100, Long64_t nentries = 1000000000, Long64_t firstentry = 0); - TKDPDF(Int_t npoints, Int_t ndim, UInt_t bsize, Float_t **data); - ~TKDPDF(); + TKDPDF(); + TKDPDF(TTree *t, const Char_t *var, const Char_t *cut = 0, UInt_t bsize = 100, Long64_t nentries = 1000000000, Long64_t firstentry = 0); + TKDPDF(Int_t npoints, Int_t ndim, UInt_t bsize, Float_t **data); + ~TKDPDF(); - inline Bool_t GetDataPoint(Int_t n, Float_t *p) const; - inline Int_t GetNodeIndex(const Float_t *p); - void DrawNode(Int_t tnode, UInt_t ax1=0, UInt_t ax2=1); + inline Bool_t GetDataPoint(Int_t n, Float_t *p) const; + inline Int_t GetNodeIndex(const Float_t *p); + void DrawNode(Int_t tnode, UInt_t ax1=0, UInt_t ax2=1); private: - TKDPDF(const TKDPDF &); - TKDPDF& operator=(const TKDPDF &); - void Build(Int_t ndim = 0); + TKDPDF(const TKDPDF &); + TKDPDF& operator=(const TKDPDF &); + Bool_t Build(Int_t ndim = 0); - - ClassDef(TKDPDF, 1) // data interpolator based on KD tree + + ClassDef(TKDPDF, 1) // data interpolator based on KD tree }; //__________________________________________________________________ Bool_t TKDPDF::GetDataPoint(Int_t n, Float_t *p) const { - if(n < 0 || n >= fNpoints) return kFALSE; - if(!fData) return kFALSE; - - for(int i=0; i= fNPoints) return kFALSE; + if(!fData) return kFALSE; + + for(int i=0; i