Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 2172)
+++ trunk/MagicSoft/Mars/Changelog	(revision 2173)
@@ -1,3 +1,116 @@
                                                  -*-*- END OF LINE -*-*-
+
+ 2003/06/13: Thomas Bretz (making Mars work with gcc 3.3 on Suse 8.2)
+
+   * Makefile.conf.linux:
+     - removed nonull-objects, Wtraditional and Wnested-externs
+       due to warnings in gcc 3.3
+     
+   * *:
+     - added 'using namespace std;'
+     - exchanged *.h C++ headers by correct headers (like <fstream>)
+     - replaced forward declarations of streams by <iosfwd>
+
+   * manalysis/MCerPhotAnal.cc:
+     - cast arguments of sqrt to correct type
+     - corrected argument type for SetPedestalRms
+     
+   * manalysis/MCurrents.h:
+     - const operator[] uses 'this' now
+     
+   * manalysis/MEnergyEstParam.[h,cc], manalysis/MSigmabarParam.[h,cc]:
+     - fixed definition of Print
+
+   * manalysis/MMcPedestalCopy.cc, manalysis/MPedCalcPedRun.cc,
+     mgui/MCamDisplay.cc, mmontecarlo/MMcThresholdCalc.cc:
+     - cast arguments of sqrt to correct type
+
+   * manalysis/MMultiDimDistCalc.cc:
+     - changed type of numg/numh to Int_t
+     
+   * mbase/BaseLinkDef.h:
+     - removed pragma for __omanip_debug
+
+   * mbase/MLog.[h,cc]:
+     - fixed copy constructor
+     - removed usage of mkstemp -- TO BE FIXED
+
+   * mbase/MLogManip.[h,cc]:
+     - completely replaced
+
+   * mdata/MDataArray.cc:
+     - fixed variable type ncols (Double_t -> Int_t)
+   
+   * mdata/MDataChain.cc:
+     - fixed argument type of gRandom->Integer()
+   
+   * meventdisp/MGEvtDisplay.[h,cc]:
+     - implemented skiping of  events which have 0 Pixels
+     
+   * mfileio/MCT1ReadPreProc.cc:
+     - fixed conversion for istream::read from Byte_t* to char*
+     - fixed argument type in Fill (fmcsize_phel)
+     
+   * mfileio/MChain.h:
+     - ResetTree must also set fTreeNumber to -1 due to changes in
+       TChain::LoadTree
+
+   * mfilter/MFAlpha.[h,cc]:
+      fixed type of Alpha in Init (Float_t instead of Int_t)
+      
+   * mfilter/MFEventSelector2.[h,cc]:
+     - renamed Read member function to ReadDistribution
+     
+   * mfilter/MFilterList.h:
+     - fixed overloading of GetRule
+     
+   * mhist/MBinning.cc, mhist/MH3.cc:
+     - removed default argument in source file
+
+   * mhist/MHArray.cc:
+      fixed type of sstyle (Stat_t -> Int_t)
+      
+   * mhist/MHCerPhotEvt.[h,cc], mhist/MHCurrents.[h,cc]:
+     - fixed definition of Clear()
+     
+   * mhist/MHFadcCam.[h,cc]:
+     - renamed Reset to ResetEntry
+     
+   * mhistmc/MHMcEnergy.cc:
+     - fixed argument type of log
+   
+   * mhistmc/MHMcRate.cc:
+     - cast argument of pow() to correct type
+   
+   * mimage/MHillas.cc:
+     - replaced default value for MeanX and MeanY by 0
+
+   * mmain/MMars.cc:
+     - fixed argument type in TGLayoutHints
+
+   * mmain/MStatusDisplay.cc:
+     - fixed some argument types
+     - for the moment removed the update of the ps-header
+
+   * mmc/MMcTrig.cxx:
+     - use binary shift instead of pow for power of two
+
+   * mmontecarlo/MMcEnergyEst.[h,cc]:
+     - declared fcn as static
+     - fixed definition of Print
+
+   * mmontecarlo/MMcTimeGenerate.cc:
+     - fixed argument type of SetTime
+   
+   * mmontecarlo/MMcTriggerRateCalc.[h,cc]:
+     - fixed definition of Draw
+
+   * mfileio/MReadRflFile.cc, mraw/MRawCrateData.cc, mraw/MRawEvtData.cc,
+     mraw/MRawEvtHeader.cc, mraw/MRawRunHeader.cc:
+     - fixed conversion for istream::read from Byte_t* to char*
+
+   * mreflector/MRflEvtData.cc, mreflector/MRflSinglePhoton.cc:
+     - fixed definition of Print
+
 
  2003/06/13: Robert Wagner
Index: trunk/MagicSoft/Mars/Makefile.conf.linux
===================================================================
--- trunk/MagicSoft/Mars/Makefile.conf.linux	(revision 2172)
+++ trunk/MagicSoft/Mars/Makefile.conf.linux	(revision 2173)
@@ -20,5 +20,6 @@
 #  ----->>>   settings for compilation
 #
-OPTIM    = -O5 -Wall -fnonnull-objects -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual
+OPTIM    = -O5 -Wall -fno-exceptions -fPIC -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Woverloaded-virtual
+# ggc 3.2: removed -fnonnull-objects -Wtraditional -Wnested-externs
 DEBUG    = 
 ARCHDEF  = -D__LINUX__
Index: trunk/MagicSoft/Mars/macros/readMagic.C
===================================================================
--- trunk/MagicSoft/Mars/macros/readMagic.C	(revision 2172)
+++ trunk/MagicSoft/Mars/macros/readMagic.C	(revision 2173)
@@ -46,5 +46,5 @@
 }
 
-void readMagic(const char *fname="~/data/Gamma_0_7*.root")
+void readMagic(const char *fname="~/Proton_zbin0_0_7_11650to11659_w0.root")
 {
     MParList plist;
Index: trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc	(revision 2173)
@@ -67,5 +67,5 @@
 #include "MBlindPixelCalc.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include "MLog.h"
@@ -83,4 +83,6 @@
 
 ClassImp(MBlindPixelCalc);
+
+using namespace std;
 
 static const TString gsDefName  = "MBlindPixelCalc";
Index: trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.cc	(revision 2173)
@@ -43,4 +43,6 @@
 
 ClassImp(MCT1PointingCorrCalc);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/manalysis/MCT1SupercutsCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCT1SupercutsCalc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MCT1SupercutsCalc.cc	(revision 2173)
@@ -31,5 +31,5 @@
 
 #include <math.h>
-#include <fstream.h>
+#include <fstream>
 
 #include "MLog.h"
@@ -45,4 +45,6 @@
 
 ClassImp(MCT1SupercutsCalc);
+
+using namespace std;
 
 void MCT1SupercutsCalc::InitParams()
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotAnal.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotAnal.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotAnal.cc	(revision 2173)
@@ -54,4 +54,6 @@
 ClassImp(MCerPhotAnal);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
@@ -178,5 +180,5 @@
 
 	sigmaped /= (fRawEvt->GetNumHiGainSamples()-5);
-	sigmaped = sqrt(sumlocal);
+	sigmaped = sqrt((float)sumlocal);
 
 	const UInt_t pixid = pixel.GetPixelId();
@@ -195,6 +197,6 @@
         fCerPhotEvt->AddPixel(pixid, nphot, sigmaped/2.236);
 	ped.SetPedestal(pedes, sigmaped);
-	ped.SetPedestalRms(sigmaped/sqrt(fRawEvt->GetNumHiGainSamples()-5),
-			   sigmaped/sqrt(2*(fRawEvt->GetNumHiGainSamples()-5)));
+	ped.SetPedestalRms(sigmaped/sqrt(fRawEvt->GetNumHiGainSamples()-5.),
+			   sigmaped/sqrt(2.*(fRawEvt->GetNumHiGainSamples()-5)));
 
         // FIXME! Handling of Lo Gains is missing!
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc	(revision 2173)
@@ -57,4 +57,6 @@
 ClassImp(MCerPhotCalc);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc	(revision 2173)
@@ -28,5 +28,5 @@
 #include <math.h>
 #include <limits.h>
-#include <fstream.h>
+#include <fstream>
 
 #include <TCanvas.h>
@@ -37,4 +37,6 @@
 
 ClassImp(MCerPhotEvt);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotPix.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotPix.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotPix.cc	(revision 2173)
@@ -29,4 +29,6 @@
 ClassImp(MCerPhotPix);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/manalysis/MCompProbCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCompProbCalc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MCompProbCalc.cc	(revision 2173)
@@ -46,4 +46,6 @@
 
 ClassImp(MCompProbCalc);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/manalysis/MCurrents.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCurrents.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MCurrents.cc	(revision 2173)
@@ -36,4 +36,6 @@
 
 ClassImp(MCurrents);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/manalysis/MCurrents.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCurrents.h	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MCurrents.h	(revision 2173)
@@ -27,5 +27,5 @@
     UInt_t GetCurrent(Int_t i) const { return (*this)[i]; }
     UInt_t &operator[](Int_t i) { return (UInt_t&)fArray[i]; }
-    const UInt_t &operator[](Int_t i) const { return ((TArrayI)fArray)[i]; }
+    const UInt_t &operator[](Int_t i) const { return (*this)[i]; }
 
     UInt_t GetMin() const;
Index: trunk/MagicSoft/Mars/manalysis/MEnergyEst.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MEnergyEst.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MEnergyEst.cc	(revision 2173)
@@ -39,4 +39,6 @@
 ClassImp(MEnergyEst);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/manalysis/MEnergyEstParam.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MEnergyEstParam.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MEnergyEstParam.cc	(revision 2173)
@@ -46,4 +46,6 @@
 ClassImp(MEnergyEstParam);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
@@ -284,5 +286,5 @@
 }
 
