Follow the compilation scheme of AliRoot and to fulfill the C++ effic
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 6 Aug 2007 12:56:20 +0000 (12:56 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 6 Aug 2007 12:56:20 +0000 (12:56 +0000)
STAT/Makefile
STAT/TKDInterpolator.cxx
STAT/TKDInterpolator.h
STAT/TKDTree.cxx
STAT/TKDTree.h
STAT/kDStatLinkDef.h [new file with mode: 0644]

index 24d9d20..43ebeb8 100644 (file)
@@ -32,7 +32,7 @@ CXXFLAGS += $(ROOTCXX) $(MCCXX) $(LOCALCXX)
 # define module specific variables
 FILE_LIST =  $(shell ls -1 ./*.$(SrcSuf))
 FILES = $(basename $(FILE_LIST))
-DICTIONARIES = kdTreeDict
+DICTIONARIES = kDStatDict
 OBJECTS = $(addsuffix .$(ObjSuf),$(FILES))
 OBJECTS += ./$(DICTIONARIES).$(ObjSuf)
 
@@ -43,7 +43,7 @@ HEADERS = $(notdir $(HDRS))
 # define libs on which the main lib depends ! (this are defined in config/Makefile.flags)
 LIBSDEPEND = $(ROOTLIBS) $(MCLIBS)
 # define libs build by module
-LIBS = libKDTree.so
+LIBS = libKDStat.so
 
 # rule for building executables
 $(EXECS):      $(OBJECTS)
index 88bce8a..1724ac0 100644 (file)
@@ -247,7 +247,6 @@ void TKDInterpolator::DrawNodes(Int_t depth, Int_t ax1, Int_t ax2)
        TGraph *ref = new TGraph(GetNTerminalNodes());
        ref->SetMarkerStyle(2);
        ref->SetMarkerColor(2);
-       Float_t val, error;
        for(int inode = 0; inode < GetNTerminalNodes(); inode++) ref->SetPoint(inode, fRefPoints[ax1][inode], fRefPoints[ax2][inode]);
        ref->Draw("p");
        return;
index 24212d2..d1e73d2 100644 (file)
@@ -19,7 +19,10 @@ public:
        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);
+
 private:
+       TKDInterpolator(const TKDInterpolator &);
+       TKDInterpolator& operator=(const TKDInterpolator &);    
        void            Build();
        
 protected:
@@ -43,7 +46,7 @@ Bool_t        TKDInterpolator::GetEstimate(Int_t node, Float_t *coord, Float_t &val, Fl
 
        for(int idim=0; idim<fNDim; idim++) coord[idim] = fRefPoints[idim][node];
        val   = fRefValues[node];
-       //error = ...;
+       error = fRefValues[node]; // to be implemented
        return kTRUE;
 }
 
index e653312..e679ed3 100644 (file)
@@ -38,12 +38,15 @@ TKDTree<Index, Value>::TKDTree() :
        ,fNDim(0)
        ,fNpoints(0)
        ,fBucketSize(0)
-       ,fIndPoints(0x0)
        ,fData(0x0)
        ,fRange(0x0)
        ,fBoundaries(0x0)
        ,fNodes(0x0)
        ,fkNN(0x0)
+       ,fIndPoints(0x0)
+       ,fRowT0(0)
+       ,fCrossNode(0)
+       ,fOffset(0)
 {
 // Default constructor. Nothing is built
 }
@@ -58,19 +61,21 @@ TKDTree<Index, Value>::TKDTree(Index npoints, Index ndim, UInt_t bsize, Value **
        ,fNDim(ndim)
        ,fNpoints(npoints)
        ,fBucketSize(bsize)
-       ,fIndPoints(0x0)
        ,fData(data) //Columnwise!!!!!
        ,fRange(0x0)
        ,fBoundaries(0x0)
        ,fNodes(0x0)
        ,fkNN(0x0)
+       ,fIndPoints(0x0)
+       ,fRowT0(0)
+       ,fCrossNode(0)
+       ,fOffset(0)
 {
        // Allocate data by hand. See TKDTree(TTree*, const Char_t*) for an automatic method.
        
        Build();
 }
 
-
 //_________________________________________________________________
 template <typename  Index, typename Value>
 TKDTree<Index, Value>::~TKDTree()
@@ -222,7 +227,6 @@ void TKDTree<Index, Value>::Build(){
                        if (nleft<0 || nright<0) Warning("Build()", "Problem Negative number");
                }
        }
-       OrderIndexes();
        
        //printf("NBuckets\t%d\n", nbucketsall);
        //fData = 0;
@@ -404,9 +408,12 @@ Index TKDTree<Index, Value>::FindNode(const Value * point){
                        stackNode[currentIndex]=(inode*2)+2;
                }
        }
+       
+       return -1;
 }
 
 
+
 //_________________________________________________________________
 template <typename  Index, typename Value>
 void TKDTree<Index, Value>::FindPoint(Value * point, Index &index, Int_t &iter){
@@ -752,18 +759,6 @@ void TKDTree<Index, Value>::CookBoundariesTerminal(Int_t parent_node, Bool_t LEF
        }
 }
 
-//_________________________________________________________________
-template <typename Index, typename Value>
-void TKDTree<Index, Value>::OrderIndexes()
-{
-// Order array of point's indexes in increasing order of terminal nodes
-// indexes such that first bucket points correspond to first terminal
-// node (index fNnodes) and so on.
-
-       printf("fRowT0 %d fCrossNode %d fOffset %d\n", fRowT0, fCrossNode, fOffset);
-
-}
-
 template class TKDTree<Int_t, Float_t>;
 template class TKDTree<Int_t, Double_t>;
 
index fb476c8..3b48910 100644 (file)
@@ -49,11 +49,12 @@ public:
 
 protected:
                                                                        void            Build();  // build tree
-                                                                       void            Clear(){};  // clear memory allocation
                                                                        
 private:
+                                                                       TKDTree(const TKDTree &); // not implemented
+                                                                       TKDTree<Index, Value>& operator=(const TKDTree<Index, Value>&); // not implemented
                                                                        void            CookBoundariesTerminal(Int_t parent_node, Bool_t left);
-                                                                       void            OrderIndexes();
+
 public:
        struct TKDNode{
                Char_t fAxis;
diff --git a/STAT/kDStatLinkDef.h b/STAT/kDStatLinkDef.h
new file mode 100644 (file)
index 0000000..49e2c0c
--- /dev/null
@@ -0,0 +1,20 @@
+#ifdef __CINT__
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class TKDTree<Int_t, Float_t>+;
+#pragma link C++ class TKDTree <Int_t, Double_t>+;
+#pragma link C++ typedef TKDTreeIF;
+#pragma link C++ typedef TKDTreeID;
+
+#pragma link C++ class TKDInterpolator+;
+#pragma link C++ class TKDSpline+;
+
+
+#endif
+