Index: /trunk/MagicSoft/Cosy/tpoint/plot.C
===================================================================
--- /trunk/MagicSoft/Cosy/tpoint/plot.C	(revision 7437)
+++ /trunk/MagicSoft/Cosy/tpoint/plot.C	(revision 7438)
@@ -77,5 +77,5 @@
     ifstream fin(fname);
 
-    cout << "Reading from " << fname << "..." << flush;
+    cout << "Reading " << setw(23) << fname << "..." << flush;
 
     while (1)
@@ -109,5 +109,6 @@
     }
 
-    cout << "done (" << g[0].GetN() << ")" << endl;
+    cout << "done (" << setw(3) << (Int_t)h->GetEntries() << "/";
+    cout << setw(3) << g[0].GetN() << ") " << flush;
 
     return g[0].GetN();
@@ -121,5 +122,5 @@
 };
 
-const Int_t counts = 13-4;
+const Int_t counts = 17-4;
 Description_t desc[counts] =
 {
@@ -137,9 +138,16 @@
     {"0503",  "TPoints Residuals 3/2005" ,   "tpoint/tpoint0503.txt"},
     {"0504",  "TPoints Residuals 4/2005" ,   "tpoint/tpoint0504.txt"},
-    {"05051", "TPoints Residuals 5/2004-1" , "tpoint/tpoint0505-1.txt"},
+    {"05051", "TPoints Residuals 5/2005-1" , "tpoint/tpoint0505-1.txt"},
     // Mirror alignment has been fixed
-    {"05052", "TPoints Residuals 5/2004-2" , "tpoint/tpoint0505-2.txt"},
+    {"05052", "TPoints Residuals 5/2005-2" , "tpoint/tpoint0505-2.txt"},
     // Fixes to pointing model due to fixing a screw
-    {"0506", "TPoints Residuals 6/2004" , "tpoint/tpoint0506.txt"}
+    {"0506", "TPoints Residuals 6/2005" , "tpoint/tpoint0506.txt"},
+
+    {"0508", "TPoints Residuals 8/2005" , "tpoint/tpoint0508.txt"},
+    {"0509", "TPoints Residuals 9/2005" , "tpoint/tpoint0509.txt"},
+    // Quick-and-dirty mirror alignment
+    {"0510", "TPoints Residuals 10/2005" , "tpoint/tpoint0510.txt"},
+    // New mirror alignment after Tenerife meeting
+    {"0511", "TPoints Residuals 11/2005" , "tpoint/tpoint0511.txt"}
 };
 
@@ -161,4 +169,5 @@
         cout << setw(2) << i << ": " << flush;
         n[i] = fill(desc[i].fFile, g, &hx[i]);
+        cout << " Mean: " << setw(5) << setprecision(2) << hx[i].GetMean() << " deg" <<  hx[i].GetRMS()<<endl;
     }
 
Index: /trunk/MagicSoft/Cosy/tpoint/tpoint0511.txt
===================================================================
--- /trunk/MagicSoft/Cosy/tpoint/tpoint0511.txt	(revision 7437)
+++ /trunk/MagicSoft/Cosy/tpoint/tpoint0511.txt	(revision 7438)
@@ -413,2 +413,8 @@
 # Capella		0.08	41   -52
 -51.7696 48.90804 90.75324 40.04845 5.278056 45.99806 -0.005096606 -0.02454738 53698.227554 197.9 2.627
+
+# --- 25.11.2005 --- 05:24:26.665
+-112.7778 47.83293 29.71322 39.00944 5.919444 7.406944 0.03266414 0.0009378095 53699.225309 204 2.6
+-143.7334 61.8596 358.7161 52.9985 7.655 5.225 0.007570955 0.01169973 53699.235536 204.6 2.769
+168.2918 51.8943 310.7723 42.92117 9.459722 -8.658611 0.02000216 0.02253327 53699.24525 209.6 3.605
+-52.39955 41.5637 90.11908 32.74121 5.278056 45.99806 0.02508735 0.002372406 53699.25409 199.4 2.982
Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 7437)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 7438)
@@ -18,12 +18,45 @@
 
                                                  -*-*- END OF LINE -*-*-
