Index: trunk/MagicSoft/Mars/mreport/MReport.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReport.cc	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReport.cc	(revision 4575)
@@ -91,5 +91,5 @@
 // argument.
 //
-Int_t MReport::InterpreteBody(TString &str)
+Int_t MReport::InterpreteBody(TString &str, Int_t ver)
 {
     *fLog << warn << "No interpreter existing for: " << fIdentifier << endl;
@@ -105,5 +105,5 @@
 // SetupReading must be called successfully before.
 //
-Int_t MReport::Interprete(TString &str, const MTime &start, const MTime &stop)
+Int_t MReport::Interprete(TString &str, const MTime &start, const MTime &stop, Int_t ver)
 {
     if (!InterpreteHeader(str))
@@ -116,5 +116,5 @@
         return -1;
 
-    const Int_t rc = InterpreteBody(str);
+    const Int_t rc = InterpreteBody(str, ver);
     if (rc != kTRUE)
         return rc;
Index: trunk/MagicSoft/Mars/mreport/MReport.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReport.h	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReport.h	(revision 4575)
@@ -25,7 +25,7 @@
 
     virtual Bool_t SetupReading(MParList &plist);
-    virtual Int_t  InterpreteBody(TString &str);
+    virtual Int_t  InterpreteBody(TString &str, Int_t ver);
 
-    Int_t  Interprete(TString &str, const MTime &start, const MTime &stop);
+    Int_t  Interprete(TString &str, const MTime &start, const MTime &stop, const Int_t ver);
     Bool_t CheckIdentifier(TString &str) const
     {
Index: trunk/MagicSoft/Mars/mreport/MReportCC.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportCC.cc	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportCC.cc	(revision 4575)
@@ -58,5 +58,5 @@
 // Interprete the body of the CC-REPORT string
 //
-Int_t MReportCC::InterpreteBody(TString &str)
+Int_t MReportCC::InterpreteBody(TString &str, Int_t ver)
 {
     // Remove the 30 tokens of the subsystem status
Index: trunk/MagicSoft/Mars/mreport/MReportCC.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportCC.h	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportCC.h	(revision 4575)
@@ -14,5 +14,5 @@
     Float_t fSolarRadiation; // [W/m^2] IR-Radiation
 
-    Int_t InterpreteBody(TString &str);
+    Int_t InterpreteBody(TString &str, Int_t ver);
 
 public:
Index: trunk/MagicSoft/Mars/mreport/MReportCamera.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportCamera.cc	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportCamera.cc	(revision 4575)
@@ -447,5 +447,5 @@
 // Interprete the body of the CAMERA-REPORT string
 //
-Int_t MReportCamera::InterpreteBody(TString &str)
+Int_t MReportCamera::InterpreteBody(TString &str, Int_t ver)
 {
     if (!InterpreteCamera(str))
Index: trunk/MagicSoft/Mars/mreport/MReportCamera.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportCamera.h	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportCamera.h	(revision 4575)
@@ -40,5 +40,5 @@
     Bool_t InterpreteHOT(TString &str);
 
-    Int_t  InterpreteBody(TString &str);
+    Int_t  InterpreteBody(TString &str, Int_t ver);
 
 public:
Index: trunk/MagicSoft/Mars/mreport/MReportCurrents.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportCurrents.cc	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportCurrents.cc	(revision 4575)
@@ -70,5 +70,5 @@
 // Interprete the body of the DC-REPORT string
 //
-Int_t MReportCurrents::InterpreteBody(TString &str)
+Int_t MReportCurrents::InterpreteBody(TString &str, Int_t ver)
 {
     Int_t len;
Index: trunk/MagicSoft/Mars/mreport/MReportCurrents.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportCurrents.h	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportCurrents.h	(revision 4575)
@@ -17,5 +17,5 @@
 
     Bool_t SetupReading(MParList &plist);
-    Int_t InterpreteBody(TString &str);
+    Int_t InterpreteBody(TString &str, Int_t ver);
 
 public:
Index: trunk/MagicSoft/Mars/mreport/MReportDAQ.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportDAQ.cc	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportDAQ.cc	(revision 4575)
@@ -48,5 +48,5 @@
 }
 
-Int_t MReportDAQ::InterpreteBody(TString &str)
+Int_t MReportDAQ::InterpreteBody(TString &str, Int_t ver)
 {
     *fLog << dbg << "D" << flush;
Index: trunk/MagicSoft/Mars/mreport/MReportDAQ.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportDAQ.h	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportDAQ.h	(revision 4575)
@@ -9,5 +9,5 @@
 {
 private:
-    Int_t InterpreteBody(TString &str);
+    Int_t InterpreteBody(TString &str, Int_t ver);
 
 public:
Index: trunk/MagicSoft/Mars/mreport/MReportDrive.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportDrive.cc	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportDrive.cc	(revision 4575)
@@ -88,5 +88,5 @@
 // Interprete the body of the DRIVE-REPORT string
 //
-Int_t MReportDrive::InterpreteBody(TString &str)
+Int_t MReportDrive::InterpreteBody(TString &str, Int_t ver)
 {
     MAstro::String2Angle(str, fRa);
Index: trunk/MagicSoft/Mars/mreport/MReportDrive.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportDrive.h	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportDrive.h	(revision 4575)
@@ -23,5 +23,5 @@
     Double_t fErrorAz;    // [?] sistem error in the azimuth angle axis
 
-    Int_t InterpreteBody(TString &str);
+    Int_t InterpreteBody(TString &str, Int_t ver);
 
 public:
Index: trunk/MagicSoft/Mars/mreport/MReportFileRead.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportFileRead.cc	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportFileRead.cc	(revision 4575)
@@ -56,7 +56,4 @@
 using namespace std;
 
-const TString MReportFileRead::gsReportHeader ="[CC Report File]";
-const TString MReportFileRead::gsVersionPrefix="Arehucas Version Number";
-
 // --------------------------------------------------------------------------
 //
@@ -65,8 +62,8 @@
 //
 MReportFileRead::MReportFileRead(const char *fname, const char *name, const char *title)
-    : fFileName(fname), fIn(NULL)
+    : fFileName(fname), fVersion(-1), fIn(NULL)
 {
     fName  = name  ? name  : "MReportFileRead";
-    fTitle = title ? title : "Read task to read Central Control report files";
+    fTitle = title ? title : "Read task to read general report files";
 
     fIn = new ifstream;
@@ -137,50 +134,4 @@
     fList->Add(help);
     return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Check whether the file header corresponds to a central control file
-// header and check for the existance of a correct version number.
-// The version number may later be used to be able to read different
-// file versions
-//
-Int_t MReportFileRead::CheckFileHeader() const
-{
-    Int_t line = 0;
-
-    TString str;
-    str.ReadLine(*fIn);   // Read to EOF or newline
-    if (str != gsReportHeader)
-    {
-        *fLog << err << "ERROR - First line doesn't match '" << gsReportHeader <<"' ";
-        *fLog << "in file '" << fFileName << "'"<<endl;
-        return line;
-    }
-    line++;
-
-    str.ReadLine(*fIn);   // Read to EOF or newline
-    if (!str.BeginsWith(gsVersionPrefix))
-    {
-        *fLog << err << "ERROR - Version prefix '" << gsVersionPrefix <<"' ";
-        *fLog << "not found in second line of file '" << fFileName << "'"<<endl;
-        return line;
-    }
-    line++;
-
-    str.Remove(0, gsVersionPrefix.Length());
-    str = str.Strip(TString::kBoth);
-
-    TString ver = str(TRegexp("^[0-9][0-9][0-9][0-9][0-9][0-9]-[0-9]$"));
-    if (ver.IsNull())
-    {
-        *fLog << err << "ERROR - Version string '" << str <<"' doesn't ";
-        *fLog << "match regular expression." << endl;
-        return line;
-    }
-
-    *fLog << dbg << "Report File version: <" << ver << ">" << endl;
-
-    return line;
 }
 
@@ -257,5 +208,5 @@
     }
 
-    const Int_t rc = rep->Interprete(str, fStart, fStop);
+    const Int_t rc = rep->Interprete(str, fStart, fStop, fVersion);
 
     switch (rc)
Index: trunk/MagicSoft/Mars/mreport/MReportFileRead.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportFileRead.h	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportFileRead.h	(revision 4575)
@@ -23,16 +23,14 @@
 {
 private:
-    static const TString gsReportHeader;
-    static const TString gsVersionPrefix;
+    TString     fFileName;  // Name of the input file
 
-    TString     fFileName;
-    ifstream   *fIn;         //! buffered input stream (file to read from)
+    THashTable *fList;      // List of possible reports to be interpreted
 
-    THashTable *fList;
+    MTime   fStart;         // Time range which should be read from file
+    MTime   fStop;          // Time range which should be read from file
 
-    MTime fStart;            // Time range which should be read from file
-    MTime fStop;             // Time range which should be read from file
+    ULong_t fNumLine;       // line counter
 
-    ULong_t fNumLine;        // line counter
+    Int_t   fVersion;       // File format version
 
     enum { kHasNoHeader = BIT(14) };
@@ -42,8 +40,12 @@
     Int_t PostProcess();
 
-    Int_t CheckFileHeader() const;
+    virtual Int_t CheckFileHeader() { return 0; }
     MReport *GetReport(const TString &str) const;
     MReport *GetReport(MReportHelp *help) const;
     MReportHelp *GetReportHelp(const TString &str) const;
+
+protected:
+    ifstream   *fIn;         //! buffered input stream (file to read from)
+    void SetVersion(Int_t v) { fVersion = v; }
 
 public:
@@ -57,5 +59,5 @@
     Bool_t AddToList(const char *name) const;
 
-    ClassDef(MReportFileRead, 0)// Task to read the central control report file
+    ClassDef(MReportFileRead, 0)// Task to read general report file
 };
 
Index: trunk/MagicSoft/Mars/mreport/MReportFileReadCC.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportFileReadCC.cc	(revision 4575)
+++ trunk/MagicSoft/Mars/mreport/MReportFileReadCC.cc	(revision 4575)
@@ -0,0 +1,133 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz, 11/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2004
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// MReportFileReadCC
+//
+// This is a report file reader which implements the CC header checking.
+// Because diffrent subsystem are writing different headers it is not
+// easily possible to have one Reader for all files. Because of this
+// you must know to which subsystem the file belongs before you can
+// instantiate your reader if you need the header or want to check the
+// header.
+//
+// If you want to restrict reading to 'single run report files' you can
+// call SetRunNumber(12345). In this case Checking the Header will fail
+// if no run information is available or the runnumber in the header
+// doesn't match. To request a 'all run' file use SetRunNumber(0).
+// To allow both file types to be read use SetRunNumber(-1) <default>
+//
+//////////////////////////////////////////////////////////////////////////////
+#include "MReportFileReadCC.h"
+
+#include <fstream>
+
+#include <TRegexp.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MReportFileReadCC);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//
+// Default constructor. It tries to open the given file and creates a
+// THashTable which allows faster access to the MReport* objects.
+//
+MReportFileReadCC::MReportFileReadCC(const char *fname, const char *name, const char *title)
+    : MReportFileRead(fname, name, title), fRunNumber(-1)
+{
+    fName  = name  ? name  : "MReportFileReadCC";
+    fTitle = title ? title : "Read task to read Central Control report files";
+}
+
+// --------------------------------------------------------------------------
+//
+// Check whether the file header corresponds to a central control file
+// header and check for the existance of a correct version number.
+// The version number may later be used to be able to read different
+// file versions
+//
+Int_t MReportFileReadCC::CheckFileHeader()
+{
+    Int_t line = 0;
+
+    TString str;
+    str.ReadLine(*fIn);   // Read to EOF or newline
+    if (!*fIn)
+        return line;
+
+    line++;
+
+    Int_t run = -1;
+
+    // whole night report file
+    if (str==TString("[CC Report File]"))
+        run = 0;
+
+    // report file matching a single run
+    if (str(TRegexp("^[CC Run [0-9]+ Control File]$")).IsNull())
+        run = atoi(str(TRegexp(" [0-9]+")).Data());
+
+    if (run<0)
+    {
+        *fLog << err << "ERROR - First line doesn't match '[CC Report File]' ";
+        *fLog << "nor '^[CC Run [0-9]+ Control File]$'" << endl;
+        return line;
+    }
+
+    if (fRunNumber!=-1 && fRunNumber!=run)
+    {
+        *fLog << err << "ERROR - Requested run #" << fRunNumber << " doesn't ";
+        *fLog << "match found run #" << run << endl;
+        return line;
+    }
+
+    str.ReadLine(*fIn);   // Read to EOF or newline
+    if (!*fIn)
+        return line;
+
+    if (str(TRegexp("^Arehucas Version Number [0-9]+-[0-9]$")).IsNull())
+    {
+        *fLog << err << "ERROR - Version '^Arehucas Version Number [0-9]+-[0-9]$' ";
+        *fLog << "not found in second line." << endl;
+        return line;
+    }
+    line++;
+
+    str = str(TRegexp("[0-9]+-[0-9]"));
+    str.Prepend("20");
+    str.ReplaceAll("-", "");
+
+    const Int_t ver = atoi(str.Data());
+
+    *fLog << dbg << "Report File version: <" << ver << ">" << endl;
+
+    SetVersion(ver);
+
+    return line;
+}
Index: trunk/MagicSoft/Mars/mreport/MReportFileReadCC.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportFileReadCC.h	(revision 4575)
+++ trunk/MagicSoft/Mars/mreport/MReportFileReadCC.h	(revision 4575)
@@ -0,0 +1,22 @@
+#ifndef MARS_MReportFileReadCC
+#define MARS_MReportFileReadCC
+
+#ifndef MARS_MReportFileRead
+#include "MReportFileRead.h"
+#endif
+
+class MReportFileReadCC : public MReportFileRead
+{
+private:
+    Int_t fRunNumber;
+
+    Int_t CheckFileHeader();
+
+public:
+    MReportFileReadCC(const char *filename, const char *name=NULL, const char *title=NULL);
+    void SetRunNumber(Int_t run) { fRunNumber = run; }
+
+    ClassDef(MReportFileReadCC, 0)// Task to read the central control report file
+};
+
+#endif
Index: trunk/MagicSoft/Mars/mreport/MReportHelp.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportHelp.cc	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportHelp.cc	(revision 4575)
@@ -138,7 +138,7 @@
 // successfull interpretations.
 //
-Int_t MReportHelp::Interprete(TString &str, const MTime &start, const MTime &stop)
+Int_t MReportHelp::Interprete(TString &str, const MTime &start, const MTime &stop, Int_t ver)
 {
-    const Int_t rc = fReport->Interprete(str, start, stop);
+    const Int_t rc = fReport->Interprete(str, start, stop, ver);
 
     switch (rc)
Index: trunk/MagicSoft/Mars/mreport/MReportHelp.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportHelp.h	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportHelp.h	(revision 4575)
@@ -30,5 +30,5 @@
     MReport *GetReport() { return fReport; }
 
-    Int_t Interprete(TString &str, const MTime &start, const MTime &stop);
+    Int_t Interprete(TString &str, const MTime &start, const MTime &stop, Int_t ver);
 
     Bool_t SetupReading(MParList &plist);
Index: trunk/MagicSoft/Mars/mreport/MReportRun.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportRun.cc	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportRun.cc	(revision 4575)
@@ -57,5 +57,5 @@
 // Interprete the body of the RUN-REPORT string
 //
-Int_t MReportRun::InterpreteBody(TString &str)
+Int_t MReportRun::InterpreteBody(TString &str, Int_t ver)
 {
     const Int_t ws = str.First(' ');
Index: trunk/MagicSoft/Mars/mreport/MReportRun.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportRun.h	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportRun.h	(revision 4575)
@@ -12,5 +12,5 @@
     TString fSourceName;
 
-    Int_t InterpreteBody(TString &str);
+    Int_t InterpreteBody(TString &str, Int_t ver);
 
 public:
Index: trunk/MagicSoft/Mars/mreport/MReportTrigger.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportTrigger.cc	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportTrigger.cc	(revision 4575)
@@ -52,5 +52,5 @@
 // Interprete the body of the TRIGGER-REPORT string
 //
-Int_t MReportTrigger::InterpreteBody(TString &str)
+Int_t MReportTrigger::InterpreteBody(TString &str, Int_t ver)
 {
     str = str.Strip(TString::kLeading);
Index: trunk/MagicSoft/Mars/mreport/MReportTrigger.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportTrigger.h	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/MReportTrigger.h	(revision 4575)
@@ -22,5 +22,5 @@
     //TArrayF fRates;           //[Hz] currently undefined
 
-    Int_t InterpreteBody(TString &str);
+    Int_t InterpreteBody(TString &str, Int_t ver);
 
 public:
Index: trunk/MagicSoft/Mars/mreport/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mreport/Makefile	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/Makefile	(revision 4575)
@@ -31,5 +31,6 @@
            MReportTrigger.cc \
            MReportCurrents.cc \
-           MReportFileRead.cc
+           MReportFileRead.cc \
+           MReportFileReadCC.cc
 
 ############################################################
Index: trunk/MagicSoft/Mars/mreport/ReportLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/ReportLinkDef.h	(revision 4569)
+++ trunk/MagicSoft/Mars/mreport/ReportLinkDef.h	(revision 4575)
@@ -17,4 +17,5 @@
 #pragma link C++ class MReportHelp+;
 #pragma link C++ class MReportFileRead+;
+#pragma link C++ class MReportFileReadCC+;
 
 #endif
