Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 2727)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 2728)
@@ -5,10 +5,88 @@
                                                  -*-*- END OF LINE -*-*-
 
+ 2003/12/20: Thomas Bretz
+
+   * Makefile:
+     - added an option to statically link the programs (for
+       debugging)
+       
+   * merpp.cc, readdaq.cc, readraw.cc:
+     - small changes to the command line options
+       (the aim is a generalization)
+
+   * manalysis/MCalibrate.[h,cc]:
+     - removed leading '//' from class description
+     - removed usage of MGeomCam (it is obsolete here)
+     - small changes to make the output fit the 'standard'
+     - take the number of pixels from the containers, added a
+       consistency check
+     - added many small comment about future development
+     - added some const-qualifiers
+     - removed the 'unused/empty' pixels. They are obsolete and not
+       wanted at all.
+     - changed pixid to pixidx
+
+   * manalysis/MCalibrationPix.h:
+     - sorted member functions
+     - added some const qualifiers
+     - added many small comment about future development
+
+   * manalysis/MExtractSignal.cc:
+     - removed arguments from constructor
+     - added corresponding member functions
+       + the convetion is to have only vital arguments in the
+         construtor and member functions to change the default
+     - removed obsolete PostProcess
+     
+   * manalysis/MExtractedSignalCam.h, manalysis/MExtractedSignalPix.h:
+     - added corresponding member functions
+   
+   * mbase/MArgs.[h,cc]:
+     - added some comments
+     - added options/arguments to Print
+     - added GetNumOptions
+     - added GetNumEntries
+     - added HasOnly
+     - added HasOnlyAndRemove
+     
+   * mbase/MEvtLoop.[h,cc]:
+     - removed leading '//' from class description
+     - replaced INT_MAX by kMaxUInt
+     - changed meaning of eventloop argument:
+       now 0 means all-events instead of -1
+     - forward tlist-name from Eventloop to PreProcess
+   
+   * mbase/MTime.[h,cc]:
+     - added UpdMagicTime
+
+   * mfilter/MFEventSelector2.cc:
+     - replaced INT_MAX by kMaxUInt
+     
+   * mmain/MEventDisplay.[h,cc]:
+     - make use of MEvtLoop::GetTaskList()
+     - removed GetReader
+     
+   * mmontecarlo/MMcEnergyEst.cc:
+     - removed leading '//' from class description
+     
+   * mranforest/MRanTree.cc:
+     - removed leading '//' from class description
+     - replaced 1e20 by FLT_MAX
+   
+   * mraw/MRawEvtHeader.[h,cc], mraw/MRawFileRead.cc,
+     mraw/MRawRead.[h,cc], mraw/MRawRunHeader.cc,
+     mraw/MRawSocketRead.cc:
+     - added decoding of time from event header - UNTESTED!
+     
+   * mreport/MReportRun.h:
+     - set class verseion to 0 -- not ment for writing at the
+       moment
+
+
+
  2003/12/19: Markus Gaug, Michele Doro
 
-   * manalysis/MExtractSignal.[h,cc]
-   * manalysis/MCalibrate.[h,cc]
-   * manalysis/MCalibrationCalc.[h,cc]
-   * manalysis/MCalibrationPix.[h,cc]
+   * manalysis/MExtractSignal.[h,cc], manalysis/MCalibrate.[h,cc],
+     manalysis/MCalibrationCalc.[h,cc], manalysis/MCalibrationPix.[h,cc]:
      - Treatment of the conversion factors between HI Gain and Lo Gain
        is now done in the MCalibrationPix. 
Index: /trunk/MagicSoft/Mars/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/Makefile	(revision 2727)
+++ /trunk/MagicSoft/Mars/Makefile	(revision 2728)
@@ -21,5 +21,5 @@
 
 #PROGRAMS = readraw merpp mars test mona status
-PROGRAMS = readraw readdaq merpp star status mars mona
+PROGRAMS = readdaq readraw merpp star status mars mona
 SOLIB    = libmars.so
 CINT     = M
@@ -63,4 +63,5 @@
 MRPROPERS = $(SUBDIRS:=.mrproper)
 CLEANERS  = $(SUBDIRS:=.clean)
+LIBS      = $(SOLIB)
 
 #------------------------------------------------------------------------------
@@ -72,9 +73,13 @@
 SRCS    = $(SRCFILES)
 HEADERS = $(SRCFILES:.cc=.h)
-OBJS    = $(SRCFILES:.cc=.o) 
+OBJS    = $(SRCFILES:.cc=.o) MCint.o
 
 ############################################################
+all: rmlib $(SOLIB) $(PROGRAMS)
+	@echo " Done. "
+	@echo " "
 
-all: rmlib $(PROGRAMS) $(SOLIB)
+static: LIBS=$(SUBDIRS:=/*.o) $(OBJS)
+static: rmlib $(LIBRARIES) $(PROGRAMS)
 	@echo " Done. "
 	@echo " "
@@ -83,42 +88,20 @@
 include Makefile.depend
 
+#
 # Use $(CXX) -v ... for a more verbose output
 #
-#
-#$(MARS_LIB)
-$(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS) MCint.o
+# ROOTGLIBS must be there - why? How can I link the libraries?
+$(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS)
 	@echo " Linking $(SOLIB) ..."
-	$(CXX) $(DYNLIB) $(CXXFLAGS) $(OBJS) MCint.o $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
+	$(CXX) $(CXXFLAGS) $(DYNLIB) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
+#	$(CXX) $(CXXFLAGS) $(DYNLIB) $(OBJS) -Wl,--export-dynamic -Llib $(LIBRARIES:%.a=-l%) -o $@
 
-$(PROGRAMS): $(SOLIB) $(PROGRAMS:=.o)
+$(PROGRAMS): $(LIBS) $(PROGRAMS:=.o)
 	@echo " Linking $@ ..." 
-	$(CXX) $(CXXFLAGS) $(ROOTGLIBS) $(SOLIB) $@.o $(MARS_LIB) -o $@
-
-#
-# We could link mars.so instead of all libraries. This would need
-# some MBs less space on the HD. But this means, that the Shared
-# Library Path in your system must be set properly to be able to start
-# 'mars'
-#
-#$(PROGRAMS): $(LIBRARIES) $(OBJS) $(HEADERS) $(SOLIB) MCint.o $(PROGRAMS:=.o) 
-#	@echo " Linking $@ ..." 
-#	$(CXX) $(CXXFLAGS) $@.o $(OBJS) lib/$(SOLIB)  MCint.o $(ROOTGLIBS) -o $@
-
-#
-# For later use
-#
-#$(PROGRAMS): $(LIBRARIES) $(OBJS) $(HEADERS) MCint.o $(PROGRAMS:=.o) 
-#	@echo " Linking $@ ..." 
-#	$(CXX) $(CXXFLAGS) $@.o $(OBJS) $(MARS_LIB) -L/usr/X11R6/lib -lX11 -lXpm MCint.o $(ROOTGLIBS) -o $@
-#
-#$(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS) MCint.o
-#	@echo " Linking $(SOLIB) ..."
-#	$(CXX) -shared $(CXXFLAGS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
-#	mv mars.so lib
+	$(CXX) $(CXXFLAGS) $(ROOTGLIBS) $(LIBS) $@.o $(MARS_LIB) -o $@
 
 $(LIBRARIES):
 	@echo " Creating lib$@:"
 	(cd $*; make; cd ..; mv $*/$@ lib/lib$@)
-#	(cd $(@:lib/lib%.a=%); make; cd ..; mv $(@:lib/lib%.a=%)/$(@:lib/lib%=%) $@)
 
 $(MRPROPERS):
Index: /trunk/MagicSoft/Mars/manalysis/MCalibrate.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MCalibrate.cc	(revision 2727)
+++ /trunk/MagicSoft/Mars/manalysis/MCalibrate.cc	(revision 2728)
@@ -24,23 +24,19 @@
 
 //////////////////////////////////////////////////////////////////////////////
-//                                                                          //
-//   MCalibrate                                                             //
-//                                                                          //
-//   This task takes the integrated charge from MExtractedSignal and apply  //
-//   the calibration constants from MCalibraitionCam to the charge. Then    //
-//   stores number of photons obtained in MCerPhotEvt.                      //
-//                                                                          //
-//   Input Containers:                                                      //
-//                                                                          //     
-//   MGeomCam                                                               //
-//   MExtractedSingal                                                       //
-//   MCalibrationCam                                                        //
-//                                                                          //
-//   Output Containers:                                                     //
-//                                                                          //
-//   MCerPhotEvt                                                            //
-//                                                                          //
+//
+//   MCalibrate
+//
+//   This task takes the integrated charge from MExtractedSignal and apply
+//   the calibration constants from MCalibraitionCam to the charge. Then
+//   stores number of photons obtained in MCerPhotEvt.
+//
+//   Input Containers:
+//    MExtractedSingal
+//    MCalibrationCam
+//
+//   Output Containers:
+//    MCerPhotEvt
+//
 //////////////////////////////////////////////////////////////////////////////
-
 #include "MCalibrate.h"
 #include "MCalibrationConfig.h"
