Index: trunk/MagicSoft/Mars/mranforest/MRFEnergyEst.cc
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRFEnergyEst.cc	(revision 6479)
+++ trunk/MagicSoft/Mars/mranforest/MRFEnergyEst.cc	(revision 6492)
@@ -96,4 +96,6 @@
     const Int_t nrows = (fMatrixTrain->GetM()).GetNrows();
 
+    cout<<"ncols="<<ncols<<" nrows="<<nrows<<endl<<flush;
+
     if(ncols<=0 || nrows <=0)
     {
@@ -138,4 +140,5 @@
 
     // training of RF for each energy bin
+    Int_t numbins=0;
     for(Int_t ie=0;ie<nbins;ie++)
     {
@@ -159,4 +162,7 @@
             }
         }
+        if(irow1*irow0==0)continue;
+
+        *fLog << inf << dbginf << "Training RF for energy bin "<<ie<< endl;
 
         // last column must be removed (true energy col.)
@@ -209,5 +215,6 @@
         MRanForest *forest=(MRanForest*)plist.FindObject("MRanForest");
         forest->SetTitle(Form("%f",0.5*(fEnergyGrid[ie]+fEnergyGrid[ie+1])));
-        forest->Write(Form("%d",ie));
+        forest->Write(Form("%d",numbins));
+        numbins++;
     }
 