- 2005/11/30 Thomas Bretz
-
-   * showplot.cc:
-     - fixed some warnings
+ 2005/12/01 Thomas Bretz
+
+   * readdaq.cc:
+     - allow different file names
+
+   * mbase/MLog.[h,cc]:
+     - replaced preprocessor directive by const data member
+
+   * mbase/MDirIter.cc:
+     - removed special treatment of ?-character
+
+   * mbase/Makefile, mbase/BaseLinkDef.h:
+     - added new class
+
+   * mimage/MHillas.cc:
+     - changed atan2-output in Print to same convention as used
+       in MGeomCam
+
+   * mjobs/MJCalibrateSignal.cc:
+     - modified replacement rule for output file names
+
+   * mbase/MStatusDisplay.cc:
+     - fixed initial size
+     - automatically call SetFrameBorderMode for each new canvas
+
+   * mjobs/MSequence.cc:
+     - updated rule used to build file names
 
    * mgui/MCamEvent.[h,cc]:
      - implemented new member function GetCameraRMS
      - implemented new member function GetCameraStat
+
+   * mraw/MRawFileRead.[h,cc]:
+     - implemented new I/O scheme
+
+
+
+ 2005/11/30 Thomas Bretz
+
+   * showplot.cc:
+     - fixed some warnings
 
    * mmc/MMcFadcHeader.[hxx,cxx]:
@@ -35,8 +68,4 @@
    * mmc/Makefile:
      - added mgui 
-
-   * mbase/MStatusDisplay.cc:
-     - fixed initial size
-     - automatically call SetFrameBorderMode for each new canvas
 
    * datacenter/macros/plotdb.C:
Index: /trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 7437)
+++ /trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 7438)
@@ -15,4 +15,7 @@
 #pragma link C++ class MLogPlugin+;
 #pragma link C++ class MLogHtml+;
+
+// I/O
+#pragma link C++ class MZlib+;
 
 // Basic Network Tools
Index: /trunk/MagicSoft/Mars/mbase/MDirIter.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MDirIter.cc	(revision 7437)
+++ /trunk/MagicSoft/Mars/mbase/MDirIter.cc	(revision 7438)
@@ -223,5 +223,4 @@
     n.ReplaceAll("+", "\\+");
     n.ReplaceAll("*", "[^\\/:]*");
-    n.ReplaceAll("?", ".");
     n.Append("$");
 
Index: /trunk/MagicSoft/Mars/mbase/MLog.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 7437)
+++ /trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 7438)
@@ -173,5 +173,5 @@
 // which is used for the output (i)
 //
