Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 2710)
+++ trunk/MagicSoft/Mars/Changelog	(revision 2711)
@@ -14,4 +14,7 @@
    * manalysis/MExetractedSignalPix.h:
      - added missing const-qualifier IsLoGainUsed
+
+   * mreport/MReportFileRead.[h,cc]:
+     - added support for line counter
 
    * mreport/MReportRun.[h,cc]:
Index: trunk/MagicSoft/Mars/Makefile.rules
===================================================================
--- trunk/MagicSoft/Mars/Makefile.rules	(revision 2710)
+++ trunk/MagicSoft/Mars/Makefile.rules	(revision 2711)
@@ -50,5 +50,5 @@
 rmbin:	
 	@echo " Removing binary files..."
-	@rm -f $(PROGRAMS) lib/$(SOLIB) so_locations
+	@rm -f $(PROGRAMS) $(SOLIB) so_locations
 
 rmbak:
Index: trunk/MagicSoft/Mars/mbase/MAGIC.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MAGIC.h	(revision 2710)
+++ trunk/MagicSoft/Mars/mbase/MAGIC.h	(revision 2711)
@@ -16,6 +16,6 @@
 //
 #ifndef __CINT__
-#if ROOT_VERSION_CODE < ROOT_VERSION(3,02,00)
-#error Your root version is too old to compile Mars, use root>=3.02
+#if ROOT_VERSION_CODE < ROOT_VERSION(3,05,06)
+#error Your root version is too old to compile Mars, use root>=3.05/06
 #endif
 #endif
Index: trunk/MagicSoft/Mars/merpp.cc
===================================================================
--- trunk/MagicSoft/Mars/merpp.cc	(revision 2710)
+++ trunk/MagicSoft/Mars/merpp.cc	(revision 2711)
@@ -120,8 +120,8 @@
     const Int_t kRunNumber = arg.HasOption("--run=") ? arg.GetIntAndRemove("--run=") : -1;
 
-    if (!kTimeStart)
-        cout << "No start time!" << endl;
-    if (!kTimeStop)
-        cout << "No stop time!" << endl;
+    if (kTimeStart)
+        gLog << inf << "Start Time: " << kTimeStart << endl;
+    if (kTimeStop)
+        gLog << inf << "Stop  Time: " << kTimeStop << endl;
 
     //
@@ -270,5 +270,5 @@
         {
             r->AddToList("MReportCC");
-            r->AddToList("MReportDAQ");
+            //r->AddToList("MReportDAQ");
             r->AddToList("MReportDrive");
             r->AddToList("MReportCamera");
@@ -277,6 +277,5 @@
             {
                 r->AddToList("MReportRun");
-                filter = new MFDataMember("MReportRun.fRunNumber", '=', kRunNumber-0.5);
-                filter->SetInverted();
+                filter = new MFDataMember("MReportRun.fRunNumber", '=', kRunNumber);
                 w->SetFilter(filter);
             }
Index: trunk/MagicSoft/Mars/mreport/MReportCC.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportCC.cc	(revision 2710)
+++ trunk/MagicSoft/Mars/mreport/MReportCC.cc	(revision 2711)
@@ -43,5 +43,5 @@
 using namespace std;
 
-MReportCC::MReportCC() : MReport("CC-REPORT")
+MReportCC::MReportCC() : MReport("CC-REPORT", kFALSE)
 {
     fName  = "MReportCC";
@@ -57,5 +57,4 @@
 
     Int_t len;
-    Float_t zd, az, dec, ra;
     const Int_t n=sscanf(str.Data(),
                          "%*f %*f %*f %*f %f %f %f %f %*f %*f %n",
@@ -67,5 +66,8 @@
         return kFALSE;
     }
+    /*
     str.Remove(0, len);
+
+    *fLog << dbg << str << endl;
 
     if (str!=(TString)"OVER")
@@ -74,5 +76,5 @@
         return kFALSE;
     }
-
+    */
     return kTRUE;
 }
Index: trunk/MagicSoft/Mars/mreport/MReportFileRead.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportFileRead.cc	(revision 2710)
+++ trunk/MagicSoft/Mars/mreport/MReportFileRead.cc	(revision 2711)
@@ -207,6 +207,8 @@
 // file versions
 //
-Bool_t MReportFileRead::CheckFileHeader() const
-{
+Int_t MReportFileRead::CheckFileHeader() const
+{
+    Int_t line = 0;
+
     TString str;
     str.ReadLine(*fIn);   // Read to EOF or newline
@@ -215,6 +217,7 @@
         *fLog << err << "ERROR - First line doesn't match '" << gsReportHeader <<"' ";
         *fLog << "in file '" << fFileName << "'"<<endl;
-        return kFALSE;
-    }
+        return line;
+    }
+    line++;
 
     str.ReadLine(*fIn);   // Read to EOF or newline
@@ -223,6 +226,7 @@
         *fLog << err << "ERROR - Version prefix '" << gsVersionPrefix <<"' ";
         *fLog << "not found in second line of file '" << fFileName << "'"<<endl;
-        return kFALSE;
-    }
+        return line;
+    }
+    line++;
 
     str.Remove(0, gsVersionPrefix.Length());
