Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 2418)
+++ trunk/MagicSoft/Mars/Changelog	(revision 2419)
@@ -1,3 +1,13 @@
                                                  -*-*- END OF LINE -*-*-
+  2003/10/21: Wolfgang Wittek
+
+  * manalysis/MMatrixLoop.[h,cc]
+    - member function PreProcess() put from .h to .cc
+
+  * mhist/MHMatrix.[h,cc]
+    - member function SetNumRow() put from .h to .cc
+
+
+
   2003/10/20: Thomas Bretz
 
Index: trunk/MagicSoft/Mars/manalysis/MMatrixLoop.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMatrixLoop.cc	(revision 2418)
+++ trunk/MagicSoft/Mars/manalysis/MMatrixLoop.cc	(revision 2419)
@@ -34,4 +34,5 @@
 
 #include "MHMatrix.h"
+#include "MLog.h"
 
 ClassImp(MMatrixLoop);
@@ -53,4 +54,14 @@
 // --------------------------------------------------------------------------
 //
+
+Int_t MMatrixLoop::PreProcess(MParList *plist)
+    {
+        fNumRow = 0;
+
+        return fMatrix ? kTRUE : kFALSE;
+    }
+
+// --------------------------------------------------------------------------
+//
 // Set the present row of the Matrix, stops the loop when all rows have
 // been accessed.
@@ -61,2 +72,11 @@
 }
 
+
+
+
+
+
+
+
+
+
Index: trunk/MagicSoft/Mars/manalysis/MMatrixLoop.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMatrixLoop.h	(revision 2418)
+++ trunk/MagicSoft/Mars/manalysis/MMatrixLoop.h	(revision 2419)
@@ -5,4 +5,5 @@
 #include "MTask.h"
 #endif
+
 
 class MHMatrix;
@@ -21,11 +22,5 @@
     MMatrixLoop(MHMatrix *mat, const char *name=NULL, const char *title=NULL);
 
-    Int_t PreProcess(MParList *plist)
-    {
-        fNumRow = 0;
-
-        return fMatrix ? kTRUE : kFALSE;
-    }
-
+    Int_t PreProcess(MParList *plist);
     Int_t Process();
 
Index: trunk/MagicSoft/Mars/mhist/MHMatrix.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMatrix.cc	(revision 2418)
+++ trunk/MagicSoft/Mars/mhist/MHMatrix.cc	(revision 2419)
@@ -83,5 +83,5 @@
 //
 MHMatrix::MHMatrix(const char *name, const char *title)
-    : fNumRow(0), fData(NULL)
+    : fNumRows(0), fData(NULL)
 {
     fName  = name  ? name  : gsDefName.Data();
@@ -94,5 +94,5 @@
 //
 MHMatrix::MHMatrix(const TMatrix &m, const char *name, const char *title)
-    : fNumRow(m.GetNrows()), fM(m), fData(NULL)
+    : fNumRows(m.GetNrows()), fM(m), fData(NULL)
 {
     fName  = name  ? name  : gsDefName.Data();
@@ -106,5 +106,5 @@
 //
 MHMatrix::MHMatrix(MDataArray *mat, const char *name, const char *title)
-    : fNumRow(0), fData(mat)
+    : fNumRows(0), fData(mat)
 {
     fName  = name  ? name  : gsDefName.Data();
@@ -122,4 +122,14 @@
         delete fData;
 }
+
+// --------------------------------------------------------------------------
+//
+Bool_t MHMatrix::SetNumRow(Int_t row) 
+    {
+      if (row>=fM.GetNrows() || row<0) return kFALSE; 
+      fRow = row; 
+      return kTRUE; 
+    }
+
 
 // --------------------------------------------------------------------------
@@ -205,7 +215,7 @@
 void MHMatrix::AddRow()
 {
-    fNumRow++;
-
-    if (fM.GetNrows() > fNumRow)
+    fNumRows++;
+
+    if (fM.GetNrows() > fNumRows)
         return;
 
@@ -237,5 +247,5 @@
 
     for (int col=0; col<fData->GetNumEntries(); col++)
-        fM(fNumRow-1, col) = (*fData)(col);
+        fM(fNumRows-1, col) = (*fData)(col);
 
     return kTRUE;
@@ -252,11 +262,11 @@
     // It's not a fatal error so we don't need to stop PostProcessing...
     //
-    if (fData->GetNumEntries()==0 || fNumRow<1)
+    if (fData->GetNumEntries()==0 || fNumRows<1)
         return kTRUE;
 
-    if (fNumRow != fM.GetNrows())
+    if (fNumRows != fM.GetNrows())
     {
         TMatrix m(fM);
-        CopyCrop(fM, m, fNumRow);
+        CopyCrop(fM, m, fNumRows);
     }
 
@@ -900,5 +910,5 @@
     //
     CopyCrop(fM, mnewtmp, evtcount1);
-    fNumRow = evtcount1;
+    fNumRows = evtcount1;
 
     if (evtcount1 < nmaxevts)
@@ -1008,5 +1018,5 @@
     //
     CopyCrop(fM, mnewtmp, evtcount1);
-    fNumRow = evtcount1;
+    fNumRows = evtcount1;
 
     if (evtcount1 < nmaxevts)
@@ -1111,7 +1121,7 @@
     TVector v(fM.GetNcols());
     TVector tmp(fM.GetNcols());
-    for (Int_t irow = 0; irow<fNumRow; irow++)
-    {
-        const Int_t jrow = rnd.Integer(fNumRow);
+    for (Int_t irow = 0; irow<fNumRows; irow++)
+    {
+        const Int_t jrow = rnd.Integer(fNumRows);
 
         v = TMatrixRow(fM, irow);
Index: trunk/MagicSoft/Mars/mhist/MHMatrix.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMatrix.h	(revision 2418)
+++ trunk/MagicSoft/Mars/mhist/MHMatrix.h	(revision 2419)
@@ -30,5 +30,5 @@
     static const TString gsDefTitle; //! Default Title
 
-    Int_t   fNumRow;    // Number of dimensions of histogram
+    Int_t   fNumRows;   //! Number of rows filled into the matrix (this is NOT the number of rows of the matrix!)
     Int_t   fRow;       //! Present row
     TMatrix fM;         // Matrix to be filled
@@ -75,5 +75,5 @@
 
     Bool_t IsValid() const { return fM.IsValid(); }
-    Int_t  GetNumRows() const { return fNumRow; }
+    Int_t  GetNumRows() const { return fM.GetNrows(); }
 
     //void Draw(Option_t *opt=NULL);
@@ -94,5 +94,6 @@
     void SortMatrixByColumn(Int_t ncol=0, Bool_t desc=kTRUE);
 
-    Bool_t SetNumRow(Int_t row) { if (row>=fNumRow || row<0) return kFALSE; fRow = row; return kTRUE; }
+    Bool_t SetNumRow(Int_t row); 
+ 
     Int_t GetNumRow() const { return fRow; };
     Double_t operator[](Int_t col) { return fM(fRow, col); }
