Index: trunk/MagicSoft/Mars/mranforest/MHRanForest.cc
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MHRanForest.cc	(revision 2207)
+++ trunk/MagicSoft/Mars/mranforest/MHRanForest.cc	(revision 2296)
@@ -68,5 +68,4 @@
     fGraphSigma = new TGraph;
     fGraphSigma->SetTitle("Evolution of Standard deviation of estimated hadronness in tree combination");
-    fGraphSigma->SetMaximum(1);
     fGraphSigma->SetMarkerStyle(kFullDotSmall);
 }
@@ -113,4 +112,5 @@
 {
     fNumEvent++;
+
     Double_t hest=0;
     Double_t htrue=fMcEvt->GetPartId()==kGAMMA ? 0. : 1.;
@@ -124,5 +124,7 @@
 
         hest/=i+1;
-        fSigma[i]+=(htrue-hest)*(htrue-hest);
+
+        const Double_t val = htrue-hest;
+        fSigma[i] += val*val;
     }
 
@@ -145,11 +147,15 @@
     for (Int_t i=0; i<n; i++)
     {
-        Stat_t ip = i+1.;
-	fSigma[i] = TMath::Sqrt(fSigma[i]/Stat_t(fNumEvent));
-        Stat_t ig = fSigma[i];
-        max=TMath::Max(max,ig);
-        min=TMath::Min(min,ig);
-        fGraphSigma->SetPoint(i,ip,ig);
+	fSigma[i] = TMath::Sqrt(fSigma[i]/fNumEvent);
+
+        const Stat_t ig = fSigma[i];
+        if (ig>max) max = ig;
+        if (ig<min) min = ig;
+        fGraphSigma->SetPoint(i, i+1, ig);
     }
+
+    // This is used in root>3.04/? so that SetMaximum/Minimum can succeed
+    fGraphSigma->GetHistogram();
+
     fGraphSigma->SetMaximum(1.05*max);
     fGraphSigma->SetMinimum(0.95*min);
@@ -180,5 +186,5 @@
         return;
 
-    h->GetXaxis()->SetRangeUser(0, 1);
+    //h->GetXaxis()->SetRangeUser(0, fNumEvent+1);
     h->SetXTitle("No.of Trees");
     h->SetYTitle("\\sigma of est.hadronness");
Index: trunk/MagicSoft/Mars/mranforest/MHRanForestGini.cc
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MHRanForestGini.cc	(revision 2207)
+++ trunk/MagicSoft/Mars/mranforest/MHRanForestGini.cc	(revision 2296)
@@ -66,5 +66,4 @@
     fGraphGini = new TGraph;
     fGraphGini->SetTitle("Importance of RF-input parameters measured by mean Gini decrease");
-    fGraphGini->SetMaximum(1);
     fGraphGini->SetMarkerStyle(kFullDotSmall);
 }