@@ -74,8 +70,6 @@
 MCalibrate::MCalibrate(const char *name, const char *title)
 {
-
     fName  = name  ? name  : "MCalibrate";
     fTitle = title ? title : "Task to calculate the number of photons in one event";
-
 }
 
@@ -94,36 +88,24 @@
 Int_t MCalibrate::PreProcess(MParList *pList)
 {
-
-    fGeomCam = (MGeomCam*)pList->FindObject("MGeomCam");
-    if (!fGeomCam)
-      {
-        *fLog << err << dbginf << "MGeomCam not found ... aborting." << endl;        
-        return kFALSE;
-      }
-
     fSignals = (MExtractedSignalCam*)pList->FindObject("MExtractedSignalCam");
     if (!fSignals)
-      {
-        *fLog << err << dbginf << "MExtractedSignalCam not found ... aborting" << endl;
+    {
+        *fLog << err << "MExtractedSignalCam not found ... aborting" << endl;
         return kFALSE;
-      }
+    }
 
     fCalibrations = (MCalibrationCam*)pList->FindObject("MCalibrationCam");
     if (!fCalibrations)
-      {
-        *fLog << err << dbginf << "MCalibrationCam not found ... aborting." << endl;        
+    {
+        *fLog << err << "MCalibrationCam not found ... aborting." << endl;
         return kFALSE;
-      }
+    }
 
     fCerPhotEvt = (MCerPhotEvt*)pList->FindCreateObj("MCerPhotEvt");
     if (!fCerPhotEvt)
-      {
-        *fLog << err << dbginf << "Cannot create MCerPhotEvt ... aborting" << endl;
         return kFALSE;
-      }
     
     return kTRUE;
 }
-
 
 // --------------------------------------------------------------------------
@@ -132,47 +114,51 @@
 Int_t MCalibrate::Process()
 {
-    UInt_t imaxnumpix = fGeomCam->GetNumPixels();
+    if (fCalibrations->GetNumPixels() != (UInt_t)fSignals->GetSize())
+    {
+        // FIXME: MExtractedSignal must be of variable size -
+        //        like MCerPhotEvt - because we must be able
+        //        to reduce size by zero supression
+        //        For the moment this check could be done in ReInit...
+        *fLog << err << "MExtractedSignal and MCalibrationCam have different sizes... abort." << endl;
+        return kFALSE;
+    }
+
+    const UInt_t imaxnumpix = fSignals->GetSize();
     
-    for (UInt_t pixid = 0; pixid < imaxnumpix; pixid++)
+    for (UInt_t pixidx=0; pixidx<imaxnumpix; pixidx++)
     {
-	MCalibrationPix &pix = (*fCalibrations)[pixid];
+	const MCalibrationPix &pix = (*fCalibrations)[pixidx];
 
+        if (!pix.IsBlindPixelMethodValid())
+            continue;
 
-	if (pix.IsBlindPixelMethodValid())
-	{
-	    MExtractedSignalPix &sig =  (*fSignals)[pixid];
+        MExtractedSignalPix &sig =  (*fSignals)[pixidx];
 
-	    Float_t signal;
-	    Float_t signalErr = 0.;
+        Float_t signal;
+        Float_t signalErr = 0.;
 
-	    if (sig.IsLoGainUsed())
-              {
-		signal    = sig.GetExtractedSignalLoGain()*pix.GetConversionHiLo();
-                signalErr = signal*pix.GetConversionHiLoError();
-              }
-	    else
-              {
-                signal = sig.GetExtractedSignalHiGain();
-              }
-            
-	    //      Float_t calibrationConvertionFactor = pix.GetMeanConversionFFactorMethod();
-	    Float_t calibrationConversionFactor      = pix.GetMeanConversionBlindPixelMethod();
-	    Float_t calibrationConversionFactorError = pix.GetErrorConversionBlindPixelMethod();
+        if (sig.IsLoGainUsed())
+        {
+            signal    = sig.GetExtractedSignalLoGain()*pix.GetConversionHiLo();
+            signalErr = signal*pix.GetConversionHiLoError();
+        }
+        else
+        {
+            signal = sig.GetExtractedSignalHiGain();
+        }
 
-	    Float_t nphot    = signal*calibrationConversionFactor;
-	    Float_t nphotErr = signal*calibrationConversionFactorError
-                              *signal*calibrationConversionFactorError;
-	    nphotErr        += signalErr*calibrationConversionFactor
-                              *signalErr*calibrationConversionFactor;
+        //      Float_t calibrationConvertionFactor = pix.GetMeanConversionFFactorMethod();
+        const Float_t calibrationConversionFactor      = pix.GetMeanConversionBlindPixelMethod();
+        const Float_t calibrationConversionFactorError = pix.GetErrorConversionBlindPixelMethod();
 
-            nphotErr  = TMath::Sqrt(nphotErr);
+        const Float_t nphot = signal*calibrationConversionFactor;
+        Float_t nphotErr    = signal*calibrationConversionFactorError
+                             *signal*calibrationConversionFactorError;
+        nphotErr += signalErr*calibrationConversionFactor
+                   *signalErr*calibrationConversionFactor;
 
-	    fCerPhotEvt->AddPixel(pixid, nphot, nphotErr);
-	}
-	else
-	  {
-	    fCerPhotEvt->AddPixel(pixid, 0., 0.);
-	    (*fCerPhotEvt)[pixid].SetPixelUnused();
-	  }
+        nphotErr  = TMath::Sqrt(nphotErr);
+
+        fCerPhotEvt->AddPixel(pixidx, nphot, nphotErr);
     }
 
@@ -182,3 +168,2 @@
     return kTRUE;
 }
-
Index: /trunk/MagicSoft/Mars/manalysis/MCalibrate.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MCalibrate.h	(revision 2727)
+++ /trunk/MagicSoft/Mars/manalysis/MCalibrate.h	(revision 2728)
@@ -25,6 +25,5 @@
 class MCalibrate : public MTask
 {
-
-    MGeomCam            *fGeomCam;      // Geometry of the camera 
+private:
     MCalibrationCam     *fCalibrations; // Calibration constants 
     MExtractedSignalCam *fSignals;      // Integrated charge in FADCs counts
@@ -40,5 +39,5 @@
     MCalibrate(const char *name=NULL, const char *title=NULL);
 
-    void SetConversionHiLo(Float_t conv)         { fConversionHiLo = conv; }
+    void SetConversionHiLo(Float_t conv) { fConversionHiLo = conv; }
     
     ClassDef(MCalibrate, 0)   // Task to calculate cerenkov photons using calibration constants
Index: /trunk/MagicSoft/Mars/manalysis/MCalibrationPix.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MCalibrationPix.h	(revision 2727)
+++ /trunk/MagicSoft/Mars/manalysis/MCalibrationPix.h	(revision 2728)
@@ -68,64 +68,80 @@
   void Clear(Option_t *o="");
 
-  Float_t GetCharge()         const    { return fCharge;         }
-  Float_t GetRSigmaSquare()   const    { return fRSigmaSquare;   }
+  // Getter
+  Bool_t IsFitValid()              const { return fFitValid;  }
+  Bool_t IsFitted()                const { return fFitted;  }
+  Bool_t IsBlindPixelMethodValid() const { return fBlindPixelMethodValid;  }
+  Bool_t IsFFactorMethodValid()    const { return fFFactorMethodValid;  }
+  Bool_t IsPINDiodeMethodValid()   const { return fPINDiodeMethodValid;  }
+
+  Float_t GetCharge()              const { return fCharge;         }
+  Float_t GetRSigmaSquare()        const { return fRSigmaSquare;   }
     
-  Float_t GetErrCharge()      const    { return fErrCharge;      }
-  Float_t GetChargeProb()     const    { return fChargeProb;     }    
+  Float_t GetErrCharge()           const { return fErrCharge;      }
+  Float_t GetChargeProb()          const { return fChargeProb;     }    
   
-  Float_t GetSigmaCharge()    const    { return fSigmaCharge;    }
-  Float_t GetErrSigmaCharge() const    { return fErrSigmaCharge; }
-  Float_t GetTime()           const    { return fTime;           }
-  Float_t GetSigmaTime()      const    { return fSigmaTime;      }
-  Float_t GetTimeChiSquare()  const    { return fTimeChiSquare;  }    
-  
-  Float_t GetPed()            const    { return fPed;            }
-  Float_t GetPedRms()         const    { return fPedRms;         }    
+  Float_t GetSigmaCharge()         const { return fSigmaCharge;    }
+  Float_t GetErrSigmaCharge()      const { return fErrSigmaCharge; }
+  Float_t GetTime()                const { return fTime;           }
+  Float_t GetSigmaTime()           const { return fSigmaTime;      }
+  Float_t GetTimeChiSquare()       const { return fTimeChiSquare;  }    
 
+  Float_t GetConversionHiLo()                 const  { return fConversionHiLo;        }
+  Float_t GetConversionHiLoError()            const  { return fConversionHiLoError;   }
+
+  Float_t GetMeanConversionBlindPixelMethod()  const { return fConversionBlindPixelMethod ; }
+  Float_t GetErrorConversionBlindPixelMethod() const { return fConversionErrorBlindPixelMethod ; }
+  Float_t GetSigmaConversionBlindPixelMethod() const { return fConversionSigmaBlindPixelMethod ; }
+
+  Float_t GetMeanConversionFFactorMethod()     const { return fConversionFFactorMethod ;       }
+  Float_t GetErrorConversionFFactorMethod()    const { return fConversionErrorFFactorMethod ;  }
+  Float_t GetSigmaConversionFFactorMethod()    const { return fConversionSigmaFFactorMethod ;  }
+
+  Float_t GetPheFFactorMethod()                const { return fPheFFactorMethod;               }
+  Float_t GetPheFFactorMethodError()           const { return fPheFFactorMethodError;          }
+
+  Float_t GetMeanConversionPINDiodeMethod()    const { return fConversionPINDiodeMethod ;      }
+  Float_t GetErrorConversionPINDiodeMethod()   const { return fConversionErrorPINDiodeMethod ; }
+  Float_t GetSigmaConversionPINDiodeMethod()   const { return fConversionSigmaPINDiodeMethod ; }
+
+  // FIXME: Remove this from stored data members
+  Float_t GetPed()    const { return fPed;    }
+  Float_t GetPedRms() const { return fPedRms; }
+
+  // Setter
   void SetPedestal(Float_t ped, Float_t pedrms);
-  void SetHiGainSaturation()                               { fHiGainSaturation = kTRUE; fHist->SetUseLoGain(); } 
+  void SetHiGainSaturation()             { fHiGainSaturation = kTRUE; fHist->SetUseLoGain(); }
 
-  void ApplyLoGainConversion();
+  void SetConversionHiLo(Float_t c)      { fConversionHiLo      = c;    }
+  void SetConversionHiLoError(Float_t e) { fConversionHiLoError = e;    }
 
-  void SetConversionHiLo(Float_t c)                       { fConversionHiLo      = c;    }
-  void SetConversionHiLoError(Float_t e)                    { fConversionHiLoError = e;    }
-
-  Float_t GetConversionHiLo()                       { return fConversionHiLo;        }
-  Float_t GetConversionHiLoError()                  { return fConversionHiLoError;   }
-  
-  void SetConversionFFactorMethod(Float_t c, Float_t err, Float_t sig)      
-                                                    { 
-						      fConversionFFactorMethod = c;
-						      fConversionErrorFFactorMethod = err;
-						      fConversionSigmaFFactorMethod = sig;
-						    }
-  void SetConversionBlindPixelMethod(Float_t c, Float_t err, Float_t sig)     
-                                                    { 
-						      fConversionBlindPixelMethod = c; 
-						      fConversionErrorBlindPixelMethod = err; 
-						      fConversionSigmaBlindPixelMethod = sig; 
-						    }
+  void SetConversionFFactorMethod(Float_t c, Float_t err, Float_t sig)
+  {
+      fConversionFFactorMethod = c;
+      fConversionErrorFFactorMethod = err;
+      fConversionSigmaFFactorMethod = sig;
+  }
+  void SetConversionBlindPixelMethod(Float_t c, Float_t err, Float_t sig)
+  {
+      fConversionBlindPixelMethod = c;
+      fConversionErrorBlindPixelMethod = err;
+      fConversionSigmaBlindPixelMethod = sig;
+  }
 
   void SetConversionPINDiodeMethod(Float_t c, Float_t err, Float_t sig)
-                                                    { 
-						      fConversionPINDiodeMethod = c ;
-						      fConversionErrorPINDiodeMethod = err; 
-						      fConversionSigmaPINDiodeMethod = sig; 
-						    }
+  {
+      fConversionPINDiodeMethod = c ;
+      fConversionErrorPINDiodeMethod = err;
+      fConversionSigmaPINDiodeMethod = sig;
+  }
 
-  Float_t GetMeanConversionBlindPixelMethod()   const  { return fConversionBlindPixelMethod ; }
-  Float_t GetErrorConversionBlindPixelMethod()  const  { return fConversionErrorBlindPixelMethod ; }
-  Float_t GetSigmaConversionBlindPixelMethod()  const  { return fConversionSigmaBlindPixelMethod ; }
+  void SetFitValid()                            { fFitValid = kTRUE;  }
+  void SetFitted()                              { fFitted = kTRUE;  }
+  void SetBlindPixelMethodValid(Bool_t b=kTRUE) { fBlindPixelMethodValid = b;  }
+  void SetFFactorMethodValid(Bool_t b=kTRUE)    { fFFactorMethodValid = b;  }
+  void SetPINDiodeMethodValid(Bool_t b=kTRUE)   { fPINDiodeMethodValid = b;  }
 
-  Float_t GetMeanConversionFFactorMethod()      const  { return fConversionFFactorMethod ;       }
-  Float_t GetErrorConversionFFactorMethod()     const  { return fConversionErrorFFactorMethod ;  }
-  Float_t GetSigmaConversionFFactorMethod()     const  { return fConversionSigmaFFactorMethod ;  }
-
-  Float_t GetPheFFactorMethod()                 const  { return fPheFFactorMethod;               }
-  Float_t GetPheFFactorMethodError()            const  { return fPheFFactorMethodError;          }    
- 
-  Float_t GetMeanConversionPINDiodeMethod()     const  { return fConversionPINDiodeMethod ;      }
-  Float_t GetErrorConversionPINDiodeMethod()    const  { return fConversionErrorPINDiodeMethod ; }
-  Float_t GetSigmaConversionPINDiodeMethod()    const  { return fConversionSigmaPINDiodeMethod ; }
+  // Unknown
+  void   ApplyLoGainConversion();
 
   void   SetChargesInGraph(Float_t qhi,Float_t qlo) { fHist->SetPointInGraph(qhi,qlo); }
@@ -139,16 +155,6 @@
   Bool_t FillRChargevsTimeLoGain(Float_t rq, Int_t t)  { return fHist->FillChargevsNLoGain(rq,t); }    
   
-  Bool_t IsFitValid()                                  { return fFitValid;  }
-  Bool_t IsFitted()                                    { return fFitted;  }
-  Bool_t IsBlindPixelMethodValid()                     { return fBlindPixelMethodValid;  }
-  Bool_t IsFFactorMethodValid()                        { return fFFactorMethodValid;  }
-  Bool_t IsPINDiodeMethodValid()                       { return fPINDiodeMethodValid;  }
-  
-  void   SetFitValid()                                     { fFitValid = kTRUE;  }
-  void   SetFitted()                                      { fFitted = kTRUE;  }
-  void   SetBlindPixelMethodValid(Bool_t b=kTRUE)               { fBlindPixelMethodValid = b;  }
-  void   SetFFactorMethodValid(Bool_t b=kTRUE)                 { fFFactorMethodValid = b;  }
-  void   SetPINDiodeMethodValid(Bool_t b=kTRUE)                { fPINDiodeMethodValid = b;  }
-  
+  // FIXME: Not necessary -> pixidx (not id anyhow!) == index in array!
+  //        Only needed n histograms which have to move to an MH-class anyhow!
   Int_t  GetPixId()                              const  { return fPixId;   }
   void   DefinePixId(Int_t i);
Index: /trunk/MagicSoft/Mars/manalysis/MExtractSignal.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MExtractSignal.cc	(revision 2727)
+++ /trunk/MagicSoft/Mars/manalysis/MExtractSignal.cc	(revision 2728)
@@ -56,7 +56,7 @@
 // Default constructor. 
 //
-MExtractSignal::MExtractSignal(const Byte_t first, const Byte_t last, const Byte_t logainshift, 
+MExtractSignal::MExtractSignal(/*const Byte_t first, const Byte_t last, const Byte_t logainshift,*/
                     const char *name, const char *title)
-  : fNumHiGainSamples(last-first+1), fNumLoGainSamples(last-first+1),
+  : /*fNumHiGainSamples(last-first+1), fNumLoGainSamples(last-first+1),*/
     fSaturationLimit(254)
 {
@@ -67,9 +67,24 @@
     AddToBranchList("MRawEvtData.*");
 
+    SetRange();
+    /*
+     fFirst       = first;
+     fLoGainFirst = first+logainshift;
+
+     fSqrtHiGainSamples = TMath::Sqrt((Float_t)fNumHiGainSamples);
+     fSqrtLoGainSamples = TMath::Sqrt((Float_t)fNumLoGainSamples);
+     */
+}
+
+void MExtractSignal::SetRange(Byte_t first, Byte_t last, Byte_t logainshift)
+{
+    fNumHiGainSamples = last-first+1;
+    fNumLoGainSamples = last-first+1;
+
     fFirst       = first;
     fLoGainFirst = first+logainshift;
 
-    fSqrtHiGainSamples = TMath::Sqrt((Float_t)fNumHiGainSamples); 
-    fSqrtLoGainSamples = TMath::Sqrt((Float_t)fNumLoGainSamples); 
+    fSqrtHiGainSamples = TMath::Sqrt((Float_t)fNumHiGainSamples);
+    fSqrtLoGainSamples = TMath::Sqrt((Float_t)fNumLoGainSamples);
 }
 
@@ -87,9 +102,8 @@
 Int_t MExtractSignal::PreProcess(MParList *pList)
 {
-
     fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData");
     if (!fRawEvt)
     {
-        *fLog << dbginf << "MRawEvtData not found... aborting." << endl;
+        *fLog << err << "MRawEvtData not found... aborting." << endl;
         return kFALSE;
     }
@@ -103,5 +117,5 @@
     if (!fPedestals)
       {
-        *fLog << err << dbginf << "Cannot find MPedestalCam ... aborting" << endl;
+        *fLog << err << "MPedestalCam not found... aborting" << endl;
         return kFALSE;
       }
@@ -118,6 +132,4 @@
 Bool_t MExtractSignal::ReInit(MParList *pList )
 {
- 
-
     MGeomCam *cam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
     if (!cam)
@@ -127,9 +139,11 @@
     }
 
+    // FIXME: This solution may change in the future, MExtractedSignal
+    //        must be similar to MCerPhotEvt not to MPedestalCam
+    //        (Have to think about the mean size of both solutions)
     fSignals->InitSize(cam->GetNumPixels());    
 
-
-    fSignals->SetNumUsedFADCSlices(fNumHiGainSamples,fFirst,fFirst+fNumHiGainSamples-1,
-				   fNumLoGainSamples,fFirst,fFirst+fNumLoGainSamples-1);
+    fSignals->SetNumUsedFADCSlices(fNumHiGainSamples, fFirst, fFirst+fNumHiGainSamples-1,
+				   fNumLoGainSamples, fFirst, fFirst+fNumLoGainSamples-1);
 
     return kTRUE;
@@ -144,11 +158,9 @@
 Int_t MExtractSignal::Process()
 {
-
     MRawEvtPixelIter pixel(fRawEvt);
     fSignals->Clear();
 
     while (pixel.Next())
-      {
-
+    {
         UShort_t satHi = 0;
         UShort_t satLo = 0;
@@ -219,6 +231,7 @@
 			       );
 
-	pix.SetGainSaturation((satHi),satHi,satLo);
-
+	pix.SetGainSaturation(satHi, satHi, satLo);
+
+        // FIXME: Arrival time has to be stored in MArrivalTime!
 	if (satHi)
 	  pix.SetArrivalTimes((Float_t)(midlo+fFirst),0.,0.);
@@ -233,9 +246,2 @@
     return kTRUE;
 }
-
-Int_t MExtractSignal::PostProcess()
-{
-
-  return kTRUE;
-
-}
Index: /trunk/MagicSoft/Mars/manalysis/MExtractedSignalCam.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MExtractedSignalCam.h	(revision 2727)
+++ /trunk/MagicSoft/Mars/manalysis/MExtractedSignalCam.h	(revision 2728)
@@ -7,6 +7,4 @@
 
 class TClonesArray;
-
-class MGeomCam;
 class MExtractedSignalPix;
 
@@ -16,4 +14,5 @@
     TClonesArray *fArray; // FIXME: Change TClonesArray away from a pointer?
 
+    // FIXME: Is it necessary to store this information for each event?
     Byte_t fNumUsedHiGainFADCSlices;
     Byte_t fNumUsedLoGainFADCSlices;
@@ -24,5 +23,4 @@
     Byte_t fLastUsedSliceHiGain;
     Byte_t fLastUsedSliceLoGain;
-
 
 public:
@@ -47,13 +45,16 @@
 
     void   SetNumUsedFADCSlices(Byte_t numh, Byte_t firsth, Byte_t lasth, 
-			Byte_t numl, Byte_t firstl, Byte_t lastl)   
-                                           { 
-					     fNumUsedHiGainFADCSlices = numh;
-					     fFirstUsedSliceHiGain    = firsth;
-					     fLastUsedSliceHiGain     = lasth;
-					     fNumUsedLoGainFADCSlices = numl;  
-					     fFirstUsedSliceLoGain    = firstl;
-					     fLastUsedSliceLoGain     = lastl;
-					   }
+                                Byte_t numl, Byte_t firstl, Byte_t lastl)
+    {
+        // FIXME: Calculate the number of used slices from first/last
+        //        to make sure, that the stored values are always
+        //        consistent!
+        fNumUsedHiGainFADCSlices = numh;
+        fFirstUsedSliceHiGain    = firsth;
+        fLastUsedSliceHiGain     = lasth;
+        fNumUsedLoGainFADCSlices = numl;
+        fFirstUsedSliceLoGain    = firstl;
+        fLastUsedSliceLoGain     = lastl;
+    }
 
     MExtractedSignalPix &operator[](Int_t i);
Index: /trunk/MagicSoft/Mars/manalysis/MExtractedSignalPix.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MExtractedSignalPix.h	(revision 2727)
+++ /trunk/MagicSoft/Mars/manalysis/MExtractedSignalPix.h	(revision 2728)
@@ -9,13 +9,16 @@
 {
 private:
-
+    // FIXME: We can only store ONE signal. Everything else takes
+    //        too much storage space - will change in the future.
     Float_t fExtractedSignalHiGain;      // mean value of the extracted signal
     Float_t fExtractedSignalHiGainError; // error of the mean value of the extracted signal
     Float_t fExtractedSignalLoGain;      // mean value of the extracted signal
     Float_t fExtractedSignalLoGainError; // error of the mean value of the extracted signal
+
     Bool_t fIsLoGainUsed;
     Byte_t fNumHiGainSaturated;
     Byte_t fNumLoGainSaturated;
 
+    // FIXME: Will be removed. Must be stored in MArrivalTime
     Float_t fMeanArrivalTime;
     Float_t fWidthArrivalTime;
Index: /trunk/MagicSoft/Mars/mbase/MArgs.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MArgs.cc	(revision 2727)
+++ /trunk/MagicSoft/Mars/mbase/MArgs.cc	(revision 2728)
@@ -30,4 +30,7 @@
 // This is a helper class for executables to parse command line arguments
 //
+// Arguments beginning with a trailing '-' are called 'options'.
+// Arguments without a trailing '-' are considered 'arguments'
+//
 //////////////////////////////////////////////////////////////////////////////
 #include "MArgs.h"
@@ -82,9 +85,34 @@
 // --------------------------------------------------------------------------
 //
-// Print all arguments parsed.
+// Print everything parsed.
+// Using 'options' as option only 'options' are printed.
+// Using 'arguments' as option only 'arguments' are printed.
 //
 void MArgs::Print(const Option_t *o) const
 {
     gLog << all << underline << fName << ":" << endl;
+
+    const TString str(o);
+
+    if (!str.CompareTo("options", TString::kIgnoreCase))
+    {
+        TIter Next(fArgv);
+        TString *s = NULL;
+        while ((s=dynamic_cast<TString*>(Next())))
+            if (s->BeginsWith("-"))
+                gLog << *s << endl;
+        return;
+    }
+
+    if (!str.CompareTo("arguments", TString::kIgnoreCase))
+    {
+        TIter Next(fArgv);
+        TString *s = NULL;
+        while ((s=dynamic_cast<TString*>(Next())))
+            if (!s->BeginsWith("-"))
+                gLog << *s << endl;
+        return;
+    }
+
     fArgv->Print();
 }
@@ -246,4 +274,30 @@
 // --------------------------------------------------------------------------
 //
+// return the number of arguments with a trainling '-'
+//
+Int_t MArgs::GetNumOptions() const
+{
+    Int_t num = 0;
+
+    TIter Next(fArgv);
+    TString *s = NULL;
+    while ((s=dynamic_cast<TString*>(Next())))
+        if (s->BeginsWith("-"))
+            num++;
+
+    return num;
+}
+
+// --------------------------------------------------------------------------
+//
+// return the total number of entries
+//
+Int_t MArgs::GetNumEntries() const
+{
+    return fArgv->GetSize();
+}
+
+// --------------------------------------------------------------------------
+//
 // Checks whether an argument beginning with 'n' is existing, eg:
 //  executable -value5
@@ -259,4 +313,24 @@
     while ((s=dynamic_cast<TString*>(Next())))
         if (s->BeginsWith(name))
+            return kTRUE;
+    return kFALSE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Checks whether an argument beginning with 'n' is existing, eg:
+//  executable -value5
+//   HasOption("-value") will return false
+//  executable -value
+//   HasOption("-value") will return true
+//
+Bool_t MArgs::HasOnly(const TString n) const
+{
+    const TString name = n.Strip(TString::kBoth);
+
+    TIter Next(fArgv);
+    TString *s = NULL;
+    while ((s=dynamic_cast<TString*>(Next())))
+        if (*s==name)
             return kTRUE;
     return kFALSE;
@@ -284,2 +358,30 @@
     return kFALSE;
 }
+
+// --------------------------------------------------------------------------
+//
+// Checks whether an argument beginning with 'n' is exists and a
+// corresponding option is available, eg.
+//  executable -value5
+//  HasOption("-value") will return false
+// but:
+//  executable -value
+//  HasOption("-value") will return true
+//
+// The argument is removed from the internal list.
+//
+Bool_t MArgs::HasOnlyAndRemove(const TString n)
+{
+    const TString name = n.Strip(TString::kBoth);
+
+    TIter Next(fArgv);
+    TString *s = NULL;
+    while ((s=dynamic_cast<TString*>(Next())))
+        if (*s==name)
+        {
+            delete fArgv->Remove(dynamic_cast<TObject*>(s));
+            return kTRUE;
+        }
+
+    return kFALSE;
+}
Index: /trunk/MagicSoft/Mars/mbase/MArgs.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MArgs.h	(revision 2727)
+++ /trunk/MagicSoft/Mars/mbase/MArgs.h	(revision 2728)
@@ -47,11 +47,15 @@
     TString  GetStringAndRemove(const TString name);
 
-    Bool_t Has(const TString name) const;
-    Bool_t HasOption(const TString name) const;
+    Bool_t   Has(const TString name) const;
+    Bool_t   HasOnly(const TString name) const;
+    Bool_t   HasOption(const TString name) const;
+    Bool_t   HasOnlyAndRemove(const TString name);
 
-    TString GetArgumentStr(Int_t i) const;
-    Int_t   GetArgumentInt(Int_t i) const;
-    Float_t GetArgumentFloat(Int_t i) const;
-    Int_t   GetNumArguments() const;
+    TString  GetArgumentStr(Int_t i) const;
+    Int_t    GetArgumentInt(Int_t i) const;
+    Float_t  GetArgumentFloat(Int_t i) const;
+    Int_t    GetNumArguments() const;
+    Int_t    GetNumOptions() const;
+    Int_t    GetNumEntries() const;
 
     ClassDef(MArgs, 0)  //Class to parse command line arguments
Index: /trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 2727)
+++ /trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 2728)
@@ -25,45 +25,45 @@
 
 //////////////////////////////////////////////////////////////////////////////
-//                                                                          //
-// MEvtLoop                                                                 //
-//                                                                          //
-// This class is the core of each event processing.                         //
-// First you must set the parameter list to use. The parameter list         //
-// must contain the task list (MTaskList) to use. The name of the task      //
-// list can be specified if you call Eventloop. The standard name is        //
-// "MTaskList". The name you specify must match the name of the MTaskList   //
-// object.                                                                  //
-//                                                                          //
-// If you call Eventloop() first all PreProcess functions - with the        //
-// parameter list as an argument - of the tasks in the task list are        //
-// executed. If one of them returns kFALSE then the execution is stopped.   //
-// If the preprocessing was ok, The Process function of the tasks are       //
-// executed as long as one function returns kSTOP. Only the tasks which     //
-// are marked as "All" or with a string which matches the MInputStreamID    //
-// of MTaskList are executed. If one tasks returns kCONTINUE the pending    //
-// tasks in the list are skipped and the execution in continued with        //
-// the first one in the list.                                               //
-// Afterwards the PostProcess functions are executed.                       //
-//                                                                          //
-// If you want to display the progress in a gui you can use SetProgressBar  //
-// and a TGProgressBar or a MProgressBar. If you set a MStatusDisplay       //
-// using SetDisplay, the Progress bar from this display is used.            //
-//                                                                          //
-// You can create a macro from a completely setup eventloop by:             //
-//   evtloop.MakeMacro("mymacro.C");                                        //
-//                                                                          //
-// You will always need to check the macro, it will not run, but it         //
-// should have al important information.                                    //
-//                                                                          //
-//                                                                          //
-// You can also write all this information to a root file:                  //
-//   TFile file("myfile.root");                                             //
-//   evtloop.Write("MyEvtloopKey");                                         //
-//                                                                          //
-// You can afterwards read the information from an open file by:            //
-//   evtloop.Read("MyEvtloopKey");                                          //
-//                                                                          //
-// To lookup the information write it to a file using MakeMacro             //
-//                                                                          //
+//
+// MEvtLoop
+//
+// This class is the core of each event processing.
+// First you must set the parameter list to use. The parameter list
+// must contain the task list (MTaskList) to use. The name of the task
+// list can be specified if you call Eventloop. The standard name is
+// "MTaskList". The name you specify must match the name of the MTaskList
+// object.
+//
+// If you call Eventloop() first all PreProcess functions - with the
+// parameter list as an argument - of the tasks in the task list are
+// executed. If one of them returns kFALSE then the execution is stopped.
+// If the preprocessing was ok, The Process function of the tasks are
+// executed as long as one function returns kSTOP. Only the tasks which
+// are marked as "All" or with a string which matches the MInputStreamID
+// of MTaskList are executed. If one tasks returns kCONTINUE the pending
+// tasks in the list are skipped and the execution in continued with
+// the first one in the list.
+// Afterwards the PostProcess functions are executed.
+//
+// If you want to display the progress in a gui you can use SetProgressBar
+// and a TGProgressBar or a MProgressBar. If you set a MStatusDisplay
+// using SetDisplay, the Progress bar from this display is used.
+//
+// You can create a macro from a completely setup eventloop by:
+//   evtloop.MakeMacro("mymacro.C");
+//
+// You will always need to check the macro, it will not run, but it
+// should have al important information.
+//
+//
+// You can also write all this information to a root file:
+//   TFile file("myfile.root");
+//   evtloop.Write("MyEvtloopKey");
+//
+// You can afterwards read the information from an open file by:
+//   evtloop.Read("MyEvtloopKey");
+//
+// To lookup the information write it to a file using MakeMacro
+//
 //////////////////////////////////////////////////////////////////////////////
 #include "MEvtLoop.h"
@@ -393,5 +393,5 @@
 // for developers or use in special jobs only!
 //
-Int_t MEvtLoop::Process(Int_t maxcnt)
+Int_t MEvtLoop::Process(UInt_t maxcnt)
 {
     if (!fTaskList)
@@ -404,5 +404,5 @@
     *fLog << all <<"Eventloop running (";
 
-    if (maxcnt<0)
+    if (maxcnt==0)
         *fLog << "all";
     else
@@ -411,5 +411,5 @@
     *fLog << " events)..." << flush;
 
-    Int_t entries = INT_MAX;
+    UInt_t entries = kMaxUInt;
     fNumEvents = 0;
 
@@ -420,5 +420,4 @@
 
 #ifdef __MARS__
-        // limits.h
         MRead *read = (MRead*)fTaskList->FindObject("MRead");
         if (read && read->GetEntries()>0)
@@ -429,5 +428,5 @@
             fNumEvents = TMath::Min(maxcnt, entries);
         else
-            if (entries!=INT_MAX)
+            if (entries!=kMaxUInt)
                 fNumEvents = entries;
     }
@@ -439,6 +438,4 @@
     }
 
-    Int_t dummy = maxcnt<0 ? 0 : maxcnt;
-
     //
     // start a stopwatch
@@ -449,11 +446,12 @@
     //
     // This is the MAIN EVENTLOOP which processes the data
-    // if maxcnt<0 the number of processed events is counted
+    // if maxcnt==0 the number of processed events is counted
     // else only maxcnt events are processed
     //
-    Int_t numcnts = 0;
+    UInt_t numcnts = 0;
+    UInt_t dummy   = maxcnt;
 
     Int_t rc = kTRUE;
-    if (maxcnt<0)
+    if (maxcnt==0)
         // process first and increment if sucessfull
         while ((rc=fTaskList->Process())==kTRUE)
@@ -529,11 +527,15 @@
 // See class description above. Returns kTRUE if PreProcessing,
 // Processing and PostProcessing was successfull, otherwise kFALSE.
-//
-Bool_t MEvtLoop::Eventloop(Int_t maxcnt, const char *tlist)
+// maxcnt==0 means: all events
+// tlist is the name of the task-list to be used. Be carefull, this
+// feature is not finally implemented - it will only work if no
+// task will access the tasklist.
+//
+Bool_t MEvtLoop::Eventloop(UInt_t maxcnt, const char *tlist)
 {
     TDatime d;
     *fLog << inf << underline << "Eventloop: " << fName << " started at " << d.AsString() << endl;
 
-    Bool_t rc = PreProcess();
+    Bool_t rc = PreProcess(tlist);
 
     //
Index: /trunk/MagicSoft/Mars/mbase/MEvtLoop.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MEvtLoop.h	(revision 2727)
+++ /trunk/MagicSoft/Mars/mbase/MEvtLoop.h	(revision 2728)
@@ -63,8 +63,8 @@
 
     Bool_t PreProcess(const char *tlist="MTaskList");
-    Int_t  Process(Int_t maxcnt);
+    Int_t  Process(UInt_t maxcnt);
     Bool_t PostProcess() const;
 
-    Bool_t Eventloop(Int_t maxcnt=-1, const char *tlist="MTaskList");
+    Bool_t Eventloop(UInt_t maxcnt=0, const char *tlist="MTaskList");
 
     void MakeMacro(const char *filename="evtloop.C");
Index: /trunk/MagicSoft/Mars/mbase/MTime.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 2727)
+++ /trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 2728)
@@ -27,8 +27,11 @@
 // MTime
 //
-// A generalized MARS time stamp
+// A generalized MARS time stamp.
 //
 // WARNING: Be carefull changing this class. It is also used in the
 //          MAGIC drive software cosy!
+//
+// Remarke: If you encounter strange behaviour, check the casting.
+//          Note, that on Linux machines ULong_t and UInt_t is the same.
 //
 // Version 1:
@@ -206,4 +209,27 @@
 
     fMjd = mjd+1;
+}
+
+// --------------------------------------------------------------------------
+//
+// Update the magic time. Make sure, that the MJD is set correctly.
+// It must be the MJD of the corresponding night. You can set it
+// by Set(2003, 12, 24);
+//
+// It is highly important, that the time correspoding to the night is
+// between 13:00:00.0 (day of dawning) and 12:59:59.999 (day of sunrise)
+//
+Bool_t MTime::UpdMagicTime(Byte_t h, Byte_t m, Byte_t s, UShort_t ms)
+{
+    if (h>23 || m>59 || s>59 || ms>999)
+         return kFALSE;
+
+    const ULong_t tm = ((((h*60+m)*60)+s)*1000)+ms;
+
+    fTime = (Long_t)(tm < kHour*13 ? tm  : tm-kDay); // day of sunrise?
+    //fNanoSec = ns;
+
+    return kTRUE;
+
 }
 
Index: /trunk/MagicSoft/Mars/mbase/MTime.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MTime.h	(revision 2727)
+++ /trunk/MagicSoft/Mars/mbase/MTime.h	(revision 2728)
@@ -26,8 +26,9 @@
 class MTime : public MParContainer
 {
-private:
+public:
     static const UInt_t kHour; // [ms] one hour
     static const UInt_t kDay;  // [ms] one day
 
+private:
     UInt_t fMjd;     // [d]  Day in the century        (Day of sun rise)
     TTime  fTime;    // [ms] Time of Day               (-11h<=x<13h)
@@ -74,7 +75,8 @@
 
     Bool_t   Set(UInt_t mjd, ULong_t ms, UInt_t ns=0);
-    Bool_t   Set(UShort_t y, Byte_t m, Byte_t d, Byte_t h, Byte_t min, Byte_t s, UShort_t ms, UInt_t ns=0);
+    Bool_t   Set(UShort_t y, Byte_t m, Byte_t d, Byte_t h=13, Byte_t min=0, Byte_t s=0, UShort_t ms=0, UInt_t ns=0);
     void     Set(const struct timeval &tv);
     void     SetCT1Time(UInt_t mjd, UInt_t t1, UInt_t t0);
+    Bool_t   UpdMagicTime(Byte_t h, Byte_t m, Byte_t s, UShort_t ms);
     void     SetMjd(Double_t m);
     Double_t GetMjd() const;
Index: /trunk/MagicSoft/Mars/merpp.cc
===================================================================
--- /trunk/MagicSoft/Mars/merpp.cc	(revision 2727)
+++ /trunk/MagicSoft/Mars/merpp.cc	(revision 2728)
@@ -66,12 +66,12 @@
     gLog << "     inputfile.txt:  Magic DC currents file." << endl;
     gLog << "     ouputfile.root: Merpped root file." << endl;
-    gLog << "     -a0: Do not use Ansii codes." << endl;
-    gLog << "     -u1: Update file." << endl;
-    gLog << "     -cn: Compression level n=1..9 [default=2]" << endl;
-    gLog << "     -vn: Verbosity level n [default=2]" << endl;
+    gLog << "     -c#:                             Compression level #=1..9 [default=2]" << endl;
+    gLog << "     -v#:                             Verbosity level # [default=2]" << endl;
+    gLog << "     -u, --update:                    Update file" << endl;
+    gLog << "     -a, --no-colors:                 Do not use Ansii color codes" << endl;
     gLog << "     --start=yyyy-mm-dd/hh:mm:ss.mmm: Start event time for merpping report files" << endl;
     gLog << "     --stop=yyyy-mm-dd/hh:mm:ss.mmm:  Stop  event time for merpping report files" << endl;
     gLog << "     --run=#:                         Only merpp data corresponding to this run number" << endl;
-    gLog << "     -?/-h: This help" << endl << endl;
+    gLog << "     -?, -h, --help:                  This help" << endl << endl;
     gLog << "   REMARK: At the moment you can process a .raw _or_ a .rep file, only!" << endl << endl;
 }
@@ -99,5 +99,5 @@
     MArgs arg(argc, argv);
 
-    if (arg.HasOption("-?") || arg.HasOption("-h"))
+    if (arg.HasOnly("-?") || arg.HasOnly("-h") || arg.HasOnly("--help"))
     {
         Usage();
@@ -105,9 +105,9 @@
     }
 
-    if (arg.HasOption("-a") && arg.GetIntAndRemove("-a")==0)
+    if (arg.HasOnlyAndRemove("--no-colors") || arg.HasOnlyAndRemove("-a"))
         gLog.SetNoColors();
 
     const Int_t kComprlvl = arg.HasOption("-c") ? arg.GetIntAndRemove("-c") : 1;
-    Bool_t kUpdate = arg.HasOption("-u") && arg.GetIntAndRemove("-u")==1;
+    Bool_t kUpdate = arg.HasOnlyAndRemove("--update") || arg.HasOnlyAndRemove("-u");
 
     gLog.SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2);
Index: /trunk/MagicSoft/Mars/mfilter/MFEventSelector2.cc
===================================================================
--- /trunk/MagicSoft/Mars/mfilter/MFEventSelector2.cc	(revision 2727)
+++ /trunk/MagicSoft/Mars/mfilter/MFEventSelector2.cc	(revision 2728)
@@ -94,6 +94,4 @@
 /////////////////////////////////////////////////////////////////////////////
 #include "MFEventSelector2.h"
-
-#include <limits.h>         // INT_MAX
 
 #include <TRandom.h>        // gRandom
