Index: trunk/MagicSoft/Mars/mhbase/MHMatrix.cc
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MHMatrix.cc	(revision 4601)
+++ trunk/MagicSoft/Mars/mhbase/MHMatrix.cc	(revision 4646)
@@ -441,5 +441,5 @@
     {
         TVector col(cols);
-        col = TMatrixRow(fM, i);
+        col = TMatrixFRow_const(fM, i);
 
         TVector d = evt;
@@ -588,5 +588,5 @@
 const TArrayI MHMatrix::GetIndexOfSortedColumn(Int_t ncol, Bool_t desc) const
 {
-    TMatrixColumn col(fM, ncol);
+    TMatrixFColumn_const col(fM, ncol);
 
     const Int_t n = fM.GetNrows();
@@ -614,5 +614,5 @@
     TVector vold(fM.GetNcols());
     for (int i=0; i<n; i++)
-        TMatrixRow(m, i) = vold = TMatrixRow(fM, idx[i]);
+        TMatrixFRow(m, i) /*= vold*/ = TMatrixFRow_const(fM, idx[i]);
 
     fM = m;
@@ -696,5 +696,7 @@
     UInt_t newrow = 0;
 
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,00,8)
     TVector vold(fM.GetNcols());
+#endif
     while (oldrow<rows)
     {
@@ -702,5 +704,9 @@
 
         if (newrow<=(unsigned int)sum)
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,00,8)
             TMatrixRow(fM, newrow++) = vold = TMatrixRow(fM, oldrow);
+#else
+            TMatrixFRow(fM, newrow++) = TMatrixFRow_const(fM, oldrow);
+#endif
 
         oldrow++;
@@ -749,9 +755,14 @@
 void MHMatrix::CopyCrop(TMatrix &target, const TMatrix &source, Int_t rows)
 {
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,00,8)
     TVector v(source.GetNcols());
-
+#endif
     target.ResizeTo(rows, source.GetNcols());
     for (Int_t ir=0; ir<rows; ir++)
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,00,8)
         TMatrixRow(target, ir) = v = TMatrixRow(source, ir);
+#else
+        TMatrixFRow(target, ir) = TMatrixFRow_const(source, ir);
+#endif
 }
 
@@ -879,5 +890,7 @@
     //
     Int_t ir;
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,00,8)
     TVector vold(fM.GetNcols());
+#endif
     for (ir=0; ir<nrows; ir++)
     {
@@ -887,5 +900,9 @@
         if (cumulweight[indref]<=0.5)
         {
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,00,8)
             TMatrixRow(mrest, evtcount2++) = vold = TMatrixRow(fM, ind[ir]);
+#else
+            TMatrixFRow(mrest, evtcount2++) = TMatrixFRow_const(fM, ind[ir]);
+#endif
             continue;
         }
@@ -895,9 +912,17 @@
             break;
 
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,00,8)
         TMatrixRow(mnewtmp, evtcount1) = vold = TMatrixRow(fM, ind[ir]);
+#else
+        TMatrixFRow(mnewtmp, evtcount1) = TMatrixFRow_const(fM, ind[ir]);
+#endif
     }
 
     for (/*empty*/; ir<nrows; ir++)
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,00,8)
         TMatrixRow(mrest, evtcount2++) = vold = TMatrixRow(fM, ind[ir]);
+#else
+        TMatrixFRow(mrest, evtcount2++) = TMatrixFRow_const(fM, ind[ir]);
+#endif
 
     //
@@ -1002,10 +1027,20 @@
     // select events (distribution after renormalization)
     //
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,00,8)
     TVector vold(fM.GetNcols());
+#endif
     for (Int_t ir=0; ir<nmaxevts; ir++)
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,00,8)
         TMatrixRow(mnewtmp, evtcount1++) = vold = TMatrixRow(fM, ind[ir]);
+#else
+        TMatrixFRow(mnewtmp, evtcount1++) = TMatrixFRow_const(fM, ind[ir]);
+#endif
 
     for (Int_t ir=nmaxevts; ir<nrows; ir++)
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,00,8)
         TMatrixRow(mrest, evtcount2++) = vold = TMatrixRow(fM, ind[ir]);
+#else
+        TMatrixFRow(mrest, evtcount2++) = TMatrixFRow_const(fM, ind[ir]);
+#endif
 
     //
@@ -1119,12 +1154,20 @@
 
     TVector v(fM.GetNcols());
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,00,8)
     TVector tmp(fM.GetNcols());
+#endif
     for (Int_t irow = 0; irow<fNumRows; irow++)
     {
         const Int_t jrow = rnd.Integer(fNumRows);
 
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,00,8)
         v = TMatrixRow(fM, irow);
         TMatrixRow(fM, irow) = tmp = TMatrixRow(fM, jrow);
         TMatrixRow(fM, jrow) = v;
+#else
+        v = TMatrixFRow_const(fM, irow);
+        TMatrixFRow(fM, irow) = TMatrixFRow_const(fM, jrow);
+        TMatrixFRow(fM, jrow) = v;
+#endif
     }
 
@@ -1165,6 +1208,9 @@
     TMatrix m(fM);
 
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,00,8)
+    TVector vold(ncol);
+#endif
+
     const Int_t ncol=fM.GetNcols();
-    TVector vold(ncol);
     int irow=0;
 
@@ -1176,9 +1222,13 @@
         int jcol;
         for (jcol=0; jcol<ncol; jcol++)
-            if (!TMath::Finite(vold(jcol)))
+            if (!TMath::Finite(row(jcol)))
                 break;
 
         if (jcol==ncol)
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,00,8)
             TMatrixRow(fM, irow++) = vold = row;
+#else
+            TMatrixFRow(fM, irow++) = row;
+#endif
         else
             *fLog << warn << "Warning - MHMatrix::RemoveInvalidRows: row #" << i<< " removed." << endl;
Index: trunk/MagicSoft/Mars/mhbase/MHMatrix.h
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MHMatrix.h	(revision 4601)
+++ trunk/MagicSoft/Mars/mhbase/MHMatrix.h	(revision 4646)
@@ -12,6 +12,4 @@
 #include "MH.h"
 #endif
-
-#include <TArrayF.h>
 
 class TArrayI;