-void MEnergyEstParam::Print(Option_t *opt)
+void MEnergyEstParam::Print(Option_t *opt) const
 {
     for (int i=0; i<fA.GetSize(); i++)
Index: trunk/MagicSoft/Mars/manalysis/MEnergyEstParam.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MEnergyEstParam.h	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MEnergyEstParam.h	(revision 2173)
@@ -61,5 +61,5 @@
     Double_t GetCoeff(Int_t i) { return i<fA.GetSize()? fA[i] : fB[i-fA.GetSize()]; }
 
-    void Print(Option_t *o=NULL);
+    void Print(Option_t *o=NULL) const;
 
     ClassDef(MEnergyEstParam, 0) // Task to estimate the energy
Index: trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.cc	(revision 2173)
@@ -45,4 +45,7 @@
 ClassImp(MEnergyEstimate);
 
+using namespace std;
+
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/manalysis/MFiltercutsCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MFiltercutsCalc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MFiltercutsCalc.cc	(revision 2173)
@@ -47,4 +47,6 @@
 
 ClassImp(MFiltercutsCalc);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/manalysis/MHadronness.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHadronness.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MHadronness.cc	(revision 2173)
@@ -39,4 +39,6 @@
 ClassImp(MHadronness);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc	(revision 2173)
@@ -53,4 +53,6 @@
 
 ClassImp(MMcPedestalCopy);
+
+using namespace std;
 
 MMcPedestalCopy::MMcPedestalCopy(const char *name, const char *title)
@@ -136,8 +138,8 @@
 
         const Float_t pedest = fMcPed->GetPedestal(i);
-        const Float_t pedrms = pedest/sqrt(num);
+        const Float_t pedrms = pedest/sqrt((float)num);
 
         const Float_t sigma  = fMcPed->GetPedestalRms(i);
-        const Float_t sigrms = sigma/sqrt(num*2);
+        const Float_t sigrms = sigma/sqrt(num*2.);
 
 	pix.SetPedestal(pedest, sigma);
Index: trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc	(revision 2173)
@@ -70,4 +70,6 @@
 ClassImp(MMcPedestalNSBAdd);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.cc	(revision 2173)
@@ -56,6 +56,7 @@
 #include <TCanvas.h>
 
-
-ClassImp(MMcTriggerLvl2)
+ClassImp(MMcTriggerLvl2);
+
+using namespace std;
 
 // ---------------------------
Index: trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.cc	(revision 2173)
@@ -49,6 +49,7 @@
 #include "MGeomCam.h"
 
+ClassImp(MMcTriggerLvl2Calc);
 
-ClassImp(MMcTriggerLvl2Calc);
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.cc	(revision 2173)
@@ -45,5 +45,5 @@
 #include "MMultiDimDistCalc.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include "MHMatrix.h" // must be before MLogManip.h
@@ -59,4 +59,6 @@
 
 ClassImp(MMultiDimDistCalc);
+
+using namespace std;
 
 static const TString gsDefName  = "MMultiDimDistCalc";
@@ -176,6 +178,6 @@
     *fData >> event;
 
-    Double_t numg = fNum;
-    Double_t numh = fNum;
+    Int_t numg = fNum;
+    Int_t numh = fNum;
     if (fNum==0)
     {
Index: trunk/MagicSoft/Mars/manalysis/MPadding.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MPadding.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MPadding.cc	(revision 2173)
@@ -98,4 +98,6 @@
 ClassImp(MPadding);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/manalysis/MParameters.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MParameters.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MParameters.cc	(revision 2173)
@@ -35,5 +35,5 @@
 #include "MParameters.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include "MLog.h"
@@ -43,4 +43,6 @@
 ClassImp(MParameterI);
 //ClassImp(MParameter);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/manalysis/MPedCalcPedRun.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MPedCalcPedRun.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MPedCalcPedRun.cc	(revision 2173)
@@ -50,4 +50,6 @@
 
 ClassImp(MPedCalcPedRun);
+
+using namespace std;
 
 MPedCalcPedRun::MPedCalcPedRun(const char *name, const char *title)
@@ -135,5 +137,5 @@
 Float_t MPedCalcPedRun::CalcHiGainMeanErr(Float_t higainrms) const
 {
-    return higainrms/sqrt(fNumHiGainSamples);
+    return higainrms/sqrt((float)fNumHiGainSamples);
 }
 
Index: trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc	(revision 2173)
@@ -40,6 +40,7 @@
 #include "MGeomCam.h"
 
+ClassImp(MPedestalCam);
 
-ClassImp(MPedestalCam);
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/manalysis/MSigmabar.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSigmabar.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MSigmabar.cc	(revision 2173)
@@ -55,4 +55,6 @@
 ClassImp(MSigmabar);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/manalysis/MSigmabarCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSigmabarCalc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MSigmabarCalc.cc	(revision 2173)
@@ -50,4 +50,6 @@
 
 ClassImp(MSigmabarCalc);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/manalysis/MSigmabarParam.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSigmabarParam.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MSigmabarParam.cc	(revision 2173)
@@ -46,4 +46,6 @@
 ClassImp(MSigmabarParam);
 
+using namespace std;
+
 MSigmabarParam::MSigmabarParam(const char *name, const char *title) : fSigmabarMin(0), fSigmabarMax(0), fMjdMin(0), fMjdMax(0), fThetaMin(0), fThetaMax(0), fRunNumber(0)
 {
@@ -73,5 +75,5 @@
 }
 
-void MSigmabarParam::Print()
+void MSigmabarParam::Print(Option_t *) const
 {
   *fLog << endl << "Run " << fRunNumber << " | " 
Index: trunk/MagicSoft/Mars/manalysis/MSigmabarParam.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSigmabarParam.h	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MSigmabarParam.h	(revision 2173)
@@ -33,5 +33,5 @@
   Double_t GetThetaMax() const { return fThetaMax; }
 
-  void Print();
+  void Print(Option_t *o="") const;
       
   ClassDef(MSigmabarParam, 1)  // Storage container for characterizing a distribution of events in the Sigmabar-Theta plane
Index: trunk/MagicSoft/Mars/manalysis/MSrcPosCam.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSrcPosCam.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/manalysis/MSrcPosCam.cc	(revision 2173)
@@ -34,5 +34,5 @@
 #include "MSrcPosCam.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include "MLog.h"
@@ -40,4 +40,6 @@
 
 ClassImp(MSrcPosCam);
+
+using namespace std;
 
 static const TString gsDefName  = "MSrcPosCam";
Index: trunk/MagicSoft/Mars/mars.cc
===================================================================
--- trunk/MagicSoft/Mars/mars.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mars.cc	(revision 2173)
@@ -14,4 +14,6 @@
 #include "MLogo.h"
 #endif
+
+using namespace std;
 
 // **********************************************************************
Index: trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 2173)
@@ -10,6 +10,4 @@
 #pragma link C++ global kRad2Deg;
 //#pragma link C++ global kPI;
-
-#pragma link C++ function __omanip_debug;
 
 #pragma link C++ global gLog;
Index: trunk/MagicSoft/Mars/mbase/MClone.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MClone.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/MClone.cc	(revision 2173)
@@ -58,4 +58,6 @@
 
 ClassImp(MClone);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mbase/MContinue.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MContinue.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/MContinue.cc	(revision 2173)
@@ -50,4 +50,6 @@
 
 ClassImp(MContinue);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 2173)
@@ -70,6 +70,5 @@
 
 #include <time.h>           // time_t
-#include <fstream.h>        // ofstream, SavePrimitive
-#include <iostream.h>
+#include <fstream>          // ofstream, SavePrimitive
 
 #include <TTime.h>          // TTime
@@ -91,4 +90,6 @@
 
 ClassImp(MEvtLoop);
+
+using namespace std;
 
 
Index: trunk/MagicSoft/Mars/mbase/MGList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MGList.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/MGList.cc	(revision 2173)
@@ -35,5 +35,5 @@
 #include "MGList.h"
 
-#include <iostream.h>
+#include <iostream>
 
 #include <TClass.h>
@@ -42,6 +42,7 @@
 #include <TGPicture.h>
 
-
 ClassImp(MGList);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
@@ -149,4 +150,5 @@
     if (IsExisting(obj))
     {
+        // FIXME: Replace by gLog
         const Int_t id = GetWidget(obj)->WidgetId();
         cout << "Widget with id #" << id << " (";
Index: trunk/MagicSoft/Mars/mbase/MGTask.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MGTask.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/MGTask.cc	(revision 2173)
@@ -41,4 +41,6 @@
 
 ClassImp(MGTask);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mbase/MLog.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 2173)
@@ -97,5 +97,5 @@
 
 #include <stdlib.h>     // mkstempe
-#include <fstream.h>
+#include <fstream>
 #ifdef _REENTRANT
 #include <pthread.h>
@@ -106,4 +106,6 @@
 
 ClassImp(MLog);
+
+using namespace std;
 
 // root 3.02:
@@ -210,10 +212,12 @@
 // copyt constructor
 //
-MLog::MLog(MLog &log)
-{
-    fOutputLevel = log.fOutputLevel;
-    fDebugLevel  = log.fDebugLevel;
-    fDevice      = log.fDevice;
-}
+/*
+MLog::MLog(MLog const& log)
+{
+//    fOutputLevel = log.fOutputLevel;
+//    fDebugLevel  = log.fDebugLevel;
+//    fDevice      = log.fDevice;
+}
+*/
 
 void MLog::Underline()
@@ -447,6 +451,7 @@
 void MLog::AllocateFile(const char *fname)
 {
+    // gcc 3.2:
     char *txt = (char*)"logXXXXXX";
-    fout = fname ? new ofstream(fname) : new ofstream(mkstemp(txt));
+    fout = fname ? new ofstream(fname) : new ofstream(/*mkstemp(*/txt/*)*/);
     fOutAllocated = kTRUE;
 }
Index: trunk/MagicSoft/Mars/mbase/MLog.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLog.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/MLog.h	(revision 2173)
@@ -9,10 +9,5 @@
 #endif
 
-#ifndef __CINT__
-#include <iostream.h>  // base classes for MLog
-#else
-class streambuf;
-class ostream;
-#endif
+#include <iostream>  // base classes for MLog
 
 #define bsz    160 // two standard lines
@@ -20,5 +15,5 @@
 class TGTextView;
 
-class MLog : public streambuf, public ostream, public TObject
+class MLog : public std::streambuf, public std::ostream, public TObject
 {
 public:
@@ -94,5 +89,10 @@
     MLog(const char *fname, int flag=-1);
 
-    MLog(MLog &log);
+    MLog(MLog const& log) : ostream((std::streambuf*)&log)
+    {
+        fOutputLevel = log.fOutputLevel;
+        fDebugLevel  = log.fDebugLevel;
+        fDevice      = log.fDevice;
+    }
     ~MLog();
 
@@ -186,5 +186,5 @@
         const int save = fOutputLevel;
         SetOutputLevel(outlvl);
-        (*this) << str << endl;
+        (*this) << str << std::endl;
         fOutputLevel = save;
     }
Index: trunk/MagicSoft/Mars/mbase/MLogManip.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLogManip.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/MLogManip.cc	(revision 2173)
@@ -25,5 +25,5 @@
 #include "MLog.h"
 #include "MLogManip.h"
-
+/*
 // ----------------------------------------------------------------
 //            Definitions of the manipulator functions
@@ -124,3 +124,3 @@
     return lout;
 }
-
+*/
Index: trunk/MagicSoft/Mars/mbase/MLogManip.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLogManip.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/MLogManip.h	(revision 2173)
@@ -2,59 +2,83 @@
 #define MARS_MLogManip
 
-#include <iomanip.h>
+#include <iomanip>
 
-// ----------------------------------------------------------------
-//                 Definitions of the manipulators
-// ----------------------------------------------------------------
+#include "MLog.h"
 
-//
-// define a general simple macro for manipulator definitions (int)
-//
-#define MANIPULATOR0(name) \
-   extern ostream& ##name(ostream& lout);
+// --------------------- simple manipulators -----------------------
 
-#ifndef OMANIP
-   #define MANIPULATOR1(name) \
-      extern ostream& __omanip_##name(ostream& lout, int i); \
-      inline omanip<int> ##name(int i)                \
-      {                                               \
-         return omanip<int>(__omanip_##name, i);     \
-      }
+enum MLogManip {
+    underline
+};
 
-#else
-   #define MANIPULATOR1(name) \
-       extern ostream& __omanip_##name(ostream& lout, int i); \
-       inline OMANIP(int) ##name(int i)                \
-       {                                               \
-          return OMANIP(int)(__omanip_##name, i);      \
-       }
+inline std::ostream &operator<<(std::ostream &lout, MLogManip u)
+{
+    MLog *log=/*<dynamic_cast>*/(MLog*)lout.rdbuf();
+    if (log)
+        log->Underline();
+    return lout;
+}
 
-#endif
 
-//
-// definitions
-//
-MANIPULATOR0(underline); // underline output
-MANIPULATOR1(debug);     // set debug level
-MANIPULATOR1(device);    // set ouput devices
-MANIPULATOR1(edev);      // enable additional output devices
-MANIPULATOR1(ddev);      // disable given output
-//#ifndef __CINT__
-//__DEFINE_IOMANIP_FN1(smanip, int, debug);    // set debug level
-//__DEFINE_IOMANIP_FN1(smanip, int, device);   // set ouput devices
-//__DEFINE_IOMANIP_FN1(smanip, int, edev);     // enable additional output devices
-//__DEFINE_IOMANIP_FN1(smanip, int, ddev);     // disable given output
-//#endif
+// ----------------------------- debug -----------------------------
 
-// ----------------------------------------------------------------
-//                         Debug helper macros
-// ----------------------------------------------------------------
+struct _Debug { int level; };
 
-//
-// Output debug information into the stream
-//  - this can only be done by a macro
-//
+inline _Debug debug(int level)
+{
+    _Debug d;
+    d.level = level;
+    return d;
+}
+
+inline std::ostream &operator<<(std::ostream &lout, _Debug d)
+{
+    MLog *log=/*<dynamic_cast>*/(MLog*)lout.rdbuf();
+    if (log)
+        log->SetOutputLevel(d.level);
+    return lout;
+}
+
+// ------------------------------- edev ----------------------------
+
+struct _EnableDev { MLog::_flags dev; };
+
+inline _EnableDev edev(MLog::_flags i)
+{
+    _EnableDev e;
+    e.dev = i;
+    return e;
+}
+
+inline std::ostream &operator<<(std::ostream &lout, _EnableDev e)
+{
+    MLog *log=/*<dynamic_cast>*/(MLog*)lout.rdbuf();
+    if (log)
+        log->EnableOutputDevice(e.dev);
+    return lout;
+}
+
+// ------------------------------- sdev ----------------------------
+
+struct _DisableDev { MLog::_flags dev; };
+
+inline _DisableDev ddev(MLog::_flags i)
+{
+    _DisableDev d;
+    d.dev = i;
+    return d;
+}
+
+inline std::ostream &operator<<(std::ostream &lout, _DisableDev d)
+{
+    MLog *log=/*<dynamic_cast>*/(MLog*)lout.rdbuf();
+    if (log)
+        log->EnableOutputDevice(d.dev);
+    return lout;
+}
+
+// ------------------------------ Macros ---------------------------
+
 #ifndef __CINT__
-//#define dbginf dbg << __FILE__ << " l." << dec << __LINE__ << ": "
 #define dbginf __FILE__ << " l." << dec << __LINE__ << ": "
 #define all    debug(0) // use this for output in any case
@@ -64,35 +88,4 @@
 #define dbg    debug(4) // use this for debug messages (blue)
 #endif
-//
-// flush the old buffer, set a new debug level
-// and output the debug information code
-//
-// Be careful: Only use them with a MLogging stream facility.
-// Remark:     All this is compiled into the code.
-//
-/*
-#ifndef __CINT__
-#define DEBUG(lvl)  flush << debug(lvl) << dbginf
-#endif
-*/
-/*
-class SMANIP(T) {
-    ios& (*fct)(ios&,T) ;
-    T arg ;
-public:
-    SMANIP(T)(ios& (*f)(ios&, T), T a) :
-        fct(f), arg(a) { }
-        friend istream& operator>>(istream& i, const SMANIP(T)& m)
-        {
-            ios* s = &i ;
-            (*m.fct)(*s,m.arg) ; return i ;
-        }
-        friend ostream& operator<<(ostream& o, const SMANIP(T)& m)
-        {
-            ios* s = &o ;
-            (*m.fct)(*s,m.arg) ; return o ;
-        }
-} ;
-*/
 
 #endif
Index: trunk/MagicSoft/Mars/mbase/MParContainer.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 2173)
@@ -38,5 +38,5 @@
 
 #include <ctype.h>        // isdigit
-#include <fstream.h>      // ofstream, AsciiWrite
+#include <fstream>        // ofstream, AsciiWrite
 
 #include <TEnv.h>         // Env::Lookup
@@ -58,4 +58,6 @@
 
 ClassImp(MParContainer);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mbase/MParContainer.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 2173)
@@ -20,6 +20,8 @@
 #endif
 
-class ofstream;
-class ifstream;
+// gcc 3.2
+#include <iosfwd>
+//class ofstream;
+//class ifstream;
 
 class TEnv;
Index: trunk/MagicSoft/Mars/mbase/MParList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 2173)
@@ -41,5 +41,5 @@
 #include "MParList.h"
 