@@ -116,23 +115,27 @@
 Bool_t MHRanForestGini::Finalize()
 {
-    Int_t n = fGini.GetSize();
+    const Int_t n = fGini.GetSize();
 
     fGraphGini->Set(n);
 
-    Stat_t max=0.;
-    Stat_t min=0.;
+    Stat_t max=0;
+    Stat_t min=0;
     for (Int_t i=0; i<n; i++)
     {
-        fGini[i]/=fRanForest->GetNumTrees();
-        fGini[i]/=fRanForest->GetNumData();
+        fGini[i] /= fRanForest->GetNumTrees();
+        fGini[i] /= fRanForest->GetNumData();
 
-        Stat_t ip = i+1.;
-        Stat_t ig = fGini[i];
+        const Stat_t ip = i+1;
+        const Stat_t ig = fGini[i];
 
-        max=TMath::Max(max,ig);
-        min=TMath::Min(min,ig);
+        if (ig>max) max=ig;
+        if (ig<min) min=ig;
 
         fGraphGini->SetPoint(i,ip,ig);
     }
+
+    // This is used in root>3.04/? so that SetMaximum/Minimum can succeed
+    fGraphGini->GetHistogram();
+
     fGraphGini->SetMaximum(1.05*max);
     fGraphGini->SetMinimum(0.95*min);
@@ -163,5 +166,5 @@
         return;
 
-    h->GetXaxis()->SetRangeUser(0, 1);
+    //h->GetXaxis()->SetRangeUser(0, fGini.GetSize()+1);
     h->SetXTitle("No.of RF-input parameter");
     h->SetYTitle("Mean decrease in Gini-index [a.u.]");
Index: trunk/MagicSoft/Mars/mranforest/MRanForest.cc
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanForest.cc	(revision 2207)
+++ trunk/MagicSoft/Mars/mranforest/MRanForest.cc	(revision 2296)
@@ -103,8 +103,8 @@
     Int_t ntree=0;
 
-    TIter forest(fForest);
+    TIter Next(fForest);
 
     MRanTree *tree;
-    while ((tree=(MRanTree*)forest.Next()))
+    while ((tree=(MRanTree*)Next()))
     {
         fTreeHad[ntree]=tree->TreeHad(event);
@@ -112,5 +112,5 @@
         ntree++;
     }
-    return hadroness/Double_t(ntree);
+    return hadroness/ntree;
 }
 
@@ -190,29 +190,23 @@
 Bool_t MRanForest::GrowForest()
 {
-    Int_t ninbag=0;
-    TArrayI datsortinbag;
-    TArrayF classpopw;
-    TArrayI jinbag;
-    TArrayF winbag;
-
-    jinbag.Set(fNumData);
-    winbag.Set(fNumData);
-    classpopw.Set(2);
-
-    TMatrix hadrons=fHadrons->GetM();
-    TMatrix gammas=fGammas->GetM();
+    if(!gRandom)
+    {
+        *fLog << err << dbginf << "gRandom not initialized... aborting." << endl;
+        return kFALSE;
+    }
 
     fTreeNo++;
 
     // initialize running output
-    if(fTreeNo==1)
-    {
-        cout<<endl<<endl<<"1st col.: no. of tree"<<endl;
-        cout<<"2nd col.: error in % (calulated using oob-data -> overestim. of error)"<<endl;
-    }
-
-    jinbag.Reset();
-    classpopw.Reset();
-    winbag.Reset();
+    if (fTreeNo==1)
+    {
+        *fLog << inf << endl;
+        *fLog << underline; // << "1st col        2nd col" << endl;
+        *fLog << "no. of tree    error in % (calulated using oob-data -> overestim. of error)" << endl;
+    }
+
+    TArrayF classpopw(2);
+    TArrayI jinbag(fNumData); // Initialization includes filling with 0
+    TArrayF winbag(fNumData); // Initialization includes filling with 0
 
     // bootstrap aggregating (bagging) -> sampling with replacement:
@@ -221,14 +215,7 @@
     // {0,1,...,fNumData-1}, which is the set of the index numbers of
     // all events in the training sample
-
-    for (Int_t n=0;n<fNumData;n++)
-    {
-        if(!gRandom)
-        {
-            *fLog << err << dbginf << "gRandom not initialized... aborting." << endl;
-            return kFALSE;
-        }
-
-        Int_t k=Int_t(fNumData*gRandom->Rndm());
+    for (Int_t n=0; n<fNumData; n++)
+    {
+        const Int_t k = Int_t(gRandom->Rndm()*fNumData);
 
         classpopw[fHadTrue[k]]+=fWeight[k];
@@ -241,7 +228,11 @@
     // In bagging procedure ca. 2/3 of all elements in the original
     // training sample are used to build the in-bag data
-    datsortinbag=fDataSort;
-
-    ModifyDataSort(datsortinbag,ninbag,jinbag);
+    TArrayI datsortinbag=fDataSort;
+    Int_t ninbag=0;
+
+    ModifyDataSort(datsortinbag, ninbag, jinbag);
+
+    const TMatrix &hadrons=fHadrons->GetM();
+    const TMatrix &gammas =fGammas->GetM();
 
     // growing single tree
@@ -258,39 +249,38 @@
     // determined from oob-data is underestimated, but can still be taken as upper limit.
 
-    TVector event(fNumDim);
-    for(Int_t ievt=0;ievt<fNumHad;ievt++)
-    {
-        if(jinbag[ievt]>0)continue;
-        event=TMatrixRow(hadrons,ievt);
-        fHadEst[ievt]+=fRanTree->TreeHad(event);
+    for (Int_t ievt=0;ievt<fNumHad;ievt++)
+    {
+        if (jinbag[ievt]>0)
+            continue;
+        fHadEst[ievt] += fRanTree->TreeHad(hadrons, ievt);
         fNTimesOutBag[ievt]++;
     }
-    for(Int_t ievt=0;ievt<fNumGam;ievt++)
-    {
-        if(jinbag[fNumHad+ievt]>0)continue;
-        event=TMatrixRow(gammas,ievt);
-        fHadEst[fNumHad+ievt]+=fRanTree->TreeHad(event);
+    for (Int_t ievt=0;ievt<fNumGam;ievt++)
+    {
+        if (jinbag[fNumHad+ievt]>0)
+            continue;
+        fHadEst[fNumHad+ievt] += fRanTree->TreeHad(gammas, ievt);
         fNTimesOutBag[fNumHad+ievt]++;
     }
 
     Int_t n=0;
-    fErr=0;
-    for(Int_t ievt=0;ievt<fNumData;ievt++)
-        if(fNTimesOutBag[ievt]!=0)
+    Double_t ferr=0;
+    for (Int_t ievt=0;ievt<fNumData;ievt++)
+        if (fNTimesOutBag[ievt]!=0)
         {
-            fErr+=TMath::Power(fHadEst[ievt]/fNTimesOutBag[ievt]-fHadTrue[ievt],2.);
+            const Double_t val = fHadEst[ievt]/fNTimesOutBag[ievt]-fHadTrue[ievt];
+            ferr += val*val;
             n++;
         }
 
-    fErr/=Float_t(n);
-    fErr=TMath::Sqrt(fErr);
+    ferr = TMath::Sqrt(ferr/n);
 
     // give running output
-    cout << setw(5) << fTreeNo << setw(15) << Form("%.2f",100.*fErr) << endl;
+    *fLog << inf << setw(5) << fTreeNo << Form("%15.2f", ferr*100) << endl;
 
     // adding tree to forest
     AddTree();
 
-    return(fTreeNo<fNumTrees);
+    return fTreeNo<fNumTrees;
 }
 
@@ -315,6 +305,6 @@
     TArrayI isort(fNumData);
 
-    TMatrix hadrons=fHadrons->GetM();
-    TMatrix gammas=fGammas->GetM();
+    const TMatrix &hadrons=fHadrons->GetM();
+    const TMatrix &gammas=fGammas->GetM();
 
     for (Int_t j=0;j<fNumHad;j++)
@@ -346,6 +336,7 @@
         for(Int_t n=0;n<fNumData-1;n++)
         {
-            Int_t n1=isort[n];
-            Int_t n2=isort[n+1];
+            const Int_t n1=isort[n];
+            const Int_t n2=isort[n+1];
+
             fDataSort[mvar*fNumData+n]=n1;
             if(n==0) fDataRang[mvar*fNumData+n1]=0;
@@ -359,9 +350,7 @@
         fDataSort[(mvar+1)*fNumData-1]=isort[fNumData-1];
     }
-
-    return;
-}
-
-void MRanForest::ModifyDataSort(TArrayI &datsortinbag,Int_t ninbag,TArrayI &jinbag)
+}
+
+void MRanForest::ModifyDataSort(TArrayI &datsortinbag, Int_t ninbag, const TArrayI &jinbag)
 {
     ninbag=0;
@@ -394,5 +383,4 @@
         }
     }
-    return;
 }
 
