Index: /trunk/MagicSoft/Mars/macros/dohtml.C
===================================================================
--- /trunk/MagicSoft/Mars/macros/dohtml.C	(revision 2502)
+++ /trunk/MagicSoft/Mars/macros/dohtml.C	(revision 2503)
@@ -39,6 +39,4 @@
     sourcedir += "mbase:";
     sourcedir += "mdata:";
-    sourcedir += "mdatacheck:";
-    sourcedir += "meventdisp:";
     sourcedir += "mfileio:";
     sourcedir += "mfilter:";
Index: unk/MagicSoft/Mars/mmain/MGCamDisplay.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MGCamDisplay.cc	(revision 2502)
+++ 	(revision )
@@ -1,548 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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, 10/2001 <mailto:tbretz@astro.uni-wuerzburg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2003
-!
-!
-\* ======================================================================== */
-#include "MGCamDisplay.h"
-
-//
-// C-lib
-//
-#include <stdlib.h>              // atoi
-
-//
-// root
-//
-#include <TList.h>               // TList::Add
-#include <TStyle.h>              // gStyle->SetOptStat
-#include <TCanvas.h>             // TCanvas::cd
-
-//
-// root GUI
-//
-#include <TGLabel.h>             // TGLabel
-#include <TGButton.h>            // TGPictureButton
-#include <TG3DLine.h>            // TGHorizontal3DLine
-#include <TGTextEntry.h>         // TGTextEntry
-#include <TGButtonGroup.h>       // TGVButtonGroup
-#include <TRootEmbeddedCanvas.h> // TRootEmbeddedCanvas
-
-//
-// General
-//
-#include "MGList.h"              // MGList
-
-#include "MParList.h"            // MParList::AddToList
-#include "MEvtLoop.h"            // MEvtLoop::GetParList
-#include "MTaskList.h"           // MTaskList::AddToList
-
-//
-// Tasks
-//
-#include "MReadMarsFile.h"       // MReadMarsFile
-#include "MGeomApply.h"          // MGeomApply
-#include "MMcPedestalCopy.h"     // MMcPedestalCopy
-#include "MMcPedestalNSBAdd.h"   // MMcPedestalNSBAdd
-#include "MCerPhotCalc.h"        // MCerPhotCalc
-#include "MImgCleanStd.h"        // MImgCleanStd
-#include "MHillasCalc.h"         // MHillasCalc
-#include "MHillasSrcCalc.h"      // MHillasSrcCalc
-#include "MBlindPixelCalc.h"     // MBlindPixelCalc
-#include "MFillH.h"              // MFillH
-
-//
-// Container
-//
-#include "MHEvent.h"             // MHEvent
-#include "MHCamera.h"            // MHCamera
-
-ClassImp(MGCamDisplay);
-
-// --------------------------------------------------------------------------
-//
-//  Constructor.
-//
-MGCamDisplay::MGCamDisplay(const char *filename) : MStatusDisplay()
-{
-    //
-    // Setup Task list for hillas calculation
-    //
-    SetupTaskList("Events", filename);
-
-    //
-    // Add MGCamDisplay GUI elements to the display
-    //
-    AddUserFrame(filename);
-
-    //
-    // Show new part of the window, resize to correct aspect ratio
-    //
-    // FIXME: This should be done by MStatusDisplay automatically
-    Resize(GetWidth(), GetHeight() + fUserFrame->GetDefaultHeight());
-    SetWindowName("Event Display");
-    MapSubwindows();
-
-    //
-    // Readin foirst event and display it
-    //
-    ReadFirstEvent();
-}
-
-// --------------------------------------------------------------------------
-//
-//  Destructor: PostProcess eventloop, delete eventloop with all containers
-//
-MGCamDisplay::~MGCamDisplay()
-{
-    fEvtLoop->PostProcess();
-    delete fEvtLoop;
-}
-
-// --------------------------------------------------------------------------
-//
-//  Return reading task
-//
-MReadTree *MGCamDisplay::GetReader() const
-{
-    MParList  *plist  = (MParList*)fEvtLoop->GetParList();
-    MTaskList *tlist  = (MTaskList*)plist->FindObject("MTaskList");
-    MReadTree *reader = (MReadTree*)tlist->FindObject("MRead");
-    return reader;
-}
-
-// --------------------------------------------------------------------------
-//
-//  Setup Task and parameter list for hillas calculation,
-//  preprocess tasks and read in first event (process)
-//
-void MGCamDisplay::SetupTaskList(const char *tname, const char *fname)
-{
-    //
-    // Setup an empty job, with a reader task only.
-    // All tasks and parameter containers are deleted automatically
-    // (via SetOwner())
-    //
-    MTaskList *tlist = new MTaskList;
-    tlist->SetOwner();
-
-    MReadMarsFile *read = new MReadMarsFile(tname, fname);
-    read->DisableAutoScheme();
-    tlist->AddToList(read);
-
-    MGeomApply *apl = new MGeomApply;
-    tlist->AddToList(apl);
-
-    MParList *plist = new MParList;
-    plist->SetOwner();
-    plist->AddToList(tlist);
-
-    fEvtLoop = new MEvtLoop;
-    fEvtLoop->SetOwner();
-    fEvtLoop->SetParList(plist);
-
-    MHEvent *evt1 = new MHEvent(MHEvent::kEvtSignal);
-    MHEvent *evt2 = new MHEvent(MHEvent::kEvtSignal);
-    MHEvent *evt3 = new MHEvent(MHEvent::kEvtPedestal);
-    MHEvent *evt4 = new MHEvent(MHEvent::kEvtPedestalRMS);
-    MHEvent *evt5 = new MHEvent(MHEvent::kEvtRelativeSignal);
-    MHEvent *evt6 = new MHEvent(MHEvent::kEvtCleaningLevels);
-    evt1->SetName("Signal");
-    evt2->SetName("Cleaned");
-    evt3->SetName("Pedestal");
-    evt4->SetName("PedRMS");
-    evt5->SetName("Signal/PedRMS");
-    evt6->SetName("CleanLevels");
-    plist->AddToList(evt1);
-    plist->AddToList(evt2);
-    plist->AddToList(evt3);
-    plist->AddToList(evt4);
-    plist->AddToList(evt5);
-    plist->AddToList(evt6);
-
-    MMcPedestalCopy   *pcopy = new MMcPedestalCopy;
-    MMcPedestalNSBAdd *pdnsb = new MMcPedestalNSBAdd;
-    MCerPhotCalc      *ncalc = new MCerPhotCalc;
-    MFillH            *fill1 = new MFillH(evt1, "MCerPhotEvt",  "MFillH1");
-    MImgCleanStd      *clean = new MImgCleanStd;
-    MFillH            *fill2 = new MFillH(evt2, "MCerPhotEvt",  "MFillH2");
-    MFillH            *fill3 = new MFillH(evt3, "MPedestalCam", "MFillH3");
-    MFillH            *fill4 = new MFillH(evt4, "MPedestalCam", "MFillH4");
-    MFillH            *fill5 = new MFillH(evt5, "MRelSignal",   "MFillH5");
-    MFillH            *fill6 = new MFillH(evt6, "MRelSignal",   "MFillH6");
-    MBlindPixelCalc   *blind = new MBlindPixelCalc;
-    MHillasCalc       *hcalc = new MHillasCalc;
-    MHillasSrcCalc    *scalc = new MHillasSrcCalc;
-
-    tlist->AddToList(pcopy);
-    tlist->AddToList(pdnsb);
-    tlist->AddToList(ncalc);
-    tlist->AddToList(fill1);
-    tlist->AddToList(clean);
-    tlist->AddToList(fill2);
-    tlist->AddToList(fill3);
-    tlist->AddToList(fill4);
-//    tlist->AddToList(fill5);
-//    tlist->AddToList(fill6);
-    tlist->AddToList(blind);
-    tlist->AddToList(hcalc);
-    tlist->AddToList(scalc);
-
-    //
-    // Now distribute Display to all tasks
-    //
-    tlist->SetDisplay(this);
-}
-
-// --------------------------------------------------------------------------
-//
-//  Add the top part of the frame: This is filename and treename display
-//
-void MGCamDisplay::AddTopFramePart1(TGCompositeFrame *frame,
-                                    const char *filename,
-                                    const char *treename)
-{
-    //
-    //  --- the top1 part of the window ---
-    //
-    TGHorizontalFrame *top1 = new TGHorizontalFrame(frame, 1, 1);
-    fList->Add(top1);
-
-    //
-    // create gui elements
-    //
-    TGLabel *file = new TGLabel(top1, new TGString(Form("%s#%s", filename, treename)));
-    fList->Add(file);
-
-    //
-    // layout and add gui elements in/to frame
-    //
-    TGLayoutHints *laystd = new TGLayoutHints(kLHintsCenterX, 5, 5);
-    fList->Add(laystd);
-
-    top1->AddFrame(file,  laystd);
-
-    //
-    //  --- the top1 part of the window ---
-    //
-    TGHorizontalFrame *top2 = new TGHorizontalFrame(frame, 1, 1);
-    fList->Add(top2);
-
-    //
-    // layout and add frames
-    //
-    TGLayoutHints *laytop1 = new TGLayoutHints(kLHintsCenterX, 5, 5, 5);
-    fList->Add(laytop1);
-    frame->AddFrame(top1, laytop1);
-    frame->AddFrame(top2, laytop1);
-}
-
-// --------------------------------------------------------------------------
-//
-//  Add the second part of the top frame: This are the event number controls
-//
-void MGCamDisplay::AddTopFramePart2(TGCompositeFrame *frame)
-{
-    //
-    // --- the top2 part of the window ---
-    //
-    TGHorizontalFrame *top2 = new TGHorizontalFrame(frame, 1, 1);
-    fList->Add(top2);
-
-    //
-    // Create the gui elements
-    //
-    TGTextButton *prevevt = new TGTextButton(top2, "<< Previous Event", kEvtPrev);
-    prevevt->Associate(this);
-
-    TGLabel *evtnr = new TGLabel(top2, new TGString("Event: "));
-
-    TGTextEntry *entry=new TGTextEntry(top2, new TGTextBuffer(100), kEvtNumber);
-    entry->Resize(60, entry->GetDefaultHeight());
-    entry->Associate(this);
-
-    fNumOfEvts = new TGLabel(top2, "out of           Events.");
-
-    TGTextButton *nextevt = new TGTextButton (top2, "Next Event >>", kEvtNext);
-    nextevt->Associate(this);
-
-    //
-    // Add gui elements to 'atotodel'
-    //
-    fList->Add(prevevt);
-    fList->Add(evtnr);
-    fList->Add(entry);
-    fList->Add(fNumOfEvts);
-    fList->Add(nextevt);
-
-    //
-    // add the gui elements to the frame
-    //
-    TGLayoutHints *laystd = new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 5, 5);
-    fList->Add(laystd);
-
-    top2->AddFrame(prevevt,    laystd);
-    top2->AddFrame(evtnr,      laystd);
-    top2->AddFrame(entry,      laystd);
-    top2->AddFrame(fNumOfEvts, laystd);
-    top2->AddFrame(nextevt,    laystd);
-
-    TGLayoutHints *laystd2 = new TGLayoutHints(kLHintsCenterX, 5, 5, 5, 5);
-    fList->Add(laystd2);
-    frame->AddFrame(top2, laystd2);
-
-    //
-    // Add trailing line...
-    //
-    TGHorizontal3DLine *line = new TGHorizontal3DLine(frame);
-    TGLayoutHints *layline = new TGLayoutHints(kLHintsExpandX);
-    fList->Add(line);
-    fList->Add(layline);
-    frame->AddFrame(line, layline);
-}
-
-// --------------------------------------------------------------------------
-//
-//  Add the user frame part of the display
-//
-void MGCamDisplay::AddUserFrame(const char* filename)
-{
-    fUserFrame->ChangeOptions(kHorizontalFrame);
-
-    TGCompositeFrame *vf1 = new TGVerticalFrame(fUserFrame, 1, 1);
-    TGCompositeFrame *vf2 = new TGVerticalFrame(fUserFrame, 1, 1);
-
-    AddTopFramePart1(vf1, filename, "Events");
-    AddTopFramePart2(vf1);
-
-    // create root embedded canvas and add it to the tab
-    TRootEmbeddedCanvas *ec = new TRootEmbeddedCanvas("Slices", vf2, vf1->GetDefaultHeight()*3/2, vf1->GetDefaultHeight(), 0);
-    vf2->AddFrame(ec);
-    fList->Add(ec);
-
-    // set background and border mode of the canvas
-    fCanvas = ec->GetCanvas();
-    fCanvas->SetBorderMode(0);
-    gROOT->GetListOfCanvases()->Add(fCanvas);
-    //fCanvas->SetBorderSize(1);
-    //fCanvas->SetBit(kNoContextMenu);
-    //fCanvas->SetFillColor(16);
-
-    TGLayoutHints *lay = new TGLayoutHints(kLHintsExpandX);
-    fUserFrame->AddFrame(vf1, lay);
-    fUserFrame->AddFrame(vf2);
-}
-
-// --------------------------------------------------------------------------
-//
-//  Checks if the event number is valid, and if so reads the new event
-//  and updates the display
-//
-void MGCamDisplay::ReadinEvent(Int_t dir)
-{
-    MParList    *plist = (MParList*)fEvtLoop->GetParList();
-    MTaskList   *tlist = (MTaskList*)plist->FindObject("MTaskList");
-    MRawEvtData *raw = (MRawEvtData*)plist->FindObject("MRawEvtData");
-    if (!raw)
-        return;
-
-    //
-    // Read first event.
-    //
-    MReadTree *reader = GetReader();
-
-    const Int_t num = reader->GetNumEntry();
-
-    do
-    {
-        if (dir<0 && !reader->DecEventNum())
-        {
-            reader->SetEventNum(num);
-            return;
-        }
-        if (dir>0 && !reader->IncEventNum())
-        {
-            reader->SetEventNum(num);
-            return;
-        }
-
-        if (!tlist->Process())
-            return;
-
-        reader->DecEventNum();
-
-    } while (raw->GetNumPixels()<1 && dir!=0);
-
-    //
-    // Cleare the 'FADC canvas'
-    //
-    fCanvas->Clear();
-    fCanvas->Modified();
-    fCanvas->Update();
-
-    //
-    // Print parameters
-    //
-    plist->FindObject("MHillas")->Print();
-    plist->FindObject("MHillasExt")->Print();
-    plist->FindObject("MHillasSrc")->Print();
-    plist->FindObject("MNewImagePar")->Print();
-
-    //
-    // UpdateDisplay
-    //
-    gStyle->SetOptStat(1101);
-    Update();
-
-    TGTextEntry *entry = (TGTextEntry*)fList->FindWidget(kEvtNumber);
-    entry->SetText(Form("%d", reader->GetNumEntry()+1));
-}
-
-// --------------------------------------------------------------------------
-//
-//  Read first event to get display booted
-//
-void MGCamDisplay::ReadFirstEvent()
-{
-    if (!fEvtLoop->PreProcess())
-        return;
-
-    //
-    // Get parlist
-    //
-    MParList *plist = (MParList*)fEvtLoop->GetParList();
-
-    //
-    // Add Geometry tab
-    //
-    MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam");
-
-    TCanvas &c=AddTab("Geometry");
-
-    MHCamera *cam = new MHCamera(*geom);
-    cam->SetBit(TH1::kNoStats);
-    cam->Draw();
-    cam->DrawPixelIndices();
-    fList->Add(cam);
-
-    c.Modified();
-    c.Update();
-
-    //
-    // Now read event...
-    //
-    ReadinEvent();
-
-    TGString *txt = new TGString(Form("out of %d Events", GetReader()->GetEntries()));
-    fNumOfEvts->SetText(txt);
-
-    //
-    // Set name for 'FADC canvas'. The name is the anchor for MHCamera.
-    // and clear the canvas
-    //
-    MHEvent *o = (MHEvent*)plist->FindObject("Signal");
-    fCanvas->SetName(Form("%p;%p;PixelContent", o->GetHist(),
-                          GetCanvas(1)->GetPad(1)->GetPad(1)));
-
-    //
-    // Draw ellipse on top of all pads
-    //
-    TObject *hillas = plist->FindObject("MHillas");
-    for (int i=1; i<5;i++)
-    {
-        TCanvas *c = GetCanvas(i);
-        c->GetPad(1)->cd(1);
-        hillas->Draw();
-    }
-}
-
-// --------------------------------------------------------------------------
-//
-//  Adds the geometry tab 
-//
-void MGCamDisplay::AddGeometryTab()
-{
-    MGeomCam *geom = (MGeomCam*)fEvtLoop->GetParList()->FindObject("MGeomCam");
-    if (!geom)
-        return;
-
-    TCanvas &c=AddTab("Geometry");
-
-    MHCamera *cam = new MHCamera(*geom);
-    cam->SetBit(TH1::kNoStats);
-    cam->Draw();
-    cam->DrawPixelIndices();
-    fList->Add(cam);
-
-    c.Modified();
-    c.Update();
-}
-
-// --------------------------------------------------------------------------
-//
-//  ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
-//
-// Processes information from all GUI items.
-// Selecting an item usually generates an event with 4 parameters.
-// The first two are packed into msg (first and second bytes).
-// The other two are parm1 and parm2.
-//
-Bool_t MGCamDisplay::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
-{
-    switch (GET_MSG(msg))
-    {
-    case kC_TEXTENTRY:
-        switch(GET_SUBMSG(msg))
-        {
-        case kTE_ENTER:
-            switch(GET_SUBMSG(msg))
-            {
-            case kTE_ENTER:
-                {
-                    TGTextEntry *entry = (TGTextEntry*)fList->FindWidget(kEvtNumber);
-                    if (GetReader()->SetEventNum(atoi(entry->GetText())-1))
-                        ReadinEvent();
-                }
-                return kTRUE;
-            }
-            return kTRUE;
-        }
-        break;
-
-    case kC_COMMAND:
-        switch (GET_SUBMSG(msg))
-        {
-        case kCM_BUTTON:
-            switch (parm1)
-            {
-            case kEvtPrev:
-                ReadinEvent(-1);
-                return kTRUE;
-
-            case kEvtNext:
-                ReadinEvent(+1);
-                return kTRUE;
-            }
-            return kTRUE;
-        }
-        break;
-    }
-    return MStatusDisplay::ProcessMessage(msg, parm1, parm2);
-}
Index: unk/MagicSoft/Mars/mmain/MGCamDisplay.h
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MGCamDisplay.h	(revision 2502)
+++ 	(revision )
@@ -1,41 +1,0 @@
-#ifndef MARS_MGCamDisplay
-#define MARS_MGCamDisplay
-
-#ifndef MARS_MGEvtDisplay
-#include "MGEvtDisplay.h"
-#endif
-
-class TGListBox;
-
-class MGeomCam;
-class MHCamera;
-
-class MGCamDisplay : public MGEvtDisplay
-{
-private:
-    Bool_t fDisplayRaw;
-    Bool_t fDisplayHillas;
-
-    TGListBox   *fPixelList;
-
-    MHCamera *fDisplay[5];
-    TCanvas  *fCanvas2[5];
-
-    void AddSetupElements();
-    void UpdateDisplay();
-
-    void SetupTaskList();
-
-public:
-    MGCamDisplay(const char *filename,
-                 const TGWindow *p, /*const TGWindow *main,*/
-                 UInt_t w, UInt_t h);
-
-    Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
-
-    ClassDef(MGCamDisplay, 0) // Display for camera images (cerenkov events)
-};
-
-#endif
-
-
Index: /trunk/MagicSoft/Mars/mmain/MGDisplayAdc.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MGDisplayAdc.cc	(revision 2502)
+++ /trunk/MagicSoft/Mars/mmain/MGDisplayAdc.cc	(revision 2503)
@@ -16,8 +16,8 @@
 !
 !