-#include <fstream.h>     // ofstream, SavePrimitive
+#include <fstream>     // ofstream, SavePrimitive
 
 #include <TNamed.h>
@@ -53,4 +53,6 @@
 
 ClassImp(MParList);
+
+using namespace std;
 
 static const TString gsDefName  = "MParList";
Index: trunk/MagicSoft/Mars/mbase/MPrint.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MPrint.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/MPrint.cc	(revision 2173)
@@ -46,4 +46,6 @@
 
 ClassImp(MPrint);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mbase/MTask.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 2173)
@@ -68,5 +68,5 @@
 #include "MTask.h"
 
-#include <fstream.h>
+#include <fstream>
 #include <TBaseClass.h>
 
@@ -79,4 +79,6 @@
 
 ClassImp(MTask);
+
+using namespace std;
 
 MTask::MTask(const char *name, const char *title)
Index: trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc	(revision 2173)
@@ -36,6 +36,4 @@
 #include "MTaskInteractive.h"
 
-#include <iostream.h>
-
 #include <Api.h>
 #include <TMethodCall.h>
@@ -45,4 +43,6 @@
 
 ClassImp(MTaskInteractive);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mbase/MTaskList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 2173)
@@ -57,5 +57,5 @@
 #include "MTaskList.h"
 
-#include <fstream.h>        // ofstream, SavePrimitive
+#include <fstream>        // ofstream, SavePrimitive
 
 #include <TClass.h>
@@ -73,4 +73,6 @@
 
 ClassImp(MTaskList);
+
+using namespace std;
 
 const TString MTaskList::gsDefName  = "MTaskList";
Index: trunk/MagicSoft/Mars/mbase/MTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 2173)
@@ -33,9 +33,11 @@
 #include "MTime.h"
 
-#include <iomanip.h>
+#include <iomanip>
 
 #include "MLog.h"
 
 ClassImp(MTime);
+
+using namespace std;
 
 void MTime::Print(Option_t *) const
Index: trunk/MagicSoft/Mars/mdata/DataIncl.h
===================================================================
--- trunk/MagicSoft/Mars/mdata/DataIncl.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mdata/DataIncl.h	(revision 2173)
@@ -1,5 +1,5 @@
 #ifndef __CINT__
 
-#include <fstream.h>
+//#include <fstream>
 
 #include <TFile.h>
Index: trunk/MagicSoft/Mars/mdata/MData.cc
===================================================================
--- trunk/MagicSoft/Mars/mdata/MData.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mdata/MData.cc	(revision 2173)
@@ -63,9 +63,11 @@
 #include "MData.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include "MLog.h"
 
 ClassImp(MData);
+
+using namespace std;
 
 Bool_t MData::AsciiWrite(ostream &out) const
Index: trunk/MagicSoft/Mars/mdata/MDataArray.cc
===================================================================
--- trunk/MagicSoft/Mars/mdata/MDataArray.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mdata/MDataArray.cc	(revision 2173)
@@ -33,5 +33,5 @@
 #include "MDataArray.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include <TVector.h>
@@ -43,4 +43,6 @@
 
 ClassImp(MDataArray);
+
+using namespace std;
 
 static const TString gsDefName  = "MDataArray";
