From a9c20b1f6a514f5e826de18eba20b88b4677aea5 Mon Sep 17 00:00:00 2001 From: abercuci Date: Mon, 6 Aug 2007 12:56:20 +0000 Subject: [PATCH] Follow the compilation scheme of AliRoot and to fulfill the C++ effic --- STAT/Makefile | 4 ++-- STAT/TKDInterpolator.cxx | 1 - STAT/TKDInterpolator.h | 5 ++++- STAT/TKDTree.cxx | 27 +++++++++++---------------- STAT/TKDTree.h | 5 +++-- STAT/kDStatLinkDef.h | 20 ++++++++++++++++++++ 6 files changed, 40 insertions(+), 22 deletions(-) create mode 100644 STAT/kDStatLinkDef.h diff --git a/STAT/Makefile b/STAT/Makefile index 24d9d20e0e0..43ebeb88185 100644 --- a/STAT/Makefile +++ b/STAT/Makefile @@ -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) diff --git a/STAT/TKDInterpolator.cxx b/STAT/TKDInterpolator.cxx index 88bce8aee78..1724ac0056f 100644 --- a/STAT/TKDInterpolator.cxx +++ b/STAT/TKDInterpolator.cxx @@ -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; diff --git a/STAT/TKDInterpolator.h b/STAT/TKDInterpolator.h index 24212d22748..d1e73d2185a 100644 --- a/STAT/TKDInterpolator.h +++ b/STAT/TKDInterpolator.h @@ -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::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::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 TKDTree::~TKDTree() @@ -222,7 +227,6 @@ void TKDTree::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::FindNode(const Value * point){ stackNode[currentIndex]=(inode*2)+2; } } + + return -1; } + //_________________________________________________________________ template void TKDTree::FindPoint(Value * point, Index &index, Int_t &iter){ @@ -752,18 +759,6 @@ void TKDTree::CookBoundariesTerminal(Int_t parent_node, Bool_t LEF } } -//_________________________________________________________________ -template -void TKDTree::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; template class TKDTree; diff --git a/STAT/TKDTree.h b/STAT/TKDTree.h index fb476c8e59b..3b48910e8f9 100644 --- a/STAT/TKDTree.h +++ b/STAT/TKDTree.h @@ -49,11 +49,12 @@ public: protected: void Build(); // build tree - void Clear(){}; // clear memory allocation private: + TKDTree(const TKDTree &); // not implemented + TKDTree& operator=(const TKDTree&); // 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 index 00000000000..49e2c0cc677 --- /dev/null +++ b/STAT/kDStatLinkDef.h @@ -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+; +#pragma link C++ class TKDTree +; +#pragma link C++ typedef TKDTreeIF; +#pragma link C++ typedef TKDTreeID; + +#pragma link C++ class TKDInterpolator+; +#pragma link C++ class TKDSpline+; + + +#endif + -- 2.39.3