-MLog::MLog(int i) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(i), fIsNull(kFALSE), fOut(NULL), fOutAllocated(kFALSE), fGui(NULL), fNumLines(0)
+MLog::MLog(int i) : ostream(this), fPPtr(fBase), fEPtr(fBase+fgBufferSize), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(i), fIsNull(kFALSE), fOut(NULL), fOutAllocated(kFALSE), fGui(NULL), fNumLines(0)
 {
     Init();
@@ -183,5 +183,5 @@
 // ofstream as the default output device
 //
-MLog::MLog(ofstream &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fOut(&out), fOutAllocated(kFALSE), fGui(NULL), fNumLines(0)
+MLog::MLog(ofstream &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+fgBufferSize), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fOut(&out), fOutAllocated(kFALSE), fGui(NULL), fNumLines(0)
 {
     Init();
@@ -193,5 +193,5 @@
 // TGTextView as the default output device
 //
-MLog::MLog(TGTextView &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eGui), fOut(NULL), fOutAllocated(kFALSE), fGui(&out), fNumLines(0)
+MLog::MLog(TGTextView &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+fgBufferSize), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eGui), fOut(NULL), fOutAllocated(kFALSE), fGui(&out), fNumLines(0)
 {
     Init();
@@ -204,5 +204,5 @@
 // or not.
 //
-MLog::MLog(const char *fname, int flag) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fGui(NULL), fNumLines(0)
+MLog::MLog(const char *fname, int flag) : ostream(this), fPPtr(fBase), fEPtr(fBase+fgBufferSize), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fGui(NULL), fNumLines(0)
 {
     Init();
Index: /trunk/MagicSoft/Mars/mbase/MLog.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MLog.h	(revision 7437)
+++ /trunk/MagicSoft/Mars/mbase/MLog.h	(revision 7438)
@@ -13,5 +13,4 @@
 #include <iostream>  // base classes for MLog
 
-#define bsz    160 // two standard lines
 
 class MArgs;
@@ -54,6 +53,8 @@
     static const char *const kDark;
 
+    static const int fgBufferSize = 160;  // two standard lines
+
     char        fBuffer;      //!
-    char        fBase[bsz+1]; //! Buffer to store the data in
+    char        fBase[fgBufferSize+1]; //! Buffer to store the data in
     char       *fPPtr;        //! Pointer to present position in buffer
     const char *fEPtr;        //! Pointer to end of buffer
Index: /trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 7437)
+++ /trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 7438)
@@ -722,6 +722,6 @@
     // set the smallest and biggest size of the Main frame
     // and move it to its appearance position
-    SetWMSizeHints(571, 480, 2048, 1536, 1, 1);
-    MoveResize(rand()%100+571, rand()%100+480, 570, 480);
+    SetWMSizeHints(572, 480, 2048, 1536, 1, 1);
+    MoveResize(rand()%100+572, rand()%100+480, 572, 480);
 
     //
@@ -998,4 +998,5 @@
 
     c.SetFillColor(16/*165*//*17*//*203*/);
+    c.SetFrameBorderMode(0);
     c.SetBorderMode(0);
 
@@ -1589,5 +1590,5 @@
 
     case kSize640:  
-        Resize(571, 480);
+        Resize(572, 480);
         return kTRUE;
     case kSize768:  
Index: /trunk/MagicSoft/Mars/mbase/MZlib.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MZlib.cc	(revision 7438)
+++ /trunk/MagicSoft/Mars/mbase/MZlib.cc	(revision 7438)
@@ -0,0 +1,159 @@
+/* ======================================================================== *\
+!
+! *
+! * 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, 12/2005 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2005
+!
+!
+\* ======================================================================== */
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// MZlib
+//
+// This is a C++ wrapper for zlib (taken from root)
+//
+// WARNING: - There might not be support for all features.
+//          - seek calls might be rather slow
+//
+//////////////////////////////////////////////////////////////////////////////
+#include "MZlib.h"
+
+ClassImp(MZlib);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//
+// Open a file by name. Test if it is open like for an ifstream
+// It doesn't matter whether the file is gzip compressed or not.
+//
+void MZlib::open(const char* name)
+{
+    if (is_open())
+    {
+        clear(rdstate()|ios::badbit);
+        return;
+    }
+
+    fFile = gzopen(name, "rb0");
+    if (fFile == 0)
+    {
+        clear(rdstate()|ios::badbit);
+        return;
+    }
+}
+
+// --------------------------------------------------------------------------
+//
+// Close an open file.
+//
+void MZlib::close()
+{
+    if (!is_open())
+        return;
+
+    sync();
+
+    if (gzclose(fFile) != Z_OK)
+        clear(rdstate()|ios::badbit);
+
+    fFile = 0;
+}
+
+// --------------------------------------------------------------------------
+//
+int MZlib::underflow()
+{
+    if (gptr() && gptr()<egptr())
+        return * reinterpret_cast<unsigned char *>(gptr());
+
+    if (!is_open())
+        return EOF;
+
+    // implementation of inbuf
+    const int putback = gptr()-eback()>4 ? 4 : gptr()-eback();
+
+    memcpy(fBuffer+(4-putback), gptr()-putback, putback);
+
+    const int num = gzread(fFile, fBuffer+4, fgBufferSize-4);
+    if (num <= 0) // ERROR or EOF
+        return EOF;
+
+    // reset buffer pointers
+    setg(fBuffer+(4-putback), fBuffer+4, fBuffer+4+num);
+
+    // return next character
+    return *reinterpret_cast<unsigned char *>(gptr());
+}
+
+// --------------------------------------------------------------------------
+//
+int MZlib::flush_buffer()
+{
+    // Separate the writing of the buffer from overflow() and sync() operation.
+    const int w = pptr() - pbase();
+
+    if (gzwrite(fFile, pbase(), w) != w)
+        return EOF;
+
+    pbump(-w);
+
+    return w;
+}
+
+/*
+int MZlib::overflow( int c)
+{
+    if ( ! ( mode & ios::out) || ! opened)
+        return EOF;
+
+    if (c != EOF)
+    {
+        *pptr() = c;
+        pbump(1);
+
+    }
+    if ( flush_buffer() == EOF)
+        return EOF;
+
+    return c;
+}
+*/
+
+// --------------------------------------------------------------------------
+//
+int MZlib::sync()
+{
+    // Use flush_buffer() instead of overflow(EOF) to
+    // cause proper behavior with std::endl and flush()
+    if (pptr() && pptr()>pbase())
+    {
+        if (flush_buffer() == EOF)
+            return -1;
+    }
+    return 0;
+}
+
+// --------------------------------------------------------------------------
+//
+streambuf::pos_type MZlib::seekoff(streambuf::off_type offset, ios_base::seekdir dir, ios_base::openmode)
+{
+    return gzseek(fFile, offset, dir);
+}
Index: /trunk/MagicSoft/Mars/mbase/MZlib.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MZlib.h	(revision 7438)
+++ /trunk/MagicSoft/Mars/mbase/MZlib.h	(revision 7438)
@@ -0,0 +1,56 @@
+#ifndef MARS_MZlib
+#define MARS_MZlib
+
+#ifndef ROOT_TObject
+#include <TObject.h>
+#endif
+
+#ifdef __CINT__
+typedef void *gzFile;
+#else
+#include <zlib.h>
+#endif
+
+#include <iostream>  // base classes for MLog
+
+class MZlib : public std::streambuf, virtual public std::istream, public TObject
+{
+private:
+    static const int fgBufferSize = 47+256; // size of data buff totals 512 bytes under g++ for igzstream at the end.
+
+    gzFile fFile;                 // file handle for compressed file
+    char   fBuffer[fgBufferSize]; // data buffer
+
+    int flush_buffer();
+    int underflow();
+    int sync();
+
+public:
+    MZlib() : istream(this), fFile(0)
+    {
+        setp(fBuffer,   fBuffer+fgBufferSize-1);
+        setg(fBuffer+4, fBuffer+4, fBuffer+4);
+    }
+    MZlib(const char *name) : istream(this), fFile(0)
+    {
+        setp(fBuffer,   fBuffer+fgBufferSize-1);
+        setg(fBuffer+4, fBuffer+4, fBuffer+4);
+
+        open(name);
+    }
+    ~MZlib() { MZlib::close(); }
+
+    int is_open() { return fFile!=0; }
+
+    void open(const char* name);
+    void close();
+
+    std::streambuf::pos_type seekoff(std::streambuf::off_type, std::ios_base::seekdir,
+                                     std::ios_base::openmode = std::ios_base::in | std::ios_base::out);
+    //std::streambuf::pos_type seekpos(std::streambuf::pos_type,
+    //                                 std::ios_base::openmode = std::ios_base::in | std::ios_base::out);
+
+    ClassDef(MZlib, 0) // A C++ wrapper to istream zlib files
+};
+
+#endif
Index: /trunk/MagicSoft/Mars/mbase/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mbase/Makefile	(revision 7437)
+++ /trunk/MagicSoft/Mars/mbase/Makefile	(revision 7438)
@@ -59,5 +59,6 @@
            MClone.cc \
            MContinue.cc \
-           MPrint.cc
+           MPrint.cc \
+           MZlib.cc
 
 ############################################################
Index: /trunk/MagicSoft/Mars/mgui/MCamEvent.cc
===================================================================
--- /trunk/MagicSoft/Mars/mgui/MCamEvent.cc	(revision 7437)
+++ /trunk/MagicSoft/Mars/mgui/MCamEvent.cc	(revision 7438)
@@ -62,4 +62,6 @@
 Double_t MCamEvent::GetCameraMean(const MGeomCam &cam, Int_t type) const
 {
+    return GetCameraStat(cam, type)[0];
+    /*
     Int_t    num  = 0;
     Double_t mean = 0;
@@ -74,3 +76,70 @@
     }
     return num == 0 ? 0 : mean/num;
+    */
 }
+
+// --------------------------------------------------------------------------
+//
+// Return the rms of all corresponding GetPixelContent
+//
+Double_t MCamEvent::GetCameraRMS(const MGeomCam &cam, Int_t type) const
+{
+    return GetCameraStat(cam, type)[1];
+    /*
+    Int_t    num  = 0;
+    Double_t sum = 0;
+    Double_t sq  = 0;
+
+    for (unsigned int i=0; i<cam.GetNumPixels(); i++)
+    {
+        Double_t val;
+        if (!GetPixelContent(val, i, cam, type))
+            continue;
+
+        sum += val;
+        sq  += val;
+        num ++;
+    }
+
+    if (num==0)
+        return 0;
+
+    sum /= num;
+    sq  /= num;
+
+    return TMath::Sqrt(sq-sum*sum);
+    */
+}
+
+// --------------------------------------------------------------------------
+//
+// Return the rms of all corresponding GetPixelContent
+//
+TArrayD MCamEvent::GetCameraStat(const MGeomCam &cam, Int_t type) const
+{
+    Int_t    num = 0;
+    Double_t sum = 0;
+    Double_t sq  = 0;
+
+    for (unsigned int i=0; i<cam.GetNumPixels(); i++)
+    {
+        Double_t val;
+        if (!GetPixelContent(val, i, cam, type))
+            continue;
+
+        sum += val;
+        sq  += val;
+        num ++;
+    }
+
+    if (num==0)
+        return 0;
+
+    sum /= num;
+    sq  /= num;
+
+    TArrayD stat(2);
+    stat[0] = sum;
+    stat[1] = TMath::Sqrt(sq-sum*sum);
+    return stat;
+}
Index: /trunk/MagicSoft/Mars/mgui/MCamEvent.h
===================================================================
--- /trunk/MagicSoft/Mars/mgui/MCamEvent.h	(revision 7437)
+++ /trunk/MagicSoft/Mars/mgui/MCamEvent.h	(revision 7438)
@@ -2,6 +2,6 @@
 #define MARS_MCamEvent
 
-#ifndef ROOT_TROOT
-#include <TROOT.h>
+#ifndef ROOT_TArrayD
+#include <TArrayD.h>
 #endif
 
@@ -18,4 +18,6 @@
 
     virtual Double_t GetCameraMean(const MGeomCam &cam, Int_t type=0) const;
+    virtual Double_t GetCameraRMS(const MGeomCam &cam, Int_t type=0) const;
+    virtual TArrayD  GetCameraStat(const MGeomCam &cam, Int_t type=0) const;
 
     ClassDef(MCamEvent, 0) // A camera event
Index: /trunk/MagicSoft/Mars/mimage/MHillas.cc
===================================================================
--- /trunk/MagicSoft/Mars/mimage/MHillas.cc	(revision 7437)
+++ /trunk/MagicSoft/Mars/mimage/MHillas.cc	(revision 7438)
@@ -159,8 +159,5 @@
 void MHillas::Print(Option_t *) const
 {
-    Double_t atg = atan2(fMeanY, fMeanX)*kRad2Deg;
-
-    if (atg<0)
-        atg += 180;
+    const Double_t atg = atan2(fMeanX, fMeanY)*kRad2Deg;
 
     *fLog << all;
@@ -182,8 +179,5 @@
 void MHillas::Print(const MGeomCam &geom) const
 {
-    Double_t atg = atan2(fMeanY, fMeanX)*kRad2Deg;
-
-    if (atg<0)
-        atg += 180;
+    const Double_t atg = atan2(fMeanX, fMeanY)*kRad2Deg;
 
     *fLog << all;
Index: /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 7437)
+++ /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 7438)
@@ -403,5 +403,5 @@
     read->AddFiles(iter);
 
-    const TString fname(Form("%s{s/_D_/_Y_}{s/.raw$/.root}", fPathOut.Data()));
+    const TString fname(Form("%s{s/_D_/_Y_}{s/\\.raw$/\\.root}{s/\\.raw\\.gz$/.root}", fPathOut.Data()));
 
     
Index: /trunk/MagicSoft/Mars/mjobs/MSequence.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MSequence.cc	(revision 7437)
+++ /trunk/MagicSoft/Mars/mjobs/MSequence.cc	(revision 7438)
@@ -279,5 +279,5 @@
         case kRawCal:
         case kRawAll:
-            n += ".raw";
+            n += ".raw.?g?z?";
             break;
         default:
Index: /trunk/MagicSoft/Mars/mraw/MRawFileRead.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawFileRead.cc	(revision 7437)
+++ /trunk/MagicSoft/Mars/mraw/MRawFileRead.cc	(revision 7438)
@@ -44,5 +44,4 @@
 
 #include <errno.h>
-#include <fstream>
 
 #include <TSystem.h>
@@ -51,4 +50,5 @@
 #include "MLogManip.h"
 
+#include "MZlib.h"
 #include "MTime.h"
 #include "MParList.h"
@@ -127,5 +127,5 @@
 Byte_t MRawFileRead::IsFileValid(const char *name)
 {
-    ifstream fin(name);
+    MZlib fin(name);
     if (!fin)
         return 0;
@@ -188,5 +188,5 @@
 
     const char *expname = gSystem->ExpandPathName(name);
-    fIn = new ifstream(expname);
+    fIn = new MZlib(expname);
 
     const Bool_t noexist = !(*fIn);
@@ -194,5 +194,5 @@
     {
         *fLog << err << "Cannot open file " << expname << ": ";
-        *fLog << strerror(errno) << endl;
+        *fLog << (errno==0?strerror(errno):"Insufficient memory for decompression") << endl;
     }
     else
Index: /trunk/MagicSoft/Mars/mraw/MRawFileRead.h
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawFileRead.h	(revision 7437)
+++ /trunk/MagicSoft/Mars/mraw/MRawFileRead.h	(revision 7438)
@@ -7,4 +7,5 @@
 
 class TList;
+class MZlib;
 class MTaskList;
 
@@ -12,14 +13,14 @@
 {
 private:
-    TList     *fFileNames;      // list of file names
-    UInt_t     fNumFile;        //! number of next file
-    UInt_t     fNumEvents;      //! input stream (file to read from)
-    UInt_t     fNumTotalEvents; //! total number of events in all files
+    TList    *fFileNames;      // list of file names
+    UInt_t    fNumFile;        //! number of next file
+    UInt_t    fNumEvents;      //! input stream (file to read from)
+    UInt_t    fNumTotalEvents; //! total number of events in all files
 
-    ifstream  *fIn;             //! input stream (file to read from)
+    MZlib    *fIn;             //! input stream (file to read from)
 
-    MParList  *fParList;        //! tasklist to call ReInit from
+    MParList *fParList;        //! tasklist to call ReInit from
 
-    UInt_t     fInterleave;
+    UInt_t    fInterleave;
 
     Int_t  OpenNextFile(Bool_t print=kTRUE);
Index: /trunk/MagicSoft/Mars/readdaq.cc
===================================================================
--- /trunk/MagicSoft/Mars/readdaq.cc	(revision 7437)
+++ /trunk/MagicSoft/Mars/readdaq.cc	(revision 7438)
@@ -92,5 +92,5 @@
     TString kNamein = arg.GetArgumentStr(0);
   
-    if (!kNamein.EndsWith(".raw"))
+    if (!kNamein.EndsWith(".raw") && !kNamein.EndsWith(".raw.gz"))
         kNamein += ".raw";
 