@@ -194,5 +196,5 @@
 void MDataArray::GetData(TVector &v) const
 {
-    Double_t ncols = GetNumEntries();
+    Int_t ncols = GetNumEntries();
 
     v.ResizeTo(ncols);
Index: trunk/MagicSoft/Mars/mdata/MDataChain.cc
===================================================================
--- trunk/MagicSoft/Mars/mdata/MDataChain.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mdata/MDataChain.cc	(revision 2173)
@@ -126,4 +126,6 @@
 
 ClassImp(MDataChain);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
@@ -543,8 +545,8 @@
     case kERad2Deg:  return val*180/TMath::Pi();
     case kEDeg2Rad:  return val*TMath::Pi()/180;
-    case kERandom:   return gRandom ? gRandom->Uniform(val)   : 0;
-    case kERandomP:  return gRandom ? gRandom->Poisson(val)   : 0;
-    case kERandomE:  return gRandom ? gRandom->Exp(val)       : 0;
-    case kERandomI:  return gRandom ? gRandom->Integer(val)   : 0;
+    case kERandom:   return gRandom ? gRandom->Uniform(val)      : 0;
+    case kERandomP:  return gRandom ? gRandom->Poisson(val)      : 0;
+    case kERandomE:  return gRandom ? gRandom->Exp(val)          : 0;
+    case kERandomI:  return gRandom ? gRandom->Integer((int)val) : 0;
     case kERandomG:  return gRandom ? gRandom->Gaus(0, val)   : 0;
     case kERandomL:  return gRandom ? gRandom->Landau(0, val) : 0;
Index: trunk/MagicSoft/Mars/mdata/MDataElement.cc
===================================================================
--- trunk/MagicSoft/Mars/mdata/MDataElement.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mdata/MDataElement.cc	(revision 2173)
@@ -38,5 +38,5 @@
 #include "MDataElement.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include "MHMatrix.h"
@@ -48,4 +48,6 @@
 
 ClassImp(MDataElement);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mdata/MDataList.cc
===================================================================
--- trunk/MagicSoft/Mars/mdata/MDataList.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mdata/MDataList.cc	(revision 2173)
@@ -36,4 +36,6 @@
 ClassImp(MDataList);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mdata/MDataMember.cc
===================================================================
--- trunk/MagicSoft/Mars/mdata/MDataMember.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mdata/MDataMember.cc	(revision 2173)
@@ -38,5 +38,5 @@
 #include "MDataMember.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include <TMethodCall.h>
@@ -48,4 +48,6 @@
 
 ClassImp(MDataMember);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mdata/MDataValue.cc
===================================================================
--- trunk/MagicSoft/Mars/mdata/MDataValue.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mdata/MDataValue.cc	(revision 2173)
@@ -38,4 +38,6 @@
 ClassImp(MDataValue);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mdatacheck/MDumpEvtHeader.cc
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/MDumpEvtHeader.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mdatacheck/MDumpEvtHeader.cc	(revision 2173)
@@ -51,4 +51,6 @@
 ClassImp(MDumpEvtHeader);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mdatacheck/MGDisplayAdc.cc
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/MGDisplayAdc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mdatacheck/MGDisplayAdc.cc	(revision 2173)
@@ -27,5 +27,5 @@
 
 #include <stdlib.h>              // mkstemp
-#include <iostream.h>            // cout for debugging
+#include <iostream>              // cout for debugging
 
 #include <TSystem.h>             // gSystem
@@ -39,4 +39,6 @@
 
 #include "MHFadcCam.h"
+
+using namespace std;
 
 enum ComIdentDisplayAdc
Index: trunk/MagicSoft/Mars/merpp.cc
===================================================================
--- trunk/MagicSoft/Mars/merpp.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/merpp.cc	(revision 2173)
@@ -16,4 +16,6 @@
 #include "MRawCrateArray.h"
 #include "MInputStreamID.h"
+
+using namespace std;
 
 //////////////////////////////////////////////////////////////////////////////
Index: trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.cc	(revision 2173)
@@ -49,4 +49,5 @@
 #include "MReadMarsFile.h"
 #include "MGeomCamMagic.h"
+#include "MRawEvtData.h"
 #include "MRawEvtHeader.h"
 
@@ -536,12 +537,25 @@
 //  and updates the display
 //
-void MGEvtDisplay::ReadinEvent()
-{
-    if (GetTaskList()->Process())
+void MGEvtDisplay::ReadinEvent(Int_t dir)
+{
+    MRawEvtData *raw = (MRawEvtData*)GetParList()->FindObject("MRawEvtData");
+    if (!raw)
+        return;
+    do
     {
+        if (dir<0 && !GetReader()->DecEventNum())
+            return;
+        if (dir>0 && !GetReader()->IncEventNum())
+            return;
+
+        if (!GetTaskList()->Process())
+            return;
+
         GetReader()->DecEventNum();
-        UpdateMcLabel();
-        UpdateDisplay();
-    }
+
+    } while (raw->GetNumPixels()<1);
+
+    UpdateMcLabel();
+    UpdateDisplay();
 
     fTxtEvtNr->SetText(Form("%d", GetReader()->GetNumEntry()+1));
@@ -645,11 +659,9 @@
             {
             case kEvtPrev:
-                if (GetReader()->DecEventNum())
-                    ReadinEvent();
+                ReadinEvent(-1);
                 return kTRUE;
 
             case kEvtNext:
-                if (GetReader()->IncEventNum())
-                    ReadinEvent();
+                ReadinEvent(+1);
                 return kTRUE;
             }
Index: trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.h	(revision 2172)
+++ trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.h	(revision 2173)
@@ -44,5 +44,5 @@
 
     void SaveAsDialog() const;
-    void ReadinEvent();
+    void ReadinEvent(Int_t dir=0);
 
     Bool_t fInitOk;
Index: trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc
===================================================================
--- trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc	(revision 2173)
@@ -27,5 +27,5 @@
 #include <limits.h>               // INT_MAX
 #include <stdlib.h>               // atoi
-#include <iostream.h>             // cout for debugging
+#include <iostream>               // cout for debugging
 
 #include <TList.h>                // TList
@@ -51,4 +51,6 @@
 
 ClassImp(MGFadcDisp);
+
+using namespace std;
 
 enum MGFadcDispCommand
Index: trunk/MagicSoft/Mars/mfileio/MCT1ReadAscii.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MCT1ReadAscii.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfileio/MCT1ReadAscii.cc	(revision 2173)
@@ -16,8 +16,8 @@
 !
 !
-!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
-!   Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
-!
-!   Copyright: MAGIC Software Development, 2000-2002
+!   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,5 +41,5 @@
 #include "MCT1ReadAscii.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include <TList.h>
@@ -56,4 +56,6 @@
 
 ClassImp(MCT1ReadAscii);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc	(revision 2173)
@@ -16,5 +16,5 @@
 !
 !
-!   Author(s): Thomas Bretz 11/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Thomas Bretz, 11/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
 !   Copyright: MAGIC Software Development, 2000-2003
@@ -47,5 +47,5 @@
 #include "MCT1ReadPreProc.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include <TList.h>
@@ -85,4 +85,6 @@
 
 ClassImp(MCT1ReadPreProc);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
@@ -469,5 +471,5 @@
     }
 
-    fIn->read((Byte_t*)&outpars, sizeof(struct outputpars));
+    fIn->read((char*)&outpars, sizeof(struct outputpars));
 
     ProcessRunHeader(outpars);
@@ -509,5 +511,5 @@
 
     struct filterresults filterres;
-    fIn->read((Byte_t*)&filterres, sizeof(struct filterresults));
+    fIn->read((char*)&filterres, sizeof(struct filterresults));
     /*
      int   imax_alt_arcs;            // maximum altitude reached during the run
@@ -996,5 +998,5 @@
 		 0, /* uiPco */
 		 0, /* uiPelS */
-                 fIsMcFile ? event.fmcsize_phel : 0, /* uiPelC, Simulated SIZE */
+                 (int)(fIsMcFile ? event.fmcsize_phel : 0), /* uiPelC, Simulated SIZE */
 		 0, /* elec */
 		 0, /* muon */
@@ -1134,5 +1136,5 @@
 
     // read the eventrecord from the file
-    fIn->read((Byte_t*)&event, sizeof(struct eventrecord));
+    fIn->read((char*)&event, sizeof(struct eventrecord));
 
     switch (ProcessEvent(event))
Index: trunk/MagicSoft/Mars/mfileio/MChain.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MChain.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfileio/MChain.cc	(revision 2173)
@@ -16,7 +16,7 @@
 !
 !
-!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2002
+!   Copyright: MAGIC Software Development, 2000-2003
 !
 !
Index: trunk/MagicSoft/Mars/mfileio/MChain.h
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MChain.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mfileio/MChain.h	(revision 2173)
@@ -15,5 +15,5 @@
     MChain(const char *name, const char *title="") : TChain(name, title), fNotified(kFALSE) {}
 
-    void ResetTree() { fTree = 0; }
+    void ResetTree() { fTree = 0; fTreeNumber = -1; }
 
     virtual Bool_t Notify() { fNotified = kTRUE; return kTRUE; }
Index: trunk/MagicSoft/Mars/mfileio/MRead.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MRead.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfileio/MRead.cc	(revision 2173)
@@ -16,7 +16,7 @@
 !
 !
-!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2002
+!   Copyright: MAGIC Software Development, 2000-2003
 !
 !
@@ -41,4 +41,6 @@
 
 ClassImp(MRead);
+
+using namespace std;
 
 Bool_t MRead::Rewind()
Index: trunk/MagicSoft/Mars/mfileio/MReadCurrents.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadCurrents.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfileio/MReadCurrents.cc	(revision 2173)
@@ -37,5 +37,5 @@
 
 #include <stdlib.h>  // atoi
-#include <fstream.h>
+#include <fstream>
 
 #include <TList.h>
@@ -51,4 +51,6 @@
 
 ClassImp(MReadCurrents);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc	(revision 2173)
@@ -16,7 +16,7 @@
 !
 !
-!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2002
+!   Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
 !
 !
@@ -33,5 +33,4 @@
 //                                                                         //
 /////////////////////////////////////////////////////////////////////////////
-
 #include "MReadMarsFile.h"
 
@@ -48,4 +47,6 @@
 
 ClassImp(MReadMarsFile);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mfileio/MReadRflFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadRflFile.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfileio/MReadRflFile.cc	(revision 2173)
@@ -32,5 +32,5 @@
 #include "MReadRflFile.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include <TSystem.h>
@@ -47,4 +47,6 @@
 
 ClassImp(MReadRflFile);
+
+using namespace std;
 
 // ------------------------------------------------
@@ -70,6 +72,6 @@
     {
         RflEventHeader_old revth;
-        fIn->read(&revth, sizeof(RflEventHeader_old));
-        fEvtHeader->SetEvtNumber(revth.EvtNumber);
+        fIn->read((char*)&revth, sizeof(RflEventHeader_old));
+        fEvtHeader->SetEvtNumber((int)revth.EvtNumber);
 //        *fLog << "Event Number: " << revth.EvtNumber;
 //        *fLog << "  Primary ID: " << revth.PrimaryID;
@@ -80,6 +82,6 @@
     {
         RflEventHeader revth;
-        fIn->read(&revth, sizeof(RflEventHeader));
-        fEvtHeader->SetEvtNumber(revth.EvtNumber);
+        fIn->read((char*)&revth, sizeof(RflEventHeader));
+        fEvtHeader->SetEvtNumber((int)revth.EvtNumber);
 //        *fLog << "Event Number: " << revth.EvtNumber;
 //        *fLog << "  Primary ID: " << revth.PrimaryID;
@@ -178,10 +180,10 @@
         {
             RflRunHeader rrunh;
-            fIn->read(&rrunh, sizeof(RflRunHeader));
+            fIn->read((char*)&rrunh, sizeof(RflRunHeader));
             if (*fIn)
             {
                 *fLog << inf << "FIXME: Call ReInit" << endl;
 
-                fRunHeader->SetRunNumber(rrunh.RunNumber);
+                fRunHeader->SetRunNumber((int)rrunh.RunNumber);
                 *fLog << underline << "RunHeader:" << endl;
                 *fLog << " Run Number:   " << rrunh.RunNumber << endl;
Index: trunk/MagicSoft/Mars/mfileio/MReadTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 2173)
@@ -16,7 +16,7 @@
 !
 !
-!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2002
+!   Copyright: MAGIC Software Development, 2000-2003
 !
 !
@@ -51,5 +51,5 @@
 #include "MReadTree.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include <TFile.h>           // TFile::GetName
@@ -68,4 +68,6 @@
 
 ClassImp(MReadTree);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mfileio/MWriteAsciiFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MWriteAsciiFile.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfileio/MWriteAsciiFile.cc	(revision 2173)
@@ -16,7 +16,7 @@
 !
 !
-!   Author(s): Thomas Bretz  06/2001 <mailto:tbretz@astro.uni-wuerzburg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2002
+!   Author(s): Thomas Bretz, 06/2001 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
 !
 !
@@ -48,5 +48,5 @@
 #include "MWriteAsciiFile.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include <TMethodCall.h> // TMethodCall, AsciiWrite
@@ -63,4 +63,6 @@
 
 ClassImp(MWriteAsciiFile);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mfileio/MWriteFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MWriteFile.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfileio/MWriteFile.cc	(revision 2173)
@@ -16,7 +16,7 @@
 !
 !
-!   Author(s): Thomas Bretz  06/2001 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Thomas Bretz, 6/2001 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2002
+!   Copyright: MAGIC Software Development, 2000-2003
 !
 !
@@ -37,5 +37,5 @@
 #include "MWriteFile.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include "MLog.h"
@@ -45,4 +45,6 @@
 
 ClassImp(MWriteFile);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 2173)
@@ -16,7 +16,7 @@
 !
 !
-!   Author(s): Thomas Bretz  06/2001 <mailto:tbretz@astro.uni-wuerzburg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2002
+!   Author(s): Thomas Bretz, 6/2001 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
 !
 !
@@ -36,5 +36,5 @@
 #include "MWriteRootFile.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include <TFile.h>
@@ -48,4 +48,6 @@
 ClassImp(MRootFileBranch);
 ClassImp(MWriteRootFile);
+
+using namespace std;
 
 static const TString gsDefName  = "MWriteRootFile";
Index: trunk/MagicSoft/Mars/mfilter/MF.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MF.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfilter/MF.cc	(revision 2173)
@@ -83,5 +83,5 @@
 #include <ctype.h>        // isalnum, ...
 #include <stdlib.h>       // strtod, ...
-#include <fstream.h>      // ofstream, ...
+#include <fstream>      // ofstream, ...
 
 #include <TMethodCall.h>
@@ -97,4 +97,6 @@
 
 ClassImp(MF);
+
+using namespace std;
 
 const TString MF::gsDefName  = "MF";
Index: trunk/MagicSoft/Mars/mfilter/MFAlpha.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFAlpha.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfilter/MFAlpha.cc	(revision 2173)
@@ -31,5 +31,5 @@
 
 #include <math.h>
-#include <fstream.h>
+#include <fstream>
 
 #include "MLog.h"
@@ -42,4 +42,5 @@
 ClassImp(MFAlpha);
 
+using namespace std;
 
 // --------------------------------------------------------------------------
@@ -62,5 +63,5 @@
 // --------------------------------------------------------------------------
 //
-void MFAlpha::Init(const char type, const Int_t val,
+void MFAlpha::Init(const char type, const Float_t val,
                    const char *name, const char *title)
 {
Index: trunk/MagicSoft/Mars/mfilter/MFAlpha.h
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFAlpha.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mfilter/MFAlpha.h	(revision 2173)
@@ -27,5 +27,5 @@
     Float_t fValue; // [deg]
 
-    void Init(const char type, const Int_t val,
+    void Init(const char type, const Float_t val,
               const char *name, const char *title);
 
Index: trunk/MagicSoft/Mars/mfilter/MFCT1SelBasic.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFCT1SelBasic.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfilter/MFCT1SelBasic.cc	(revision 2173)
@@ -57,4 +57,6 @@
 ClassImp(MFCT1SelBasic);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mfilter/MFCT1SelFinal.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFCT1SelFinal.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfilter/MFCT1SelFinal.cc	(revision 2173)
@@ -57,4 +57,6 @@
 
 ClassImp(MFCT1SelFinal);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mfilter/MFCT1SelStandard.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFCT1SelStandard.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfilter/MFCT1SelStandard.cc	(revision 2173)
@@ -58,4 +58,6 @@
 ClassImp(MFCT1SelStandard);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mfilter/MFDataChain.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFDataChain.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfilter/MFDataChain.cc	(revision 2173)
@@ -44,5 +44,5 @@
 #include "MFDataChain.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include <TMethodCall.h>
@@ -54,4 +54,6 @@
 
 ClassImp(MFDataChain);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mfilter/MFDataMember.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFDataMember.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfilter/MFDataMember.cc	(revision 2173)
@@ -44,5 +44,5 @@
 #include "MFDataMember.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include <TMethodCall.h>
@@ -54,4 +54,6 @@
 
 ClassImp(MFDataMember);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mfilter/MFEnergySlope.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFEnergySlope.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfilter/MFEnergySlope.cc	(revision 2173)
@@ -48,5 +48,5 @@
 #include "MFEnergySlope.h"
 
-#include <fstream.h>
+#include <fstream>
 #include <TRandom.h>
 
@@ -60,4 +60,6 @@
 
 ClassImp(MFEnergySlope);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mfilter/MFEventSelector.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFEventSelector.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfilter/MFEventSelector.cc	(revision 2173)
@@ -74,4 +74,6 @@
 ClassImp(MFEventSelector);
 
+using namespace std;
+
 static const TString gsDefName  = "MFEventSelector";
 static const TString gsDefTitle = "Filter to select events";
Index: trunk/MagicSoft/Mars/mfilter/MFEventSelector2.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFEventSelector2.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfilter/MFEventSelector2.cc	(revision 2173)
@@ -112,4 +112,6 @@
 
 ClassImp(MFEventSelector2);
+
+using namespace std;
 
 const TString MFEventSelector2::gsDefName  = "MFEventSelector2";
@@ -133,5 +135,5 @@
 //     would result in redistributing cos(Theta).
 //
-MFEventSelector2::MFEventSelector2(MH3 &hist, const char *name=NULL, const char *title=NULL)
+MFEventSelector2::MFEventSelector2(MH3 &hist, const char *name, const char *title)
 : fHistOrig(NULL), fHistNom(&hist), fHistRes(NULL),
   fDataX(hist.GetRule('x')), fDataY(hist.GetRule('y')),
@@ -178,5 +180,5 @@
 // Reading task of the present loop is used in a new eventloop.
 //
-Bool_t MFEventSelector2::Read(MRead &read)
+Bool_t MFEventSelector2::ReadDistribution(MRead &read)
 {
     if (read.GetEntries() > INT_MAX) // FIXME: LONG_MAX ???
@@ -355,5 +357,5 @@
 
     // Read primary distribution
-    if (!Read(*read))
+    if (!ReadDistribution(*read))
         return kFALSE;
 
Index: trunk/MagicSoft/Mars/mfilter/MFEventSelector2.h
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFEventSelector2.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mfilter/MFEventSelector2.h	(revision 2173)
@@ -44,5 +44,5 @@
 
     TH1   &InitHistogram(MH3* &hist);
-    Bool_t Read(MRead &read);
+    Bool_t ReadDistribution(MRead &read);
     void   PrepareHistograms();
     Bool_t PreProcessData(MParList *parlist);
Index: trunk/MagicSoft/Mars/mfilter/MFParticleId.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFParticleId.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfilter/MFParticleId.cc	(revision 2173)
@@ -34,5 +34,5 @@
 #include "MFParticleId.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include "MLog.h"
@@ -45,4 +45,5 @@
 ClassImp(MFParticleId);
 
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mfilter/MFTriggerLvl1.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFTriggerLvl1.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfilter/MFTriggerLvl1.cc	(revision 2173)
@@ -30,5 +30,5 @@
 #include "MFTriggerLvl1.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include "MLog.h"
@@ -41,4 +41,5 @@
 ClassImp(MFTriggerLvl1);
 
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mfilter/MFTriggerLvl2.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFTriggerLvl2.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfilter/MFTriggerLvl2.cc	(revision 2173)
@@ -20,6 +20,4 @@
 !   Copyright: MAGIC Software Development, 2000-2003
 !
-!   Filter for L2Trigger. 02/2003
-!
 \* ======================================================================== */
 
@@ -33,5 +31,5 @@
 #include "MFTriggerLvl2.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include "MLog.h"
@@ -44,4 +42,5 @@
 ClassImp(MFTriggerLvl2);
 
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mfilter/MFilterList.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFilterList.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mfilter/MFilterList.cc	(revision 2173)
@@ -30,5 +30,5 @@
 #include "MFilterList.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include <TString.h>
@@ -40,4 +40,6 @@
 
 ClassImp(MFilterList);
+
+using namespace std;
 
 static const TString gsDefName  = "MFilterList";
Index: trunk/MagicSoft/Mars/mfilter/MFilterList.h
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFilterList.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mfilter/MFilterList.h	(revision 2173)
@@ -50,5 +50,6 @@
 
     void Print(Option_t *opt = "") const;
-    TString GetRule(Option_t *opt="") const;
+    TString GetRule() const { return GetRule(""); }
+    TString GetRule(Option_t *opt) const;
 
     ClassDef(MFilterList, 1)		// List to combine several filters logically
Index: trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 2173)
@@ -43,4 +43,6 @@
 
 ClassImp(MGeomCam);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000.cc	(revision 2173)
@@ -39,4 +39,6 @@
 
 ClassImp(MGeomCamECO1000);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000HG.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000HG.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000HG.cc	(revision 2173)
@@ -43,4 +43,6 @@
 
 ClassImp(MGeomCamECO1000HG);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mgeom/MGeomMirror.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomMirror.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mgeom/MGeomMirror.cc	(revision 2173)
@@ -37,4 +37,6 @@
 
 ClassImp(MGeomMirror);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mgeom/MGeomPMT.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomPMT.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mgeom/MGeomPMT.cc	(revision 2173)
@@ -37,4 +37,6 @@
 ClassImp(MGeomPMT);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mgeom/MGeomPix.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomPix.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mgeom/MGeomPix.cc	(revision 2173)
@@ -47,4 +47,6 @@
 
 ClassImp(MGeomPix);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mgui/MCamDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mgui/MCamDisplay.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mgui/MCamDisplay.cc	(revision 2173)
@@ -37,6 +37,6 @@
 #include "MCamDisplay.h"
 
-#include <fstream.h>
-#include <iostream.h>
+#include <fstream>
+#include <iostream>
 
 #include <TBox.h>
@@ -70,4 +70,6 @@
 ClassImp(MCamDisplay);
 
+using namespace std;
+
 // ------------------------------------------------------------------------
 //
@@ -133,5 +135,5 @@
     const Float_t h = 2./kItemsLegend;
 
-    const Float_t w = fRange/sqrt(fNumPixels);
+    const Float_t w = fRange/sqrt((float)fNumPixels);
 
     fLegend  = new TClonesArray("TBox",  kItemsLegend);
Index: trunk/MagicSoft/Mars/mgui/MHexagon.cc
===================================================================
--- trunk/MagicSoft/Mars/mgui/MHexagon.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mgui/MHexagon.cc	(revision 2173)
@@ -32,6 +32,6 @@
 #include "MHexagon.h"
 
-#include <fstream.h>
-#include <iostream.h>
+#include <fstream>
+#include <iostream>
 
 #include <TVirtualPad.h>  // gPad
@@ -40,4 +40,6 @@
 
 ClassImp(MHexagon);
+
+using namespace std;
 
 // ------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhist/MBinning.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MBinning.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MBinning.cc	(revision 2173)
@@ -31,5 +31,5 @@
 
 #include <ctype.h>      // tolower
-#include <fstream.h>
+#include <fstream>
 
 #include <TH1.h>        // InheritsFrom
@@ -41,4 +41,6 @@
 
 ClassImp(MBinning);
+
+using namespace std;
 
 static const TString gsDefName  = "MBinning";
@@ -75,5 +77,5 @@
 }
 
-void MBinning::SetEdges(const TH1 &h, const Char_t axis='x')
+void MBinning::SetEdges(const TH1 &h, const Char_t axis)
 {
     TH1 &hist = (TH1&)h; // get rid of const qualifier
Index: trunk/MagicSoft/Mars/mhist/MFillH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 2173)
@@ -74,5 +74,5 @@
 #include "MFillH.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include <TClass.h>
@@ -93,4 +93,6 @@
 
 ClassImp(MFillH);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhist/MH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MH.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MH.cc	(revision 2173)
@@ -75,4 +75,6 @@
 ClassImp(MH);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mhist/MH3.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MH3.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MH3.cc	(revision 2173)
@@ -61,5 +61,5 @@
 
 #include <ctype.h>   // tolower
-#include <fstream.h>
+#include <fstream>
 
 #include <TPad.h>
@@ -80,4 +80,6 @@
 
 ClassImp(MH3);
+
+using namespace std;
 
 static const TString gsDefName  = "MH3";
@@ -638,5 +640,5 @@
 }
 
-TString MH3::GetRule(const Char_t axis='x') const
+TString MH3::GetRule(const Char_t axis) const
 {
     switch (tolower(axis))
Index: trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.cc	(revision 2173)
@@ -49,4 +49,6 @@
 
 ClassImp(MHAlphaEnergyTheta);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.cc	(revision 2173)
@@ -50,4 +50,5 @@
 ClassImp(MHAlphaEnergyTime);
 
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhist/MHArray.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHArray.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHArray.cc	(revision 2173)
@@ -80,4 +80,6 @@
 ClassImp(MHArray);
 
+using namespace std;
+
 //////////////////////////////////////////////////////////////////////////////
 //
@@ -551,5 +553,5 @@
         MH::MakeDefCanvas(this);
 
-    const Stat_t sstyle = gStyle->GetOptStat();
+    const Int_t sstyle = gStyle->GetOptStat();
     gStyle->SetOptStat(0);
 
@@ -672,5 +674,5 @@
         o.Remove(scalemax, 9);
 
-    const Stat_t sstyle = gStyle->GetOptStat();
+    const Int_t sstyle = gStyle->GetOptStat();
     gStyle->SetOptStat(0);
 
Index: trunk/MagicSoft/Mars/mhist/MHBlindPixels.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHBlindPixels.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHBlindPixels.cc	(revision 2173)
@@ -43,4 +43,6 @@
 
 ClassImp(MHBlindPixels);
+
+using namespace std;
 
 // -------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.cc	(revision 2173)
@@ -44,9 +44,11 @@
 ClassImp(MHCerPhotEvt);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
 // Reset all pixels to 0 and reset fEntries to 0.
 //
-void MHCerPhotEvt::Clear()
+void MHCerPhotEvt::Clear(const Option_t *)
 {
     fSum.Reset();
Index: trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.h	(revision 2173)
@@ -26,5 +26,5 @@
     ~MHCerPhotEvt();
 
-    void Clear();
+    void Clear(const Option_t *o="");
 
     Bool_t SetupFill(const MParList *pList);
Index: trunk/MagicSoft/Mars/mhist/MHCompProb.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCompProb.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHCompProb.cc	(revision 2173)
@@ -53,4 +53,6 @@
 ClassImp(MHCompProb);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mhist/MHCurrents.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCurrents.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHCurrents.cc	(revision 2173)
@@ -44,9 +44,11 @@
 ClassImp(MHCurrents);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
 // Reset all pixels to 0 and reset fEntries to 0.
 //
-void MHCurrents::Clear()
+void MHCurrents::Clear(const Option_t *)
 {
     // FIXME: Implement a clear function with setmem
Index: trunk/MagicSoft/Mars/mhist/MHCurrents.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCurrents.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHCurrents.h	(revision 2173)
@@ -27,5 +27,5 @@
     ~MHCurrents();
 
-    void Clear();
+    void Clear(const Option_t *o="");
 
     Bool_t SetupFill(const MParList *pList);
Index: trunk/MagicSoft/Mars/mhist/MHEffOnTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEffOnTime.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHEffOnTime.cc	(revision 2173)
@@ -58,4 +58,5 @@
 ClassImp(MHEffOnTime);
 
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhist/MHEnergyTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEnergyTheta.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHEnergyTheta.cc	(revision 2173)
@@ -44,4 +44,6 @@
 
 ClassImp(MHEnergyTheta);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhist/MHEnergyTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEnergyTime.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHEnergyTime.cc	(revision 2173)
@@ -45,4 +45,6 @@
 
 ClassImp(MHEnergyTime);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhist/MHFadcCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHFadcCam.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHFadcCam.cc	(revision 2173)
@@ -41,4 +41,6 @@
 
 ClassImp(MHFadcCam);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
@@ -130,8 +132,8 @@
 {
     for (Int_t i=0; i<577; i++)
-        Reset(i);
+        ResetEntry(i);
 }
 
-void MHFadcCam::Reset(Int_t i)
+void MHFadcCam::ResetEntry(Int_t i)
 {
     GetHistHi(i)->Reset();
Index: trunk/MagicSoft/Mars/mhist/MHFadcCam.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHFadcCam.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHFadcCam.h	(revision 2173)
@@ -49,5 +49,5 @@
 
     void ResetHistograms();
-    void Reset(Int_t i);
+    void ResetEntry(Int_t i);
 
     //
Index: trunk/MagicSoft/Mars/mhist/MHFlux.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHFlux.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHFlux.cc	(revision 2173)
@@ -58,4 +58,6 @@
 ClassImp(MHFlux);
 
+using namespace std;
+
 MHFlux::MHFlux(const MHGamma &hist, const TString varname, const TString unit)
     : fHOrig(), fHUnfold(), fHFlux()
Index: trunk/MagicSoft/Mars/mhist/MHGamma.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHGamma.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHGamma.cc	(revision 2173)
@@ -48,4 +48,5 @@
 ClassImp(MHGamma);
 
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhist/MHHadronness.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHHadronness.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHHadronness.cc	(revision 2173)
@@ -75,4 +75,6 @@
 
 ClassImp(MHHadronness);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhist/MHMatrix.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMatrix.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHMatrix.cc	(revision 2173)
@@ -47,5 +47,5 @@
 #include "MHMatrix.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include <TList.h>
@@ -70,6 +70,7 @@
 #include "MFilter.h"
 
-
 ClassImp(MHMatrix);
+
+using namespace std;
 
 const TString MHMatrix::gsDefName  = "MHMatrix";
Index: trunk/MagicSoft/Mars/mhist/MHSigmaPixel.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmaPixel.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHSigmaPixel.cc	(revision 2173)
@@ -48,4 +48,6 @@
 
 ClassImp(MHSigmaPixel);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc	(revision 2173)
@@ -56,7 +56,7 @@
 #include "MLogManip.h"
 
-
 ClassImp(MHSigmaTheta);
 
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.cc	(revision 2173)
@@ -46,4 +46,6 @@
 
 ClassImp(MHSigmabarTheta);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhist/MHStarMap.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 2173)
@@ -50,4 +50,6 @@
 ClassImp(MHStarMap);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mhist/MHThetabarTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHThetabarTheta.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHThetabarTheta.cc	(revision 2173)
@@ -44,4 +44,6 @@
 
 ClassImp(MHThetabarTheta);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhist/MHThetabarTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHThetabarTime.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHThetabarTime.cc	(revision 2173)
@@ -46,4 +46,5 @@
 ClassImp(MHThetabarTime);
 
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.cc	(revision 2173)
@@ -47,4 +47,5 @@
 ClassImp(MHTimeDiffTheta);
 
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc	(revision 2173)
@@ -47,4 +47,5 @@
 ClassImp(MHTimeDiffTime);
 
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhistmc/MHMcCT1CollectionArea.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcCT1CollectionArea.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcCT1CollectionArea.cc	(revision 2173)
@@ -41,6 +41,7 @@
 #include "MLogManip.h"
 
-
 ClassImp(MHMcCT1CollectionArea);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.cc	(revision 2173)
@@ -45,4 +45,6 @@
 ClassImp(MHMcCollectionArea);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mhistmc/MHMcEnergy.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcEnergy.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcEnergy.cc	(revision 2173)
@@ -35,5 +35,5 @@
 
 #include <stdlib.h>
-#include <iostream.h>
+#include <iostream>
 
 #include <TH1.h> 
@@ -48,4 +48,6 @@
 
 ClassImp(MHMcEnergy);
+
+using namespace std;
 
 // -------------------------------------------------------------------------
@@ -217,5 +219,5 @@
 Float_t MHMcEnergy::CalcThresholdErr(TF1 *gauss)
 {
-    const Float_t lg10  = log(10);
+    const Float_t lg10  = log(10.);
     const Float_t p1    = gauss->GetParameter(1);
     const Float_t p1err = gauss->GetParError(1);
Index: trunk/MagicSoft/Mars/mhistmc/MHMcEnergyMigration.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcEnergyMigration.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcEnergyMigration.cc	(revision 2173)
@@ -50,4 +50,5 @@
 ClassImp(MHMcEnergyMigration);
 
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhistmc/MHMcIntRate.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcIntRate.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcIntRate.cc	(revision 2173)
@@ -44,4 +44,6 @@
 
 ClassImp(MHMcIntRate);
+
+using namespace std;
 
 // -------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhistmc/MHMcRate.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcRate.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcRate.cc	(revision 2173)
@@ -40,4 +40,6 @@
 ClassImp(MHMcRate);
 
+using namespace std;
+
 void MHMcRate::Init(const char *name, const char *title)
 {
@@ -196,6 +198,6 @@
     const Double_t specidx = 1.0-fSpecIndex;
 
-    const Double_t epowmax = pow(fEnergyMax, specidx);
-    const Double_t epowmin = pow(fEnergyMin, specidx);
+    const Double_t epowmax = pow((double)fEnergyMax, specidx);
+    const Double_t epowmin = pow((double)fEnergyMin, specidx);
 
     if (fShowerRate <= 0)
Index: trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.cc	(revision 2173)
@@ -51,4 +51,6 @@
 #include "MBinning.h"
 
+using namespace std;
+
 /*
  Please, DON'T USE IFDEFS IN SUCH A CONTEXT, Thomas.
Index: trunk/MagicSoft/Mars/mimage/MCameraSmooth.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MCameraSmooth.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mimage/MCameraSmooth.cc	(revision 2173)
@@ -46,4 +46,6 @@
 
 ClassImp(MCameraSmooth);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mimage/MHHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHHillas.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mimage/MHHillas.cc	(revision 2173)
@@ -53,4 +53,6 @@
 ClassImp(MHHillas);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mimage/MHHillasExt.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHHillasExt.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mimage/MHHillasExt.cc	(revision 2173)
@@ -52,4 +52,6 @@
 ClassImp(MHHillasExt);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mimage/MHHillasSrc.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHHillasSrc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mimage/MHHillasSrc.cc	(revision 2173)
@@ -50,4 +50,6 @@
 ClassImp(MHHillasSrc);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc	(revision 2173)
@@ -48,4 +48,6 @@
 
 ClassImp(MHNewImagePar);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mimage/MHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillas.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mimage/MHillas.cc	(revision 2173)
@@ -60,5 +60,5 @@
 #include "MHillas.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include <TArrayF.h>
@@ -75,4 +75,6 @@
 
 ClassImp(MHillas);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
@@ -111,6 +113,6 @@
 
     fSize   = -1;
-    fMeanX  = -1;
-    fMeanY  = -1;
+    fMeanX  =  0;
+    fMeanY  =  0;
 
     Clear();
Index: trunk/MagicSoft/Mars/mimage/MHillasCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasCalc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mimage/MHillasCalc.cc	(revision 2173)
@@ -68,4 +68,6 @@
 
 ClassImp(MHillasCalc);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mimage/MHillasExt.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasExt.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mimage/MHillasExt.cc	(revision 2173)
@@ -59,5 +59,5 @@
 #include "MHillasExt.h"
 
-#include <fstream.h>
+#include <fstream>
 #include <TArrayF.h>
 
@@ -74,4 +74,6 @@
 
 ClassImp(MHillasExt);
+
+using namespace std;
 
 // -------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mimage/MHillasSrc.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasSrc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mimage/MHillasSrc.cc	(revision 2173)
@@ -63,5 +63,5 @@
 #include "MHillasSrc.h"
 
-#include <fstream.h>
+#include <fstream>
 #include <TArrayF.h>
 
@@ -72,4 +72,6 @@
 
 ClassImp(MHillasSrc);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
@@ -98,12 +100,12 @@
 Bool_t MHillasSrc::Calc(const MHillas *hillas)
 {
-    const Double_t mx   = hillas->GetMeanX();       // [mm]
-    const Double_t my   = hillas->GetMeanY();       // [mm]
+    const Double_t mx = hillas->GetMeanX();     // [mm]
+    const Double_t my = hillas->GetMeanY();     // [mm]
 
-    const Double_t sx   = mx - fSrcPos->GetX();     // [mm]
-    const Double_t sy   = my - fSrcPos->GetY();     // [mm]
+    const Double_t sx = mx - fSrcPos->GetX();   // [mm]
+    const Double_t sy = my - fSrcPos->GetY();   // [mm]
 
-    const Double_t sd   = hillas->GetSinDelta();    // [1]
-    const Double_t cd   = hillas->GetCosDelta();    // [1]
+    const Double_t sd = hillas->GetSinDelta();  // [1]
+    const Double_t cd = hillas->GetCosDelta();  // [1]
 
     //
@@ -112,5 +114,5 @@
     // The calculation has failed and returnes kFALSE.
     //
-    const Double_t dist = sqrt(sx*sx + sy*sy);      // [mm]
+    const Double_t dist = sqrt(sx*sx + sy*sy);  // [mm]
     if (dist==0)
         return kFALSE;
@@ -124,10 +126,10 @@
     // *OLD* fAlpha = asin(arg)*kRad2Deg;
 
-    const Double_t arg1 = cd*sy-sd*sx;              // [mm]
-    const Double_t arg2 = cd*sx+sd*sy;              // [mm]
+    const Double_t arg1 = cd*sy-sd*sx;          // [mm]
+    const Double_t arg2 = cd*sx+sd*sy;          // [mm]
 
-    fAlpha         = asin(arg1/dist)*kRad2Deg;      // [deg]
-    fCosDeltaAlpha = arg2/dist;                     // [1]
-    fDist          = dist;                          // [mm]
+    fAlpha         = asin(arg1/dist)*kRad2Deg;  // [deg]
+    fCosDeltaAlpha = arg2/dist;                 // [1]
+    fDist          = dist;                      // [mm]
 
     SetReadyToSave();
Index: trunk/MagicSoft/Mars/mimage/MHillasSrcCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasSrcCalc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mimage/MHillasSrcCalc.cc	(revision 2173)
@@ -33,5 +33,5 @@
 #include "MHillasSrcCalc.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include "MParList.h"
@@ -44,4 +44,6 @@
 
 ClassImp(MHillasSrcCalc);
+
+using namespace std;
 
 static const TString gsDefName  = "MHillasSrcCalc";
Index: trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc	(revision 2173)
@@ -253,5 +253,5 @@
 
 #include <stdlib.h>       // atof					  
-#include <fstream.h>      // ofstream, SavePrimitive
+#include <fstream>        // ofstream, SavePrimitive
 
 #include <TGFrame.h>      // TGFrame
@@ -272,4 +272,6 @@
 
 ClassImp(MImgCleanStd);
+
+using namespace std;
 
 enum {
Index: trunk/MagicSoft/Mars/mimage/MNewImagePar.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MNewImagePar.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mimage/MNewImagePar.cc	(revision 2173)
@@ -35,5 +35,5 @@
 #include "MNewImagePar.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include "MLog.h"
@@ -49,4 +49,6 @@
 
 ClassImp(MNewImagePar);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mmain/MAnalysis.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MAnalysis.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mmain/MAnalysis.cc	(revision 2173)
@@ -24,5 +24,5 @@
 #include "MAnalysis.h"
 
-#include <iostream.h>
+#include <iostream>
 
 #include <TGLabel.h>       // TGlabel
@@ -33,5 +33,7 @@
 #include "MImgCleanStd.h"  // MImgCleanStd
 
-ClassImp(MAnalysis)
+ClassImp(MAnalysis);
+
+using namespace std;
 
 enum {
Index: trunk/MagicSoft/Mars/mmain/MBrowser.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MBrowser.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mmain/MBrowser.cc	(revision 2173)
@@ -26,5 +26,5 @@
 #include "MBrowser.h"
 
-#include <iostream.h>
+#include <iostream>
 #include <sys/stat.h>       // S_ISDIR
 
@@ -45,4 +45,6 @@
 
 ClassImp(MBrowser);
+
+using namespace std;
 
 enum {
Index: trunk/MagicSoft/Mars/mmain/MMars.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MMars.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mmain/MMars.cc	(revision 2173)
@@ -26,5 +26,5 @@
 #include "MMars.h"
 
-#include <iostream.h>
+#include <iostream>
 
 #include <TApplication.h>  // gROOT->GetApplication()->...
@@ -44,5 +44,7 @@
 #include "MCameraDisplay.h"
 
-ClassImp(MMars)
+ClassImp(MMars);
+
+using namespace std;
 
 enum {
@@ -94,5 +96,5 @@
         fList->Add(magic);
         magic->Associate(this);
-        TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft,  10., 10., 20., 10.);
+        TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft,  10, 10, 20, 10);
         fList->Add(lay1);
         top->AddFrame(magic, lay1);
@@ -105,5 +107,5 @@
         fList->Add(mars);
         mars->Associate(this);
-        TGLayoutHints *lay2 = new TGLayoutHints(kLHintsRight, 10., 10., 10., 10.);
+        TGLayoutHints *lay2 = new TGLayoutHints(kLHintsRight, 10, 10, 10, 10);
         fList->Add(lay2);
         top->AddFrame(mars,  lay2);
Index: trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc	(revision 2173)
@@ -27,5 +27,5 @@
 
 #include <stdlib.h>
-#include <iostream.h>
+#include <iostream>
 
 #include <TGLabel.h>        // TGLabel
@@ -37,5 +37,7 @@
 #include "MGList.h"
 
-ClassImp(MMonteCarlo)
+ClassImp(MMonteCarlo);
+
+using namespace std;
 
 enum {
Index: trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc	(revision 2173)
@@ -61,5 +61,5 @@
 #include "MStatusDisplay.h"
 
-#include <fstream.h>              // fstream
+#include <fstream>                // fstream
 
 #include <TLine.h>                // TLine
@@ -98,4 +98,6 @@
 
 ClassImp(MStatusDisplay);
+
+using namespace std;
 
 // ------------ Workaround for a non working TGTextView::Search -------------
@@ -1356,4 +1358,6 @@
     const TString newstr("%%DocumentPaperSizes: a4\n%%Orientation: Landscape");
 
+    // gcc 3.2:
+    /*
     fstream f(name, ios::in|ios::out|ios::nocreate);
 
@@ -1393,4 +1397,5 @@
     delete c2;
     delete c1;
+    */
 }
 
@@ -1770,7 +1775,7 @@
     // canculate new size of frame (canvas @ 1:sqrt(2))
     if (hchanged)
-        w = (UInt_t)((h-ch)*sqrt(2)+.5)+cw;
+        w = (UInt_t)((h-ch)*sqrt(2.)+.5)+cw;
     else
-        h = (UInt_t)((w-cw)/sqrt(2)+.5)+ch;
+        h = (UInt_t)((w-cw)/sqrt(2.)+.5)+ch;
 
     //cout << "Res: " << w << " " << h << " " << evt->fX << " " << evt->fY << endl;
Index: trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.cc	(revision 2173)
@@ -49,4 +49,6 @@
 
 ClassImp(MMcCollectionAreaCalc);
+
+using namespace std;
 
 MMcCollectionAreaCalc::MMcCollectionAreaCalc(const char *input,
Index: trunk/MagicSoft/Mars/mmontecarlo/MMcEnergyEst.cc
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcEnergyEst.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mmontecarlo/MMcEnergyEst.cc	(revision 2173)
@@ -62,4 +62,7 @@
 #include "MLogManip.h"
 
+ClassImp(MMcEnergyEst);
+
+using namespace std;
 
 //------------------------------------------------------------------------
@@ -67,5 +70,5 @@
 // fcn calculates the function to be minimized (using TMinuit::Migrad)
 //
-void fcn(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
+static void fcn(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
 {
   MEvtLoop *evtloop = (MEvtLoop*)gMinuit->GetObjectFit();
@@ -82,6 +85,4 @@
   f = eval->GetChisq();
 }
-
-ClassImp(MMcEnergyEst);
 
 // --------------------------------------------------------------------------
@@ -323,5 +324,5 @@
 // Print current values of parameters
 //
-void MMcEnergyEst::Print(Option_t *o)
+void MMcEnergyEst::Print(Option_t *o) const
 {
   for (Int_t i = 0; i < fA.GetSize(); i++)
Index: trunk/MagicSoft/Mars/mmontecarlo/MMcEnergyEst.h
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcEnergyEst.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mmontecarlo/MMcEnergyEst.h	(revision 2173)
@@ -47,5 +47,5 @@
 
   void FindParams();
-  void Print(Option_t *o="");
+  void Print(Option_t *o="") const;
 
   ClassDef(MMcEnergyEst, 1) // Class for optimization of Energy estimator
Index: trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.cc	(revision 2173)
@@ -52,5 +52,7 @@
 ClassImp(MMcThresholdCalc);
 
-const Float_t MMcThresholdCalc::fSqrt2 = sqrt(2);
+using namespace std;
+
+const Float_t MMcThresholdCalc::fSqrt2 = sqrt(2.);
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mmontecarlo/MMcTimeGenerate.cc
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcTimeGenerate.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mmontecarlo/MMcTimeGenerate.cc	(revision 2173)
@@ -86,5 +86,5 @@
     const UInt_t t = fTime->GetTimeLo();
 
-    fTime->SetTime(t+dt*10000, 0); // [0.1ms]
+    fTime->SetTime((int)(t+dt*10000), 0); // [0.1ms]
 
     return kTRUE;
Index: trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc	(revision 2173)
@@ -29,9 +29,12 @@
 #include "MMcTriggerRateCalc.h"
 
+#include <math.h>
+
+#include <TCanvas.h>
+
 #include "MLog.h"
 #include "MLogManip.h"
 
 #include "MParList.h"
-#include "MHMcRate.h"
 
 #include "MMcEvt.hxx"
@@ -42,9 +45,9 @@
 
 #include "MH.h"
-#include <TCanvas.h>
-#include <math.h>
-
+#include "MHMcRate.h"
 
 ClassImp(MMcTriggerRateCalc);
+
+using namespace std;
 
 void MMcTriggerRateCalc::Init(int dim, float *trigbg, float simbg,
@@ -364,5 +367,5 @@
 // Draw rate as a funtion of discriminator threshold.
 //
-void MMcTriggerRateCalc::Draw()
+void MMcTriggerRateCalc::Draw(Option_t *)
 {
     /*
Index: trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.h
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.h	(revision 2173)
@@ -67,5 +67,5 @@
     TH1F* GetHist(Int_t i) {return fHist[i];}
 
-    void Draw();
+    void Draw(const Option_t *o="");
 
     ClassDef(MMcTriggerRateCalc, 0)	// Task to compute the trigger rate
Index: trunk/MagicSoft/Mars/mranforest/MHRanForest.cc
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MHRanForest.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mranforest/MHRanForest.cc	(revision 2173)
@@ -50,4 +50,6 @@
 
 ClassImp(MHRanForest);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mranforest/MHRanForestGini.cc
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MHRanForestGini.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mranforest/MHRanForestGini.cc	(revision 2173)
@@ -48,4 +48,6 @@
 
 ClassImp(MHRanForestGini);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mranforest/MHRanForestGini.h
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MHRanForestGini.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mranforest/MHRanForestGini.h	(revision 2173)
Index: trunk/MagicSoft/Mars/mranforest/MRanForest.cc
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanForest.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mranforest/MRanForest.cc	(revision 2173)
@@ -53,4 +53,6 @@
 ClassImp(MRanForest);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mranforest/MRanForestCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanForestCalc.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mranforest/MRanForestCalc.cc	(revision 2173)
@@ -50,4 +50,6 @@
 
 ClassImp(MRanForestCalc);
+
+using namespace std;
 
 static const TString gsDefName  = "MRanForestCalc";
Index: trunk/MagicSoft/Mars/mranforest/MRanForestFill.cc
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanForestFill.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mranforest/MRanForestFill.cc	(revision 2173)
@@ -44,4 +44,6 @@
 
 ClassImp(MRanForestFill);
+
+using namespace std;
 
 static const TString gsDefName  = "MRanForestFill";
Index: trunk/MagicSoft/Mars/mranforest/MRanForestFill.h
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanForestFill.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mranforest/MRanForestFill.h	(revision 2173)
Index: trunk/MagicSoft/Mars/mranforest/MRanForestGrow.cc
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanForestGrow.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mranforest/MRanForestGrow.cc	(revision 2173)
@@ -43,4 +43,6 @@
 
 ClassImp(MRanForestGrow);
+
+using namespace std;
 
 static const TString gsDefName  = "MRanForestGrow";
Index: trunk/MagicSoft/Mars/mranforest/MRanTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanTree.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mranforest/MRanTree.cc	(revision 2173)
@@ -33,5 +33,5 @@
 #include "MRanTree.h"
 
-#include <iostream.h>
+#include <iostream>
 
 #include <TVector.h>
@@ -45,4 +45,6 @@
 
 ClassImp(MRanTree);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mraw/MRawCrateData.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawCrateData.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mraw/MRawCrateData.cc	(revision 2173)
@@ -33,8 +33,8 @@
 #include "MRawCrateData.h"
 
-#include <iostream.h>
-#include <iomanip.h>
+#include <iostream>
+#include <iomanip>
 
-#include <fstream.h>
+#include <fstream>
 
 #include "MLog.h"
@@ -42,4 +42,6 @@
 
 ClassImp(MRawCrateData);
+
+using namespace std;
 
 MRawCrateData::MRawCrateData() : fDAQCrateNumber(0), fFADCEvtNumber(0), fFADCClockTick(0)
@@ -54,7 +56,7 @@
 void MRawCrateData::ReadEvt(istream& fin)
 {
-    fin.read((Byte_t*)&fDAQCrateNumber, 2);
-    fin.read((Byte_t*)&fFADCEvtNumber,  4);
-    fin.read((Byte_t*)&fFADCClockTick,  4);
+    fin.read((char*)&fDAQCrateNumber, 2);
+    fin.read((char*)&fFADCEvtNumber,  4);
+    fin.read((char*)&fFADCClockTick,  4);
 }
 
Index: trunk/MagicSoft/Mars/mraw/MRawCrateData.h
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawCrateData.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mraw/MRawCrateData.h	(revision 2173)
@@ -6,5 +6,7 @@
 #endif
 
-class ifstream;
+//gcc 3.2
+//class ifstream;
+#include <iosfwd>
 
 class MRawCrateData : public MParContainer
Index: trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawEvtData.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mraw/MRawEvtData.cc	(revision 2173)
@@ -50,5 +50,5 @@
 #include "MRawEvtData.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include <TH1.h>
@@ -65,4 +65,6 @@
 
 ClassImp(MRawEvtData);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
@@ -430,5 +432,5 @@
         //
         fHiGainPixId->AddAt(npix, ipos);
-        fin.read(higainsam, nhi);
+        fin.read((char*)higainsam, nhi);
         higainsam += nhi;
 
@@ -437,5 +439,5 @@
         //{
         fLoGainPixId->AddAt(npix, ipos);
-        fin.read(logainsam, nlo);
+        fin.read((char*)logainsam, nlo);
         logainsam += nlo;
         //}
Index: trunk/MagicSoft/Mars/mraw/MRawEvtData.h
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawEvtData.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mraw/MRawEvtData.h	(revision 2173)
@@ -6,5 +6,8 @@
 #endif
 
-class ifstream;
+// gcc 3.2
+//class ifstream;
+#include <iosfwd>
+
 class MRawRunHeader;
 
Index: trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc	(revision 2173)
@@ -95,6 +95,6 @@
 #include "MRawEvtHeader.h"
 
-#include <iomanip.h>
-#include <fstream.h>
+#include <iomanip>
+#include <fstream>
 
 #include "MLog.h"
@@ -106,4 +106,6 @@
 
 ClassImp(MRawEvtHeader);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
@@ -235,8 +237,8 @@
 int MRawEvtHeader::ReadEvt(istream &fin)
 {
-    fin.read((Byte_t*)&fDAQEvtNumber, 4);
+    fin.read((char*)&fDAQEvtNumber, 4);
 
     UInt_t fAbsTime[2];
-    fin.read((Byte_t*)fAbsTime,       8);
+    fin.read((char*)fAbsTime,       8);
 
     //
@@ -247,10 +249,10 @@
     Byte_t dummy[4];
 
-    fin.read((Byte_t*)&fNumTrigLvl1,  4);
-    fin.read((Byte_t*)&fNumTrigLvl2,  4);
-    fin.read((Byte_t*)fTrigPattern,   8);
-    fin.read((Byte_t*)&fTrigType,     2);
-    fin.read((Byte_t*)dummy,          2); // was fAllLoGainOn
-    fin.read((Byte_t*)fPixLoGainOn->GetArray(), fPixLoGainOn->GetSize());
+    fin.read((char*)&fNumTrigLvl1,  4);
+    fin.read((char*)&fNumTrigLvl2,  4);
+    fin.read((char*)fTrigPattern,   8);
+    fin.read((char*)&fTrigType,     2);
+    fin.read((char*)dummy,          2); // was fAllLoGainOn
+    fin.read((char*)fPixLoGainOn->GetArray(), fPixLoGainOn->GetSize());
 
     fNumLoGainOn = 0;
@@ -260,5 +262,5 @@
                 fNumLoGainOn++;
 
-    fin.read((Byte_t*)&dummy, 4);
+    fin.read((char*)&dummy, 4);
 
     return !fin.eof();
Index: trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h	(revision 2173)
@@ -6,5 +6,8 @@
 #endif
 
-class ifstream;
+// gcc 3.2
+//class ifstream;
+#include <iosfwd>
+
 class MTime;
 class MArrayB;
Index: trunk/MagicSoft/Mars/mraw/MRawFileRead.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawFileRead.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mraw/MRawFileRead.cc	(revision 2173)
@@ -41,5 +41,5 @@
 #include "MRawFileRead.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include "MLog.h"
@@ -56,4 +56,5 @@
 ClassImp(MRawFileRead);
 
+using namespace std;
 
 /*  ----------- please don't delete and don't care about (Thomas) ------------
Index: trunk/MagicSoft/Mars/mraw/MRawFileRead.h
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawFileRead.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mraw/MRawFileRead.h	(revision 2173)
@@ -6,5 +6,7 @@
 #endif
 
-class ifstream;
+// gcc 3.2
+//class ifstream;
+#include <iosfwd>
 
 class MTime;
Index: trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc	(revision 2173)
@@ -54,4 +54,6 @@
 
 ClassImp(MRawFileWrite);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 2173)
@@ -33,6 +33,6 @@
 #include "MRawRunHeader.h"
 
-#include <fstream.h>
-#include <iomanip.h>
+#include <fstream>
+#include <iomanip>
 
 #include "MLog.h"
@@ -42,4 +42,6 @@
 
 ClassImp(MRawRunHeader);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
@@ -74,5 +76,5 @@
     // read one RUN HEADER from the input stream
     //
-    fin.read((Byte_t*)&fMagicNumber,       2);
+    fin.read((char*)&fMagicNumber,       2);
 
     //
@@ -87,23 +89,23 @@
     Byte_t dummy[16];
 
-    fin.read((Byte_t*)&fFormatVersion,    2);
-    fin.read((Byte_t*)&fSoftVersion,      2);
-    fin.read((Byte_t*)&fRunType,          2);
-    fin.read((Byte_t*)&fRunNumber,        4);
-    fin.read((Byte_t*)&fProjectName,     22);
-    fin.read((Byte_t*)&fSourceName,      12);
-    fin.read((Byte_t*)dummy,              4); // was RA  (moved to tracking system)
-    fin.read((Byte_t*)dummy,              4); // was DEC (moved to tracking system)
-    fin.read((Byte_t*)&fSourceEpochChar,  2);
-    fin.read((Byte_t*)&fSourceEpochDate,  2);
-    fin.read((Byte_t*)&fMJD,              4);
-    fin.read((Byte_t*)&fDateYear,         2);
-    fin.read((Byte_t*)&fDateMonth,        2);
-    fin.read((Byte_t*)&fDateDay,          2);
-    fin.read((Byte_t*)&fNumCrates,        2);
-    fin.read((Byte_t*)&fNumPixInCrate,    2);
-    fin.read((Byte_t*)&fNumSamplesLoGain, 2);
-    fin.read((Byte_t*)&fNumSamplesHiGain, 2);
-    fin.read((Byte_t*)&fNumEvents,        4);
+    fin.read((char*)&fFormatVersion,    2);
+    fin.read((char*)&fSoftVersion,      2);
+    fin.read((char*)&fRunType,          2);
+    fin.read((char*)&fRunNumber,        4);
+    fin.read((char*)&fProjectName,     22);
+    fin.read((char*)&fSourceName,      12);
+    fin.read((char*)dummy,              4); // was RA  (moved to tracking system)
+    fin.read((char*)dummy,              4); // was DEC (moved to tracking system)
+    fin.read((char*)&fSourceEpochChar,  2);
+    fin.read((char*)&fSourceEpochDate,  2);
+    fin.read((char*)&fMJD,              4);
+    fin.read((char*)&fDateYear,         2);
+    fin.read((char*)&fDateMonth,        2);
+    fin.read((char*)&fDateDay,          2);
+    fin.read((char*)&fNumCrates,        2);
+    fin.read((char*)&fNumPixInCrate,    2);
+    fin.read((char*)&fNumSamplesLoGain, 2);
+    fin.read((char*)&fNumSamplesHiGain, 2);
+    fin.read((char*)&fNumEvents,        4);
 
 
@@ -114,6 +116,6 @@
     fPixAssignment->Set(nPixel);
 
-    fin.read((Byte_t*)fPixAssignment->GetArray(), nPixel*2);
-    fin.read((Byte_t*)&dummy, 16);
+    fin.read((char*)fPixAssignment->GetArray(), nPixel*2);
+    fin.read((char*)&dummy, 16);
 }
 
Index: trunk/MagicSoft/Mars/mraw/MRawRunHeader.h
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawRunHeader.h	(revision 2172)
+++ trunk/MagicSoft/Mars/mraw/MRawRunHeader.h	(revision 2173)
@@ -11,6 +11,9 @@
 #endif
 
+// gcc 3.2
+//class ifstream;
+#include <iosfwd>
+
 class TBuffer;
-class ifstream;
 class MArrayS;
 
Index: trunk/MagicSoft/Mars/mreflector/MRflEvtData.cc
===================================================================
--- trunk/MagicSoft/Mars/mreflector/MRflEvtData.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mreflector/MRflEvtData.cc	(revision 2173)
@@ -44,4 +44,6 @@
 ClassImp(MRflEvtData);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
@@ -59,5 +61,5 @@
 // Dump informations off all photons
 //
-void MRflEvtData::Print(Option_t *o="") const
+void MRflEvtData::Print(Option_t *o) const
 {
     *fLog << all << underline << GetDescriptor() << ":" << endl;
Index: trunk/MagicSoft/Mars/mreflector/MRflSinglePhoton.cc
===================================================================
--- trunk/MagicSoft/Mars/mreflector/MRflSinglePhoton.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mreflector/MRflSinglePhoton.cc	(revision 2173)
@@ -37,9 +37,11 @@
 ClassImp(MRflSinglePhoton);
 
+using namespace std;
+
 // --------------------------------------------------------------------------
 //
 // Dump all photon information
 //
-void MRflSinglePhoton::Print(Option_t *o="") const
+void MRflSinglePhoton::Print(Option_t *o) const
 {
     *fLog << all << "x=" << fX << " y=" << fY << endl;
Index: trunk/MagicSoft/Mars/mtools/MChisqEval.cc
===================================================================
--- trunk/MagicSoft/Mars/mtools/MChisqEval.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mtools/MChisqEval.cc	(revision 2173)
@@ -29,9 +29,11 @@
 #include "MChisqEval.h"
 
-#include <fstream.h>
+#include <fstream>
 
 #include "MDataChain.h"
 
 ClassImp(MChisqEval);
+
+using namespace std;
 
 void MChisqEval::StreamPrimitive(ofstream &out) const
Index: trunk/MagicSoft/Mars/mtools/MagicCivilization.cc
===================================================================
--- trunk/MagicSoft/Mars/mtools/MagicCivilization.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mtools/MagicCivilization.cc	(revision 2173)
@@ -57,5 +57,5 @@
 #include "MagicCivilization.h"
 
-#include <iostream.h>
+#include <iostream>
 
 #include <KeySymbols.h>
@@ -72,4 +72,6 @@
 
 ClassImp(MagicCivilization);
+
+using namespace std;
 
 void MagicCivilization::Free()
Index: trunk/MagicSoft/Mars/mtools/MagicDomino.cc
===================================================================
--- trunk/MagicSoft/Mars/mtools/MagicDomino.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mtools/MagicDomino.cc	(revision 2173)
@@ -59,5 +59,5 @@
 #include "MagicDomino.h"
 
-#include <iostream.h>
+#include <iostream>
 
 #include <KeySymbols.h>
@@ -74,4 +74,6 @@
 
 ClassImp(MagicDomino);
+
+using namespace std;
 
 // ------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mtools/MagicReversi.cc
===================================================================
--- trunk/MagicSoft/Mars/mtools/MagicReversi.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mtools/MagicReversi.cc	(revision 2173)
@@ -51,5 +51,5 @@
 #include "MagicReversi.h"
 
-#include <iostream.h>
+#include <iostream>
 
 #include <KeySymbols.h>
@@ -69,4 +69,7 @@
 
 ClassImp(MagicReversi);
+
+using namespace std;
+
 /*
 const Int_t MagicReversi::fColorBombs[7] = {
Index: trunk/MagicSoft/Mars/mtools/MagicShow.cc
===================================================================
--- trunk/MagicSoft/Mars/mtools/MagicShow.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mtools/MagicShow.cc	(revision 2173)
@@ -57,5 +57,5 @@
 #include "MagicShow.h"
 
-#include <iostream.h>
+#include <iostream>
 
 #include <KeySymbols.h>
@@ -71,4 +71,6 @@
 
 ClassImp(MagicShow);
+
+using namespace std;
 
 // ------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mtools/MagicSnake.cc
===================================================================
--- trunk/MagicSoft/Mars/mtools/MagicSnake.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mtools/MagicSnake.cc	(revision 2173)
@@ -53,5 +53,5 @@
 #include "MagicSnake.h"
 
-#include <iostream.h>
+#include <iostream>
 
 #include <KeySymbols.h>
@@ -70,4 +70,6 @@
 
 ClassImp(MagicSnake);
+
+using namespace std;
 
 void MagicSnake::Free()
Index: trunk/MagicSoft/Mars/mtools/MineSweeper.cc
===================================================================
--- trunk/MagicSoft/Mars/mtools/MineSweeper.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/mtools/MineSweeper.cc	(revision 2173)
@@ -48,5 +48,5 @@
 #include "MineSweeper.h"
 
-#include <iostream.h>
+#include <iostream>
 
 #include <TText.h>
@@ -64,4 +64,6 @@
 
 ClassImp(MineSweeper);
+
+using namespace std;
 
 const Int_t MineSweeper::fColorBombs[7] = {
Index: trunk/MagicSoft/Mars/readraw.cc
===================================================================
--- trunk/MagicSoft/Mars/readraw.cc	(revision 2172)
+++ trunk/MagicSoft/Mars/readraw.cc	(revision 2173)
@@ -19,4 +19,6 @@
 #include "MMcEvt.hxx"
 #include "MMcTrig.hxx"
+
+using namespace std;
 
 /////////////////////////////////////////////////////////////////////////////
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcConfigRunHeader.cc
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcConfigRunHeader.cc	(revision 2172)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcConfigRunHeader.cc	(revision 2173)
@@ -37,6 +37,6 @@
 #include "MMcConfigRunHeader.h"
 
-#include <fstream.h>
-#include <iomanip.h>
+#include <fstream>
+#include <iomanip>
 
 #include <TArrayF.h>
@@ -46,4 +46,6 @@
 
 ClassImp(MMcConfigRunHeader);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcCorsikaRunHeader.cc
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcCorsikaRunHeader.cc	(revision 2172)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcCorsikaRunHeader.cc	(revision 2173)
@@ -36,4 +36,6 @@
 
 ClassImp(MMcCorsikaRunHeader);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx	(revision 2172)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx	(revision 2173)
@@ -23,4 +23,5 @@
 ClassImp(MMcEvt);
 
+using namespace std;
 
 
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcFadcHeader.cxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcFadcHeader.cxx	(revision 2172)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcFadcHeader.cxx	(revision 2173)
@@ -1,5 +1,5 @@
 #include "MMcFadcHeader.hxx"
 
-#include <iostream.h>
+#include <iostream>
 
 //==========
@@ -15,4 +15,5 @@
 ClassImp(MMcFadcHeader);
 
+using namespace std;
 
 
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcRunHeader.cxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcRunHeader.cxx	(revision 2172)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcRunHeader.cxx	(revision 2173)
@@ -69,10 +69,12 @@
 #include "MMcRunHeader.hxx"
 
-#include <fstream.h>
-#include <iomanip.h>
+#include <fstream>
+#include <iomanip>
 
 #include "MLog.h"
 
 ClassImp(MMcRunHeader);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.cxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.cxx	(revision 2172)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.cxx	(revision 2173)
@@ -1,5 +1,5 @@
 #include "MMcTrig.hxx"
 
-#include <iostream.h>
+#include <iostream>
 
 
@@ -24,4 +24,5 @@
 ClassImp(MMcTrig);
 
+using namespace std;
 
 
@@ -123,13 +124,7 @@
   //
 
-  Byte_t ret=0;
-  Byte_t reminder;
-  Int_t body;
+  const Int_t  body=npix/8;
+  const Byte_t reminder= 1>>(npix%8);
 
-  body=npix/8;
-  reminder=(Byte_t)(pow(2,npix%8));
-
-  ret=reminder&fPixelsFirst[body][nfirstlevel];
-  return(ret);
-
+  return reminder&fPixelsFirst[body][nfirstlevel];
 }
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcTrigHeader.cxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcTrigHeader.cxx	(revision 2172)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcTrigHeader.cxx	(revision 2173)
@@ -1,5 +1,5 @@
 #include "MMcTrigHeader.hxx"
 
-#include <iostream.h>
+#include <iostream>
 
 
@@ -28,4 +28,5 @@
 ClassImp(MMcTrigHeader);
 
+using namespace std;
 
 
