Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 2177)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 2178)
@@ -5,4 +5,70 @@
    * mhist/MHOnSubtraction.cc:
      - worked around the non compiling source file
+
+   * merpp.cc:
+     - set compression level default = 1
+
+   * macros/readCT1.C, macros/readMagic.C, macros/readcurrents.C,
+     meventdisp/MGCamDisplay.cc
+     - adapted to new MCamDisplay and MCamEvent
+
+   * macros/sumcurrents.C:
+     - enhanced
+
+   * manalysis/MCerPhotCalc.[h, cc]:
+     - simplified algorithm
+
+   * manalysis/MCerPhotEvt.[h,cc], manalysis/MCurrents.[h,cc],
+     manalysis/MPedestalCam.[h,cc]:
+     - derived from MCamEvent
+     
+   * manalysis/MMcPedestalNSBAdd.cc:
+     - minor change
+     
+   * mbase/BaseLinkDef.h, mbase/Makefile:
+     - added MDirIter
+
+   * mbase/MDirIter.[h,cc]:
+     - added
+     
+   * mbase/MParList.cc:
+     - enhnced some output
+
+   * mbase/MTaskInteractive.cc:
+     - fixed a bug
+     
+   * mbase/MTaskList.cc:
+     - added handling of gui events for Pre- and PostProcess
+     
+   * mgeom/MGeomPix.cc:
+     - added a comment
+     
+   * mgui/MCamDisplay.[h,cc] -  PRELIMINARY:
+     - added a notification list
+     - fixed SetRange if pad is not the main pad
+     - new Fill functions using MCamEvent, removed old ones 
+     
+   * mhist/MFillH.cc:
+     - check for the existance of the canvas
+     
+   * mhist/MHCerPhotEvt.cc:
+     - take usage of MCamEvent
+
+   * mhist/MHCurrents.cc:
+     - take usage of MCamEvent
+     - added rms
+     
+   * mmain/MStatusDisplay.[h,cc]:
+     - added "Reset" and "Remove Tab" to menu bar
+
+   * mraw/MRawEvtData.[h,cc]:
+     - draw hi- and logains
+     - derived from MCamEvent
+     
+   * mraw/MRawEvtPixelIter.[h,cc]:
+     - added GetVarHiGainSamples
+
+   * mraw/Makefile:
+     - added -I../mgui - PRELIMINARY
 
 
Index: /trunk/MagicSoft/Mars/macros/readCT1.C
===================================================================
--- /trunk/MagicSoft/Mars/macros/readCT1.C	(revision 2177)
+++ /trunk/MagicSoft/Mars/macros/readCT1.C	(revision 2178)
@@ -89,5 +89,5 @@
             continue;
 
-        display.FillPhotNum(*evt);
+        display.Fill(*evt);
         display.Update();
 
@@ -100,5 +100,5 @@
         newimgpar.Print();
 
-        display.FillPhotNum(*(MCerPhotEvt*)plist.FindObject("MCerPhotEvt"));
+        display.Fill(*(MCerPhotEvt*)plist.FindObject("MCerPhotEvt"));
         display.Update();
 
Index: /trunk/MagicSoft/Mars/macros/readMagic.C
===================================================================
--- /trunk/MagicSoft/Mars/macros/readMagic.C	(revision 2177)
+++ /trunk/MagicSoft/Mars/macros/readMagic.C	(revision 2178)
@@ -104,5 +104,5 @@
         cout << "Event #" << read.GetNumEntry() ":" << endl;
 
-        display.FillPhotNum(*(MCerPhotEvt*)clone.GetClone());
+        display.Fill(*(MCerPhotEvt*)clone.GetClone());
         gPad->Modified();
         gPad->Update();
@@ -116,5 +116,5 @@
         newimgpar.Print();
 
-        display.FillPhotNum(*(MCerPhotEvt*)plist.FindObject("MCerPhotEvt"));
+        display.Fill(*(MCerPhotEvt*)plist.FindObject("MCerPhotEvt"));
         gPad->Modified();
         gPad->Update();
Index: /trunk/MagicSoft/Mars/macros/readcurrents.C
===================================================================
--- /trunk/MagicSoft/Mars/macros/readcurrents.C	(revision 2177)
+++ /trunk/MagicSoft/Mars/macros/readcurrents.C	(revision 2178)
@@ -45,5 +45,5 @@
 }
 
