Index: trunk/MagicSoft/Mars/mhbase/MHMatrix.cc
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MHMatrix.cc	(revision 7731)
+++ trunk/MagicSoft/Mars/mhbase/MHMatrix.cc	(revision 7749)
@@ -53,5 +53,4 @@
 #include <TArrayD.h>
 #include <TArrayI.h>
-#include <TVector.h>
 
 #include <TH1.h>
@@ -421,5 +420,9 @@
         avg /= rows;
 
+#if ROOT_VERSION_CODE > ROOT_VERSION(5,00,00)
+        TMatrixFColumn(m, x) += -avg;
+#else
         TMatrixColumn(m, x) += -avg;
+#endif
     }
 
@@ -924,5 +927,9 @@
     //
     TVector v(fM.GetNrows());
+#if ROOT_VERSION_CODE > ROOT_VERSION(5,00,00)
+    v = TMatrixFColumn_const(fM, refcolumn);
+#else
     v = TMatrixColumn(fM, refcolumn);
+#endif
     //v += -frombin;
     //v *= 1/dbin;
@@ -1260,6 +1267,9 @@
     for (int i=0; i<m.GetNrows(); i++)
     {
+#if ROOT_VERSION_CODE > ROOT_VERSION(5,00,00)
+        const TMatrixFRow_const &row = TMatrixFRow_const(m, i);
+#else
         const TMatrixRow &row = TMatrixRow(m, i);
-
+#endif
         // finite (-> math.h) checks for NaN as well as inf
         int jcol;
Index: trunk/MagicSoft/Mars/mhbase/MHMatrix.h
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MHMatrix.h	(revision 7731)
+++ trunk/MagicSoft/Mars/mhbase/MHMatrix.h	(revision 7749)
@@ -9,11 +9,15 @@
 #include <TMatrix.h>
 #endif
+
 #ifndef MARS_MH
 #include "MH.h"
 #endif
 
+#ifndef ROOT_TVector
+#include <TVector.h>
+#endif
+
 class TArrayI;
 class TArrayF;
-class TVector;
 class TH1F;
 