-!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@uni-sw.gwdg.de>
-!   Author(s): Harald Kornmayer 1/2001
-!
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Harald Kornmayer, 1/2001
+!
+!   Copyright: MAGIC Software Development, 2000-2003
 !
 !
@@ -41,4 +41,6 @@
 
 using namespace std;
+
+ClassImp(MGDisplayAdc);
 
 enum ComIdentDisplayAdc
Index: /trunk/MagicSoft/Mars/mmain/MGDisplayAdc.h
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MGDisplayAdc.h	(revision 2502)
+++ /trunk/MagicSoft/Mars/mmain/MGDisplayAdc.h	(revision 2503)
@@ -49,4 +49,6 @@
 
     Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+
+    ClassDef(MGDisplayAdc, 0)
 };
 
Index: unk/MagicSoft/Mars/mmain/MGEvtDisplay.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MGEvtDisplay.cc	(revision 2502)
+++ 	(revision )
@@ -1,751 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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, 10/2001 <mailto:tbretz@astro.uni-wuerzburg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2003
-!
-!
-\* ======================================================================== */
-
-#include "MGEvtDisplay.h"
-
-#include <stdlib.h>               // atoi
-
-#include <TGTab.h>                // TGTab
-#include <TGMenu.h>               // TGPopupMenu
-#include <TCanvas.h>              // TCanvas::Print
-#include <TGLabel.h>              // TGLabel
-#include <TGButton.h>             // TGPictureButton
-#include <TGMsgBox.h>             // TGMsgBox
-#include <TGTextEntry.h>          // TGTextEntry
-#include <TGFileDialog.h>         // TGFileDialog
-#include <TRootEmbeddedCanvas.h>  // TRootEmbeddedCanvas
-
-#include <TG3DLine.h>             // TGHorizontal3DLine
-                                  // use TGSplitter instead for root<3.00
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-#include "MHCamera.h"
-#include "MParList.h"
-#include "MTaskList.h"
-#include "MEvtLoop.h"
-#include "MHCamera.h"
-#include "MGeomApply.h"
-#include "MRawEvtData.h"
-#include "MRawEvtHeader.h"
-#include "MReadMarsFile.h"
-
-#include "MMcEvt.hxx"
-
-ClassImp(MGEvtDisplay);
-
-enum MGCamDisplayCommand
-{
-    kEvtPrev,
-    kEvtNext,
-    kEvtNumber,
-
-    kFileSaveAs,
-    kFileSaveAsRoot,
-    kFileSaveAsC,
-    kFileSaveAsPS,
-    kFileSaveAsEPS,
-    kFileSaveAsGIF,
-    kFilePrint,
-    kClose
-}; 
-
-// --------------------------------------------------------------------------
-//
-//  Return a pointer to the parameter list.
-//
-MParList *MGEvtDisplay::GetParList() const
-{
-    return fEvtLoop->GetParList();
-}
-
-// --------------------------------------------------------------------------
-//
-//  Return a pointer to the task list.
-//
-MTaskList *MGEvtDisplay::GetTaskList() const
-{
-    return (MTaskList*)GetParList()->FindObject("MTaskList");
-}
-
-// --------------------------------------------------------------------------
-//
-//  Return a pointer to the reader task (MReadTree)
-//
-MReadTree *MGEvtDisplay::GetReader() const
-{
-    return (MReadTree*)GetTaskList()->FindObject("MRead");
-}
-
-// --------------------------------------------------------------------------
-//
-//  Add the top part of the frame: This is filename and treename display
-//
-void MGEvtDisplay::AddTopFramePart1(TGVerticalFrame *frame,
-                                    const char *filename,
-                                    const char *treename)
-{
-    //
-    //  --- the top1 part of the window ---
-    //
-    TGHorizontalFrame *top1 = new TGHorizontalFrame(frame, 300, 100);
-    fList->Add(top1);
-
-    //
-    // create gui elements
-    //
-    TGLabel *lfile = new TGLabel(top1, new TGString("File:"));
-    TGLabel *file  = new TGLabel(top1, new TGString(filename));
-    TGLabel *ltree = new TGLabel(top1, new TGString("Tree:"));
-    TGLabel *tree  = new TGLabel(top1, new TGString(treename));
-
-    fList->Add(lfile);
-    fList->Add(file);
-    fList->Add(ltree);
-    fList->Add(tree);
-
-    //
-    // layout and add gui elements in/to frame
-    //
-    TGLayoutHints *laystd = new TGLayoutHints(kLHintsLeft, 10, 10, 10, 10);
-    fList->Add(laystd);
-
-    top1->AddFrame(lfile, laystd);
-    top1->AddFrame(file,  laystd);
-    top1->AddFrame(ltree, laystd);
-    top1->AddFrame(tree,  laystd);
-
-    //
-    //  --- the top1 part of the window ---
-    //
-    TGHorizontalFrame *top2 = new TGHorizontalFrame(frame, 300, 100);
-    fList->Add(top2);
-
-    fEvtInfo = new TGLabel(top2, new TGString(""));
-    fList->Add(fEvtInfo);
-    top2->AddFrame(fEvtInfo, laystd);
-
-    //
-    // layout and add frames
-    //
-    TGLayoutHints *laytop1 = new TGLayoutHints(kLHintsTop);
-    fList->Add(laytop1);
-    frame->AddFrame(top1, laytop1);
-    frame->AddFrame(top2, laytop1);
-}
-
-// --------------------------------------------------------------------------
-//
-//  Add the second part of the top frame: This are the event number controls
-//
-void MGEvtDisplay::AddTopFramePart2(TGVerticalFrame *frame)
-{
-    //
-    // --- the top2 part of the window ---
-    //
-    TGHorizontalFrame *top2 = new TGHorizontalFrame(frame, 300, 100);
-    fList->Add(top2);
-
-    //
-    // Create the gui elements
-    //
-    TGTextButton *prevevt = new TGTextButton(top2, "<< Previous Event", kEvtPrev);
-    prevevt->Associate(this);
-
-    TGLabel *evtnr = new TGLabel(top2, new TGString("Event: "));
-
-    fTxtEvtNr = new TGTextEntry(top2, new TGTextBuffer(100), kEvtNumber);
-    fTxtEvtNr->Resize(60, fTxtEvtNr->GetDefaultHeight());
-    fTxtEvtNr->Associate(this);
-
-    fNumOfEvts = new TGLabel(top2, "out of           Events.");
-
-    TGTextButton *nextevt = new TGTextButton (top2, "Next Event >>", kEvtNext);
-    nextevt->Associate(this);
-
-    //
-    // Add gui elements to 'atotodel'
-    //
-    fList->Add(prevevt);
-    fList->Add(evtnr);
-    fList->Add(fTxtEvtNr);
-    fList->Add(fNumOfEvts);
-    fList->Add(nextevt);
-
-    //
-    // add the gui elements to the frame
-    //
-    TGLayoutHints *laystd    = new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 10, 10, 10, 10);
-
-    fList->Add(laystd);
-
-    top2->AddFrame(prevevt,    laystd);
-    top2->AddFrame(evtnr,      laystd);
-    top2->AddFrame(fTxtEvtNr,  laystd);
-    top2->AddFrame(fNumOfEvts, laystd);
-    top2->AddFrame(nextevt,    laystd);
-
-    frame->AddFrame(top2, new TGLayoutHints(kLHintsCenterX));
-}
-
-// --------------------------------------------------------------------------
-//
-//  Add a tab with an embedded canvas for an camera display and return the
-//  pointer to the canvas
-//
-TCanvas *MGEvtDisplay::AddTab(TString name)
-{
-    TGLayoutHints *laycanvas = new TGLayoutHints(kLHintsCenterX|kLHintsCenterY|kLHintsExpandX|kLHintsExpandY);
-    fList->Add(laycanvas);
-
-    // Add new tab
-    TGCompositeFrame *f = fEvtDisplay->AddTab(name);
-
-    // create root embedded canvas and add it to the tab
-    TRootEmbeddedCanvas *ec = new TRootEmbeddedCanvas(name+"Display", f, f->GetWidth(), f->GetHeight());
-    f->AddFrame(ec, laycanvas);
-    fList->Add(ec);
-
-    // set background and border mode of the canvas
-    TCanvas &c = *ec->GetCanvas();
-    c.SetBorderMode(0);
-
-    // 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(fEvtDisplay);
-
-    // return pointer to new canvas
-    return &c;
-}
-
-// --------------------------------------------------------------------------
-//
-//  Add the mid frame: This are the two tabs with the canvas in the right one
-//
-void MGEvtDisplay::AddMidFrame(TGHorizontalFrame *frame)
-{
-    //
-    // create tab control
-    //
-    TGTab *tabs = new TGTab(frame, 300, 300);
-
-    //
-    // Create Tab1
-    //
-    fTab1 = tabs->AddTab("Setup");
-
-    //
-    // Crete second gui elemet for tab1 (TGVertical Frame)
-    //
-    TGLayoutHints *laytabs = new TGLayoutHints(kLHintsNormal|kLHintsExpandY, 10, 10, 10, 10);
-    frame->AddFrame(tabs, laytabs);
-
-    //
-    // Create second part of frame
-    //
-    fEvtDisplay = new TGTab(frame, 300, 300);
-
-    fCanvas=AddTab("Photons");
-
-    //
-    // Add second part to frame
-    //
-    TGLayoutHints *laydisp = new TGLayoutHints(kLHintsNormal|kLHintsExpandY|kLHintsExpandX, 10, 10, 10, 10);
-    frame->AddFrame(fEvtDisplay, laydisp);
-
-    //
-    // Now add all gui elements to 'autodel'-list
-    //
-    fList->Add(fEvtDisplay);
-    fList->Add(laydisp);
-    fList->Add(laytabs);
-}
-
-// --------------------------------------------------------------------------
-//
-//  Add the low frame: These are the buttons Print and Close
-//
-void MGEvtDisplay::AddLowFrame(TGHorizontalFrame *frame)
-{
-    TGTextButton *but = new TGTextButton(frame, "Close", kClose);
-
-    but->Associate(this);
-
-    fList->Add(but);
-
-    TGLayoutHints *laybut = new TGLayoutHints(kLHintsLeft, 10, 10, 10, 10);
-    fList->Add(laybut);
-
-    frame->AddFrame(but, laybut);
-}
-
-// --------------------------------------------------------------------------
-//
-//  Create and setup all the three frames and build the window interieur
-//
-void MGEvtDisplay::AddFrames(const char *filename, const char *treename)
-{
-    //
-    // Create the frame elements and add gui elements to it
-    //
-    TGVerticalFrame *frametop = new TGVerticalFrame(this, 300, 100);
-    fList->Add(frametop);
-
-    AddTopFramePart1(frametop, filename, treename);
-    AddTopFramePart2(frametop);
-
-    TGLayoutHints *laytop  = new TGLayoutHints(kLHintsTop|kLHintsCenterX);
-    fList->Add(laytop);
-
-    // -----
-
-    TGHorizontalFrame *framemid = new TGHorizontalFrame(this, 300, 100);
-    fList->Add(framemid);
-
-    AddMidFrame(framemid);
-
-    TGLayoutHints *laymid  = new TGLayoutHints(kLHintsExpandY|kLHintsExpandX);
-    fList->Add(laymid);
-
-    //
-    // add frame elements to 'autodel'
-    //
-    TGHorizontal3DLine *line1 = new TGHorizontal3DLine(this);
-    TGHorizontal3DLine *line2   = new TGHorizontal3DLine(this);
-    fList->Add(line1);
-    fList->Add(line2);
-
-    TGLayoutHints *layline = new TGLayoutHints(kLHintsTop|kLHintsExpandX);
-    fList->Add(layline);
-
-    // -----
-    TGHorizontalFrame *framelow = new TGHorizontalFrame(this, 300, 100);
-    fList->Add(framelow);
-
-    AddLowFrame(framelow);
-
-    TGLayoutHints *laylow  = new TGLayoutHints(kLHintsTop);
-    fList->Add(laylow);
-
-    //
-    // Layout frame elements and add elements to frame
-    //
-    AddFrame(frametop, laytop);
-    AddFrame(line1,    layline);
-    AddFrame(framemid, laymid);
-    AddFrame(line2,    layline);
-    AddFrame(framelow, laylow);
-}
-
-// --------------------------------------------------------------------------
-//
-//  Constructor
-//
-void MGEvtDisplay::AddMenuBar()
-{
-    //
-    // Add all GUI elements and update the event counter
-    //
-    TGLayoutHints *laymenubar  = new TGLayoutHints(kLHintsTop|kLHintsLeft|kLHintsExpandX, 2, 2, 2, 2);
-    TGLayoutHints *laymenuitem = new TGLayoutHints(kLHintsTop|kLHintsLeft, 0, 4, 0, 0);
-    TGLayoutHints *laylinesep  = new TGLayoutHints(kLHintsTop|kLHintsExpandX);
-
-    fList->Add(laymenubar);
-    fList->Add(laymenuitem);
-    fList->Add(laylinesep);
-
-    TGPopupMenu *filemenu = new TGPopupMenu(gClient->GetRoot());
-    filemenu->AddEntry("Save &As...",           kFileSaveAs);
-    filemenu->AddEntry("Save As display.p&s",   kFileSaveAsPS);
-    filemenu->AddEntry("Save As display.&eps",  kFileSaveAsEPS);
-    filemenu->AddEntry("Save As display.&gif",  kFileSaveAsGIF);
-    filemenu->AddEntry("Save As display.&C",    kFileSaveAsC);
-    filemenu->AddEntry("Save As display.&root", kFileSaveAsRoot);
-    filemenu->AddSeparator();
-    filemenu->AddEntry("&Print...", kFilePrint);
-    filemenu->AddSeparator();
-    filemenu->AddEntry("E&xit", kClose);
-    filemenu->Associate(this);
-
-    TGMenuBar *menubar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
-    menubar->AddPopup("&File", filemenu, laymenuitem);
-    AddFrame(menubar, laymenubar);
-
-    TGHorizontal3DLine *linesep = new TGHorizontal3DLine(this);
-    AddFrame(linesep, laylinesep);
-
-    fList->Add(filemenu);
-    fList->Add(menubar);
-    fList->Add(linesep);
-}
-
-MGEvtDisplay::MGEvtDisplay(const char *fname, const char *tname,
-                           const TGWindow *p, /*const TGWindow *main,*/
-                           UInt_t w, UInt_t h)
-//    : TGTransientFrame(p, main, w, h), fInitOk(kFALSE)
-: TGMainFrame(p, w, h), fInitOk(kFALSE), fGeom(NULL)
-{
-    //
-    //  create an autodelete-list for the gui elements
-    //
-    fList = new TList;
-    fList->SetOwner();
-
-    //
-    // Setup an empty job, with a reader task only.
-    // All tasks and parameter containers are deleted automatically
-    // (via SetOwner())
-    //
-    MTaskList *tlist = new MTaskList;
-    tlist->SetOwner();
-
-    MReadMarsFile *read = new MReadMarsFile(tname, fname);
-    read->DisableAutoScheme();
-    tlist->AddToList(read);
-
-    MGeomApply *apl = new MGeomApply;
-    tlist->AddToList(apl);
-
-    MParList *plist = new MParList;
-    plist->SetOwner();
-    plist->AddToList(tlist);
-
-    fEvtLoop = new MEvtLoop;
-    fEvtLoop->SetOwner();
-    fEvtLoop->SetParList(plist);
-
-    AddMenuBar();
-    AddFrames(fname, tname);
-
-    SetWMSizeHints(450, 400, 1000, 1000, 10, 10);
-    Move(rand()%100+50, rand()%100+50);
-}
-
-// --------------------------------------------------------------------------
-//
-//  Destructs the graphical members and the eventloop members
-//
-MGEvtDisplay::~MGEvtDisplay()
-{
-    fEvtLoop->PostProcess();
-    delete fEvtLoop;
-
-    delete fList;
-}
-
-// --------------------------------------------------------------------------
-//
-// The close message is generated by the window manager when its close
-// window menu item is selected.
-//
-void MGEvtDisplay::CloseWindow()
-{
-    delete this;
-}
-
-void MGEvtDisplay::UpdateMcLabel()
-{
-    MMcEvt *evt=(MMcEvt*)GetParList()->FindObject("MMcEvt");
-    if (!evt)
-        return;
-
-    TString txt = " ";
-
-    switch (evt->GetPartId())
-    {
-    case kGAMMA:
-        txt += "Gamma";
-        break;
-    case kPROTON:
-        txt += "Proton";
-        break;
-    case kHELIUM:
-        txt += "Helium";
-        break;
-    default:
-        txt += "Unknown Particle Id#";
-        txt += evt->GetPartId();
-    }
-
-    txt += ":  E=";
-    txt += (int)(evt->GetEnergy()+.5);
-    txt += "GeV  r=";
-    txt += (int)(evt->GetImpact()/100+.5);
-    txt += "m  ZA=";
-    txt += (int)(evt->GetTheta()*180/TMath::Pi()+.5);
-    txt += "°  ";
-    txt += evt->GetPhotElfromShower();
-    txt += "PhEl";
-
-    const MRawEvtHeader *hed = (MRawEvtHeader*)GetParList()->FindObject("MRawEvtHeader");
-    if (hed)
-    {
-        txt += "  DAQEvt #";
-        txt += hed->GetDAQEvtNumber();
-    }
-
-    fEvtInfo->SetText(txt);
-
-    gLog << all;
-    gLog.Separator(txt);
-
-    //
-    // Seems to be necessary to newly layout the upper part to display
-    // the whole line of text
-    //
-    TGFrame &f = *(TGFrame*)fEvtInfo->GetParent()->GetParent();
-    f.Layout();
-    f.MapSubwindows();
-}
-
-// --------------------------------------------------------------------------
-//
-//  Adds the geometry tab 
-//
-void MGEvtDisplay::AddGeometryTab()
-{
-    MGeomCam *geom = (MGeomCam*)GetParList()->FindObject("MGeomCam");
-    if (!geom)
-        return;
-
-    fGeom=AddTab("Geometry");
-
-    MHCamera *cam = new MHCamera(*geom);
-    cam->SetBit(TH1::kNoStats);
-    cam->Draw();
-    cam->DrawPixelIndices();
-    fList->Add(cam);
-
-    fGeom->Modified();
-    fGeom->Update();
-}
-
-// --------------------------------------------------------------------------
-//
-//  Checks if the event number is valid, and if so reads the new event
-//  and updates the display
-//
-void MGEvtDisplay::ReadinEvent(Int_t dir)
-{
-    if (!fGeom)
-        AddGeometryTab();
-
-    MRawEvtData *raw = (MRawEvtData*)GetParList()->FindObject("MRawEvtData");
-    if (!raw)
-        return;
-
-    const Int_t num = GetReader()->GetNumEntry();
-
-    do
-    {
-        if (dir<0 && !GetReader()->DecEventNum())
-        {
-            GetReader()->SetEventNum(num);
-            return;
-        }
-        if (dir>0 && !GetReader()->IncEventNum())
-        {
-            GetReader()->SetEventNum(num);
-            return;
-        }
-
-        if (!GetTaskList()->Process())
-            return;
-
-        GetReader()->DecEventNum();
-
-    } while (raw->GetNumPixels()<1 && dir!=0);
-
-    UpdateMcLabel();
-    UpdateDisplay();
-
-    fTxtEvtNr->SetText(Form("%d", GetReader()->GetNumEntry()+1));
-}
-
-void MGEvtDisplay::ReadFirstEvent()
-{
-    fInitOk = fEvtLoop->PreProcess();
-
-    if (fInitOk)
-        ReadinEvent();
-
-    TGString *txt = new TGString(Form("out of %d Events", GetReader()->GetEntries()));
-    fNumOfEvts->SetText(txt);
-}
-
-// --------------------------------------------------------------------------
-//
-//  Opens a save as dialog, and tries to store the canvas
-//  in the given output format
-//
-void MGEvtDisplay::SaveAsDialog() const
-{
-    static const char *gSaveAsTypes[] =
-    {
-        "PostScript",   "*.ps",
-        "Encapsulated PostScript", "*.eps",
-        "Gif files",    "*.gif",
-        "Macro files",  "*.C",
-        "ROOT files",   "*.root",
-        "All files",    "*",
-        NULL,           NULL
-    };
-
-    static TString dir(".");
-
-    TGFileInfo fi; // fFileName and fIniDir deleted in ~TGFileInfo
-
-    fi.fFileTypes = (const char**)gSaveAsTypes;
-    fi.fIniDir    = StrDup(dir);
-
-    new TGFileDialog(fClient->GetRoot(), this, kFDSave, &fi);
-
-    if (!fi.fFilename)
-        return;
-
-    dir = fi.fIniDir;
-
-    if (strstr(fi.fFilename, ".root") ||
-        strstr(fi.fFilename, ".ps")   ||
-        strstr(fi.fFilename, ".eps")  ||
-        strstr(fi.fFilename, ".gif"))
-    {
-        fCanvas->SaveAs(fi.fFilename);
-        return;
-    }
-    if (strstr(fi.fFilename, ".C"))
-    {
-        fCanvas->SaveSource(fi.fFilename);
-        return;
-    }
-    Warning("SaveAsDialog", "Unknown Extension: %s", fi.fFilename);
-}
-
-// --------------------------------------------------------------------------
-//
-//  ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
-//
-// Processes information from all GUI items.
-// Selecting an item usually generates an event with 4 parameters.
-// The first two are packed into msg (first and second bytes).
-// The other two are parm1 and parm2.
-//
-Bool_t MGEvtDisplay::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
-{
-    switch (GET_MSG(msg))
-    {
-    case kC_TEXTENTRY:
-        switch(GET_SUBMSG(msg))
-        {
-        case kTE_ENTER:
-            if (parm1==kClose)
-            {
-                CloseWindow();
-                return kTRUE;
-            }
-
-            if (!fInitOk)
-                return kTRUE;
-
-            switch(GET_SUBMSG(msg))
-            {
-            case kTE_ENTER:
-                if (GetReader()->SetEventNum(atoi(fTxtEvtNr->GetText())-1))
-                    ReadinEvent();
-                return kTRUE;
-            }
-            return kTRUE;
-        }
-        return kTRUE;
-
-    case kC_COMMAND:
-        switch (GET_SUBMSG(msg))
-        {
-        case kCM_BUTTON:
-            if (parm1==kClose)
-            {
-                CloseWindow();
-                return kTRUE;
-            }
-
-            if (!fInitOk)
-                return kTRUE;
-
-            switch (parm1)
-            {
-            case kEvtPrev:
-                ReadinEvent(-1);
-                return kTRUE;
-
-            case kEvtNext:
-                ReadinEvent(+1);
-                return kTRUE;
-            }
-            return kTRUE;
-
-        case kCM_MENU:
-            switch (parm1)
-            {
-            case kFileSaveAs:
-                SaveAsDialog();
-                return kTRUE;
-            case kFileSaveAsRoot:
-                fCanvas->SaveAs("display.root");
-                return kTRUE;
-            case kFileSaveAsC:
-                // FIXME: The line opening the canvas is wrong.
-                fCanvas->SaveSource("display.C");
-                return kTRUE;
-            case kFileSaveAsPS:
-                fCanvas->SaveAs("display.ps");
-                return kTRUE;
-            case kFileSaveAsEPS:
-                fCanvas->SaveAs("display.eps");
-                return kTRUE;
-            case kFileSaveAsGIF:
-                fCanvas->SaveAs("display.gif");
-                return kTRUE;
-            case kFilePrint:
-                fCanvas->Print();
-                return kTRUE;
-            case kClose:
-                CloseWindow();
-                return kTRUE;
-            }
-            return kTRUE;
-        }
-        return kTRUE;
-    }
-    return kTRUE;
-}
-
Index: unk/MagicSoft/Mars/mmain/MGEvtDisplay.h
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MGEvtDisplay.h	(revision 2502)
+++ 	(revision )
@@ -1,92 +1,0 @@
-#ifndef MARS_MGEvtDisplay
-#define MARS_MGEvtDisplay
-
-#ifndef MARS_MAGIC
-#include "MAGIC.h"
-#endif
-
-#ifndef ROOT_TGFrame
-#include <TGFrame.h>
-#endif
-
-class TGTab;
-class TList;
-class TCanvas;
-class TGLabel;
-class TGTextEntry;
-
-class MEvtLoop;
-class MParList;
-class MTaskList;
-class MReadTree;
-
-class MGEvtDisplay : public TGMainFrame/*TGTransientFrame*/
-{
-private:
-    //
-    // GUI stuff
-    //
-    TGLabel     *fNumOfEvts;
-    TGLabel     *fEvtInfo;
-    TGTextEntry *fTxtEvtNr;
-
-    TGTab       *fEvtDisplay;
-
-    void AddMenuBar();
-    void AddTopFramePart1(TGVerticalFrame *frame,
-                          const char *filename,
-                          const char *treename);
-    void AddTopFramePart2(TGVerticalFrame *frame);
-    void AddMidFrame(TGHorizontalFrame *frame);
-    void AddLowFrame(TGHorizontalFrame *frame);
-
-    void AddFrames(const char *filename, const char *treename);
-    void AddGeometryTab();
-
-    void SaveAsDialog() const;
-    void ReadinEvent(Int_t dir=0);
-
-    Bool_t fInitOk;
-
-protected:
-    TList     *fList;
-    MEvtLoop  *fEvtLoop;
-
-    TCanvas   *fCanvas;
-    TCanvas   *fGeom;
-
-    TGCompositeFrame *fTab1;
-    TGCompositeFrame *fTab2;
-
-    TGVerticalFrame  *fMidFrame;
-
-    MParList  *GetParList() const;
-    MTaskList *GetTaskList() const;
-    MReadTree *GetReader() const;
-
-    TCanvas *AddTab(TString name);
-
-    void   ReadFirstEvent();
-    Bool_t IsInitOk() { return fInitOk; }
-
-    void UpdateMcLabel();
-
-    virtual void UpdateDisplay() = 0;
-
-public:
-    MGEvtDisplay(const char *fname, const char *tname,
-                 const TGWindow *p, /*const TGWindow *main,*/
-                 UInt_t w, UInt_t h);
-
-    ~MGEvtDisplay();
-
-    void CloseWindow();
-
-    virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
-
-    ClassDef(MGEvtDisplay, 0) // base class to display something event by event
-};
-
-#endif
-
-