-void readcurrents(const char *fname="../currents/dcs_vega.dat")
+void readcurrents(const char *fname="../currents/dcs_arcturus.dat")
 {
     MParList plist;
@@ -86,5 +86,5 @@
     {
         // cur.Print();
-        display.FillCurrents(cur);
+        display.Fill(cur);
         gPad->Modified();
         gPad->Update();
Index: /trunk/MagicSoft/Mars/macros/sumcurrents.C
===================================================================
--- /trunk/MagicSoft/Mars/macros/sumcurrents.C	(revision 2177)
+++ /trunk/MagicSoft/Mars/macros/sumcurrents.C	(revision 2178)
@@ -29,5 +29,5 @@
 //  This macro shows how to fill and display a histogram using Mars
 //
-void sumcurrents(const char *fname="../currents/dcs_arcturus.dat")
+void sumcurrents(const char *fname="../currents/spica_center.txt")
 {
     //
@@ -83,6 +83,63 @@
     MHCurrents &h = *(MHCurrents*)plist->FindObject("MHCurrents");
 
-    MCamDisplay *disp = new MCamDisplay(&geom);
-    disp->FillCurrents(h.GetSum());
-    disp->Draw();
+    TCanvas *c = MH::MakeDefCanvas();
+    c->Divide(3, 2);
+
+    MCamDisplay *disp1=new MCamDisplay(&geom);
+    MCamDisplay *disp2=new MCamDisplay(&geom);
+    MCamDisplay *disp3=new MCamDisplay(&geom);
+    disp1->Fill(h.GetSum());
+    disp2->Fill(h.GetRms());
+
+    TArrayF arr(577);
+    for (int i=0;i<577;i++)
+    {
+        TArrayF &r = h.GetRms();
+        TArrayF &v = h.GetSum();
+        arr[i] = (r[i]==0 ? 0 : v[i]/r[i]);
+    }
+    disp3->Fill(arr);
+
+    c->cd(1);
+    gPad->SetBorderMode(0);
+    gPad->Divide(1,1);
+    gPad->cd(1);
+    gPad->SetLogz();
+    disp1->Draw();
+    disp1->SetBit(kCanDelete);
+    c->cd(2);
+    gPad->SetBorderMode(0);
+    gPad->Divide(1,1);
+    gPad->cd(1);
+    gPad->SetLogz();
+    disp2->Draw();
+    disp2->SetBit(kCanDelete);
+    c->cd(3);
+    gPad->SetBorderMode(0);
+    gPad->Divide(1,1);
+    gPad->cd(1);
+    gPad->SetLogz();
+    disp3->Draw();
+    disp3->SetBit(kCanDelete);
+    c->cd(4);
+    gPad->SetBorderMode(0);
+    h.GetHist().DrawClone();
+    c->cd(5);
+    gPad->SetBorderMode(0);
+    TH1F h1("currents;rms", "Currents Rms", 577, -0.5, 576.5);
+    for (int i=1;i<=577; i++)
+        h1.SetBinContent(i, h.GetHist().GetBinError(i));
+    h1.DrawCopy();
+    c->cd(6);
+    gPad->SetBorderMode(0);
+    TH1F h2("currents;relerr", "Currents rel. Error [%]", 577, -0.5, 576.5);
+    for (int i=1;i<=577; i++)
+    {
+        Float_t val = h.GetHist().GetBinContent(i);
+        Float_t rms = h.GetHist().GetBinError(i);
+        h2.SetBinContent(i, rms==0?0:val/rms);
+    }
+    h2.DrawCopy();
+
+    c->SaveAs("spica_center-avg.ps");
 }
Index: /trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc	(revision 2177)
+++ /trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc	(revision 2178)
@@ -32,4 +32,6 @@
 //   the array fWeight (default: all slices added up with weight 1).
 //
+//   The weights are rescaled, such that sum(weigths)=num slices
+//
 //  Input Containers:
 //   MRawRunHeader, MRawEvtData, MPedestalCam
@@ -112,7 +114,11 @@
 
     // Calculate quadratic sum of weights:
-    fSumQuadWeights = 0.;
-    for (Int_t i = 0; i < fWeight.GetSize(); i++)
+    fSumWeights = 0;
+    fSumQuadWeights = 0;
+    for (Int_t i=0; i<fWeight.GetSize(); i++)
+    {
+        fSumWeights += fWeight[i];
         fSumQuadWeights += fWeight[i]*fWeight[i];
+    }
 
     fSumQuadWeights = sqrt(fSumQuadWeights);
@@ -169,6 +175,4 @@
 
     MRawEvtPixelIter pixel(fRawEvt);
-
-    TArrayF binsignal(fWeight.GetSize());
 
     while (pixel.Next())
@@ -194,18 +198,13 @@
         // Calculate pixel signal unless it has all FADC slices empty:
         //
-        const Byte_t *ptr = pixel.GetHiGainSamples();
-
-	Float_t nphot = 0;
-        Float_t nphoterr = 0;
-
-        if (pixel.GetSumHiGainSamples()>0)
-        {
-            for (Int_t i=0; i<fWeight.GetSize(); i++)
-            {
-                binsignal[i] =  ptr[i] - mean;
-                nphot       +=  binsignal[i] * fWeight[i];
-            }
-            nphoterr = ped.GetSigma() * fSumQuadWeights;
-        }
+        Byte_t *ptr = pixel.GetHiGainSamples();
+
+        Float_t nphot = 0;
+        for(Int_t i=0; i<fWeight.GetSize(); i++)
+            nphot += ptr[i]*fWeight[i];
+
+        nphot -= mean*fSumWeights;
+
+        const Float_t nphoterr = ped.GetSigma()* fSumQuadWeights;
 
         fCerPhotEvt->AddPixel(pixid, nphot, nphoterr);
Index: /trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.h	(revision 2177)
+++ /trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.h	(revision 2178)
@@ -33,4 +33,5 @@
 
     TArrayF         fWeight;  // Weights for adding up the ADC slices
+    Float_t         fSumWeights;
     Float_t         fSumQuadWeights;
 
Index: /trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc	(revision 2177)
+++ /trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc	(revision 2178)
@@ -384,2 +384,25 @@
     fNumPixels=fPixels->GetEntriesFast();
 }
+
+Bool_t MCerPhotEvt::GetPixelContent(Float_t &val, Int_t idx, Float_t ratio, Int_t type) const
+{
+    MCerPhotPix *pix = GetPixById(idx);
+    if (!pix || !pix->IsPixelUsed())
+        return kFALSE;
+
+    switch (type)
+    {
+    case 1:
+        val = pix->GetErrorPhot()*TMath::Sqrt(ratio);
+        return kTRUE;
+    case 2:
+        if (pix->GetErrorPhot()<=0)
+            return kFALSE;
+        val = pix->GetNumPhotons()*TMath::Sqrt(ratio)/pix->GetErrorPhot();
+        return kTRUE;
+    default:
+        val = pix->GetNumPhotons()*ratio;
+        return kTRUE;
+    }
+    return kTRUE;
+}
Index: /trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h	(revision 2177)
+++ /trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h	(revision 2178)
@@ -4,4 +4,7 @@
 #ifndef ROOT_TClonesArray
 #include <TClonesArray.h>
+#endif
+#ifndef MARS_MCamEvent
+#include "MCamEvent.h"
 #endif
 #ifndef MARS_MCerPhotPix
@@ -12,5 +15,5 @@
 class MCerPhotPix;
 
-class MCerPhotEvt : public MParContainer
+class MCerPhotEvt : public MCamEvent
 {
 private:
@@ -61,4 +64,9 @@
     void Clear(Option_t *opt=NULL) { Reset(); }
 
+    Bool_t GetPixelContent(Float_t &val, Int_t idx, Float_t ratio=1, Int_t type=0) const;
+    void DrawPixelContent(Int_t num) const
+    {
+    }
+
     ClassDef(MCerPhotEvt, 1)    // class for an event containing cerenkov photons
 };
Index: /trunk/MagicSoft/Mars/manalysis/MCurrents.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MCurrents.h	(revision 2177)
+++ /trunk/MagicSoft/Mars/manalysis/MCurrents.h	(revision 2178)
@@ -2,6 +2,6 @@
 #define MARS_MCurrents
 
-#ifndef MARS_MParContainer
-#include "MParContainer.h"
+#ifndef MARS_MCamEvent
+#include "MCamEvent.h"
 #endif
 
@@ -10,5 +10,6 @@
 #endif
 
-class MCurrents : public MParContainer
+#include <iostream.h>
+class MCurrents : public MCamEvent
 {
 private:
@@ -37,4 +38,13 @@
     void Print(Option_t *opt=NULL) const;
 
+    Bool_t GetPixelContent(Float_t &val, Int_t idx, Float_t ratio=1, Int_t type=0) const
+    {
+        val = (*this)[idx];
+        return val>0;
+    }
+    void DrawPixelContent(Int_t num) const
+    {
+    }
+
     ClassDef(MCurrents, 1) // Storage Container for the Currents (PRELIMINARY)
 };
Index: /trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc	(revision 2177)
+++ /trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc	(revision 2178)
@@ -16,5 +16,5 @@
 !
 !
-!   Author(s): Oscar Blanch  11/2001 < mailto:blanch@ifae.es>
+!   Author(s): Oscar Blanch, 11/2001 <mailto:blanch@ifae.es>
 !
 !   Copyright: MAGIC Software Development, 2000-2001
Index: /trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc	(revision 2177)
+++ /trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc	(revision 2178)
@@ -181,2 +181,8 @@
     return maxval;
 }
+
+Bool_t MPedestalCam::GetPixelContent(Float_t &val, Int_t idx, Float_t ratio=1, Int_t type=0) const
+{
+    val = (*this)[idx].GetMean()*ratio;
+    return kTRUE;
+}
Index: /trunk/MagicSoft/Mars/manalysis/MPedestalCam.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MPedestalCam.h	(revision 2177)
+++ /trunk/MagicSoft/Mars/manalysis/MPedestalCam.h	(revision 2178)
@@ -2,6 +2,6 @@
 #define MARS_MPedestalCam
 
-#ifndef MARS_MParContainer
-#include "MParContainer.h"
+#ifndef MARS_MCamEvent
+#include "MCamEvent.h"
 #endif
 
@@ -11,5 +11,5 @@
 class MPedestalPix;
 
-class MPedestalCam : public MParContainer
+class MPedestalCam : public MCamEvent
 {
 private:
@@ -35,4 +35,9 @@
     void Print(Option_t *o="") const;
 
+    Bool_t GetPixelContent(Float_t &val, Int_t idx, Float_t ratio=1, Int_t type=0) const;
+    void DrawPixelContent(Int_t num) const
+    {
+    }
+
     ClassDef(MPedestalCam, 1)	// Storage Container for all pedestal information of the camera
 };
Index: /trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 2177)
+++ /trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 2178)
@@ -16,4 +16,5 @@
 
 #pragma link C++ class MIter+;
+#pragma link C++ class MDirIter+;
 
 #pragma link C++ class MTask+;
