Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7534)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7535)
@@ -27,4 +27,26 @@
      - added showing the axis range of the time evolution histogram
 
+   * macros/train/trainseparation.C:
+     - replaced outdated MTTrainRFSeparate by MJTrainSeparation
+
+   * mastro/MAstro.h:
+     - added conversion constants for pc-m and pc-ly
+
+   * mhflux/MMcSpectrumWeight.cc:
+     - fixed typo in comment
+
+   * mimage/MImagePar.h:
+     - minor changes to layout
+
+   * mranforest/MRanForest.[h,cc]:
+     - the initialization of fTreeHad was done at the wrong moment
+     - replaced a cast int(x+.5) by TMath::Nint
+     - added some additional warning output
+     - added "!" to fTreeHad - it is only for temporary storage used
+       in the histogram classes
+
+   * mranforest/MRanForestGrow.h:
+     - added GetForest
+
 
 
Index: trunk/MagicSoft/Mars/macros/train/trainseparation.C
===================================================================
--- trunk/MagicSoft/Mars/macros/train/trainseparation.C	(revision 7534)
+++ trunk/MagicSoft/Mars/macros/train/trainseparation.C	(revision 7535)
@@ -6,5 +6,5 @@
     settst.SetNumAnalysis(2);
 
-    MTTrainRFSeparate opt;
+    MJTrainSeparation opt;
     //opt.SetDebug();
 
Index: trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.cc
===================================================================
--- trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.cc	(revision 7534)
+++ trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.cc	(revision 7535)
@@ -448,5 +448,5 @@
 //   MMcSpectrumWeight.NewSlope: -2.6
 //   MMcSpectrumWeight.Norm:      1.0
-//   MMcSpectrumWeight.Formula:  pow(MMcEvt.fEnergy, -2.6)
+//   MMcSpectrumWeight.Formula:  pow(X, -2.6)
 //
 Int_t MMcSpectrumWeight::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
Index: trunk/MagicSoft/Mars/mimage/MImagePar.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MImagePar.h	(revision 7534)
+++ trunk/MagicSoft/Mars/mimage/MImagePar.h	(revision 7535)
@@ -30,10 +30,10 @@
     Short_t GetNumIslands() const { return fNumIslands; }
 
-    Short_t GetNumSatPixelsHG() const { return fNumSatPixelsHG; }
-    Short_t GetNumSatPixelsLG() const { return fNumSatPixelsLG; }
-    Short_t GetNumSinglePixels() const { return fNumSinglePixels; }
+    Short_t GetNumSatPixelsHG() const   { return fNumSatPixelsHG; }
+    Short_t GetNumSatPixelsLG() const   { return fNumSatPixelsLG; }
+    Short_t GetNumSinglePixels() const  { return fNumSinglePixels; }
     Float_t GetSizeSinglePixels() const { return fSizeSinglePixels; }
-    Float_t GetSizeSubIslands() const { return fSizeSubIslands; }
-    Float_t GetSizeMainIsland() const { return fSizeMainIsland; }
+    Float_t GetSizeSubIslands() const   { return fSizeSubIslands; }
+    Float_t GetSizeMainIsland() const   { return fSizeMainIsland; }
 
     void Print(Option_t *opt=NULL) const;
Index: trunk/MagicSoft/Mars/mranforest/MRanForest.cc
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanForest.cc	(revision 7534)
+++ trunk/MagicSoft/Mars/mranforest/MRanForest.cc	(revision 7535)
@@ -164,6 +164,4 @@
     //at least 1 tree
     fNumTrees=TMath::Max(n,1);
-    fTreeHad.Set(fNumTrees);
-    fTreeHad.Reset();
 }
 
@@ -250,5 +248,5 @@
         // classes directly given
         for (Int_t j=0;j<numdata;j++)
-            fClass[j] = int(fHadTrue[j]+0.5);
+            fClass[j] = TMath::Nint(fHadTrue[j]);
     }
 }
@@ -264,6 +262,8 @@
 Double_t MRanForest::CalcHadroness(const TVector &event)
 {
+    fTreeHad.Set(fNumTrees);
+
     Double_t hadroness=0;
-    Int_t ntree=0;
+    Int_t    ntree    =0;
 
     TIter Next(fForest);
@@ -341,5 +341,5 @@
     // setup rules to be used for classification/regression
     const MDataArray *allrules=(MDataArray*)mat->GetColumns();
-    if(allrules==NULL)
+    if (allrules==NULL)
     {
         *fLog << err <<"Rules of matrix == null, exiting"<< endl;
@@ -347,6 +347,13 @@
     }
 
+    if (allrules->GetNumEntries()!=dim+1)
+    {
+        *fLog << err <<"Rules of matrix " << allrules->GetNumEntries() << " mismatch dimension+1 " << dim+1 << "...exiting."<< endl;
+        return kFALSE;
+    }
+
     if (fRules)
         delete fRules;
+
     fRules = new MDataArray();
     fRules->Reset();
Index: trunk/MagicSoft/Mars/mranforest/MRanForest.h
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanForest.h	(revision 7534)
+++ trunk/MagicSoft/Mars/mranforest/MRanForest.h	(revision 7535)
@@ -61,5 +61,5 @@
 
     // estimates for classification error of growing forest
-    TArrayD fTreeHad;      // Hadronness values
+    TArrayD fTreeHad;      //! Hadronness values (buffer for MHRanForest)
 
     Double_t fUserVal;     // A user value describing this tree (eg E-mc)
Index: trunk/MagicSoft/Mars/mranforest/MRanForestGrow.h
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanForestGrow.h	(revision 7534)
+++ trunk/MagicSoft/Mars/mranforest/MRanForestGrow.h	(revision 7535)
@@ -34,4 +34,6 @@
     MRanForestGrow(const char *name=NULL, const char *title=NULL);
 
+    MRanForest *GetForest() const { return fRanForest; }
+
     //     void SetNumTrees(Int_t n=-1) { fNumTrees=n>0?n:100; }
     //     void SetNumTry(Int_t   n=-1) { fNumTry  =n>0?n:  3; }