Index: trunk/MagicSoft/Mars/mranforest/MRanForest.h
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanForest.h	(revision 2207)
+++ trunk/MagicSoft/Mars/mranforest/MRanForest.h	(revision 2296)
@@ -65,10 +65,9 @@
     // estimates for classification error of growing forest
     TArrayD fTreeHad;
-    Float_t fErr;
 
 protected:
     // create and modify (->due to bagging) fDataSort
     void CreateDataSort();
-    void ModifyDataSort(TArrayI &datsortinbag,Int_t ninbag,TArrayI &jinbag);
+    void ModifyDataSort(TArrayI &datsortinbag, Int_t ninbag, const TArrayI &jinbag);
 
 public:
Index: trunk/MagicSoft/Mars/mranforest/MRanForestCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanForestCalc.cc	(revision 2207)
+++ trunk/MagicSoft/Mars/mranforest/MRanForestCalc.cc	(revision 2296)
@@ -84,5 +84,5 @@
 // Needs:
 //  - MatrixGammas  [MHMatrix]
-//  - MatrixHadrons {MHMatrix]
+//  - MatrixHadrons [MHMatrix]
 //  - MHadronness
 //  - all data containers used to build the matrixes
Index: trunk/MagicSoft/Mars/mranforest/MRanTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanTree.cc	(revision 2207)
+++ trunk/MagicSoft/Mars/mranforest/MRanTree.cc	(revision 2296)
@@ -76,5 +76,5 @@
 }
 
-void MRanTree::GrowTree(TMatrix &mhad,TMatrix &mgam,Int_t numdata, Int_t numdim,TArrayI &hadtrue,
+void MRanTree::GrowTree(const TMatrix &mhad, const TMatrix &mgam,Int_t numdata, Int_t numdim,TArrayI &hadtrue,
                         TArrayI &datasort,TArrayI &datarang,TArrayF &tclasspop,TArrayI &jinbag,
                         TArrayF &winbag,TArrayF &weight)
@@ -88,10 +88,4 @@
     for (Int_t n=0;n<numdata;n++)
         if(jinbag[n]==1) ninbag++;
-
-    // weighted class populations after split
-    TArrayF wl(2); // left node
-    TArrayF wc(2); 
-    TArrayF wr(2); // right node
-    TArrayI nc(2);
 
     TArrayI bestsplit(nrnodes);
@@ -106,6 +100,4 @@
     TArrayI idmove(numdata);
 
-    idmove.Reset();
-
     fBestVar.Set(nrnodes);
     fTreeMap1.Set(nrnodes);
@@ -123,21 +115,21 @@
     BuildTree(datasort,datarang,hadtrue,numdim,numdata,bestsplit,
               bestsplitnext,nodepop,nodestart,tclasspop,nrnodes,
-              idmove,ncase,parent,jinbag,iv,winbag,wr,wc,wl,ninbag);
+              idmove,ncase,parent,jinbag,iv,winbag,ninbag);
 
     // post processing, determine cut (or split) values fBestSplit
     Int_t nhad=mhad.GetNrows();
 
-    for(Int_t k=0;k<nrnodes;k++)
-    {
-        Int_t bsp=bestsplit[k];
-        Int_t bspn=bestsplitnext[k];
-        Int_t msp=fBestVar[k];
-
-        if (GetNodeStatus(k)!=-1)
-        {
-            fBestSplit[k] = bsp<nhad ? mhad(bsp,msp):mgam(bsp-nhad,msp);
-            fBestSplit[k] += bspn<nhad ? mhad(bspn,msp):mgam(bspn-nhad,msp);
-            fBestSplit[k] /=2.;
-        }
+    for(Int_t k=0; k<nrnodes; k++)
+    {
+        if (GetNodeStatus(k)==-1)
+            continue;
+
+        const Int_t &bsp =bestsplit[k];
+        const Int_t &bspn=bestsplitnext[k];
+        const Int_t &msp =fBestVar[k];
+
+        fBestSplit[k]  = bsp<nhad  ? mhad(bsp, msp):mgam(bsp-nhad, msp);
+        fBestSplit[k] += bspn<nhad ? mhad(bspn,msp):mgam(bspn-nhad,msp);
+        fBestSplit[k] /= 2;
     }
 
@@ -152,7 +144,16 @@
                              Int_t numdata,Int_t ndstart,Int_t ndend,TArrayF &tclasspop,
                              Int_t &msplit,Float_t &decsplit,Int_t &nbest,TArrayI &ncase,
-                             TArrayI &jinbag,TArrayI &iv,TArrayF &winbag,TArrayF &wr,
-                             TArrayF &wc,TArrayF &wl,Int_t kbuild)
-{
+                             TArrayI &jinbag,TArrayI &iv,TArrayF &winbag,Int_t kbuild)
+{
+    if(!gRandom)
+    {
+        *fLog << err << dbginf << "gRandom not initialized... aborting." << endl;
+        return kFALSE;
+    }
+
+    // weighted class populations after split
+    TArrayF wc(2); 
+    TArrayF wr(2); // right node
+
     // For the best split, msplit is the index of the variable (e.g Hillas par., zenith angle ,...)
     // split on. decsplit is the decreae in impurity measured by Gini-index.
@@ -160,6 +161,6 @@
     // and nsplitnext is the case number of the next larger value of msplit.
 
-    Int_t mvar,nc,nbestvar=0,jstat,k;
-    Float_t crit,crit0,critmax,critvar=0;
+    Int_t nc,nbestvar=0,k;
+    Float_t crit;
     Float_t rrn, rrd, rln, rld, u;
 
@@ -171,24 +172,20 @@
     for (Int_t j=0;j<2;j++)
     {
-          pno+=tclasspop[j]*tclasspop[j];
-          pdo+=tclasspop[j];
-    }
-    crit0=pno/pdo;
-    jstat=0;
+        pno+=tclasspop[j]*tclasspop[j];
+        pdo+=tclasspop[j];
+    }
+
+    const Double_t crit0=pno/pdo;
+    Int_t jstat=0;
 
     // start main loop through variables to find best split,
     // (Gini-index as criterium crit)
 
-    critmax=-1.0e20;  // FIXME: Replace by a constant from limits.h
+    Double_t critmax=-1.0e20;  // FIXME: Replace by a constant from limits.h
 
     // random split selection, number of trials = fNumTry