Index: /trunk/MagicSoft/Mars/mbase/MDirIter.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MDirIter.cc	(revision 2178)
+++ /trunk/MagicSoft/Mars/mbase/MDirIter.cc	(revision 2178)
@@ -0,0 +1,312 @@
+/* ======================================================================== *\
+!
+! *
+! * 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, 6/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+//  MDirIter
+//
+// Iterator for files in several directories (with filters)
+//
+// Use this class if you want to get all filenames in a directory
+// one-by-one.
+//
+// You can specify more than one directory (also recursivly) and you
+// can use filters (eg. *.root)
+//
+// Here is an example which will print all *.root files in the current
+// directory and all its subdirectories and all Gamma*.root files in
+// the directory ../data.
+//
+// ------------------------------------------------------------------------
+//
+//  // Instatiate the iterator
+//  MDirIter Next();
+//
+//  // Add the current directory (for *.root files) and recursive
+//  // directories with the same filter
+//  Next.AddDirectory(".", "*.root", kTRUE);
+//  // Add the directory ../data, too (filter only Gamma*.root files)
+//  Next.AddDirectory("../data", "Gamma*.root");
+//
+//  TString name;
+//  while (!(name=Next()).IsNull())
+//     cout << name << endl;
+//
+// ------------------------------------------------------------------------
+//
+// WARNING: If you specify relative directories (like in the example) the
+//          result may depend on the current working directory! Better use
+//          absolute paths.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include "MDirIter.h"
+
+#include <iostream>
+
+#include <TNamed.h>
+#include <TRegexp.h>
+#include <TSystem.h>
+
+ClassImp(MDirIter);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//
+//  Add a directory, eg dir="../data"
+//  Using a filter (wildcards) will only return files matching this filter.
+//  recursive is the number of recursive directories (use 0 for none and -1
+//  for all)
+//  Returns the number of directories added.
+//  If a directory is added using a filter and the directory is already
+//  existing without a filter the filter is replaced.
+//  If any directory to be added is already existing with a different
+//  filter a new entry is created, eg:
+//   already existing:  ../data <*.root>
+//   new entry:         ../data <G*>
+//  The filters are or'ed.
+//
+Int_t MDirIter::AddDirectory(const char *d, const char *filter, Int_t recursive)
+{
+    TString dir = d;
+
+    // Sanity check
+    if (dir.IsNull())
+        return 0;
+
+#if ROOT_VERSION_CODE < ROOT_VERSION(3,05,05)
+    if (dir[dir.Length()-1]!='/')
+        dir += '/';
+#else
+    if (!dir.EndsWith("/"))
+        dir += '/';
+#endif
+    gSystem->ExpandPathName(dir);
+
+    // Try to find dir in the list of existing dirs
+    TObject *o = fList.FindObject(dir);
+    if (o)
+    {
+        const TString t(o->GetTitle());
+
+        // Check whether the existing dir has an associated filter
+        if (t.IsNull())
+        {
+            // Replace old filter by new one
+            ((TNamed*)o)->SetTitle(filter);
+            return 0;
+        }
+
+        // If the filters are the same no action is taken
+        if (t==filter)
+            return 0;
+    }
+
+    fList.Add(new TNamed((const char*)dir, filter ? filter : ""));
+
+    // No recuresive directories, return
+    if (recursive==0)
+        return 1;
+
+    Int_t rc = 1;
+
+    // Create an iterator to iterate over all entries in the directory
+    MDirIter Next(dir);
+
+    TString c;
+    while (!(c=Next(kTRUE)).IsNull())
+    {
+        // Do not process . and .. entries
+        if (c.EndsWith("/.") || c.EndsWith("/.."))
+            continue;
+
+        // If entry is a directory add it with a lowere recursivity
+        if (IsDir(c)==0)
+            rc += AddDirectory(c, filter, recursive-1);
+    }
+    return rc;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Return the pointer to the current directory. If the pointer is NULL
+//  a new directory is opened. If no new directory can be opened NULL is
+//  returned.
+//
+void *MDirIter::Open()
+{
+    // Check whether a directory is already open
+    if (fDirPtr)
+        return fDirPtr;
+
+    // Get Next entry of list
+    fCurrentPath=fNext();
+
+    // Open directory if new entry was found
+    return fCurrentPath ? gSystem->OpenDirectory(fCurrentPath->GetName()) : NULL;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Close directory is opened. Set fDirPtr=NULL
+//
+void MDirIter::Close()
+{
+    if (fDirPtr)
+        gSystem->FreeDirectory(fDirPtr);
+    fDirPtr = NULL;
+}
+
+TString MDirIter::ConcatFileName(const char *dir, const char *name) const
+{
+    return TString(dir)+name;
+}
+
+// --------------------------------------------------------------------------
+//
+// Check whether the given name n matches the filter f.
+// Filters are of the form TRegexp(f, kTRUE)
+//
+Bool_t MDirIter::MatchFilter(const TString &n, const TString &f) const
+{
+    return f.IsNull() || !n(TRegexp(f, kTRUE)).IsNull();
+}
+
+// --------------------------------------------------------------------------
+//
+// Check whether fqp is a directory.
+// Returns -1 if fqp couldn't be accesed, 0 if it is a directory,
+// 1 otherwise
+//
+Int_t MDirIter::IsDir(const char *fqp) const
+{
+    Long_t t[4];
+    if (gSystem->GetPathInfo(fqp, t, t+1, t+2, t+3))
+        return -1;
+
+    if (t[2]==3)
+        return 0;
+
+    return 1;
+}
+
+// --------------------------------------------------------------------------
+//
+// Check whether the current entry in the directory n is valid or not.
+// Entries must:
+//  - not be . or ..
+//  - match the associated filter
+//  - match the global filter
+//  - not be a directory
+//  - have read permission
+//
+Bool_t MDirIter::Check(const TString n) const
+{
+    // Check . and ..
+    if (n=="." || n=="..")
+        return kFALSE;
+
+    // Check associated filter
+    if (!MatchFilter(n, fCurrentPath->GetTitle()))
+        return kFALSE;
+
+    // Check global filter
+    if (!MatchFilter(n, fFilter))
+        return kFALSE;
+
+    // Check for file or directory
+    const TString fqp = ConcatFileName(fCurrentPath->GetName(), n);
+    if (IsDir(fqp)<=0)
+        return kFALSE;
+
+    // Check for rread perissions
+    return !gSystem->AccessPathName(fqp, kReadPermission);
+}
+
+// --------------------------------------------------------------------------
+//
+// Return the Next file in the directory which is valid (see Check())
+// nocheck==1 returns the next entry unchecked
+//
+TString MDirIter::Next(Bool_t nocheck)
+{
+    fDirPtr = Open();
+    if (!fDirPtr)
+        return "";
+
+    // Get next entry in dir, if existing check validity
+    const char *n = gSystem->GetDirEntry(fDirPtr);
+    if (n)
+        return nocheck || Check(n) ? ConcatFileName(fCurrentPath->GetName(), n) : Next();
+
+    // Otherwise close directory and try to get next entry
+    Close();
+    return Next();
+}
+
+// --------------------------------------------------------------------------
+//
+// Print a single entry in the list
+//
+void MDirIter::PrintEntry(const TObject &o) const
+{
+    TString p = o.GetName();
+    TString f = o.GetTitle();
+    cout << p;
+    if (!f.IsNull())
+        cout << " <" << f << ">";
+    cout << endl;
+}
+
+// --------------------------------------------------------------------------
+//
+// Print all scheduled directories. If "all" is specified also all
+// matching entries are printed.
+//
+void MDirIter::Print(const Option_t *o)
+{
+    TString s(o);
+    if (!s.Contains("all", TString::kIgnoreCase))
+    {
+        TIter Next(&fList);
+        TObject *o=NULL;
+        while ((o=Next()))
+            PrintEntry(*o);
+        return;
+    }
+
+    MDirIter Next(*this);
+    TString name;
+    TString d;
+    while (!(name=Next()).IsNull())
+    {
+        const TString p = Next.fCurrentPath->GetName();
+        if (p!=d)
+        {
+            d=p;
+            PrintEntry(*Next.fCurrentPath);
+        }
+        cout << " " << name << endl;
+    }
+}
Index: /trunk/MagicSoft/Mars/mbase/MDirIter.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MDirIter.h	(revision 2178)
+++ /trunk/MagicSoft/Mars/mbase/MDirIter.h	(revision 2178)
@@ -0,0 +1,67 @@
+#ifndef MARS_MDirIter
+#define MARS_MDirIter
+
+#ifndef ROOT_TObjArray
+#include <TObjArray.h>
+#endif
+
+class MDirIter : public TObject
+{
+private:
+    TObjArray fList;
+    TString   fFilter;
+
+    TIter     fNext;        //!
+    void     *fDirPtr;      //!
+    TObject  *fCurrentPath; //!
+
+    void   *Open();
+    void    Close();
+    Bool_t  Check(const TString n) const;
+    Int_t   IsDir(const char *dir) const;
+    Bool_t  MatchFilter(const TString &n, const TString &n) const;
+    TString ConcatFileName(const char *dir, const char *name) const;
+    void    PrintEntry(const TObject &o) const;
+
+public:
+    MDirIter() : fNext(&fList), fDirPtr(NULL)
+    {
+        fList.SetOwner();
+    }
+    MDirIter(MDirIter &dir) : fNext(&fList), fDirPtr(NULL)
+    {
+        fList.SetOwner();
+
+        TObject *o=NULL;
+        TIter Next(&dir.fList);
+        while ((o=Next()))
+            AddDirectory(o->GetName(), o->GetTitle());
+    }
+    MDirIter(const char *dir, const char *filter="") : fNext(&fList), fDirPtr(NULL)
+    {
+        fList.SetOwner();
+        AddDirectory(dir, filter);
+    }
+    ~MDirIter()
+    {
+        Close();
+    }
+
+    Int_t AddDirectory(const char *dir, const char *filter="", Int_t recursive=0);
+    void  Reset()
+    {
+        Close();
+        fNext.Reset();
+    }
+
+    TString Next(Bool_t nocheck=kFALSE);
+    TString operator()(Bool_t nocheck=kFALSE) { return Next(nocheck); }
+
+    void SetFilter(const char *f="") { fFilter = f; }
+
+    void Print(const Option_t *o="");
+
+    ClassDef(MDirIter, 1) // Iterator for files in several directories (with filters)
+};
+
+#endif
Index: /trunk/MagicSoft/Mars/mbase/MParList.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 2177)
+++ /trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 2178)
@@ -472,5 +472,7 @@
     if (!pcont)
     {
-        *fLog << err << dbginf << "Cannot create new instance of class '" << cname << "' (Maybe no def. constructor)" << endl;
+        *fLog << err << dbginf << "Cannot create new instance of class '" << cname << "' Possible reasons:" << endl;
+        *fLog << " - Class has no default constructor." << endl;
+        *fLog << " - An abstract member functions of a base class is not overwritten." << endl;
         return NULL;
     }
Index: /trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc	(revision 2177)
+++ /trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc	(revision 2178)
@@ -26,4 +26,12 @@
 //
 // MTaskInteractive
+//
+// If you want to create a new task inside a macro you will have to compile
+// your macro using macro.C++, because the root interpreter cannot use
+// uncompiled classes. To workaround this problem you can write simple
+// funcions (which can be handled by CINT) and use MTaskInteractive.
+//
+// This is a simple way to develop new code in a macro without need
+// to compile it.
 //
 //  Input Containers:
@@ -77,5 +85,7 @@
 
     Long_t result;
-    fCall[no]->Execute(params, result);
+    fCall[no]->SetParamPtrs(params);
+    fCall[no]->Execute(result);
+
     return result;
 }
Index: /trunk/MagicSoft/Mars/mbase/MTaskList.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 2177)
+++ /trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 2178)
@@ -60,4 +60,5 @@
 
 #include <TClass.h>
+#include <TSystem.h>        // gSystem
 #include <TOrdCollection.h>
 
@@ -365,4 +366,7 @@
 
         case kTRUE:
+            // Handle GUI events (display changes, mouse clicks)
+            if (fDisplay)
+                gSystem->ProcessEvents();
             continue;
 
@@ -461,4 +465,5 @@
             //
             rc = kFALSE;
+            *fLog << inf << task->GetDescriptor() << " has stopped execution of " << GetDescriptor() << "." << endl;
             break;
 
@@ -531,4 +536,8 @@
         if (!task->CallPostProcess())
             return kFALSE;
+
+        // Handle GUI events (display changes, mouse clicks)
+        if (fDisplay)
+            gSystem->ProcessEvents();
     }
 
Index: /trunk/MagicSoft/Mars/mbase/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mbase/Makefile	(revision 2177)
+++ /trunk/MagicSoft/Mars/mbase/Makefile	(revision 2178)
@@ -43,4 +43,5 @@
            MEvtLoop.cc \
            MIter.cc \
+           MDirIter.cc \
            MGList.cc \
            MGTask.cc \
Index: /trunk/MagicSoft/Mars/merpp.cc
===================================================================
--- /trunk/MagicSoft/Mars/merpp.cc	(revision 2177)
+++ /trunk/MagicSoft/Mars/merpp.cc	(revision 2178)
@@ -53,5 +53,5 @@
         gLog << "     input file:   Magic DAQ binary file." << endl;
         gLog << "     ouput file:   Merpped root file." << endl;
-        gLog << "     compr. level: 1..9 [default=9]" << endl << endl;
+        gLog << "     compr. level: 1..9 [default=1]" << endl << endl;
         return -1;
     }
@@ -67,5 +67,5 @@
     const char *kNamein   = argv[1];
     const char *kNameout  = argv[2];
-    const int   kComprlvl = argc==4 ? atoi(argv[3]) : 9;
+    const int   kComprlvl = argc==4 ? atoi(argv[3]) : 1;
 
     //
Index: /trunk/MagicSoft/Mars/meventdisp/MGCamDisplay.cc
===================================================================
--- /trunk/MagicSoft/Mars/meventdisp/MGCamDisplay.cc	(revision 2177)
+++ /trunk/MagicSoft/Mars/meventdisp/MGCamDisplay.cc	(revision 2178)
@@ -46,4 +46,5 @@
 #include "MImgCleanStd.h"        // MImgCleanStd
 #include "MGeomCamMagic.h"       // MGeomMagicCam
+#include "MRawEvtData.h"         // MRawEvtData
 
 ClassImp(MGCamDisplay);
@@ -137,7 +138,9 @@
     MGeomCamMagic *geom   = new MGeomCamMagic;
     MPedestalCam  *pedest = new MPedestalCam;
+    MRawEvtData   *event  = new MRawEvtData;
 
     plist->AddToList(geom);
     plist->AddToList(pedest);
+    plist->AddToList(event);
 
     return geom;
@@ -176,4 +179,5 @@
         fDisplay[i]  = new MCamDisplay(geom);
         fDisplay[i]->Draw();
+        fDisplay[i]->AddNotify(*(MCamEvent*)GetParList()->FindObject("MRawEvtData"));
         fCanvas2[i]->Update();
         fList->Add(fDisplay[i]);
@@ -245,9 +249,9 @@
     const MPedestalCam *ped   = (MPedestalCam*)plist->FindObject("MPedestalCam");
 
-    fDisplay[0]->FillPhotNum(*evt);
-    fDisplay[1]->FillErrorPhot(*evt);
-    fDisplay[2]->FillRatio(*evt);
+    fDisplay[0]->Fill((MCamEvent&)*evt, 0);
+    fDisplay[1]->Fill((MCamEvent&)*evt, 1);
+    fDisplay[2]->Fill((MCamEvent&)*evt, 2);
     fDisplay[3]->FillLevels(*evt, *clean);
-    fDisplay[4]->FillPedestals(*ped);
+    fDisplay[4]->Fill((MCamEvent&)*ped);
 
     for (int i=0; i<5; i++)
Index: /trunk/MagicSoft/Mars/mfileio/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mfileio/Makefile	(revision 2177)
+++ /trunk/MagicSoft/Mars/mfileio/Makefile	(revision 2178)
@@ -21,5 +21,5 @@
 
 INCLUDES = -I. -I../mbase -I../mraw -I../mmc -I../mdata -I../manalysis \
-	   -I../mgeom -I../mhist -I../mmain -I../mreflector
+	   -I../mgeom -I../mhist -I../mmain -I../mreflector -I../mgui
 
 # @code 
Index: /trunk/MagicSoft/Mars/mgeom/MGeomPix.cc
===================================================================
--- /trunk/MagicSoft/Mars/mgeom/MGeomPix.cc	(revision 2177)
+++ /trunk/MagicSoft/Mars/mgeom/MGeomPix.cc	(revision 2178)
@@ -16,8 +16,8 @@
 !
 !
-!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
 !   Author(s): Harald Kornmayer 1/2001
 !
-!   Copyright: MAGIC Software Development, 2000-2002
+!   Copyright: MAGIC Software Development, 2000-2003
 !
 !
@@ -35,6 +35,8 @@
 // MGeomPix.
 //
+// FIXME: According to an agreement we have to change the name 'Id'
+//        to 'idx'
+//
 ////////////////////////////////////////////////////////////////////////////
-
 #include "MGeomPix.h"
 
Index: /trunk/MagicSoft/Mars/mgui/GuiLinkDef.h
===================================================================
--- /trunk/MagicSoft/Mars/mgui/GuiLinkDef.h	(revision 2177)
+++ /trunk/MagicSoft/Mars/mgui/GuiLinkDef.h	(revision 2178)
@@ -6,4 +6,5 @@
 
 #pragma link C++ class MHexagon+;
+#pragma link C++ class MCamEvent+;
 #pragma link C++ class MCamDisplay+;
 
Index: /trunk/MagicSoft/Mars/mgui/MCamDisplay.cc
===================================================================
--- /trunk/MagicSoft/Mars/mgui/MCamDisplay.cc	(revision 2177)
+++ /trunk/MagicSoft/Mars/mgui/MCamDisplay.cc	(revision 2178)
@@ -63,4 +63,5 @@
 
 #include "MCurrents.h"
+#include "MCamEvent.h"
 
 #include "MImgCleanStd.h"
@@ -91,4 +92,6 @@
     fMinimum = 0;
     fMaximum = 1;
+
+    fNotify = new TList;
 }
 
@@ -101,4 +104,6 @@
 {
     fGeomCam = (MGeomCam*)geom->Clone(); 
+
+    fNotify = new TList;
 
     //
@@ -211,4 +216,6 @@
 
     delete fGeomCam;
+
+    delete fNotify;
 }
 
@@ -228,5 +235,11 @@
     pad->SetBorderMode(0);
     pad->SetFillColor(16);
-
+    //pad->Modified();
+    /*
+    pad->Divide(1,1);
+    pad->cd(1);
+    gPad->SetBorderMode(0);
+    gPad->SetFillColor(16);
+*/
     AppendPad("");
 }
