Index: trunk/MagicSoft/Mars/mcamera/MCameraRecTemp.cc
===================================================================
--- trunk/MagicSoft/Mars/mcamera/MCameraRecTemp.cc	(revision 8287)
+++ trunk/MagicSoft/Mars/mcamera/MCameraRecTemp.cc	(revision 8955)
@@ -57,4 +57,34 @@
 // --------------------------------------------------------------------------
 //
+// Interprete the receiver board temperature part of the report
+//
+Bool_t MCameraRecTemp::InterpreteRecTemp(TString &str)
+{
+    Int_t len;
+    for (Int_t i=0; i<76; i++)
+    {
+        const Int_t n=sscanf(str.Data(), "%f %n", &fRecTemp[i], &len);
+        str.Remove(0, len);
+
+        if (n==1)
+            continue;
+
+        if (n==0 && i==0)
+        {
+            *fLog << inf << "Receiver Board Temperatures empty." << endl;
+            Invalidate();
+            break;
+        }
+
+        *fLog << warn << "WARNING - Reading Receiver Board Temperature information." << endl;
+        return kFALSE;
+    }
+
+    return kTRUE;
+}
+
+
+// --------------------------------------------------------------------------
+//
 // Print the dc currents
 //
Index: trunk/MagicSoft/Mars/mcamera/MCameraRecTemp.h
===================================================================
--- trunk/MagicSoft/Mars/mcamera/MCameraRecTemp.h	(revision 8287)
+++ trunk/MagicSoft/Mars/mcamera/MCameraRecTemp.h	(revision 8955)
@@ -13,7 +13,10 @@
 {
     friend class MReportCC;
+    friend class MReportRec;
 private:
     TArrayF fRecTemp; // [deg C] receiver board temperatures
     Bool_t  fIsValid; // fRecTemp contains valid information
+
+    Bool_t InterpreteRecTemp(TString &str);
 
 public:
Index: trunk/MagicSoft/Mars/mcamera/MCameraTD.cc
===================================================================
--- trunk/MagicSoft/Mars/mcamera/MCameraTD.cc	(revision 8287)
+++ trunk/MagicSoft/Mars/mcamera/MCameraTD.cc	(revision 8955)
@@ -19,5 +19,5 @@
 !   Author(s): Florian Goebel 11/2005 <mailto:fgoebel@mppmu.mpg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2006
+!   Copyright: MAGIC Software Development, 2000-2008
 !
 !
@@ -57,4 +57,58 @@
 // --------------------------------------------------------------------------
 //
+// Interprete the TD (discriminator delays) part of the report
+//
+Bool_t MCameraTD::InterpreteTD(TString &str, Int_t ver)
+{
+    // Skip the TD (discriminator delays) part of the report (for old
+    // CC files with wrong or nonsense number of TD-Bytes)
+    if (ver<200412210)
+    {
+        Ssiz_t pr = str.First(' ');
+        if (pr<0)
+        {
+            *fLog << warn << "WARNING - No TD information found at all." << endl;
+            return kFALSE;
+        }
+        if (pr!=1000)
+        {
+            Invalidate();
+
+            str.Remove(0, pr);
+            str=str.Strip(TString::kLeading);
+            return kTRUE;
+        }
+    }
+
+    // Older files have less bytes (pixels) stored
+    const Int_t numpix = ver<200510250 ? 500 : 577;
+
+    const char *pos = str.Data();
+    const char *end = str.Data()+numpix*2;
+
+    Int_t i=0;
+    while (pos<end)
+    {
+        const Char_t hex[3] = { pos[0], pos[1], 0 };
+        pos += 2;
+
+        const Int_t n=sscanf(hex, "%2hhx", &fTD[i++]);
+        if (n==1)
+            continue;
+
+        *fLog << warn << "WARNING - Reading hexadecimal TD information." << endl;
+        return kFALSE;
+    }
+
+    SetValid();
+
+    str.Remove(0, end-str.Data()); // Remove TD
+    str=str.Strip(TString::kLeading);
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
 // Print the discrimintaor delays
 //
Index: trunk/MagicSoft/Mars/mcamera/MCameraTD.h
===================================================================
--- trunk/MagicSoft/Mars/mcamera/MCameraTD.h	(revision 8287)
+++ trunk/MagicSoft/Mars/mcamera/MCameraTD.h	(revision 8955)
@@ -16,7 +16,10 @@
 {
     friend class MReportCC;
+    friend class MReportRec;
 private:
     TArrayC fTD;      // [au] discriminator delays
     Bool_t  fIsValid; // fTD contains valid information
+
+    Bool_t InterpreteTD(TString &str, Int_t ver);
 
 public:
Index: trunk/MagicSoft/Mars/mcamera/MCameraTH.cc
===================================================================
--- trunk/MagicSoft/Mars/mcamera/MCameraTH.cc	(revision 8287)
+++ trunk/MagicSoft/Mars/mcamera/MCameraTH.cc	(revision 8955)
@@ -40,4 +40,6 @@
 #include "MLogManip.h"
 
+#include "MCameraTD.h"
+
 ClassImp(MCameraTH);
 
@@ -53,4 +55,54 @@
     fName  = name  ? name  : "MCameraTH";
     fTitle = title ? title : "Storage container for the pixel discriminator threshold";
+}
+
+// --------------------------------------------------------------------------
+//
+// Interprete the TH (discriminator thresholds) part of the report
+//
+Bool_t MCameraTH::InterpreteTH(TString &str, Int_t ver, MCameraTD &td)
+{
+    // Skip the TH (discriminator thresholds) part of the report (for old
+    // CC files with wrong or nonsense number of TH-Bytes)
+    if (ver<200507190)
+    {
+        Ssiz_t pr = str.First(' ');
+        if (pr<0)
+        {
+            *fLog << warn << "WARNING - No TH information found at all." << endl;
+            return kFALSE;
+        }
+        if (pr!=1154)
+        {
+            td.Invalidate();
+
+            str.Remove(0, pr);
+            str=str.Strip(TString::kLeading);
+            return kTRUE;
+        }
+    }
+
+    const char *pos = str.Data();
+    const char *end = str.Data()+577*2;
+
+    Int_t i=0;
+    while (pos<end)
+    {
+        const Char_t hex[3] = { pos[0], pos[1], 0 };
+        pos += 2;
+
+        const Int_t n=sscanf(hex, "%2hhx", &fTH[i++]);
+        if (n==1)
+            continue;
+
+        *fLog << warn << "WARNING - Reading hexadecimal TH information." << endl;
+        return kFALSE;
+    }
+
+    SetValid();
+
+    str.Remove(0, end-str.Data()); // Remove TH
+    str=str.Strip(TString::kLeading);
+    return kTRUE;
 }
 
Index: trunk/MagicSoft/Mars/mcamera/MCameraTH.h
===================================================================
--- trunk/MagicSoft/Mars/mcamera/MCameraTH.h	(revision 8287)
+++ trunk/MagicSoft/Mars/mcamera/MCameraTH.h	(revision 8955)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-!  $Name: not supported by cvs2svn $:$Id: MCameraTH.h,v 1.7 2007-02-01 15:56:17 tbretz Exp $
+!  $Name: not supported by cvs2svn $:$Id: MCameraTH.h,v 1.8 2008-06-14 14:19:03 tbretz Exp $
 \* ======================================================================== */
 #ifndef MARS_MCameraTH
@@ -16,10 +16,15 @@
 #endif
 
+class MCameraTD;
+
 class MCameraTH : public MParContainer, public MCamEvent
 {
     friend class MReportCC;
+    friend class MReportRec;
 private:
     TArrayC fTH;      // [au] discriminator thresholds
     Bool_t  fIsValid; // fTH contains valid information
+
+    Bool_t InterpreteTH(TString &str, Int_t ver, MCameraTD &td);
 
 public:
