Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 1051)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 1052)
@@ -1,3 +1,93 @@
                                                                   -*-*- END -*-*-
+ 2001/11/08: Thomas Bretz
+
+   * manalysis/MCerPhotCalc.cc, manalysis/MPedCalcPedRun.cc,
+     mhist/MHFadcCam.cc:
+     - removed 'Fadc' from function names
+
+   * manalysis/MCerPhotEvt.[h,cc]:
+     - made AddPixel inline
+   
+   * manalysis/MMcPedestalCopy.cc:
+     - added output
+
+   * manalysis/MPedestalCam.cc:
+     - removed FIXME
+
+   * Makefile's:
+     - some reordering
+     - changed to the output
+
+   * mbase/MReadTree.cc:
+     - removed setting of AutoDel-flag (this was not intended and doesn't
+       work for a TChain, yet)
+
+   * meventdisp/MGCamDisplay.cc, meventdisp/MGFadcDisp.cc:
+     - moved SetWMSizeHints to base class
+
+   * meventdisp/MGEvtDisplay.cc:
+     - added a random move and the SetWMSizeHints
+
+   * mhist/MHHillas.cc:
+     - replaced some text by Latex-formulas
+
+   * mmain/MBrowser.cc:
+     - added a menu entry for opening a TBrowser
+     - added a random move
+
+   * mmain/MMars.[h,cc]:
+     - changed enums to root style
+     - moved size specification from header to source
+     - changed SetWMSizeHints call
+
+   * mraw/MrawEvtPixelIter.[h,cc]:
+     - added fNum[Hi,Lo]GainSamples to make GetSum* faster
+     - removed 'Fadc' from function names
+
+
+
+ 2001/11/07: Thomas Bretz
+
+   * Makefile:
+     - changed order in 'mrproper'
+
+   * manalysis/MCT1ReadAscii.cc, manalysis/MCerPhotCalc.cc:
+     - added InitSize
+
+   * manalysis/MCerPhotEvt.[h,cc]:
+     - introduces InitSize to speed up things
+     - changed []-operator to an unchecked access
+
+   * manalysis/MPedestalCam.h:
+     - changed ExpandCreateFast to ExpandCreate (due to lack of good dox)
+     - changed []-operator to an unchecked access
+
+   * mbase/MEvtLoop.cc:
+     - changed 'total' to 'real' time.
+
+   * mgui/MGeomCam.[h,cc]:
+     - moved []-operator code back to class definition, due to runtime speed
+     - changed []-operator to an unchecked access
+
+   * mhist/MHHillas.cc:
+     - changed 'degree' to Latex-style
+
+   * manalysis/MImgCleanStd.cc:
+     - we are now initialising an array holding the used pixel to prevent
+       looping through all pixel thousands of times
+       (MCerPhotEvt::IsPixelUsed)
+
+   * mbase/MWriteAsciiFile.cc:
+     - enhanced the documentation
+
+   * mmain/MBrowser.[h,cc]:
+     - enhanced the functionality to display the filename
+     - improved the layout
+
+   * mmain/MMars.cc:
+     - added calling of 'netscape' for the two picture buttons
+
+
+
  2001/11/06: Thomas Bretz
 
@@ -33,5 +123,4 @@
      - changed so, that the arrays are dreed and allocated only
        as less as possible
-     - removed (by comment) AddPixel
 
    * mraw/MRawFileRead.[h,cc]:
Index: /trunk/MagicSoft/Mars/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/Makefile	(revision 1051)
+++ /trunk/MagicSoft/Mars/Makefile	(revision 1052)
@@ -48,4 +48,6 @@
 
 LIBRARIES = $(SUBDIRS:=.a)
+MRPROPERS = $(SUBDIRS:=.mrproper)
+CLEANERS  = $(SUBDIRS:=.clean)
 
 #------------------------------------------------------------------------------
@@ -62,4 +64,6 @@
 
 all: rmlib $(PROGRAMS) $(SOLIB)
+	@echo " Done. "
+	@echo " "
 
 # Use $(CXX) -v ... for a more verbose output
@@ -80,7 +84,14 @@
 
 $(LIBRARIES):
-	@echo " "  
 	@echo " Creating lib$@:"
 	(cd $*; make; cd ..; mv $*/$@ lib/lib$@) 