@@ -234,10 +238,10 @@
         *fLog << err << "ERROR - Version string '" << str <<"' doesn't ";
         *fLog << "match regular expression." << endl;
-        return kFALSE;
+        return line;
     }
 
     *fLog << dbg << "Report File version: <" << ver << ">" << endl;
 
-    return kTRUE;
+    return line;
 }
 
@@ -252,4 +256,5 @@
     //if (!time)
     //    return kFALSE;
+    fNumLine = 0;
 
     TIter Next(fList);
@@ -275,5 +280,7 @@
         return kTRUE;
 
-    return CheckFileHeader();
+    const Int_t n = CheckFileHeader();
+    fNumLine += n;
+    return n==2;
 }
 
@@ -298,4 +305,6 @@
         }
 
+        fNumLine++;
+
         const Int_t pos = str.First(' ');
         if (pos<=0)
@@ -310,5 +319,5 @@
     if (rc==kFALSE)
     {
-        *fLog << err << "ERROR - Interpretation of '" << rep->GetName() << "' failed." << endl;
+        *fLog << err << "ERROR - Interpretation of '" << rep->GetName() << "' failed (Line #" << fNumLine << ")" << endl;
         return kFALSE;
     }
Index: trunk/MagicSoft/Mars/mreport/MReportFileRead.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportFileRead.h	(revision 2710)
+++ trunk/MagicSoft/Mars/mreport/MReportFileRead.h	(revision 2711)
@@ -34,4 +34,6 @@
     MTime fStop;             // Time range which should be read from file
 
+    ULong_t fNumLine;        // line counter
+
     enum { kHasNoHeader = BIT(14) };
 
@@ -40,5 +42,5 @@
     Int_t PostProcess();
 
-    Bool_t CheckFileHeader() const;
+    Int_t CheckFileHeader() const;
     MReport *GetReport(const TString &str) const;
     MReport *GetReport(MReportHelp *help) const;
Index: trunk/MagicSoft/Mars/mreport/MReportRun.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportRun.cc	(revision 2710)
+++ trunk/MagicSoft/Mars/mreport/MReportRun.cc	(revision 2711)
@@ -50,9 +50,4 @@
 Bool_t MReportRun::InterpreteBody(TString &str)
 {
-    // Remove the 30 tokens of the subsystem status
-    //  table 12.1 p59
-    for (int i=0; i<30; i++)
-        str.Remove(0, str.First(' ')+1);
-
     Int_t len;
     const Int_t n=sscanf(str.Data(), "%d %n", &fRunNumber, &len);
@@ -69,5 +64,8 @@
     str.Remove(0, 6);
     str = str.Strip(TString::kBoth);
-    fSourceName = str(0, str.First(' ')+1);
+    Ssiz_t pos = str.First(' ');
+    if (pos<0)
+        pos = str.Length();
+    fSourceName = str(0, pos+1);
 
     return kTRUE;
Index: trunk/MagicSoft/Mars/mtools/MTFillMatrix.cc
===================================================================
--- trunk/MagicSoft/Mars/mtools/MTFillMatrix.cc	(revision 2710)
+++ trunk/MagicSoft/Mars/mtools/MTFillMatrix.cc	(revision 2711)
@@ -134,4 +134,9 @@
         return kFALSE;
     }
+    if (fname.IsNull())
+    {
+        *fLog << "ERROR - Unable to write matrix, file name empty." << endl;
+        return kFALSE;
+    }
 
     TFile file(fname, "RECREATE", m->GetTitle());
@@ -245,4 +250,6 @@
     MEvtLoop evtloop(fName);
     evtloop.SetParList(&plist);
+    evtloop.SetDisplay(fDisplay);
+    evtloop.SetLogStream(fLog);
     if (!evtloop.Eventloop())
     {