@@ -240,13 +253,31 @@
     const float ratio = 1.15;
 
-    const float w = gPad->GetWw();
-    const float h = gPad->GetWh()*ratio;
-
+    //
+    // Calculate width and height of the current pad in pixels
+    //
+    Float_t w = gPad->GetWw();
+    Float_t h = gPad->GetWh()*ratio;
+
+    //
+    // This prevents the pad from resizing itself wrongly
+    //
+    if (gPad->GetMother() != gPad)
+    {
+        w *= gPad->GetMother()->GetAbsWNDC();
+        h *= gPad->GetMother()->GetAbsHNDC();
+    }
+
+    //
+    // Set Range (coordinate system) of pad
+    //
     gPad->Range(-fRange, -fRange, (2*ratio-1)*fRange, fRange);
 
+    //
+    // Resize Pad to given ratio
+    //
     if (h<w)
-        gPad->SetPad((1.-h/w)/2, 0, (h/w+1)/2, 0.9999999);
+        gPad->SetPad((1.-h/w)/2, 0, (h/w+1.)/2, 1);
     else
-        gPad->SetPad(0, (1.-w/h)/2, 1, (w/h+1)/2);
+        gPad->SetPad(0, (1.-w/h)/2, 1, (w/h+1.)/2);
 }
 