+
+$(MRPROPERS):
+	@echo " Doing Mr.Proper in $(@:.mrproper=)"
+	(cd $(@:.mrproper=); (make mrproper > /dev/null); cd ..;) 
+
+$(CLEANERS):
+	@echo "Cleaning $(@:.clean=):"
+	(cd $(@:.clean=); make clean; cd ..;) 
 
 dox:
@@ -90,34 +101,8 @@
 include Makefile.rules
 
-clean:	rmlib rmcint rmobjs rmcore rmbin
+clean:	rmcint rmobjs rmcore rmlib
 
-mrproper:	clean rmbak
-	@echo "Removing backup files in macros"
-	@rm -f macros/*~
-	@echo "Removing htmldoc-tree"
-	@rm -rf htmldoc
-	@echo "Doing Mr.Proper in manalysis"
-	@cd manalysis; (make mrproper > /dev/null); cd ..
-	@echo "Doing Mr.Proper in mbase"
-	@cd mbase; (make mrproper > /dev/null); cd ..
-	@echo "Doing Mr.Proper in mdatacheck"
-	@cd mdatacheck; (make mrproper > /dev/null); cd ..
-	@echo "Doing Mr.Proper in mevtdisp"
-	@cd meventdisp; (make mrproper > /dev/null); cd ..
-	@echo "Doing Mr.Proper in mfilter"
-	@cd mfilter; (make mrproper > /dev/null); cd ..
-	@echo "Doing Mr.Proper in mgui"
-	@cd mgui; (make mrproper > /dev/null); cd ..
-	@echo "Doing Mr.Proper in mhist"
-	@cd mhist; (make mrproper > /dev/null); cd ..
-	@echo "Doing Mr.Proper in mmain"
-	@cd mmain; (make mrproper > /dev/null); cd ..
-	@echo "Doing Mr.Proper in mmc"
-	@cd mmc; (make mrproper > /dev/null); cd ..
-	@echo "Doing Mr.Proper in mmontecarlo"
-	@cd mmontecarlo; (make mrproper > /dev/null); cd ..
-	@echo "Doing Mr.Proper in mraw"
-	@cd mraw; (make mrproper > /dev/null); cd ..
-	@echo "Done."
+mrproper:	$(MRPROPERS) rmbin rmbak rmbakmac rmhtml clean
+	@echo " Done."
 
 tar:	mrproper
Index: /trunk/MagicSoft/Mars/Makefile.rules
===================================================================
--- /trunk/MagicSoft/Mars/Makefile.rules	(revision 1051)
+++ /trunk/MagicSoft/Mars/Makefile.rules	(revision 1052)
@@ -7,4 +7,5 @@
 	@echo " - Building Library lib$(LIB)"
 	$(AR) $(LIB) *.o
+	@echo " "
 
 $(CINT)Cint.cc: $(HEADERS) 
@@ -30,26 +31,35 @@
 
 rmcint:	
-	@echo "Removing cint-stuff..."
+	@echo " Removing cint-stuff..."
 	@rm -f *Cint.*
 
 rmlib:	
-	@echo "Removing libraries..."
-	@rm -f lib/lib*.a  lib*.a
+	@echo " Removing libraries..."
+	@echo " "
+	@rm -f lib/lib*.a lib*.a
 
 rmobjs:	
-	@echo "Removing object files..."
+	@echo " Removing object files..."
 	@rm -f *.o
 
 rmcore:	
-	@echo "Removing core files..."
+	@echo " Removing core files..."
 	@rm -f core*
 
 rmbin:	
-	@echo "Removing binary files..."
+	@echo " Removing binary files..."
 	@rm -f $(PROGRAMS) lib/$(SOLIB) so_locations
 
 rmbak:
-	@echo "Removing backup files..."
+	@echo " Removing backup files..."
 	@rm -f *~ kk.kk *.bak
+
+rmbakmac:
+	@echo " Removing backup files in macros"
+	@rm -f macros/*~
+
+rmhtml:
+	@echo " Removing htmldoc-tree"
+	@rm -rf htmldoc
 
 cflags: 
Index: /trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc	(revision 1051)
+++ /trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc	(revision 1052)
@@ -47,8 +47,4 @@
     fArray = new TClonesArray("MPedestalPix", 577);
 
-    //
-    // TClonesArray: The 'new operator with placement' must be used
-    // FIXME: Use ExpandCraete instead
-    //
     for (int i=0; i<577; i++)
         new ((*fArray)[i]) MPedestalPix;
@@ -61,5 +57,4 @@
 MPedestalCam::~MPedestalCam()
 {
-    // FIXME: Do we have to delete the objects itself?
     delete fArray;
 }
Index: /trunk/MagicSoft/Mars/manalysis/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/Makefile	(revision 1051)
+++ /trunk/MagicSoft/Mars/manalysis/Makefile	(revision 1052)
@@ -50,5 +50,5 @@
 include ../Makefile.rules
 
-clean:	rmlib rmcint rmobjs rmcore rmbin
+clean:	rmcint rmobjs rmcore rmlib
 
 mrproper:	clean rmbak
Index: /trunk/MagicSoft/Mars/mbase/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mbase/Makefile	(revision 1051)
+++ /trunk/MagicSoft/Mars/mbase/Makefile	(revision 1052)
@@ -64,5 +64,5 @@
 include ../Makefile.rules
 
-clean:	rmlib rmcint rmobjs rmcore
+clean:	rmcint rmobjs rmcore rmlib
 
 mrproper:	clean rmbak
Index: /trunk/MagicSoft/Mars/mdatacheck/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mdatacheck/Makefile	(revision 1051)
+++ /trunk/MagicSoft/Mars/mdatacheck/Makefile	(revision 1052)
@@ -41,5 +41,5 @@
 include ../Makefile.rules
 
-clean:	rmlib rmcint rmobjs rmcore rmbin
+clean:	rmcint rmobjs rmcore rmlib
 
 mrproper:	clean rmbak
Index: /trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.cc
===================================================================
--- /trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.cc	(revision 1051)
+++ /trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.cc	(revision 1052)
@@ -338,5 +338,5 @@
     TGPopupMenu *filemenu = new TGPopupMenu(gClient->GetRoot());
     filemenu->AddEntry("Save &As...",           kFileSaveAs);
-    filemenu->AddEntry("Save As display.&ps",   kFileSaveAsPS);
+    filemenu->AddEntry("Save As display.p&s",   kFileSaveAsPS);
     filemenu->AddEntry("Save As display.&eps",  kFileSaveAsEPS);
     filemenu->AddEntry("Save As display.&gif",  kFileSaveAsGIF);
@@ -350,5 +350,5 @@
 
     TGMenuBar *menubar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
-    menubar->AddPopup("File", filemenu, laymenuitem);
+    menubar->AddPopup("&File", filemenu, laymenuitem);
     AddFrame(menubar, laymenubar);
 
@@ -393,4 +393,7 @@
     AddMenuBar();
     AddFrames(fname, tname);
+
+    SetWMSizeHints(450, 400, 1000, 1000, 10, 10);
+    Move(rand()%100+50, rand()%100+50);
 }
 
Index: /trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc
===================================================================
--- /trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc	(revision 1051)
+++ /trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc	(revision 1052)
@@ -129,9 +129,4 @@
 
     //
-    // set the smallest and biggest size of the Main frame
-    //
-    SetWMSizeHints(450, 400, 1000, 1000, 10, 10);
-
-    //
     // Map the window, set up the layout, etc.
     //
Index: /trunk/MagicSoft/Mars/meventdisp/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/meventdisp/Makefile	(revision 1051)
+++ /trunk/MagicSoft/Mars/meventdisp/Makefile	(revision 1052)
@@ -42,5 +42,5 @@
 include ../Makefile.rules
 
-clean:	rmlib rmcint rmobjs rmcore rmbin
+clean:	rmcint rmobjs rmcore rmlib
 
 mrproper:	clean rmbak
Index: /trunk/MagicSoft/Mars/mfilter/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mfilter/Makefile	(revision 1051)
+++ /trunk/MagicSoft/Mars/mfilter/Makefile	(revision 1052)
@@ -43,5 +43,5 @@
 include ../Makefile.rules
 
-clean:	rmlib rmcint rmobjs rmcore
+clean:	rmcint rmobjs rmcore rmlib
 
 mrproper:	clean rmbak
Index: /trunk/MagicSoft/Mars/mgui/MGeomCam.h
===================================================================
--- /trunk/MagicSoft/Mars/mgui/MGeomCam.h	(revision 1051)
+++ /trunk/MagicSoft/Mars/mgui/MGeomCam.h	(revision 1052)
@@ -6,5 +6,5 @@
 #endif
 #ifndef ROOT_TObjArray
-#include "TObjArray.h"
+#include <TObjArray.h>
 #endif
 
Index: /trunk/MagicSoft/Mars/mgui/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mgui/Makefile	(revision 1051)
+++ /trunk/MagicSoft/Mars/mgui/Makefile	(revision 1052)
@@ -45,5 +45,5 @@
 include ../Makefile.rules
 
-clean:	rmlib rmcint rmobjs rmcore rmbin
+clean:	rmcint rmobjs rmcore rmlib
 
 mrproper:	clean rmbak
Index: /trunk/MagicSoft/Mars/mhist/MHHillas.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHHillas.cc	(revision 1051)
+++ /trunk/MagicSoft/Mars/mhist/MHHillas.cc	(revision 1052)
@@ -36,5 +36,5 @@
     // connect all the histogram with the container fHist
     //
-    fAlpha  = new TH1F("\\alpha [^\\circ]", "Alpha of Hillas",   90, 0,  90);
+    fAlpha  = new TH1F("\\alpha [\\circ]", "Alpha of Hillas",   90, 0,  90);
     fWidth  = new TH1F("Width [mm]",  "Width of Hillas",  100, 0, 300);
     fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300);
@@ -46,5 +46,5 @@
     fWidth->SetDirectory(NULL);
 
-    fAlpha->GetXaxis()->SetTitle("Alpha [°]");
+    fAlpha->GetXaxis()->SetTitle("\\alpha [\\circ]");
     fLength->GetXaxis()->SetTitle("Length [mm]");
     fDist->GetXaxis()->SetTitle("Dist [mm]");
Index: /trunk/MagicSoft/Mars/mhist/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mhist/Makefile	(revision 1051)
+++ /trunk/MagicSoft/Mars/mhist/Makefile	(revision 1052)
@@ -48,5 +48,5 @@
 include ../Makefile.rules
 
-clean:	rmlib rmcint rmobjs rmcore rmbin
+clean:	rmcint rmobjs rmcore rmlib
 
 mrproper:	clean rmbak
Index: /trunk/MagicSoft/Mars/mmain/MBrowser.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MBrowser.cc	(revision 1051)
+++ /trunk/MagicSoft/Mars/mmain/MBrowser.cc	(revision 1052)
@@ -32,4 +32,5 @@
 #include <TGButton.h>       // TGTextButton
 #include <TGMsgBox.h>       // TGMsgBox
+#include <TBrowser.h>       // TBrowser
 #include <TGListBox.h>      // TGListBox
 #include <TGTextEntry.h>    // TGTextEntry
@@ -48,4 +49,5 @@
 
 enum {
+    kFileTBrowser,
     kFileClose,
     kButDirUp,
@@ -62,5 +64,8 @@
     //
     TGPopupMenu *filemenu = new TGPopupMenu(gClient->GetRoot());
-    filemenu->AddEntry("Close", kFileClose);
+    filemenu->AddEntry("Open &TBrowser", kFileTBrowser);
+    filemenu->AddSeparator();
+    filemenu->AddEntry("&Close", kFileClose);
+    filemenu->Associate(this);
     fList->Add(filemenu);
 
@@ -75,5 +80,5 @@
 
     TGMenuBar *menubar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
-    menubar->AddPopup("File", filemenu, laymenuitem);
+    menubar->AddPopup("&File", filemenu, laymenuitem);
     AddFrame(menubar, laymenubar);
     fList->Add(menubar);
@@ -320,4 +325,5 @@
     ChangeDir();
     SetWMSizeHints(400, 350, 1000, 1000, 10, 10); // set the smallest and biggest size of the Main frame
+    Move(rand()%100+50, rand()%100+50);
 }
 
@@ -450,99 +456,103 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Process events generated by the gui elements in the frame.
+//
 Bool_t MBrowser::ProcessMessage(Long_t msg, Long_t parm1, Long_t)
-{     
-  // Process events generated by the buttons in the frame.
-  
-  switch (GET_MSG(msg))
-  {
-  case kC_TEXTENTRY:
-      if (GET_SUBMSG(msg)!=kTE_ENTER)
-          return kTRUE;
-
-      SetFileName(fEntry->GetText());
-      return kTRUE;
-
-  case kC_COMMAND:
-      switch (GET_SUBMSG(msg))
-      {
-      case kCM_BUTTON:
-
-          switch (parm1)
-          {
-          case kButDirUp :
-              //
-	      //  goto the parent directory
-              //
-              ChangeDir("..");
-	      return kTRUE;
-	    
-	    case kButListMode:
-	      fFileView->SetViewMode(kLVList);
-              fDetail->SetState(kButtonUp) ;
-              return kTRUE;
-	      
-          case kButDetailMode:
-              fFileView->SetViewMode(kLVDetails);
-              fListMode->SetState(kButtonUp);
-              return kTRUE;
-          }
-          return kTRUE;
-
-      case kCM_COMBOBOX:
-          //
-          // FIXME: Don't add the new entry to the list!
-          // But to do this we need the number of entries in the list.
-          //
-          if (parm1 != kCBDirectory)
-              return kTRUE;
-
-          ChangeDir(((TGTreeLBEntry*)fDir->GetSelectedEntry())->GetPath()->GetString());
-          return kTRUE;
-
-	case kCM_MENU:
-	  if (parm1==kFileClose)
-              CloseWindow();
-          return kTRUE;
-      }
-      return kTRUE;
-      
-  case kC_CONTAINER:
-      switch (GET_SUBMSG(msg))
-      {
-
-          //      case kCT_ITEMCLICK:
-          // 	printf ("itemclick\n");
-          //      break;
-
-      case kCT_ITEMDBLCLICK:
-          //
-          //  process the double click in the file view container
-          //
-
-          if (parm1 != kButton1 || fFileCont->NumSelected() != 1)
-              return kTRUE;
-
-          //
-          //  one file selected
-          //
-          void *dummy = NULL;
-          const TGFileItem *item = (TGFileItem *)fFileCont->GetNextSelected(&dummy);
-
-          const char *str = item->GetItemName()->GetString();
-
-          //
-          // if the user choose a directory
-          // change to this directory
-          //
-          if (S_ISDIR(item->GetType())) 
-          {
-              ChangeDir(str);
-              return kTRUE;
-          }
-
-          SetFileName(str);
-          return kTRUE;
-      }
-  }
-  return kTRUE;
-} 
+{
+    switch (GET_MSG(msg))
+    {
+    case kC_TEXTENTRY:
+        if (GET_SUBMSG(msg)!=kTE_ENTER)
+            return kTRUE;
+
+        SetFileName(fEntry->GetText());
+        return kTRUE;
+
+    case kC_COMMAND:
+        switch (GET_SUBMSG(msg))
+        {
+        case kCM_MENU:
+            switch (parm1)
+            {
+            case kFileClose:
+                CloseWindow();
+                return kTRUE;
+
+            case kFileTBrowser:
+                new TBrowser();
+                return kTRUE;
+            }
+            return kTRUE;
+
+        case kCM_BUTTON:
+            switch (parm1)
+            {
+            case kButDirUp:
+                //
+                //  goto the parent directory
+                //
+                ChangeDir("..");
+                return kTRUE;
+
+            case kButListMode:
+                fFileView->SetViewMode(kLVList);
+                fDetail->SetState(kButtonUp);
+                return kTRUE;
+
+            case kButDetailMode:
+                fFileView->SetViewMode(kLVDetails);
+                fListMode->SetState(kButtonUp);
+                return kTRUE;
+            }
+            return kTRUE;
+
+        case kCM_COMBOBOX:
+            if (parm1 != kCBDirectory)
+                return kTRUE;
+
+            ChangeDir(((TGTreeLBEntry*)fDir->GetSelectedEntry())->GetPath()->GetString());
+            return kTRUE;
+        }
+        return kTRUE;
+
+    case kC_CONTAINER:
+        switch (GET_SUBMSG(msg))
+        {
+
+            //      case kCT_ITEMCLICK:
+            // 	printf ("itemclick\n");
+            //      break;
+
+        case kCT_ITEMDBLCLICK:
+            //
+            //  process the double click in the file view container
+            //
+            if (parm1 != kButton1 || fFileCont->NumSelected() != 1)
+                return kTRUE;
+
+            //
+            //  one file selected
+            //
+            void *dummy = NULL;
+            const TGFileItem *item = (TGFileItem *)fFileCont->GetNextSelected(&dummy);
+
+            const char *str = item->GetItemName()->GetString();
+
+            //
+            // if the user choose a directory
+            // change to this directory
+            //
+            if (S_ISDIR(item->GetType()))
+            {
+                ChangeDir(str);
+                return kTRUE;
+            }
+
+            SetFileName(str);
+            return kTRUE;
+        }
+    }
+    return kTRUE;
+}
Index: /trunk/MagicSoft/Mars/mmain/MMars.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MMars.cc	(revision 1051)
+++ /trunk/MagicSoft/Mars/mmain/MMars.cc	(revision 1052)
@@ -44,15 +44,15 @@
 
 enum {
-    M_FILE_EXIT,
-    M_FILE_ABOUT,
-
-    M_PICTURE_MAGIC,
-    M_PICTURE_MARS,
-
-    M_BUTTON_EVTDISP,
-    M_BUTTON_DATACHECK,
-    M_BUTTON_ANALYSE,
-    M_BUTTON_MONTECARLO,
-    M_BUTTON_CAMDISPLAY
+    kFileExit,
+    kFileAbout,
+
+    kPicMagic,
+    kPicMars,
+
+    kButEvtDisplay,
+    kButDataCheck,
+    kButAnalysis,
+    kButMonteCarlo,
+    kButCameraDisplay
 };
 
@@ -68,9 +68,9 @@
 
     TGPopupMenu *filemenu = new TGPopupMenu(gClient->GetRoot());
-    filemenu->AddEntry("Exit", M_FILE_EXIT);
-    //fFileMenu->Associate(this);
+    filemenu->AddEntry("E&xit", kFileExit);
+    filemenu->Associate(this);
 
     TGMenuBar *menubar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
-    menubar->AddPopup("File", filemenu, laymenuitem);
+    menubar->AddPopup("&File", filemenu, laymenuitem);
     AddFrame(menubar, laymenubar);
 
@@ -88,6 +88,6 @@
     fPic2 = gClient->GetPicture("marslogo.xpm");
 
-    TGPictureButton *magic = new TGPictureButton(top, fPic1, M_PICTURE_MAGIC);
-    TGPictureButton *mars  = new TGPictureButton(top, fPic2, M_PICTURE_MARS);
+    TGPictureButton *magic = new TGPictureButton(top, fPic1, kPicMagic);
+    TGPictureButton *mars  = new TGPictureButton(top, fPic2, kPicMars);
 
     fList->Add(magic);
@@ -163,14 +163,13 @@
     fList->Add(laybut);
 
-    CreateTextButton(tab2, "Event Display",  M_BUTTON_EVTDISP,    laybut);
-    CreateTextButton(tab2, "Data Check",     M_BUTTON_DATACHECK,  laybut);
-    CreateTextButton(tab2, "Analysis",       M_BUTTON_ANALYSE,    laybut);
-    CreateTextButton(tab2, "Monte Carlo",    M_BUTTON_MONTECARLO, laybut);
-    CreateTextButton(tab2, "Camera Display", M_BUTTON_CAMDISPLAY, laybut);
-}
-
-MMars::MMars(/*const TGWindow *p,*/ UInt_t w, UInt_t h)
-: TGMainFrame(gClient->GetRoot(), w, h)
-//: MBrowser (gClient->GetRoot(), gClient->GetRoot(), w, h)
+    CreateTextButton(tab2, "Event Display",  kButEvtDisplay,    laybut);
+    CreateTextButton(tab2, "Data Check",     kButDataCheck,  laybut);
+    CreateTextButton(tab2, "Analysis",       kButAnalysis,    laybut);
+    CreateTextButton(tab2, "Monte Carlo",    kButMonteCarlo, laybut);
+    CreateTextButton(tab2, "Camera Display", kButCameraDisplay, laybut);
+}
+
+MMars::MMars()
+: TGMainFrame(gClient->GetRoot(), 330, 400, kVerticalFrame|kFixedSize)
 {
     //
@@ -212,6 +211,8 @@
     //
     //   Map the window, set up the layout, etc.
-    //
-    SetWMSizeHints(330, 410, 330, 410, 10, 10);  // set the smallest and biggest size of the Main frame
+    //   kFixedSize seems to be ignored
+    //
+    SetWMSizeHints(GetWidth(), GetHeight(), GetWidth(), GetHeight(), 0, 0);  // set the smallest and biggest size of the Main frame
+    Move(rand()%100, rand()%100);
 
     MapSubwindows();
@@ -269,29 +270,29 @@
             {
 
-            case M_BUTTON_EVTDISP:
+            case kButEvtDisplay:
                 new MEvtDisp(this);
                 return kTRUE;
 
-            case M_BUTTON_DATACHECK:
+            case kButDataCheck:
                 new MDataCheck(this);
                 return kTRUE;
 
-            case M_BUTTON_ANALYSE:
+            case kButAnalysis:
                 new MAnalysis(this);
                 return kTRUE;
 
-            case M_BUTTON_MONTECARLO:
+            case kButMonteCarlo:
                 new MMonteCarlo(this);
                 return kTRUE;
 
-            case M_BUTTON_CAMDISPLAY:
+            case kButCameraDisplay:
                 new MCameraDisplay(this);
                 return kTRUE;
 
-            case M_PICTURE_MAGIC:
+            case kPicMagic:
                 gSystem->Exec("netscape http://hegra1.mppmu.mpg.de/MAGICWeb/ &");
                 return kTRUE;
 
-            case M_PICTURE_MARS:
+            case kPicMars:
                 gSystem->Exec("netscape http://magic.uni-sw.gwdg.de/mars/ &");
                 return kTRUE;
@@ -299,5 +300,5 @@
 
 	case kCM_MENU:
-            if (parm1!=M_FILE_EXIT)
+            if (parm1!=kFileExit)
                 return kTRUE;
 
Index: /trunk/MagicSoft/Mars/mmain/MMars.h
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MMars.h	(revision 1051)
+++ /trunk/MagicSoft/Mars/mmain/MMars.h	(revision 1052)
@@ -33,6 +33,5 @@
 
 public:
-    MMars(UInt_t w=400, UInt_t h=500);
-
+    MMars();
     ~MMars();
 
Index: /trunk/MagicSoft/Mars/mmain/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mmain/Makefile	(revision 1051)
+++ /trunk/MagicSoft/Mars/mmain/Makefile	(revision 1052)
@@ -47,5 +47,5 @@
 include ../Makefile.rules
 
-clean:	rmlib rmcint rmobjs rmcore rmbin
+clean:	rmcint rmobjs rmcore rmlib
 
 mrproper:	clean rmbak
Index: /trunk/MagicSoft/Mars/mmontecarlo/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mmontecarlo/Makefile	(revision 1051)
+++ /trunk/MagicSoft/Mars/mmontecarlo/Makefile	(revision 1052)
@@ -42,5 +42,5 @@
 include ../Makefile.rules
 
-clean:	rmlib rmcint rmobjs rmcore rmbin
+clean:	rmcint rmobjs rmcore rmlib
 
 mrproper:	clean rmbak
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc	(revision 1051)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc	(revision 1052)
@@ -56,4 +56,12 @@
 ClassImp(MRawEvtPixelIter);
 
+MRawEvtPixelIter::MRawEvtPixelIter(MRawEvtData *dat) : fData(dat)
+{
+    fNumHiGainSamples = dat->GetNumHiGainSamples();
+    fNumLoGainSamples = dat->GetNumLoGainSamples();
+
+    Reset();
+}
+
 // --------------------------------------------------------------------------
 //
@@ -92,5 +100,5 @@
             fNumLoGainEntry++;
             fLoGainId++;
-            fLoGainPos += fData->GetNumLoGainSamples();
+            fLoGainPos += fNumLoGainSamples;
         }
 
@@ -100,5 +108,5 @@
     fNumHiGainEntry++;
     fHiGainId++;
-    fHiGainPos += fData->GetNumHiGainSamples();
+    fHiGainPos += fNumHiGainSamples;
 
     //
@@ -125,6 +133,6 @@
     fHiGainId   = fData->fHiGainPixId->GetArray()-1;
     fLoGainId   = fData->fLoGainPixId->GetArray()-1;
-    fHiGainPos  = fData->fHiGainFadcSamples->GetArray()-fData->GetNumHiGainSamples();
-    fLoGainPos  = fData->fLoGainFadcSamples->GetArray()-fData->GetNumLoGainSamples();
+    fHiGainPos  = fData->fHiGainFadcSamples->GetArray()-fNumHiGainSamples;
+    fLoGainPos  = fData->fLoGainFadcSamples->GetArray()-fNumLoGainSamples;
 }
 
@@ -145,5 +153,5 @@
 // returns the sum of all hi gain fadc samples of the actual pixel
 //
-ULong_t MRawEvtPixelIter::GetSumHiGainFadcSamples() const
+ULong_t MRawEvtPixelIter::GetSumHiGainSamples() const
 {
     //
@@ -151,5 +159,5 @@
     //
     Byte_t *ptr = fHiGainPos;
-    const Byte_t *end = ptr + fData->GetNumHiGainSamples();
+    const Byte_t *end = ptr + fNumHiGainSamples;
 
     ULong_t sum=0;
@@ -166,5 +174,5 @@
 // if no lo gain information is available 0 is returned.
 //
-ULong_t MRawEvtPixelIter::GetSumLoGainFadcSamples() const
+ULong_t MRawEvtPixelIter::GetSumLoGainSamples() const
 {
     //
@@ -175,5 +183,5 @@
 
     Byte_t *ptr = fLoGainPos;
-    const Byte_t *end = ptr + fData->GetNumLoGainSamples();
+    const Byte_t *end = ptr + fNumLoGainSamples;
 
     ULong_t sum=0;
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h	(revision 1051)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h	(revision 1052)
@@ -28,11 +28,11 @@
     UShort_t fNumEntry;
 
+    Byte_t fNumHiGainSamples;   //!
+    Byte_t fNumLoGainSamples;   //!
+
     MRawEvtData *fData;         //! pointer to object which we are iterating
 
 public:
-    MRawEvtPixelIter(MRawEvtData *dat) : fData(dat)
-    {
-        Reset();
-    }
+    MRawEvtPixelIter(MRawEvtData *dat);
 
     MRawEvtData *Next();
@@ -66,5 +66,5 @@
     Byte_t GetNumPixels() const;
 
-    Byte_t *GetHiGainFadcSamples() const
+    Byte_t *GetHiGainSamples() const
     {
         //
@@ -77,5 +77,5 @@
     }
 
-    ULong_t GetSumHiGainFadcSamples() const;
+    ULong_t GetSumHiGainSamples() const;
 
     Bool_t HasLoGain() const
@@ -87,5 +87,5 @@
     }
 
-    Byte_t *GetLoGainFadcSamples() const
+    Byte_t *GetLoGainSamples() const
     {
         //
@@ -96,5 +96,6 @@
     }
 
-    ULong_t GetSumLoGainFadcSamples() const;
+    ULong_t GetSumLoGainSamples() const;
+
 
     void Reset();
Index: /trunk/MagicSoft/Mars/mraw/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mraw/Makefile	(revision 1051)
+++ /trunk/MagicSoft/Mars/mraw/Makefile	(revision 1052)
@@ -47,5 +47,5 @@
 include ../Makefile.rules
 
-clean:	rmlib rmcint rmobjs rmcore rmbin
+clean:	rmcint rmobjs rmcore rmlib
 
 mrproper:	clean rmbak
Index: /trunk/MagicSoft/include-Classes/MMcFormat/Makefile
===================================================================
--- /trunk/MagicSoft/include-Classes/MMcFormat/Makefile	(revision 1051)
+++ /trunk/MagicSoft/include-Classes/MMcFormat/Makefile	(revision 1052)
@@ -46,5 +46,5 @@
 include ../Makefile.rules
 
-clean:	rmlib rmcint rmobjs rmcore
+clean:	rmcint rmobjs rmcore rmlib
 
 mrproper:	clean rmbak