@@ -190,7 +188,7 @@
 Bool_t MFEventSelector2::ReadDistribution(MRead &read)
 {
-    if (read.GetEntries() > INT_MAX) // FIXME: LONG_MAX ???
-    {
-        *fLog << err << "INT_MAX exceeded." << endl;
+    if (read.GetEntries() > kMaxUInt) // FIXME: LONG_MAX ???
+    {
+        *fLog << err << "kIntMax exceeded." << endl;
         return kFALSE;
     }
Index: /trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MEventDisplay.cc	(revision 2727)
+++ /trunk/MagicSoft/Mars/mmain/MEventDisplay.cc	(revision 2728)
@@ -128,16 +128,4 @@
 // --------------------------------------------------------------------------
 //
-//  Return reading task
-//
-MReadTree *MEventDisplay::GetReader() const
-{
-    MParList  *plist  = (MParList*)fEvtLoop->GetParList();
-    MTaskList *tlist  = (MTaskList*)plist->FindObject("MTaskList");
-    MReadTree *reader = (MReadTree*)tlist->FindObject("MRead");
-    return reader;
-}
-
-// --------------------------------------------------------------------------
-//
 //  Setup Task and parameter list for hillas calculation,
 //  preprocess tasks and read in first event (process)
@@ -389,8 +377,8 @@
 void MEventDisplay::ReadinEvent(Int_t dir)
 {
-    MParList    *plist = (MParList*)fEvtLoop->GetParList();
-    MGeomCam    *geom  = (MGeomCam*) plist->FindObject("MGeomCam");
-    MTaskList   *tlist = (MTaskList*)plist->FindObject("MTaskList");
-    MRawEvtData *raw = (MRawEvtData*)plist->FindObject("MRawEvtData");
+    MParList    *plist = (MParList*)   fEvtLoop->GetParList();
+    MTaskList   *tlist = (MTaskList*)  fEvtLoop->GetTaskList();
+    MGeomCam    *geom  = (MGeomCam*)   plist->FindObject("MGeomCam");
+    MRawEvtData *raw   = (MRawEvtData*)plist->FindObject("MRawEvtData");
     if (!raw)
         return;
@@ -399,5 +387,5 @@
     // Read first event.
     //
-    MReadTree *reader = GetReader();
+    MReadTree *reader = (MReadTree*)fEvtLoop->FindTask("MRead");
 
     const Int_t num = reader->GetNumEntry();
@@ -472,5 +460,6 @@
     ReadinEvent();
 
-    TGString *txt = new TGString(Form("of %d", GetReader()->GetEntries()));
+    MReadTree *reader = (MReadTree*)fEvtLoop->FindTask("MRead");
+    TGString *txt = new TGString(Form("of %d", reader->GetEntries()));
     fNumOfEvts->SetText(txt);
 
@@ -540,5 +529,6 @@
                 {
                     TGTextEntry *entry = (TGTextEntry*)fList->FindWidget(kEvtNumber);
-                    if (GetReader()->SetEventNum(atoi(entry->GetText())-1))
+                    MReadTree *reader  = (MReadTree*)fEvtLoop->FindTask("MRead");
+                    if (reader->SetEventNum(atoi(entry->GetText())-1))
                         ReadinEvent();
                 }
Index: /trunk/MagicSoft/Mars/mmain/MEventDisplay.h
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MEventDisplay.h	(revision 2727)
+++ /trunk/MagicSoft/Mars/mmain/MEventDisplay.h	(revision 2728)
@@ -43,6 +43,4 @@
     void ReadinEvent(Int_t dir=0);
 
-    MReadTree *GetReader() const;
-
     Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
 
Index: /trunk/MagicSoft/Mars/mmontecarlo/MMcEnergyEst.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmontecarlo/MMcEnergyEst.cc	(revision 2727)
+++ /trunk/MagicSoft/Mars/mmontecarlo/MMcEnergyEst.cc	(revision 2728)
@@ -26,15 +26,14 @@
 
 /////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MMcEnergyEst                                                            //
-//                                                                         //
-// Class for otimizing the parameters of the energy estimator              //
-//                                                                         //
-// FIXME: the class must be made more flexible, allowing for different     //
-// parametrizations to be used. Also a new class is needed, a container    //
-// for the parameters of the energy estimator.                             //
-// FIXME: the starting values of the parameters are now fixed.             //
-//                                                                         //
-//                                                                         //
+//
+// MMcEnergyEst
+//
+// Class for otimizing the parameters of the energy estimator
+//
+// FIXME: the class must be made more flexible, allowing for different
+// parametrizations to be used. Also a new class is needed, a container
+// for the parameters of the energy estimator.
+// FIXME: the starting values of the parameters are now fixed.
+//
 /////////////////////////////////////////////////////////////////////////////
 #include "MMcEnergyEst.h"
Index: /trunk/MagicSoft/Mars/mranforest/MRanTree.cc
===================================================================
--- /trunk/MagicSoft/Mars/mranforest/MRanTree.cc	(revision 2727)
+++ /trunk/MagicSoft/Mars/mranforest/MRanTree.cc	(revision 2728)
@@ -24,10 +24,9 @@
 
 /////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MRanTree                                                                //
-//                                                                         //
-// ParameterContainer for Tree structure                                   //
-//                                                                         //
-//                                                                         //
+//
+// MRanTree
+//
+// ParameterContainer for Tree structure
+//
 /////////////////////////////////////////////////////////////////////////////
 #include "MRanTree.h"
@@ -159,5 +158,5 @@
     Double_t pno=0;
     Double_t pdo=0;
-    for (Int_t j=0;j<2;j++)
+    for (Int_t j=0; j<2; j++)
     {
         pno+=tclasspop[j]*tclasspop[j];
@@ -171,8 +170,8 @@
     // (Gini-index as criterium crit)
 
-    Double_t critmax=-1.0e20;  // FIXME: Replace by a constant from limits.h
+    Double_t critmax=-FLT_MAX;
 
     // random split selection, number of trials = fNumTry
-    for(Int_t mt=0;mt<fNumTry;mt++)
+    for (Int_t mt=0; mt<fNumTry; mt++)
     {
         const Int_t mvar=Int_t(gRandom->Rndm()*mdim);
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc	(revision 2727)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc	(revision 2728)
@@ -236,4 +236,45 @@
 }
 
+Bool_t MRawEvtHeader::DecodeTime(UInt_t abstime[2]) const
+{
+    // BADC|1032 --> DCBA|3210 (Byte swap - exchange MSB and LSB)
+    abstime[0] = (abstime[0]<<16) | (abstime[0]>>16);
+    abstime[1] = (abstime[1]<<16) | (abstime[1]>>16);
+
+    const Byte_t h = (abstime[0]>>18 & 0x30)*10 + (abstime[0]>>14 & 0x0f);
+    const Byte_t m = (abstime[0]>>11 & 0x70)*10 + (abstime[0]>> 7 & 0x0f);
+    const Byte_t s = (abstime[0]>> 4 & 0x70)*10 + (abstime[0]>> 0 & 0x0f);
+    const Int_t ms =
+        ((abstime[1]>>16)&0xf)*1000 +
+        ((abstime[1]>> 8)&0xf)* 100 +
+        ((abstime[1]>> 4)&0xf)*  10 +
+        ((abstime[1]>> 0)&0xf)*   1;
+
+    // hms   =3210 -->  h=2:4 m=3:4 s=3:4
+    // subsec=DCBA --> subsec?
+    *fLog << dbg << dec;
+    *fLog << (int)(abstime[0]>>18 & 0x30); // h
+    *fLog << (int)(abstime[0]>>14 & 0x0f); // h
+    *fLog << ":";
+    *fLog << (int)(abstime[0]>>11 & 0x70); // m
+    *fLog << (int)(abstime[0]>> 7 & 0x0f); // m
+    *fLog << ":";
+    *fLog << (int)(abstime[0]>> 4 & 0x70); // s
+    *fLog << (int)(abstime[0]>> 0 & 0x0f); // s
+    *fLog << " ";
+    *fLog << (int)(abstime[1]>>16 & 0xf) << ".";
+    *fLog << (int)(abstime[1]>> 8 & 0xf) << ".";
+    *fLog << (int)(abstime[1]>> 4 & 0xf) << ".";
+    *fLog << (int)(abstime[1]>> 0 & 0xf);
+    *fLog << endl;
+
+    // Update the time stamp with the current event time.
+    // Make sure, that the time stamp was initialized correctly
+    // with the start-date/time of the run (after reading the run header)
+    //
+    // Here the nanosec precision is ignored... (FIXME!)
+    return fTime->UpdMagicTime(h, m, s, ms);
+}
+
 // --------------------------------------------------------------------------
 //
@@ -241,23 +282,21 @@
 // return FALSE if there is now header anymore, else TRUE
 //
+// Updates the time stamp with the current event time.
+// Make sure, that the time stamp was initialized correctly
+// with the start-date/time of the run (after reading the run header)
+//
+// Remark: This 'feature' disallows single runs of more than 11h!
+//
 int MRawEvtHeader::ReadEvt(istream &fin)
 {
     fin.read((char*)&fDAQEvtNumber, 4);  // Total=4
 
-    UInt_t abstime[2];
+    UInt_t abstime[2];                   // BADC|1032
     fin.read((char*)abstime,        8);  // Total=12
-
-    //
-    // store the time of the event in the corresponding container
-    //
-    /*
-     const Double_t mhz = 9.375;                        // [1e6 ticks/s]
-     const Double_t t   = (Double_t)abstime[0]/mhz;     // [ns]
-     const UShort_t ns  = (UShort_t)fmod(t*1e-3, 1e9);
-     const Byte_t s     = (Byte_t)fmod(t/1e12, 60);
-     const Byte_t m     = (Byte_t)fmod(t/60e12, 60);
-     const Byte_t h     = (Byte_t)(t/3600e12);
-     fTime->SetTime(h, m, s, ns);
-     */
+    if (!DecodeTime(abstime))
+    {
+        *fLog << err << "ERROR - Event time in event header invalid... abort." << endl;
+        return kFALSE;
+    }
 
     Byte_t dummy[4];
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h	(revision 2727)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h	(revision 2728)
@@ -44,6 +44,7 @@
     MArrayB *fPixLoGainOn;     //! Array which tell you which pixels have lo gain on
 
+    Bool_t DecodeTime(UInt_t abstime[2]) const;
+
 public:
-
     MRawEvtHeader(const char *name=NULL, const char *title=NULL);
     ~MRawEvtHeader();
Index: /trunk/MagicSoft/Mars/mraw/MRawFileRead.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawFileRead.cc	(revision 2727)
+++ /trunk/MagicSoft/Mars/mraw/MRawFileRead.cc	(revision 2728)
@@ -151,5 +151,10 @@
     fRawRunHeader->Print();
 
-    return fRawRunHeader->GetMagicNumber()==kMagicNumber;
+    if (fRawRunHeader->GetMagicNumber()!=kMagicNumber)
+        return kFALSE;
+
+    *fRawEvtTime = fRawRunHeader->GetRunStart();
+
+    return kTRUE;
 }
 
Index: /trunk/MagicSoft/Mars/mraw/MRawRead.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawRead.cc	(revision 2727)
+++ /trunk/MagicSoft/Mars/mraw/MRawRead.cc	(revision 2728)
@@ -125,4 +125,41 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// This is a workaround for the oldest runs (run-number<3490)
+// for which no time stamp was available.
+// For this runs a fake time stamp is created
+//
+// Be carefull: This is NOT thread safe!
+//
+void MRawRead::CreateFakeTime() const
+{
+    static Double_t tm = 0; // Range of roughly 8min
+    const UInt_t ct = (*fRawCrateArray)[0]->GetFADCClockTick();
+
+    tm = ct<tm ? fmod(tm, (UInt_t)(-1))+(UInt_t)(-1)+ct : ct;
+
+    const Double_t mhz = 9.375;                        // [1e6 ticks/s]
+    const Double_t t   = tm/mhz;                       // [us]
+    const UInt_t ns    = (UInt_t)fmod(t*1e3, 1e6);
+    const UShort_t ms  = (UShort_t)fmod(t/1e3, 1e3);
+    const Byte_t s     = (Byte_t)fmod(t/1e6, 60);
+
+    // Create an artificial time stamp!
+    UInt_t m = (Byte_t)fmod(t/60e6, 60);
+    //const Byte_t h     = (Byte_t)(t/3600e6);
+    m += fRawRunHeader->GetRunNumber()*10;
+    m %= 360; // 6h
+
+    fRawEvtTime->Set(fRawRunHeader->GetRunStart().Year(),
+                     fRawRunHeader->GetRunStart().Month(),
+                     fRawRunHeader->GetRunStart().Day(),
+                     m/60, m%60, s, ms, ns);
+}
+
+// --------------------------------------------------------------------------
+//
+// Read a single event from the stream
+//
 Bool_t MRawRead::ReadEvent(istream &fin)
 {
@@ -169,29 +206,13 @@
     }
 
-    {
-        // FIXME This is a stupid workaround for the missing time stamp!
-        //       Might be used depending on the run number in the future
-        static Double_t tm = 0; // Range of roughly 8min
-        const UInt_t ct = (*fRawCrateArray)[0]->GetFADCClockTick();
-
-        tm = ct<tm ? fmod(tm, (UInt_t)(-1))+(UInt_t)(-1)+ct : ct;
-
-        const Double_t mhz = 9.375;                        // [1e6 ticks/s]
-        const Double_t t   = tm/mhz;                       // [us]
-        const UInt_t ns    = (UInt_t)fmod(t*1e3, 1e6);
-        const UShort_t ms  = (UShort_t)fmod(t/1e3, 1e3);
-        const Byte_t s     = (Byte_t)fmod(t/1e6, 60);
-
-        // Create an artificial time stamp!
-        UInt_t m = (Byte_t)fmod(t/60e6, 60);
-        //const Byte_t h     = (Byte_t)(t/3600e6);
-        m += fRawRunHeader->GetRunNumber()*10;
-        m %= 360; // 6h
-
-        fRawEvtTime->Set(fRawRunHeader->GetRunStart().Year(),
-                         fRawRunHeader->GetRunStart().Month(),
-                         fRawRunHeader->GetRunStart().Day(),
-                         m/60, m%60, s, ms, ns);
-    }
+    // This is a workaround for the oldest runs (run-number<3490)
+    // for which no time stamp was available.
+    // For this runs a fake time stamp is created
+    if (fRawRunHeader->GetRunNumber()<3490)
+        CreateFakeTime();
+
+    // FIXME: For all other runs we should enhance the precision
+    //        of the time-stamp by using the FADCClockTick
+
     return kTRUE;
 }
Index: /trunk/MagicSoft/Mars/mraw/MRawRead.h
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawRead.h	(revision 2727)
+++ /trunk/MagicSoft/Mars/mraw/MRawRead.h	(revision 2728)
@@ -22,4 +22,6 @@
     MTime          *fRawEvtTime;    // raw evt time information container to fill from file
 
+    void CreateFakeTime() const;
+
     Bool_t ReadEvent(istream &fin);
     Int_t  PreProcess(MParList *pList);
Index: /trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 2727)
+++ /trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 2728)
@@ -29,14 +29,18 @@
 // Root storage container for the RUN HEADER information
 //
-//
-//
-//  Version 2:
-//  ----------
+//  Format Version 2:
+//  -----------------
+//   - removed mjd from data
+//   - added start time
+//   - added stop  time
+//
+//  Class Version 2:
+//  ----------------
 //   - removed fMJD, fYear, fMonth, fDay
 //   - added fRunStart
 //   - added fRunStop
 // 
-//  Version 1:
-//  ----------
+//  Class Version 1:
+//  ----------------
 //   - first implementation
 //
@@ -212,5 +216,4 @@
     for (int i=0; i<GetNumPixel(); i++)
         *fLog << setfill('0') << setw(3) << (*fPixAssignment)[i] << " ";
-    *fLog << hex << endl;
 
     *fLog << endl;
Index: /trunk/MagicSoft/Mars/mraw/MRawSocketRead.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawSocketRead.cc	(revision 2727)
+++ /trunk/MagicSoft/Mars/mraw/MRawSocketRead.cc	(revision 2728)
@@ -252,4 +252,6 @@
     }
 