@@ -271,4 +302,6 @@
     }
 
+    if (fMinimum==FLT_MAX && fMaximum==-FLT_MAX)
+        fMinimum = fMaximum = 0;
     if (fMinimum==fMaximum)
         fMaximum = fMinimum + 1;
@@ -282,5 +315,4 @@
         else
             (*this)[i].SetFillColor(10);
-
     }
 }
@@ -314,6 +346,6 @@
 
     // Paint primitives (pixels, color legend, photons, ...)
-    { fPixels->ForEach(TObject, Paint)(); }
-    { fLegend->ForEach(TObject, Paint)(); }
+    { fPixels->ForEach( TObject, Paint)(); }
+    { fLegend->ForEach( TObject, Paint)(); }
     { fLegText->ForEach(TObject, Paint)(); }
     { fPhotons->ForEach(TObject, Paint)(); }
@@ -445,113 +477,32 @@
 // ------------------------------------------------------------------------
 //
-// Call this function to fill the number of photo electron into the
-// camera.
-//
-void MCamDisplay::FillPhotNum(const MCerPhotEvt &event)
+// Call this function to fill the currents
+//
+void MCamDisplay::Fill(const MCamEvent &event, Int_t type)
 {
     Reset();
 
-    const Int_t entries = event.GetNumPixels();
-
-    for (Int_t i=0; i<entries; i++)
-    {
-        const MCerPhotPix &pix = event[i];
-        if (!pix.IsPixelUsed())
-            continue;
-
-        const Int_t id = pix.GetPixId();
-
-        fData[id] = pix.GetNumPhotons()*fGeomCam->GetPixRatio(id);
-        (*this)[id].SetBit(kIsUsed);
-    }
-}
-
-// ------------------------------------------------------------------------
-//
-// Call this function to fill the number of photo electron into the
-// camera.
-//
-void MCamDisplay::FillPedestals(const MPedestalCam &event)
+    // FIXME: Security check missing!
+    for (UInt_t idx=0; idx<fNumPixels; idx++)
+    {
+        fData[idx] = 0;
+        if (event.GetPixelContent(fData[idx], idx, fGeomCam->GetPixRatio(idx), type))
+            (*this)[idx].SetBit(kIsUsed);
+    }
+}
+
+// ------------------------------------------------------------------------
+//
+// Call this function to fill the currents
+//
+void MCamDisplay::Fill(const TArrayF &event, Bool_t ispos)
 {
     Reset();
 
-    const Int_t entries = event.GetSize();
-    for (Int_t i=0; i<entries; i++)
-    {
-        fData[i] = event[i].GetMean()*fGeomCam->GetPixRatio(i);
-        (*this)[i].SetBit(kIsUsed);
-    }
-}
-
-// ------------------------------------------------------------------------
-//
-// Call this function to fill the error of number of photo electron
-// into the camera.
-//
-void MCamDisplay::FillErrorPhot(const MCerPhotEvt &event)
-{
-    Reset();
-
-    const Int_t entries = event.GetNumPixels();
-
-    for (Int_t i=0; i<entries; i++)
-    {
-        const MCerPhotPix &pix = event[i];
-        if (!pix.IsPixelUsed())
-            continue;
-
-        const Int_t id = pix.GetPixId();
-
-        fData[id] = pix.GetErrorPhot()*sqrt(fGeomCam->GetPixRatio(id));
-        (*this)[id].SetBit(kIsUsed);
-    }
-}
-
-// ------------------------------------------------------------------------
-//
-// Call this function to fill the ratio of the number of photons
-// divided by its error
-//
-void MCamDisplay::FillRatio(const MCerPhotEvt &event)
-{
-    Reset();
-
-    const Int_t entries = event.GetNumPixels();
-
-    for (Int_t i=0; i<entries; i++)
-    {
-        const MCerPhotPix &pix = event[i];
-
-        if (!pix.IsPixelUsed())
-            continue;
-
-        const Int_t id = pix.GetPixId();
-
-        const Float_t  entry = pix.GetNumPhotons();
-        const Float_t  noise = pix.GetErrorPhot();
-        const Double_t ratio = TMath::Sqrt(fGeomCam->GetPixRatio(id));
-
-        fData[id] = entry*ratio/noise;
-        (*this)[id].SetBit(kIsUsed);
-    }
-}
-
-// ------------------------------------------------------------------------
-//
-// Call this function to fill the currents
-//
-void MCamDisplay::FillCurrents(const MCurrents &event)
-{
-    Reset();
-
-    // FIXME: Security check missing!
-    for (UInt_t i=0; i<fNumPixels; i++)
-    {
-        if (event[i]<=0)
-            continue;
-
-        (*this)[i].SetBit(kIsUsed);
-        fData[i] = event[i];
-    }
+    fData = event;
+
+    for (UInt_t idx=0; idx<fNumPixels; idx++)
+        if (!ispos || fData[idx]>0)
+            (*this)[idx].SetBit(kIsUsed);
 }
 
@@ -562,5 +513,5 @@
 void MCamDisplay::FillLevels(const MCerPhotEvt &event, Float_t lvl1, Float_t lvl2)
 {
-    FillRatio(event);
+    Fill(event, 2);
 
     for (UInt_t i=0; i<fNumPixels; i++)
@@ -793,4 +744,17 @@
 }
 
+Int_t MCamDisplay::GetPixelIndex(Int_t px, Int_t py) const
+{
+    UInt_t i;
+    for (i=0; i<fNumPixels; i++)
+    {
+        if ((*fPixels)[i]->DistancetoPrimitive(px, py)>0)
+            continue;
+
+        return i;
+    }
+    return -1;
+}
+
 // ------------------------------------------------------------------------
 //
@@ -800,15 +764,37 @@
 char *MCamDisplay::GetObjectInfo(Int_t px, Int_t py) const
 {
-    static char info[64];
-
-    UInt_t i;
-    for (i=0; i<fNumPixels; i++)
-    {
-        if ((*fPixels)[i]->DistancetoPrimitive(px, py)>0)
-            continue;
-
-        sprintf(info, "Pixel Id: %d", i);
-        return info;
-    }
-    return TObject::GetObjectInfo(px, py);
-}
+    static char info[128];
+
+    const Int_t idx=GetPixelIndex(px, py);
+
+    if (idx<0)
+        return TObject::GetObjectInfo(px, py);
+
+    sprintf(info, "Software Pixel Index: %d (Hardware Id=%d)", idx, idx+1);
+    return info;
+}
+
+// ------------------------------------------------------------------------
+//
+// Execute a mouse event on the camera
+//
+void MCamDisplay::ExecuteEvent(Int_t event, Int_t px, Int_t py)
+{
+    //if (event==kMouseMotion && fStatusBar)
+    //    fStatusBar->SetText(GetObjectInfo(px, py), 0);
+    if (event!=kButton1Down)
+        return;
+
+    const Int_t idx = GetPixelIndex(px, py);
+    if (idx<0)
+        return;
+
+    cout << "Software Pixel Index: " << idx << endl;
+    cout << "Hardware Pixel Id:    " << idx+1 << endl;
+    cout << "Contents:             " << fData[idx] << endl;
+
+    //fNotify->Print();
+    if (fNotify->GetSize()>0)
+        new TCanvas;
+    fNotify->ForEach(MCamEvent, DrawPixelContent)(idx);
+}
Index: /trunk/MagicSoft/Mars/mgui/MCamDisplay.h
===================================================================
--- /trunk/MagicSoft/Mars/mgui/MCamDisplay.h	(revision 2177)
+++ /trunk/MagicSoft/Mars/mgui/MCamDisplay.h	(revision 2178)
@@ -22,9 +22,11 @@
 class TText;
 class TArrow;