-    if(!gRandom)
-    {
-        *fLog << err << dbginf << "gRandom not initialized... aborting." << endl;
-        return kFALSE;
-    }
     for(Int_t mt=0;mt<fNumTry;mt++)
     {
-        mvar=Int_t(mdim*gRandom->Rndm());
+        Int_t mvar=Int_t(gRandom->Rndm()*mdim);
 
         // Gini index = rrn/rrd+rln/rld
@@ -197,12 +194,9 @@
         rln=0;
         rld=0;
-        wl.Reset();
-
-        for (Int_t j=0;j<2;j++)
-        {
-            wr[j]=tclasspop[j];
-        }
-
-        critvar=-1.0e20;
+
+        TArrayF wl(2); // left node
+        wr = tclasspop;
+
+        Double_t critvar=-1.0e20;
 
         for(Int_t nsp=ndstart;nsp<=ndend-1;nsp++)
@@ -223,5 +217,5 @@
             if (datarang[mvar*numdata+nc]<datarang[mvar*numdata+datasort[mvar*numdata+nsp+1]])
             {
-                if(TMath::Min(rrd,rld)>1.0e-5)
+                if (TMath::Min(rrd,rld)>1.0e-5)
                 {
                     crit=(rln/rld)+(rrn/rrd);
@@ -309,6 +303,5 @@
                          TArrayI &nodepop,TArrayI &nodestart,TArrayF &tclasspop,
                          Int_t nrnodes,TArrayI &idmove,TArrayI &ncase,TArrayI &parent,
-                         TArrayI &jinbag,TArrayI &iv,TArrayF &winbag,TArrayF &wr,TArrayF &wc,
-                         TArrayF &wl,Int_t ninbag)
+                         TArrayI &jinbag,TArrayI &iv,TArrayF &winbag,Int_t ninbag)
 {
     // Buildtree consists of repeated calls to two void functions, FindBestSplit and MoveData.
@@ -326,18 +319,11 @@
     // returns.
 
-    Int_t msplit,nbest,ndendl,nc,jstat,ndend,ndstart;
+    Int_t msplit, nbest, ndendl;
     Float_t decsplit=0;
-    Float_t popt1,popt2,pp;
-    TArrayF classpop;
-    TArrayI nodestatus;
-
-    nodestatus.Set(nrnodes);
-    classpop.Set(2*nrnodes);
-
-    nodestatus.Reset();
+    TArrayF classpop(2*nrnodes);
+    TArrayI nodestatus(nrnodes);
+
     nodestart.Reset();
     nodepop.Reset();
-    classpop.Reset();
-
 
     for (Int_t j=0;j<2;j++)
@@ -357,13 +343,12 @@
           // initialize for next call to FindBestSplit
 
-          ndstart=nodestart[kbuild];
-          ndend=ndstart+nodepop[kbuild]-1;
+          const Int_t ndstart=nodestart[kbuild];
+          const Int_t ndend=ndstart+nodepop[kbuild]-1;
           for (Int_t j=0;j<2;j++)
             tclasspop[j]=classpop[j*nrnodes+kbuild];
 
-          jstat=FindBestSplit(datasort,datarang,hadtrue,mdim,numdata,
-                              ndstart,ndend,tclasspop,msplit,decsplit,
-                              nbest,ncase,jinbag,iv,winbag,wr,wc,wl,
-                              kbuild);
+          const Int_t jstat=FindBestSplit(datasort,datarang,hadtrue,mdim,numdata,
+                                          ndstart,ndend,tclasspop,msplit,decsplit,
+                                          nbest,ncase,jinbag,iv,winbag,kbuild);
 
           if(jstat==1) {
@@ -392,6 +377,6 @@
           for (Int_t n=ndstart;n<=ndendl;n++)
           {
-              nc=ncase[n];
-              Int_t j=hadtrue[nc];
+              const Int_t nc=ncase[n];
+              const Int_t j=hadtrue[nc];
               classpop[j*nrnodes+ncur+1]+=winbag[nc];
           }
@@ -399,6 +384,6 @@
           for (Int_t n=ndendl+1;n<=ndend;n++)
           {
-              nc=ncase[n];
-              Int_t j=hadtrue[nc];
+              const Int_t nc=ncase[n];
+              const Int_t j=hadtrue[nc];
               classpop[j*nrnodes+ncur+2]+=winbag[nc];
           }
@@ -410,16 +395,17 @@
           if (nodepop[ncur+1]<=fNdSize) nodestatus[ncur+1]=-1;
           if (nodepop[ncur+2]<=fNdSize) nodestatus[ncur+2]=-1;
-          popt1=0;
-          popt2=0;
+
+          Double_t popt1=0;
+          Double_t popt2=0;
           for (Int_t j=0;j<2;j++)
           {
-            popt1+=classpop[j*nrnodes+ncur+1];
-            popt2+=classpop[j*nrnodes+ncur+2];
+              popt1+=classpop[j*nrnodes+ncur+1];
+              popt2+=classpop[j*nrnodes+ncur+2];
           }
 
           for (Int_t j=0;j<2;j++)
           {
-            if (classpop[j*nrnodes+ncur+1]==popt1) nodestatus[ncur+1]=-1;
-            if (classpop[j*nrnodes+ncur+2]==popt2) nodestatus[ncur+2]=-1;
+              if (classpop[j*nrnodes+ncur+1]==popt1) nodestatus[ncur+1]=-1;
+              if (classpop[j*nrnodes+ncur+2]==popt2) nodestatus[ncur+2]=-1;
           }
 
@@ -446,5 +432,5 @@
         {
             fNumEndNodes++;
-            pp=0;
+            Double_t pp=0;
             for (Int_t j=0;j<2;j++)
             {
@@ -482,9 +468,35 @@
 
         const Int_t m=fBestVar[kt];
-
         kt = event(m)<=fBestSplit[kt] ? fTreeMap1[kt] : fTreeMap2[kt];
     }
 
     return fBestSplit[kt];
+}
+
+Double_t MRanTree::TreeHad(const TMatrixRow &event)
+{
+    Int_t kt=0;
+    // to optimize on storage space node status and node class
+    // are coded into fBestVar:
+    // status of node kt = TMath::Sign(1,fBestVar[kt])
+    // class  of node kt = fBestVar[kt]+2 (class defined by larger
+    //  node population, actually not used)
+    // hadronness assigned to node kt = fBestSplit[kt]
+
+    for (Int_t k=0;k<fNumNodes;k++)
+    {
+        if (fBestVar[kt]<0)
+            break;
+
+        const Int_t m=fBestVar[kt];
+        kt = event(m)<=fBestSplit[kt] ? fTreeMap1[kt] : fTreeMap2[kt];
+    }
+
+    return fBestSplit[kt];
+}
+
+Double_t MRanTree::TreeHad(const TMatrix &m, Int_t ievt)
+{
+    return TreeHad(TMatrixRow(m, ievt));
 }
 
Index: trunk/MagicSoft/Mars/mranforest/MRanTree.h
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanTree.h	(revision 2207)
+++ trunk/MagicSoft/Mars/mranforest/MRanTree.h	(revision 2296)
@@ -15,4 +15,5 @@
 
 class TMatrix;
+class TMatrixRow;
 class TVector;
 class TRandom;
@@ -60,5 +61,6 @@
 
     // functions used in tree growing process
-    void GrowTree(TMatrix &mhad,TMatrix &mgam,Int_t numdata, Int_t numdim,TArrayI &hadtrue,
+    void GrowTree(const TMatrix &mhad, const TMatrix &mgam,Int_t numdata,
+                  Int_t numdim,TArrayI &hadtrue,
                   TArrayI &datasort,TArrayI &datarang,TArrayF &tclasspop,TArrayI &jinbag,
                   TArrayF &winbag,TArrayF &weight);
@@ -67,6 +69,5 @@
                         Int_t numdata,Int_t ndstart,Int_t ndend,TArrayF &tclasspop,
                         Int_t &msplit,Float_t &decsplit,Int_t &nbest,TArrayI &ncase,
-                        TArrayI &jinbag,TArrayI &iv,TArrayF &winbag,TArrayF &wr,
-                        TArrayF &wc,TArrayF &wl,Int_t kbuild);
+                        TArrayI &jinbag,TArrayI &iv,TArrayF &winbag,Int_t kbuild);
 
     void MoveData(TArrayI &datasort,Int_t mdim,Int_t numdata,Int_t ndstart,
@@ -78,8 +79,9 @@
                    TArrayI &nodepop,TArrayI &nodestart,TArrayF &tclasspop,
                    Int_t nrnodes,TArrayI &idmove,TArrayI &ncase,TArrayI &parent,
-                   TArrayI &jinbag,TArrayI &iv,TArrayF &winbag,TArrayF &wr,TArrayF &wc,
-                   TArrayF &wl,Int_t ninbag);
+                   TArrayI &jinbag,TArrayI &iv,TArrayF &winbag,Int_t ninbag);
 
     Double_t TreeHad(const TVector &event);
+    Double_t TreeHad(const TMatrixRow &event);
+    Double_t TreeHad(const TMatrix &m, Int_t ievt);
     Double_t TreeHad();
 