+    *fRawEvtTime = fRawRunHeader->GetRunStart();
+
     if (!ReadEvent(*fIn))
         return kFALSE;
Index: /trunk/MagicSoft/Mars/mreport/MReportRun.h
===================================================================
--- /trunk/MagicSoft/Mars/mreport/MReportRun.h	(revision 2727)
+++ /trunk/MagicSoft/Mars/mreport/MReportRun.h	(revision 2728)
@@ -22,5 +22,5 @@
     Int_t GetRunNumber() const { return fRunNumber; }
 
-    ClassDef(MReportRun, 1) // Class for RUN-REPORT information
+    ClassDef(MReportRun, 0) // Class for RUN-REPORT information
 };
 
Index: /trunk/MagicSoft/Mars/readdaq.cc
===================================================================
--- /trunk/MagicSoft/Mars/readdaq.cc	(revision 2727)
+++ /trunk/MagicSoft/Mars/readdaq.cc	(revision 2728)
@@ -55,5 +55,5 @@
     gLog << "     -d1: print data in decimal values" << endl;
     gLog << "     -c1: print MRawCrateArray data" << endl;
-    gLog << "     -?/-h: This help" << endl << endl;
+    gLog << "     -?, -h, --help: This help" << endl << endl;
 }
 
@@ -67,5 +67,5 @@
     MArgs arg(argc, argv);
 
-    if (arg.HasOption("-?") || arg.HasOption("-h"))
+    if (arg.HasOnly("-?") || arg.HasOnly("-h") || arg.HasOnly("--help"))
     {
         Usage();
Index: /trunk/MagicSoft/Mars/readraw.cc
===================================================================
--- /trunk/MagicSoft/Mars/readraw.cc	(revision 2727)
+++ /trunk/MagicSoft/Mars/readraw.cc	(revision 2728)
@@ -54,8 +54,8 @@
     gLog << "   readraw [-h] [-?] [-vn] [-dec] [-a0] inputfile[.root]" << endl << endl;
     gLog << "     input file:   Magic DAQ binary file." << endl;
-    gLog << "     -a0: Do not use Ansii codes." << endl;
     gLog << "     -vn: Verbosity level n [default=2]" << endl;
-    gLog << "     -d1: print data in decimal values" << endl;
-    gLog << "     -?/-h: This help" << endl << endl;
+    gLog << "     -d, --dec: print data in decimal values" << endl;
+    gLog << "     -a, --no-colors: Do not use Ansii color codes" << endl;
+    gLog << "     -?,-h,--help: This help" << endl << endl;
 }
 
@@ -73,10 +73,10 @@
     StartUpMessage();
 
-    //
     // Evaluate arguments
-    //
     MArgs arg(argc, argv);
 
-    if (arg.HasOption("-?") || arg.HasOption("-h"))
+    // check for the right usage of the program
+    if (arg.HasOption("-?") || arg.HasOption("-h") || arg.HasOption("--help") ||
+        arg.GetNumArguments()!=1)
     {
         Usage();
@@ -84,21 +84,22 @@
     }
 
-    //
-    // Set verbosity to highest level.
-    //
+    // Set verbosity
     gLog.SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2);
 
-    if (arg.HasOption("-a") && arg.GetIntAndRemove("-a")==0)
+    // Set color usage
+    if (arg.HasOnlyAndRemove("--no-colors") || arg.HasOnlyAndRemove("-a"))
         gLog.SetNoColors();
 
-    const bool kDecimal = arg.HasOption("-d") && arg.GetIntAndRemove("-d")==1;
-
-    //
-    // check for the right usage of the program
-    //
-    if (arg.GetNumArguments()!=1)
-    {
-        Usage();
-        return -1;
+    // Set usage of decimal values
+    const bool kDecimal = arg.HasOnlyAndRemove("-d") || arg.HasOnlyAndRemove("--dec");
+
+    //
+    // check for unidentified options
+    //
+    if (arg.GetNumOptions()>0)
+    {
+        gLog << warn << "WARNING - unknown commandline options..." << endl;
+        arg.Print("options");
+        gLog << endl;
     }
 
@@ -128,5 +129,5 @@
     //  open the file
     //
-    gLog << " Open the file '" << kNamein << "'" << endl;
+    gLog << inf << " Open the file '" << kNamein << "'" << endl;
     TFile input(kNamein, "READ");
 
@@ -137,5 +138,5 @@
     TTree *runtree = (TTree*)input.Get("RunHeaders");
     if (!runtree)
-        gLog << " WARNING: This file has NO Tree 'RunHeaders'" << endl << endl;
+        gLog << warn << " WARNING - This file has no Tree 'RunHeaders'" << endl << endl;
     else
     {
@@ -151,9 +152,9 @@
     // open the DataTree and read in 
     //
-    gLog << " Check the Tree 'Events'" << endl ;
+    gLog << inf << " Check the Tree 'Events'" << endl ;
     TTree *evttree = (TTree*)input.Get("Events") ;
     if (!evttree)
     {
-        gLog << "Tree 'Events' not found in file... exit!" << endl;
+        gLog << err << "Tree 'Events' not found in file... exit!" << endl;
         return -1;
     }
@@ -184,5 +185,4 @@
     const Int_t nent = (Int_t)evttree->GetEntries();
 
-    gLog << endl;
     gLog << " Entries in Tree Data: " << dec << nent << endl;
     gLog << endl;
@@ -190,5 +190,5 @@
     for (Int_t i = 0; i<nent; i++)
     {
-        gLog << "Entry: " << i << endl;
+        gLog << all << "Entry: " << i << endl;
 
         //