+class TGStatusBar;
 
 class MGeomCam;
 class MHexagon;
+class MCurrents;
+class MCamEvent;
 class MRflEvtData;
-class MCurrents;
 class MCerPhotEvt;
 class MCerPhotPix;
@@ -60,4 +62,8 @@
     Float_t        fMaximum;
 
+    TList         *fNotify;
+
+    //TGStatusBar   *fStatusBar;
+
     TBox  *GetBox(Int_t i)  { return (TBox*) fLegend->At(i); }
 
@@ -71,4 +77,6 @@
     void  SetPalette();
 
+    Int_t GetPixelIndex(Int_t px, Int_t py) const;
+
     enum {
         kIsUsed = BIT(14)
@@ -81,13 +89,11 @@
 
     void  SetAutoScale(Bool_t input=kTRUE); // *MENU*
-    void  FillPhotNum(const MCerPhotEvt &event);
-    void  FillRatio(const MCerPhotEvt &event);
+
+    void  ShowRflEvent(const MRflEvtData *event=NULL, EMarkerStyle m=kFullDotMedium);
+    void  FillRflEvent(const MRflEvtData &event);
     void  FillLevels(const MCerPhotEvt &event, Float_t lvl1, Float_t lvl2);
-    void  FillErrorPhot(const MCerPhotEvt &event);
     void  FillLevels(const MCerPhotEvt &event, const MImgCleanStd &clean);
-    void  FillPedestals(const MPedestalCam &event);
-    void  FillRflEvent(const MRflEvtData &event);
-    void  FillCurrents(const MCurrents &event);
-    void  ShowRflEvent(const MRflEvtData *event=NULL, EMarkerStyle m=kFullDotMedium);
+    void  Fill(const MCamEvent &event, Int_t type=0);
+    void  Fill(const TArrayF &event, Bool_t ispos=kTRUE);
 
     void  DrawPixelNumbers();
@@ -99,5 +105,5 @@
     Int_t DistancetoPrimitive(Int_t px, Int_t py);
     char *GetObjectInfo(Int_t px, Int_t py) const;
-    //virtual void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
+    void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
 
     void  SetPalette(Int_t ncolors, Int_t *colors);
@@ -111,4 +117,8 @@
     void  SetMinimum(Float_t m); // *MENU*
     void  SetMaximum(Float_t m); // *MENU*
+
+    void  AddNotify(const MCamEvent &event) { fNotify->Add((TObject*)(&event)); }
+
+    //void SetStatusBar(TGStatusBar *bar) { fStatusBar = bar; }
 
     ClassDef(MCamDisplay, 0) // Displays the magic camera
Index: /trunk/MagicSoft/Mars/mgui/MCamEvent.cc
===================================================================
--- /trunk/MagicSoft/Mars/mgui/MCamEvent.cc	(revision 2178)
+++ /trunk/MagicSoft/Mars/mgui/MCamEvent.cc	(revision 2178)
@@ -0,0 +1,32 @@
+/* ======================================================================== *\
+!
+! *
+! * 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, 6/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+// MCamEvent                                                                //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+#include "MCamEvent.h"
+
+ClassImp(MCamEvent);
Index: /trunk/MagicSoft/Mars/mgui/MCamEvent.h
===================================================================
--- /trunk/MagicSoft/Mars/mgui/MCamEvent.h	(revision 2178)
+++ /trunk/MagicSoft/Mars/mgui/MCamEvent.h	(revision 2178)
@@ -0,0 +1,27 @@
+#ifndef MARS_MCamEvent
+#define MARS_MCamEvent
+
+//////////////////////////////////////////////////////////////
+//
+//   MCamEvent
+//
+//   A Hexagon for the MAGIC event display
+//
+//////////////////////////////////////////////////////////////
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+class MGeomCam;
+
+class MCamEvent : public MParContainer
+{
+public:
+    virtual Bool_t GetPixelContent(Float_t &val, Int_t idx, Float_t ratio=1, Int_t type=0) const = 0;
+    virtual void   DrawPixelContent(Int_t num) const = 0;
+
+    ClassDef(MCamEvent, 0)    // A hexagon for MAGIC
+};
+
+#endif
+
Index: /trunk/MagicSoft/Mars/mgui/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mgui/Makefile	(revision 2177)
+++ /trunk/MagicSoft/Mars/mgui/Makefile	(revision 2178)
@@ -23,5 +23,5 @@
 #
 INCLUDES = -I. -I../mbase -I../mgeom -I../manalysis -I../mimage -I../mhist \
-	   -I../mreflector
+	   -I../mreflector -I../mraw
 
 #------------------------------------------------------------------------------
@@ -30,5 +30,6 @@
 
 SRCFILES = MHexagon.cc \
-           MCamDisplay.cc 
+	   MCamEvent.cc \
+           MCamDisplay.cc
 
 SRCS    = $(SRCFILES)
Index: /trunk/MagicSoft/Mars/mhist/MFillH.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 2177)
+++ /trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 2178)
@@ -501,8 +501,9 @@
 
     //
-    // Check whether fDisplay has previously been used (fCanvas)
-    // and fDisplay is still open.
-    //
-    if (fCanvas && fDisplay)
+    // Check whether fDisplay has previously been used (fCanvas),
+    // fDisplay is still open and the corresponding Canvas/Tab is
+    // still existing.
+    //
+    if (fDisplay && fDisplay->HasCanvas(fCanvas))
     {
         fCanvas->cd();
Index: /trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.cc	(revision 2177)
+++ /trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.cc	(revision 2178)
@@ -127,12 +127,12 @@
     const UInt_t n = evt->GetNumPixels();
 
-    for (UInt_t i=0; i<n; i++)
+    for (UInt_t idx=0; idx<n; idx++)
     {
-        const MCerPhotPix &pix = (*evt)[i];
+        Float_t val;
+        if (!evt->GetPixelContent(val, idx))
+            continue;
 
-        const Int_t id = pix.GetPixId();
-
-        fSum[id].SetPixelUsed();
-        fSum[id].AddNumPhotons(pix.GetNumPhotons());
+        fSum[idx].SetPixelUsed();
+        fSum[idx].AddNumPhotons(val);
     }
 
@@ -148,5 +148,8 @@
 Bool_t MHCerPhotEvt::Finalize()
 {
-    fSum.Scale(fEntries);
+    if (fEntries<1)
+        *fLog << warn << "WARNING - " << GetDescriptor() << " doesn't contain entries." << endl;
+    else
+        fSum.Scale(fEntries);
     return kTRUE;
 }
@@ -185,5 +188,5 @@
         fDispl = new MCamDisplay(fCam);
 
-    fDispl->FillPhotNum(fSum);
+    fDispl->Fill(fSum);
     fDispl->Paint();
 }
Index: /trunk/MagicSoft/Mars/mhist/MHCurrents.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHCurrents.cc	(revision 2177)
+++ /trunk/MagicSoft/Mars/mhist/MHCurrents.cc	(revision 2178)
@@ -36,4 +36,5 @@
 
 #include "MParList.h"
+#include "MBinning.h"
 #include "MCurrents.h"
 #include "MCamDisplay.h"
@@ -54,5 +55,8 @@
     // FIXME: Implement a clear function with setmem
     for (int i=0; i<577; i++)
+    {
         fSum[i] = 0;
+        fRms[i] = 0;
+    }
 
     fEntries = 0;
@@ -65,5 +69,5 @@
 //
 MHCurrents::MHCurrents(const char *name, const char *title)
-    : fSum(577), fCam(NULL), fEvt(NULL), fDispl(NULL)
+    : fSum(577), fRms(577), fCam(NULL), fEvt(NULL), fDispl(NULL)
 {
     //
@@ -74,4 +78,9 @@
 
     Clear();
+
+    fHist.SetName("currents");
+    fHist.SetTitle("Avg.Currents [nA]");
+    fHist.SetDirectory(NULL);
+    fHist.Sumw2();
 }
 
@@ -105,4 +114,8 @@
     Clear();
 
+    MBinning bins;
+    bins.SetEdges(577, -0.5, 576.5);
+    bins.Apply(fHist);
+
     return kTRUE;
 }
@@ -121,9 +134,45 @@
     }
 
+    for (UInt_t idx=0; idx<577; idx++)
+    {
+        Float_t val;
+        if (!evt->GetPixelContent(val, idx))
+            continue;
+
+        fSum[idx] += val;
+        fRms[idx] += val*val;
+    }
+
+    fEntries++;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Scale the sum container with the number of entries
+//
+Bool_t MHCurrents::Finalize()
+{
+    if (fEntries<2)
+    {
+        *fLog << warn << "WARNING - " << GetDescriptor() << " doesn't contain enough entries." << endl;
+        return kTRUE;
+    }
+
     for (UInt_t i=0; i<577; i++)
-        fSum[i] += (*evt)[i];
-
-    fEntries++;
-
+    {
+        // calc sdev^2 for pixel index i
+        // var^2 = (sum[xi^2] - sum[xi]^2/n) / (n-1);
+        fRms[i] -= fSum[i]*fSum[i]/fEntries;
+        fRms[i] /= fEntries-1;
+        fRms[i]  = TMath::Sqrt(fRms[i]);
+
+        // calc mean value for pixel index i
+        fSum[i] /= fEntries;
+
+        fHist.SetBinContent(i+1, fSum[i]);
+        fHist.SetBinError(  i+1, fRms[i]);
+    }
     return kTRUE;
 }
@@ -131,19 +180,7 @@
 // --------------------------------------------------------------------------
 //
-// Scale the sum container with the number of entries
-//
-Bool_t MHCurrents::Finalize()
-{
-    for (UInt_t i=0; i<577; i++)
-        fSum[i] /= fEntries;
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
 // Draw the present 'fill status'
 //
-void MHCurrents::Draw(Option_t *)
+void MHCurrents::Draw(Option_t *o)
 {
     if (!fCam)
@@ -156,4 +193,5 @@
     pad->SetBorderMode(0);
 
+    SetDrawOption(o);
     AppendPad("");
 }
@@ -174,5 +212,7 @@
         fDispl = new MCamDisplay(fCam);
 
-    fDispl->FillCurrents(fSum);
+    TString opt(GetDrawOption());
+
+    fDispl->Fill(opt.Contains("rms", TString::kIgnoreCase) ? fRms : fSum);
     fDispl->Paint();
 }
Index: /trunk/MagicSoft/Mars/mhist/MHCurrents.h
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHCurrents.h	(revision 2177)
+++ /trunk/MagicSoft/Mars/mhist/MHCurrents.h	(revision 2178)
@@ -6,9 +6,13 @@
 #endif
 
-#ifndef MARS_MCurrents
-#include "MCurrents.h"
+#ifndef ROOT_TH1
+#include <TH1.h>
 #endif
 
-class TH1D;
+#ifndef ROOT_TArrayF
+#include <TArrayF.h>
+#endif
+
+class MCurrents;
 class MGeomCam;
 class MCamDisplay;
@@ -17,9 +21,12 @@
 {
 private:
-    MCurrents    fSum;      // storing the sum
+    TArrayF      fSum;      // storing the sum
+    TArrayF      fRms;      // storing the rms
     Int_t        fEntries;  // number of entries in the histogram
     MGeomCam    *fCam;      // the present geometry
     MCurrents   *fEvt;      //! the current event
     MCamDisplay *fDispl;    //! the camera display
+
+    TH1F         fHist;
 
 public:
@@ -35,5 +42,8 @@
     TH1 *GetHistByName(const TString name) { return NULL; }
 
-    const MCurrents &GetSum() const { return fSum; }
+    const TArrayF &GetSum() const { return fSum; }
+    const TArrayF &GetRms() const { return fRms; }
+
+    const TH1F    &GetHist() const { return fHist; }
 
     void Draw(Option_t *opt="");
Index: /trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc	(revision 2177)
+++ /trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc	(revision 2178)
@@ -181,4 +181,6 @@
     filemenu->AddEntry("Save As status.&root", kFileSaveAsRoot);
     filemenu->AddSeparator();
+    filemenu->AddEntry("Re&set",               kFileReset);
+    filemenu->AddSeparator();
     filemenu->AddEntry("Print with &lpr",      kFilePrint);
     //filemenu->AddEntry("Set printer &name",    kFilePrinterName);
@@ -196,4 +198,6 @@
     tabmenu->AddEntry("Save As tab-i.&C",    kTabSaveAsC);
     tabmenu->AddEntry("Save As tab-i.&root", kTabSaveAsRoot);
+    tabmenu->AddSeparator();
+    tabmenu->AddEntry("Re&move",             kTabRemove);
     tabmenu->AddSeparator();
     tabmenu->AddEntry("Print with &lpr",     kFilePrint);
@@ -560,5 +564,5 @@
 // to the corresponding TCanvas. If it isn't found NULL is returned.
 //
-TCanvas *MStatusDisplay::GetCanvas(TGCompositeFrame *cf) const
+TRootEmbeddedCanvas *MStatusDisplay::GetEmbeddedCanvas(TGCompositeFrame *cf) const
 {
     TIter Next(cf->GetList());
@@ -567,7 +571,19 @@
     while ((f=(TGFrameElement*)Next()))
         if (f->fFrame->InheritsFrom(TRootEmbeddedCanvas::Class()))
-            return ((TRootEmbeddedCanvas*)f->fFrame)->GetCanvas();
+            return (TRootEmbeddedCanvas*)f->fFrame;
 
     return NULL;
+}
+
+// --------------------------------------------------------------------------
+//
+// Takes a TGCompositeFrame as argument. Searches for the first
+// TRootEmbeddedCanvas which is contained by it and returns a pointer
+// to the corresponding TCanvas. If it isn't found NULL is returned.
+//
+TCanvas *MStatusDisplay::GetCanvas(TGCompositeFrame *cf) const
+{
+    TRootEmbeddedCanvas *ec = GetEmbeddedCanvas(cf);
+    return ec ? ec->GetCanvas() : NULL;
 }
 
@@ -654,5 +670,5 @@
     c.SetBorderMode(0);
 
-    // If kNoContaxtMenu set set kNoCOntextMenu of the canvas
+    // If kNoContextMenu set set kNoContextMenu of the canvas
     if (TestBit(kNoContextMenu))
         c.SetBit(kNoContextMenu);
@@ -738,4 +754,57 @@
 
     return pages;
+}
+
+// --------------------------------------------------------------------------
+//
+// Remove tab no i if this tab contains a TRootEmbeddedCanvas
+//
+void MStatusDisplay::RemoveTab(int i)
+{
+    TGCompositeFrame *f = fTab->GetTabContainer(i);
+    if (!f)
+        return;
+
+    TRootEmbeddedCanvas *ec = GetEmbeddedCanvas(f);
+    if (!ec)
+        return;
+
+    TCanvas *c = ec->GetCanvas();
+    if (!c)
+        return;
+
+    const TString name(c->GetName());
+
+    f->RemoveFrame(ec);
+    delete fList->Remove(ec);
+
+    fTab->RemoveTab(i);
+
+    // layout and map new tab
+#if ROOT_VERSION_CODE < ROOT_VERSION(3,03,00)
+    MapSubwindows();
+    Layout();
+#else
+    Layout();
+    MapSubwindows();
+#endif
+
+    // display new tab in the main frame
+    gClient->ProcessEventsFor(fTab);
+
+    *fLog << inf << "Removed Tab #" << i << " '" << name << "'" << endl;
+}
+
+// --------------------------------------------------------------------------
+//
+// Use this to check whether the MStatusDisplay still contains the
+// TCanvas c. It could be removed meanwhile by menu usage.
+//
+Bool_t MStatusDisplay::HasCanvas(const TCanvas *c) const
+{
+    for (int i=1; i<fTab->GetNumberOfTabs(); i++)
+        if (c==GetCanvas(i))
+            return kTRUE;
+    return kFALSE;
 }
 
@@ -773,4 +842,8 @@
         return kTRUE;
 
+    case kFileReset:
+        for (int i=fTab->GetNumberOfTabs()-1; i>0; i--)
+            RemoveTab(i);
+        return kTRUE;
         /*
     case kFileSave:
@@ -828,4 +901,8 @@
     case kTabPrevious:
         fTab->SetTab(fTab->GetCurrent()-1);
+        return kTRUE;
+
+    case kTabRemove:
+        RemoveTab(fTab->GetCurrent());
         return kTRUE;
 
Index: /trunk/MagicSoft/Mars/mmain/MStatusDisplay.h
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MStatusDisplay.h	(revision 2177)
+++ /trunk/MagicSoft/Mars/mmain/MStatusDisplay.h	(revision 2178)
@@ -27,4 +27,5 @@
 class TGProgressBar;
 class TGHProgressBar;
+class TRootEmbeddedCanvas;
 
 class MStatusDisplay : public TGMainFrame
@@ -35,10 +36,10 @@
         kFileBrowser, kFileCanvas, kFileSave, kFileSaveAs, kFileSaveAsPS,
         kFileSaveAsRoot, kFileSaveAsGIF, kFileSaveAsC, kFilePrint,
-        kFilePrinterName, kFileExit,
+        kFilePrinterName, kFileExit, kFileReset,
         // kLoop
         kLoopNone, kLoopStop,
         // kTab
         kTabSave, kTabSaveAs, kTabSaveAsPS, kTabSaveAsRoot, kTabSaveAsGIF,
-        kTabSaveAsC, kTabPrint, kTabNext, kTabPrevious,
+        kTabSaveAsC, kTabPrint, kTabNext, kTabPrevious, kTabRemove,
         // kSize
         kSize640, kSize800, kSize960, kSize1024, kSize1280,
@@ -102,4 +103,9 @@
     void UpdatePSHeader(const TString &name) const;
 
+    void Reset();
+    void RemoveTab(int i);
+
+    TRootEmbeddedCanvas *GetEmbeddedCanvas(TGCompositeFrame *cf) const;
+
 public:
      MStatusDisplay(Long_t t=1000);
@@ -122,4 +128,5 @@
      TCanvas &AddTab(const char *name);
 
+     Bool_t   HasCanvas(const TCanvas *c) const;
      TCanvas *GetCanvas(int i) const;
      TCanvas *GetCanvas(const TString &name) const;
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtData.cc	(revision 2177)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtData.cc	(revision 2178)
@@ -16,7 +16,7 @@
 !
 !
-!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@uni-sw.gwdg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
 !
 !
@@ -45,4 +45,7 @@
 //  --------------------------
 //  see fHiGainFadcSaples
+//
+//
+//   Version 2: Derives from MCamEvent now
 //
 /////////////////////////////////////////////////////////////////////////////
@@ -232,23 +235,27 @@
     if (!pix.Jump(id))
     {
-        *fLog << warn << "Pixel Id #" << id << " doesn't exist!" << endl;
+        *fLog << warn << "Pixel Idx #" << id << " doesn't exist!" << endl;
         return;
     }
 
     const Byte_t *higains = pix.GetHiGainSamples();
-
-    const Int_t n = GetNumHiGainSamples();
-
-    TString name = "Pixel No.";
+    const Byte_t *logains = pix.GetLoGainSamples();
+
+    const Int_t nh = GetNumHiGainSamples();
+    const Int_t nl = GetNumLoGainSamples();
+
+    TString name = "Pixel Idx.";
     name += pix.GetPixelId();
 
+    Bool_t same = str.Contains("same", TString::kIgnoreCase);
+
     if (str.BeginsWith("GRAPH", TString::kIgnoreCase))
     {
-        *fLog << inf << "Drawing Graph: Pixel Id #" << pix.GetPixelId();
+        *fLog << inf << "Drawing Graph: Pixel Idx #" << pix.GetPixelId();
         *fLog << " of " << (int)GetNumPixels() << "Pixels" << endl;
 
         TGraph *graph = new TGraph;
 
-        for (int i=0; i<n; i++)
+        for (int i=0; i<nh; i++)
             graph->SetPoint(graph->GetN(), i, higains[i]);
 
@@ -257,5 +264,5 @@
 
         graph->SetBit(kCanDelete);
-        graph->Draw("AC*");
+        graph->Draw(same ? "C*" : "AC*");
 
         TH1F *hist = graph->GetHistogram();
@@ -269,16 +276,26 @@
     if (str.BeginsWith("HIST", TString::kIgnoreCase))
     {
-        *fLog << "Drawing Histogram of Pixel with Id " << pix.GetPixelId() << endl;
-
-        TH1F *hist = new TH1F(name, "Hi Gain Samples FADC", n, 0, n);
-        hist->SetXTitle("Time/FADC Slices");
-        hist->SetYTitle("Signal/FADC Units");
-
-        for (int i=0; i<n; i++)
-            hist->Fill(0.5+i, higains[i]);
-
-        hist->SetBit(kCanDelete);
-        hist->Draw();
-
+        // FIXME: Add Legend
+        *fLog << "Drawing Histogram of Pixel with Idx " << pix.GetPixelId() << endl;
+
+        TH1F *histh = new TH1F(name, "FADC Samples",      nh, -0.5, nh-.5);
+        histh->SetXTitle("Time [FADC Slices]");
+        histh->SetYTitle("Signal [FADC Units]");
+        histh->SetDirectory(NULL);
+        for (int i=0; i<nh; i++)
+            histh->Fill(i, higains[i]);
+        histh->SetBit(kCanDelete);
+        histh->Draw(same ? "same" : "");
+
+        if (nh>0)
+        {
+            TH1F *histl = new TH1F(name+";2", "FADC Samples", nl, -0.5, nl-.5);
+            histl->SetLineColor(kBlue);
+            histl->SetDirectory(NULL);
+            for (int i=0; i<nl; i++)
+                histl->Fill(i, logains[i]);
+            histl->SetBit(kCanDelete);
+            histl->Draw("same");
+        }
         return;
     }
@@ -447,2 +464,11 @@
 }
 
+Bool_t MRawEvtData::GetPixelContent(Float_t &val, Int_t idx, Float_t ratio, Int_t type) const
+{
+    MRawEvtPixelIter Next(const_cast<MRawEvtData*>(this));
+    if (!Next.Jump(idx))
+        return kFALSE;
+
+    val = Next.GetSumHiGainSamples();
+    return kTRUE;
+}
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtData.h
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtData.h	(revision 2177)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtData.h	(revision 2178)
@@ -2,6 +2,6 @@
 #define MARS_MRawEvtData
 
-#ifndef MARS_MParContainer
-#include "MParContainer.h"
+#ifndef MARS_MCamEvent
+#include "MCamEvent.h"
 #endif
 
@@ -16,5 +16,7 @@
 class MArrayB;
 
-class MRawEvtData : public MParContainer
+#include <iostream.h>
+
+class MRawEvtData : public MCamEvent
 {
     friend class MRawEvtPixelIter;
@@ -63,5 +65,13 @@
     void ReadEvt(istream &fin);
 
-    ClassDef(MRawEvtData, 1) //Container to store the raw Event Data
+    Bool_t GetPixelContent(Float_t &val, Int_t idx, Float_t ratio=1, Int_t type=0) const;
+    void   DrawPixelContent(Int_t num) const
+    {
+        TString s("HIST");
+        s += num;
+        const_cast<MRawEvtData*>(this)->Draw(s);
+    }
+
+    ClassDef(MRawEvtData, 2) //Container to store the raw Event Data
 };
 
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc	(revision 2177)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc	(revision 2178)
@@ -187,4 +187,20 @@
 }
 
+Float_t MRawEvtPixelIter::GetVarHiGainSamples() const
+{
+    Byte_t *ptr = fHiGainPos;
+    const Byte_t *end = ptr + fNumHiGainSamples;
+
+    ULong_t sum=0;
+    ULong_t sqsum=0;
+
+    do {
+        sum += *ptr;
+        sqsum += (*ptr)*(*ptr);
+    } while (++ptr != end);
+
+    return (sqsum-(Float_t)sum*sum/fNumHiGainSamples)/(fNumHiGainSamples-1);
+}
+
 // --------------------------------------------------------------------------
 //
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h	(revision 2177)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h	(revision 2178)
@@ -79,4 +79,5 @@
     ULong_t GetSumHiGainSamples() const;
     ULong_t GetSumSqrHiGainSamples() const;
+    Float_t GetVarHiGainSamples() const;
 
     Bool_t HasLoGain() const
Index: /trunk/MagicSoft/Mars/mraw/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mraw/Makefile	(revision 2177)
+++ /trunk/MagicSoft/Mars/mraw/Makefile	(revision 2178)
@@ -22,5 +22,5 @@
 #  connect the include files defined in the config.mk file
 #
-INCLUDES = -I. -I../mbase -I../MBase
+INCLUDES = -I. -I../mbase -I../MBase -I../mgui
 
 #------------------------------------------------------------------------------
