Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 608)
+++ trunk/MagicSoft/Mars/Changelog	(revision 609)
@@ -1,3 +1,20 @@
                                                                   -*-*- END -*-*-
+
+ 2000/02/22: Thomas Bretz
+
+ * merpp.cc, readraw.cc, mbase/MParContainer.cc, mbase/MParList.cc,
+   mbase/MParList.h, mbase/MReadTree.cc, mbase/MTask.cc, mbase/MTask.h,
+   mbase/MTaskList.cc, mbase/MTime.cc, mdatacheck/MDumpEvtHeader.cc,
+   mdatacheck/MShowSpect.cc, meventdisp/MGFadcDisp.cc, mgui/MGPrototyp.h,
+   mmc/MHeaderTrig.cxx, mraw/MRawCrateArray.cc, mraw/MRawEvtData.cc,
+   mraw/MRawEvtHeader.cc, mraw/MRawFileRead.cc, mraw/MRawFileWrite.cc,
+   mraw/MRawRunHeader.cc:
+   exchanged cout with the new logging style (gLog, *fLog)
+   
+ * mraw/MRawEvtData.cc: added 'dec' option to Print
+  
+ * mmc/MHeaderTrig.cxx, mmc/MMcEvt.cxx, mmc/MMcTrig.cxx:
+   small changes to the Print funtions
+   
  
  2000/02/21: Thomas Bretz
Index: trunk/MagicSoft/Mars/mbase/MAGIC.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MAGIC.h	(revision 608)
+++ trunk/MagicSoft/Mars/mbase/MAGIC.h	(revision 609)
@@ -34,6 +34,10 @@
 // default pipes all output to the stdout
 //
+
+//This will be fixed soon. It doesn't work with Alphas at the moment
 class MLog;
+#ifndef __CINT__
 extern MLog gLog;
+#endif
 
 #endif
Index: trunk/MagicSoft/Mars/mbase/MLog.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 608)
+++ trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 609)
@@ -46,5 +46,5 @@
 }
 
-void MLog::Write()
+void MLog::WriteBuffer()
 {
     const int len = fPPtr - fBase;
@@ -76,5 +76,5 @@
 {
 //    cout << "*sync*";
-    Write();
+    WriteBuffer();
 
     if (fDevice&eStdout)
@@ -100,11 +100,11 @@
     // If the buffer is not really filled i is EOF(-1).
     //
-    if (fOutputLevel < fDebugLevel)
-    {
-        *fPPtr++ = (char)i;
+    if (fOutputLevel >= fDebugLevel)
+        return 0;
 
-        if (fPPtr == fEPtr)
-            Write();
-    }
+    *fPPtr++ = (char)i;
+
+    if (fPPtr == fEPtr)
+        WriteBuffer();
 
     return 0;
Index: trunk/MagicSoft/Mars/mbase/MLog.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLog.h	(revision 608)
+++ trunk/MagicSoft/Mars/mbase/MLog.h	(revision 609)
@@ -36,5 +36,5 @@
     void Init();
 
-    void Write();
+    void WriteBuffer();
     int sync();
     int overflow(int i); // i=EOF means not a real overflow
Index: trunk/MagicSoft/Mars/mbase/MParContainer.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 608)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 609)
@@ -13,9 +13,9 @@
 #include "MParContainer.h"
 
-#include <iostream.h>    // cout
-
 #include <TClass.h>      // IsA
 #include <TROOT.h>       // TROOT::Identlevel
 #include <TVirtualPad.h> // gPad
+
+#include "MLog.h"
 
 ClassImp(MParContainer)
@@ -78,5 +78,5 @@
 
    TROOT::IndentLevel();
-   cout <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : "
+   *fLog <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : "
         << Int_t(TestBit(kCanDelete)) << endl;
 }
@@ -87,5 +87,5 @@
    // Print MParContainer name and title.
 
-   cout <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << endl;
+   *fLog <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << endl;
 }
 
Index: trunk/MagicSoft/Mars/mbase/MParContainer.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 608)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 609)
@@ -20,5 +20,4 @@
 #endif
 
-class MLog;
 class ofstream;
 class ifstream;
Index: trunk/MagicSoft/Mars/mbase/MParList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 608)
+++ trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 609)
@@ -15,10 +15,9 @@
 //                                                                         //
 /////////////////////////////////////////////////////////////////////////////
-
 #include "MParList.h"
 
 #include <TNamed.h>
 
-#include "MParContainer.h"
+#include "MLog.h"
 
 ClassImp(MParList)
@@ -57,5 +56,5 @@
         cont->SetLogStream(log);
 
-//    SetLogStream(log);
+    MParContainer::SetLogStream(log);
 }
 
@@ -74,5 +73,5 @@
   if (!obj) return kTRUE;
 
-  cout << "Adding " << obj->GetName() << " to " << GetName() << "... " << flush;
+  *fLog << "Adding " << obj->GetName() << " to " << GetName() << "... " << flush;
   //
   //  check if it is in the list yet
@@ -80,5 +79,5 @@
   if (fContainer.FindObject(obj))
   {
-      cout << "WARNING: MParList::add: Container already added" << endl;
+      *fLog << "WARNING: MParList::add: Container already added" << endl;
       return kTRUE;
   }
@@ -92,5 +91,5 @@
       if (!fContainer.FindObject(where))
       {
-          cout << "ERROR: MParList::add: Cannot find parameter container after which the new one should be added!" << endl;
+          *fLog << "ERROR: MParList::add: Cannot find parameter container after which the new one should be added!" << endl;
           return kFALSE;
       }
@@ -98,5 +97,5 @@
 
   fContainer.Add(obj);
-  cout << "Done." << endl;
+  *fLog << "Done." << endl;
 
   return kTRUE;
@@ -118,6 +117,6 @@
   //   print some information about the current status of MParList
   //
-  cout << "ParList: " << this->GetName() << " <" << this->GetTitle() << ">" << endl;
-  cout << endl;
+  *fLog << "ParList: " << this->GetName() << " <" << this->GetTitle() << ">" << endl;
+  *fLog << endl;
   
 }
Index: trunk/MagicSoft/Mars/mbase/MParList.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParList.h	(revision 608)
+++ trunk/MagicSoft/Mars/mbase/MParList.h	(revision 609)
@@ -14,14 +14,14 @@
 #endif
 
-#include <iostream.h>
-
 #ifndef ROOT_TOrdCollection
 #include "TOrdCollection.h"
 #endif
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
 
 class MLog;
-class MParContainer;
 
-class MParList : public TObject
+class MParList : public MParContainer
 {
 private:
Index: trunk/MagicSoft/Mars/mbase/MReadTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MReadTree.cc	(revision 608)
+++ trunk/MagicSoft/Mars/mbase/MReadTree.cc	(revision 609)
@@ -15,5 +15,4 @@
 #include "MReadTree.h"
 
-#include <iostream.h>
 #include <fstream.h>
 
@@ -22,4 +21,5 @@
 #include <TObjArray.h>
 
+#include "MLog.h"
 #include "MTime.h"
 #include "MParList.h"
@@ -49,6 +49,6 @@
     if (!fFile->IsOpen())
     {
-        cout << "MReadTree::PreProcess: ERROR: Cannot open file '";
-        cout << fFileName << "'" << endl;
+        *fLog << "MReadTree::PreProcess: ERROR: Cannot open file '";
+        *fLog << fFileName << "'" << endl;
         return kFALSE;
     }
@@ -58,6 +58,6 @@
     if (!fTree)
     {
-        cout << "MReadTree::PreProcess: ERROR: Cannot open tree '";
-        cout << fTreeName << "'" << endl;
+        *fLog << "MReadTree::PreProcess: ERROR: Cannot open tree '";
+        *fLog << fTreeName << "'" << endl;
         return kFALSE;
     }
@@ -66,6 +66,6 @@
     fNumEntry   = 0;
 
-    cout << "File: '" << fFileName << "'  Tree: '" << fTreeName;
-    cout << "' with " << fNumEntries << " Entries opened." << endl;
+    *fLog << "File: '" << fFileName << "'  Tree: '" << fTreeName;
+    *fLog << "' with " << fNumEntries << " Entries opened." << endl;
 
     //
@@ -96,5 +96,5 @@
             // if object is not existing in the list try to create one
             //
-            cout << "MReadTree::PreProcess - WARNING: '" << name << "' not found... creating." << endl;
+            *fLog << "MReadTree::PreProcess - WARNING: '" << name << "' not found... creating." << endl;
 
             //
@@ -109,5 +109,5 @@
                 // we cannot proceed reading this branch
                 //
-                cout << "MReadTree::PreProcess - Warning: Class '" << name << "' not existing in dictionary. Branch skipped." << endl;
+                *fLog << "MReadTree::PreProcess - Warning: Class '" << name << "' not existing in dictionary. Branch skipped." << endl;
                 continue;
             }
@@ -117,5 +117,5 @@
             //
             pcont = (MParContainer*)cls->New();
-            cout << pcont << endl;
+            *fLog << pcont << endl;
             pList->AddToList(pcont);
         }
@@ -180,5 +180,5 @@
     if (fNumEntry < dec/*+1*/)
     {
-        cout << "MReadTree::SetPrevEvent: WARNING: " << fNumEntry/*-1*/ << "-" << dec << " out of Range." << endl;
+        *fLog << "MReadTree::SetPrevEvent: WARNING: " << fNumEntry/*-1*/ << "-" << dec << " out of Range." << endl;
         return kFALSE;
     }
@@ -203,5 +203,5 @@
     if (fNumEntry+inc/*-1*/ >= fNumEntries)
     {
-        cout << "MReadTree::SkipEvents: WARNING: " << fNumEntry/*-1*/ << "+" << inc << " out of Range." << endl;
+        *fLog << "MReadTree::SkipEvents: WARNING: " << fNumEntry/*-1*/ << "+" << inc << " out of Range." << endl;
         return kFALSE;
     }
@@ -218,5 +218,5 @@
     if (nr>=fNumEntries)
     {
-        cout << "MReadTree::SetEventNum: WARNING: " << nr << " out of Range." << endl;
+        *fLog << "MReadTree::SetEventNum: WARNING: " << nr << " out of Range." << endl;
         return kFALSE;
     }
Index: trunk/MagicSoft/Mars/mbase/MTask.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 608)
+++ trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 609)
@@ -37,41 +37,37 @@
 #include "MTask.h"
 
-#include <string.h>
-#include <iostream.h>
-
 ClassImp(MTask)
 
 Bool_t MTask::PreProcess( MParList *pList )
 {
-  //
-  // This is processed before the eventloop starts
-  // 
-  // It is the job of the PreProcess to connect the tasks
-  // with the right container in the parameter list. 
-  //
-  // the virtual implementation returns kTRUE
-  //
-  return kTRUE; 
+    //
+    // This is processed before the eventloop starts
+    //
+    // It is the job of the PreProcess to connect the tasks
+    // with the right container in the parameter list.
+    //
+    // the virtual implementation returns kTRUE
+    //
+    return kTRUE;
 }
-
 
 Bool_t MTask::Process()
 {
-  //
-  // This is processed for every event in the eventloop 
-  //
-  // the virtual implementation returns kTRUE
-  //
-  return kTRUE;
+    //
+    // This is processed for every event in the eventloop
+    //
+    // the virtual implementation returns kTRUE
+    //
+    return kTRUE;
 }
 
 Bool_t MTask::PostProcess()
 {
-  //
-  // This is processed after the eventloop starts
-  //
-  // the virtual implementation returns kTRUE
-  //
-  return kTRUE;
+    //
+    // This is processed after the eventloop starts
+    //
+    // the virtual implementation returns kTRUE
+    //
+    return kTRUE;
 }
 
Index: trunk/MagicSoft/Mars/mbase/MTask.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.h	(revision 608)
+++ trunk/MagicSoft/Mars/mbase/MTask.h	(revision 609)
@@ -18,6 +18,4 @@
 class MTask : public MInputStreamID
 {
-    MLog *fLog; //!
-
 public:
     ~MTask()
Index: trunk/MagicSoft/Mars/mbase/MTaskList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 608)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 609)
@@ -9,6 +9,5 @@
 #include "MTaskList.h"
 
-#include <iostream.h>
-
+#include "MLog.h"
 #include "MParList.h"
 #include "MInputStreamID.h"
@@ -56,5 +55,5 @@
         task->SetLogStream(log);
 
-//    SetLogStream(log);
+    MParContainer::SetLogStream(log);
 }
 
@@ -73,5 +72,5 @@
     if (fTasks.FindObject(task))
     {
-        cout << "WARNING: MTaskList::AddToList: Task already existing." << endl;
+        *fLog << "WARNING: MTaskList::AddToList: Task already existing." << endl;
         return kTRUE;
     }
@@ -79,5 +78,5 @@
     if (fTasks.FindObject(name))
     {
-        cout << "WARNING: MTaskList::AddToList: '" << name << "' exists in List already." << endl;
+        *fLog << "WARNING: MTaskList::AddToList: '" << name << "' exists in List already." << endl;
         return kTRUE;
     }
@@ -92,10 +91,10 @@
     }
 
-    cout << "Adding " << name << " to " << GetName() << " for " << type << "... " << flush;
+    *fLog << "Adding " << name << " to " << GetName() << " for " << type << "... " << flush;
 
     task->SetStreamId(type);
     fTasks.Add(task);
 
-    cout << "Done." << endl;
+    *fLog << "Done." << endl;
 
     return kTRUE;
@@ -108,5 +107,5 @@
     // do pre processing (before eventloop) of all tasks in the task-list
     //
-    cout << "Preprocessing... " << flush;
+    *fLog << "Preprocessing... " << flush;
 
     //
@@ -122,5 +121,5 @@
     while ( (task=(MTask*)Next()) )
     {
-        cout << task->GetName() << "... " << flush;
+        *fLog << task->GetName() << "... " << flush;
 
         if (!task->PreProcess( pList ))
@@ -128,5 +127,5 @@
     }
 
-    cout << endl;
+    *fLog << endl;
 
     return kTRUE;
@@ -184,5 +183,5 @@
   //
 
-    cout << "Postprocessing... " << flush;
+    *fLog << "Postprocessing... " << flush;
 
   //
@@ -198,5 +197,5 @@
   while ( (task=(MTask*)Next()) )
   {
-      cout << task->GetName() << "... " << flush;
+      *fLog << task->GetName() << "... " << flush;
 
       if (!task->PostProcess())
@@ -204,5 +203,5 @@
   }
 
-  cout << endl;
+  *fLog << endl;
 
   return kTRUE;
@@ -213,9 +212,9 @@
 void MTaskList::Print(Option_t *t)
 {
-  cout << "TaskList: " << this->GetName() << " <" <<  this->GetTitle() << ">" << endl;
+  *fLog << "TaskList: " << this->GetName() << " <" <<  this->GetTitle() << ">" << endl;
   
   fTasks.Print();
 
-  cout << endl;
-}
-
+  *fLog << endl;
+}
+
Index: trunk/MagicSoft/Mars/mbase/MTaskList.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 608)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 609)
@@ -26,5 +26,4 @@
     TOrdCollection fTasks;	// Container for the ordered list of different tasks
 
-
 public:
     MTaskList(const char *title=NULL);
Index: trunk/MagicSoft/Mars/mbase/MTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 608)
+++ trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 609)
@@ -9,39 +9,16 @@
 #include "MTime.h"
 
-#include <iostream.h>
 #include <iomanip.h>
+
+#include "MLog.h"
 
 ClassImp(MTime)
 
 void MTime::Print(Option_t *)
-{ 
-    cout << "MTime Information:  " << hex
-        << " 0x" <<setfill('0') << setw(2) << fTimeStamp[0]
-        << " 0x" <<setfill('0') << setw(2) << fTimeStamp[1] << endl << endl;
+{
+    fLog->setf(ios::showbase);
+    *fLog << "MTime Information:  " << hex 
+        << " " <<setfill('0') << setw(2) << fTimeStamp[0]
+        << " " <<setfill('0') << setw(2) << fTimeStamp[1] << endl << endl;
 } 
-    /*
-inline Bool_t operator<(MTime &t1, MTime &t2)
-{
-    return (t1.GetTimeHi()<=t2.GetTimeHi()) && (t1.GetTimeLo()<t2.GetTimeLo());
-}
 
-inline Bool_t operator>(MTime &t1, MTime &t2)
-{
-    return (t1.GetTimeHi()>=t2.GetTimeHi()) && (t1.GetTimeLo()>t2.GetTimeLo());
-}
-
-inline Bool_t operator<=(MTime &t1, MTime &t2)
-{
-    return (t1.GetTimeHi()<=t2.GetTimeHi()) && (t1.GetTimeLo()<=t2.GetTimeLo());
-}
-
-inline Bool_t operator>=(MTime &t1, MTime &t2)
-{
-    return (t1.GetTimeHi()>=t2.GetTimeHi()) && (t1.GetTimeLo()>=t2.GetTimeLo());
-}
-
-inline Bool_t operator==(MTime &t1, MTime &t2)
-{
-    return (t1.GetTimeLo()==t2.GetTimeLo()) && (t1.GetTimeHi()==t2.GetTimeHi());
-}
-*/
Index: trunk/MagicSoft/Mars/mdatacheck/MDumpEvtHeader.cc
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/MDumpEvtHeader.cc	(revision 608)
+++ trunk/MagicSoft/Mars/mdatacheck/MDumpEvtHeader.cc	(revision 609)
@@ -1,3 +1,5 @@
 #include "MDumpEvtHeader.h"
+
+#include <iostream.h>
 
 #include "MParList.h"
Index: trunk/MagicSoft/Mars/mdatacheck/MShowSpect.cc
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/MShowSpect.cc	(revision 608)
+++ trunk/MagicSoft/Mars/mdatacheck/MShowSpect.cc	(revision 609)
@@ -1,3 +1,5 @@
 #include "MShowSpect.h"
+
+#include <iostream.h>
 
 #include "MParList.h"      // MParList
@@ -35,8 +37,8 @@
     {
       cout << "ERROR: MShowSpect::PreProc(): " << fHistName << " not found!" << endl;
-      return kFALSE ; 
+      return kFALSE;
     }
   
-  return (kTRUE) ; 
+  return kTRUE;
 } 
 
@@ -48,5 +50,5 @@
   new MGDisplayAdc(fHists, gClient->GetRoot(), gClient->GetRoot(), 600, 600);
 
-  return (kTRUE) ; 
+  return kTRUE;
 } 
 
Index: trunk/MagicSoft/Mars/merpp.cc
===================================================================
--- trunk/MagicSoft/Mars/merpp.cc	(revision 608)
+++ trunk/MagicSoft/Mars/merpp.cc	(revision 609)
@@ -1,4 +1,2 @@
-#include <iostream.h>
-
 #include <TSystem.h>
 
@@ -10,9 +8,10 @@
 #include "MRawFileWrite.h"
 
+#include "MLog.h"
+#include "MTime.h"
+#include "MRawEvtData.h"
 #include "MRawRunHeader.h"
 #include "MRawEvtHeader.h"
-#include "MRawEvtData.h"
 #include "MRawCrateArray.h"
-#include "MTime.h"
 #include "MInputStreamID.h"
 
@@ -34,10 +33,10 @@
 int main(const int argc, const char **argv)
 {
-    cout << "==================================================" << endl ;
-    cout << "                   MERPP v0.1" << endl;
-    cout << "      MARS Merging and Preprocessing Program" << endl ;
-    cout << "            Compiled on <" << __DATE__ << ">" << endl ;
-    cout << "==================================================" << endl ;
-    cout << endl;
+    gLog << "==================================================" << endl ;
+    gLog << "                   MERPP v0.1" << endl;
+    gLog << "      MARS Merging and Preprocessing Program" << endl ;
+    gLog << "            Compiled on <" << __DATE__ << ">" << endl ;
+    gLog << "==================================================" << endl ;
+    gLog << endl;
 
     //
@@ -46,6 +45,6 @@
     if (argc!=3)
     {
-        cout << "Sorry the usage is:" << endl;
-        cout << "   merpp inputfile outputfile" << endl << endl;
+        gLog << "Sorry the usage is:" << endl;
+        gLog << "   merpp inputfile outputfile" << endl << endl;
         return -1;
     }
@@ -61,14 +60,14 @@
     if (gSystem->AccessPathName(argv[1], kFileExists))
     {
-        cout << "Sorry, the file '" << argv[1] << "' doesn't exist." << endl;
+        gLog << "Sorry, the file '" << argv[1] << "' doesn't exist." << endl;
         return -1;
     }
 
     if (!gSystem->AccessPathName(argv[2], kFileExists))
-        cout << "Warning: The file '" << argv[2] << "' exists." << endl;
+        gLog << "Warning: The file '" << argv[2] << "' exists." << endl;
     else
         if (!gSystem->AccessPathName(argv[2], kWritePermission))
         {
-            cout << "Sorry, you don't have write permission for '" << argv[2] << "'." << endl;
+            gLog << "Sorry, you don't have write permission for '" << argv[2] << "'." << endl;
             return -1;
         }
Index: trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc
===================================================================
--- trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc	(revision 608)
+++ trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc	(revision 609)
@@ -2,4 +2,5 @@
 
 #include <stdlib.h>
+#include <iostream.h>
 
 #include <TGButton.h>      // TGPictureButton
@@ -272,5 +273,5 @@
    // window menu item is selected.
 
-  delete this ;
+    delete this ;
 }
        
Index: trunk/MagicSoft/Mars/mgui/MGPrototyp.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/MGPrototyp.h	(revision 608)
+++ trunk/MagicSoft/Mars/mgui/MGPrototyp.h	(revision 609)
@@ -9,5 +9,4 @@
 #include <TGFrame.h>
 #endif
-
 
 class TGMenuBar;
Index: trunk/MagicSoft/Mars/mgui/MHexagon.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/MHexagon.h	(revision 608)
+++ trunk/MagicSoft/Mars/mgui/MHexagon.h	(revision 609)
@@ -1,4 +1,4 @@
-#ifndef M_HEXAGON
-#define M_HEXAGON
+#ifndef MHEXAGON_H
+#define MHEXAGON_H
 
 //////////////////////////////////////////////////////////////
Index: trunk/MagicSoft/Mars/mraw/MRawCrateArray.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawCrateArray.cc	(revision 608)
+++ trunk/MagicSoft/Mars/mraw/MRawCrateArray.cc	(revision 609)
@@ -12,7 +12,7 @@
 #include "MRawCrateArray.h"
 
-#include <iostream.h>
+#include <TClonesArray.h>
 
-#include <TClonesArray.h>
+#include "MLog.h"
 
 ClassImp(MRawCrateArray)
@@ -45,5 +45,5 @@
 void MRawCrateArray::Print(Option_t *opt)
 {
-    cout << "MRawCrateArray::Print()" << endl;
+    *fLog << "MRawCrateArray::Print()" << endl;
 }
 
Index: trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawEvtData.cc	(revision 608)
+++ trunk/MagicSoft/Mars/mraw/MRawEvtData.cc	(revision 609)
@@ -26,5 +26,4 @@
 #include "MRawEvtData.h"
 
-#include <iostream.h>
 #include <iomanip.h>
 
@@ -35,4 +34,5 @@
 #include <TArrayC.h>
 
+#include "MLog.h"
 #include "MArrayS.h"
 #include "MArrayB.h"
@@ -87,8 +87,10 @@
 
 
-void MRawEvtData::Print(Option_t *)
+void MRawEvtData::Print(Option_t *opt)
 {
     //
     // print fadc inforation to screen
+    // Possible Options:
+    // - DEC: Print values decimal instead of hexadecimal (default)
     //
     const Byte_t nHiSamp = GetNumHiGainSamples();
@@ -98,29 +100,49 @@
     const UShort_t nLoPix = fLoGainPixId->GetSize();;
 
-    cout << dec;
-    cout << "HiGain: " << nHiPix << " Pixels with " << (Int_t)nHiSamp << " Samples" << endl;
-    cout << "LoGain: " << nLoPix << " Pixels with " << (Int_t)nLoSamp << " Samples" << endl;
+    fLog->unsetf(ios::showbase);
+
+    *fLog << dec;
+    *fLog << "HiGain: " << nHiPix << " Pixels with " << (Int_t)nHiSamp << " Samples" << endl;
+    *fLog << "LoGain: " << nLoPix << " Pixels with " << (Int_t)nLoSamp << " Samples";;
+
+    TString str(opt);
+    Int_t manip = str.Contains("dec", TString::kIgnoreCase);
 
     Int_t l=0;
     for (int i=0; i<nHiPix; i++)
     {
-        cout << " " << setfill(' ') << setw(3) << i << ": " << hex << flush;
-
-        cout << setfill('0');
+        *fLog << endl;
+        *fLog << " " << setfill(' ') << setw(3) << dec << i << ": ";
+        *fLog << (manip?dec:hex) << flush;
+
+        if (!manip)
+            *fLog << setfill('0');
 
         for (int j=0; j<nHiSamp; j++)
-            cout << setw(2)
-                << ((UShort_t)(*fHiGainFadcSamples)[j+i*nHiSamp]&0xff) << flush;
-
-        if (l<nLoPix && (*fLoGainPixId)[l]==(*fHiGainPixId)[i])
         {
-            for (int j=0; j<nLoSamp; j++)
-                cout << setw(2)
-                    <<((UShort_t)(*fLoGainFadcSamples)[j+i*nLoSamp]&0xff) << flush;
-            l++;
+            *fLog << setw(manip?3:2);
+            *fLog << ((UShort_t)(*fHiGainFadcSamples)[j+i*nHiSamp]&0xff);
+            if (manip)
+                *fLog << ' ';
+            *fLog << flush;
         }
-        cout << dec << endl;
+
+        if (!(l<nLoPix && (*fLoGainPixId)[l]==(*fHiGainPixId)[i]))
+            continue;
+
+        if (manip)
+            *fLog << "/ ";
+
+        for (int j=0; j<nLoSamp; j++)
+        {
+            *fLog << setw(manip?3:2);
+            *fLog << ((UShort_t)(*fLoGainFadcSamples)[j+i*nLoSamp]&0xff);
+            if (manip)
+                *fLog << ' ';
+            *fLog << flush;
+        }
+        l++;
     }
-    cout << endl;
+    *fLog << endl;
 }
 
@@ -135,61 +157,61 @@
   if (str.BeginsWith("GRAPH", TString::kIgnoreCase))
   {
-    if (str.Length()>5)
-      sscanf(&str[5], "%d", &num);
-    
-    if (num>=GetNumPixels())
-      num= GetNumPixels();
-    
-    cout << "Drawing Graph of Pixel " << num << endl;
-    
-    const Int_t n = GetNumHiGainSamples();
-    
-    Float_t *x = new Float_t[n];
-    Float_t *y = new Float_t[n];
-    
-    for (int i=0; i<n; i++)
-    {
-      x[i] = i;
-      y[i] = (*fHiGainFadcSamples)[i + num*GetNumHiGainSamples()];
-    }
-    
-    TGraph *graph = new TGraph(n, x, y);
-    graph->SetMaximum (256) ; 
-    graph->SetMinimum (0) ; 
-    
-    graph->Draw("AC*");
-    
-    return;
+      if (str.Length()>5)
+          sscanf(&str[5], "%d", &num);
+
+      if (num>=GetNumPixels())
+          num= GetNumPixels();
+
+      *fLog << "Drawing Graph of Pixel " << num << endl;
+
+      const Int_t n = GetNumHiGainSamples();
+
+      Float_t *x = new Float_t[n];
+      Float_t *y = new Float_t[n];
+
+      for (int i=0; i<n; i++)
+      {
+          x[i] = i;
+          y[i] = (*fHiGainFadcSamples)[i + num*GetNumHiGainSamples()];
+      }
+
+      TGraph *graph = new TGraph(n, x, y);
+      graph->SetMaximum (256) ;
+      graph->SetMinimum (0) ;
+
+      graph->Draw("AC*");
+
+      return;
   }
-  
+
   if (str.BeginsWith("HIST", TString::kIgnoreCase))
   {
-    cout << "Length: " << str.Length() << endl;
-    
-    if (str.Length()>4)
-      sscanf(&str[4], "%d", &num);
-    
-    if (num>=GetNumPixels())
-      num= GetNumPixels();
-    
-    cout << "Drawing Histogram of Pixel " << num << endl;
-    
-    const Int_t n = GetNumHiGainSamples();
-    
-    char *name = new char[16];
-    
-    sprintf(name, "Pixel No.%d", (*fHiGainPixId)[num]);
-    
-    TH1F *hist = new TH1F(name, "Hi Gain Samples FADC", n, 0, n);
-    
-    for (int i=0; i<n; i++)
-      hist->Fill(0.5+i, (*fHiGainFadcSamples)[i + num*GetNumHiGainSamples()]);
-    
-    hist->Draw();
-
-    return;
+      *fLog << "Length: " << str.Length() << endl;
+
+      if (str.Length()>4)
+          sscanf(&str[4], "%d", &num);
+
+      if (num>=GetNumPixels())
+          num= GetNumPixels();
+
+      *fLog << "Drawing Histogram of Pixel " << num << endl;
+
+      const Int_t n = GetNumHiGainSamples();
+
+      char *name = new char[16];
+
+      sprintf(name, "Pixel No.%d", (*fHiGainPixId)[num]);
+
+      TH1F *hist = new TH1F(name, "Hi Gain Samples FADC", n, 0, n);
+
+      for (int i=0; i<n; i++)
+          hist->Fill(0.5+i, (*fHiGainFadcSamples)[i + num*GetNumHiGainSamples()]);
+
+      hist->Draw();
+
+      return;
   }
-  
-  cout << "MRawEvtData::Draw: Warning: You must specify either 'GRAPH' or 'HIST'" << endl;
+
+  *fLog << "MRawEvtData::Draw: Warning: You must specify either 'GRAPH' or 'HIST'" << endl;
 }
 
@@ -238,6 +260,6 @@
     if (nSamp && ns!=nSamp)
     {
-        cout << "RawEvtData::FillPixel: Error, number of samples in ";
-        cout << "TArrayC doesn't match actual number" << endl;
+        *fLog << "RawEvtData::FillPixel: Error, number of samples in ";
+        *fLog << "TArrayC doesn't match actual number" << endl;
         return;
     }
Index: trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc	(revision 608)
+++ trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc	(revision 609)
@@ -71,8 +71,8 @@
 #include "MRawEvtHeader.h"
 
-#include <iostream.h>
 #include <iomanip.h>
 #include <fstream.h>
 
+#include "MLog.h"
 #include "MTime.h"
 #include "MArrayB.h"
@@ -145,27 +145,27 @@
     //  This member function prints all Data of one Event on screen.
     //
-    cout << "DAQEvtNr: " << dec << fDAQEvtNumber << "  (";
-    cout << "Trigger: ";
-    cout << "NumLvl1=" << fNumTrigLvl1 << " ";
-    cout << "NumLvl2=" << fNumTrigLvl2 << " ";
-    cout << "Pattern=" << hex << setfill('0');
-    cout << setw(2) << fTrigPattern[0];
-    cout << setw(2) << fTrigPattern[1] << " " << dec;
-
-    cout << "Type=";
+    *fLog << "DAQEvtNr: " << dec << fDAQEvtNumber << "  (";
+    *fLog << "Trigger: ";
+    *fLog << "NumLvl1=" << fNumTrigLvl1 << " ";
+    *fLog << "NumLvl2=" << fNumTrigLvl2 << " ";
+    *fLog << "Pattern=" << hex << setfill('0');
+    *fLog << setw(2) << fTrigPattern[0];
+    *fLog << setw(2) << fTrigPattern[1] << " " << dec;
+
+    *fLog << "Type=";
     switch (fTrigType)
     {
     case 0:
-        cout << "Trigger";
+        *fLog << "Trigger";
         break;
     case 1:
-        cout << "Pedestal";
+        *fLog << "Pedestal";
         break;
     case 2:
-        cout << "Calibration";
+        *fLog << "Calibration";
         break;
     }
-    cout << ")" << endl;
-    cout << "Number of Lo Gains On: " << fNumLoGainOn << endl;
+    *fLog << ")" << endl;
+    *fLog << "Number of Lo Gains On: " << fNumLoGainOn << endl;
 
     for (int i=0; i<fPixLoGainOn->GetSize(); i++)
@@ -174,11 +174,11 @@
         {
             const UInt_t on = (*fPixLoGainOn)[i]&(1<<j) ? 1 : 0;
-            cout << on;
+            *fLog << on;
         }
     }
 
-    cout << endl;
-
-    cout << endl;
+    *fLog << endl;
+
+    *fLog << endl;
 
 }
Index: trunk/MagicSoft/Mars/mraw/MRawFileRead.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawFileRead.cc	(revision 608)
+++ trunk/MagicSoft/Mars/mraw/MRawFileRead.cc	(revision 609)
@@ -11,7 +11,7 @@
 #include "MRawFileRead.h"
 
-#include <iostream.h>
 #include <fstream.h>
 
+#include "MLog.h"
 #include "MTime.h"
 #include "MParList.h"
@@ -34,10 +34,6 @@
     fIn = new ifstream(fname);
 
-    /*
-     FIXME: How can I test whether the construction of
-            the instance was successfull?
-    if (!fIn->is_open())
-    cout << "Error: Trying to open file '" << fname << "'" << endl;
-    */
+    if (!(*fIn))
+        *fLog << "Error: Trying to open file '" << fname << "'" << endl;
 }
 
@@ -56,5 +52,5 @@
     if (!fRawRunHeader)
     {
-        cout << "MRawFileRead::PreProcess - WARNING: MRawRunHeader not found... creating." << endl;
+        *fLog << "MRawFileRead::PreProcess - WARNING: MRawRunHeader not found... creating." << endl;
         fRawRunHeader = new MRawRunHeader;
         pList->AddToList(fRawRunHeader);
@@ -64,5 +60,5 @@
     if (!fRawEvtHeader)
     {
-        cout << "MRawFileRead::PreProcess - WARNING: MRawEvtHeader not found... creating." << endl;
+        *fLog << "MRawFileRead::PreProcess - WARNING: MRawEvtHeader not found... creating." << endl;
         fRawEvtHeader = new MRawEvtHeader;
         pList->AddToList(fRawEvtHeader);
@@ -72,5 +68,5 @@
     if (!fRawEvtData)
     {
-        cout << "MRawFileRead::PreProcess - WARNING: MRawEvtData not found... creating." << endl;
+        *fLog << "MRawFileRead::PreProcess - WARNING: MRawEvtData not found... creating." << endl;
         fRawEvtData = new MRawEvtData;
         pList->AddToList(fRawEvtData);
@@ -80,5 +76,5 @@
     if (!fRawCrateArray)
     {
-        cout << "MRawFileRead::PreProcess - WARNING: MRawCrateArray not found... creating." << endl;
+        *fLog << "MRawFileRead::PreProcess - WARNING: MRawCrateArray not found... creating." << endl;
         fRawCrateArray = new MRawCrateArray;
         pList->AddToList(fRawCrateArray);
@@ -88,5 +84,5 @@
     if (!fRawEvtTime)
     {
-        cout << "MRawFileRead::PreProcess - WARNING: MRawEvtTime not found... creating." << endl;
+        *fLog << "MRawFileRead::PreProcess - WARNING: MRawEvtTime not found... creating." << endl;
         fRawEvtTime = new MTime("MRawEvtTime");
         pList->AddToList(fRawEvtTime);
Index: trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc	(revision 608)
+++ trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc	(revision 609)
@@ -10,10 +10,9 @@
 #include "MRawFileWrite.h"
 
-#include <iostream.h>
-
 #include <TFile.h>
 #include <TTree.h>
 #include <TBranch.h>
 
+#include "MLog.h"
 #include "MParList.h"
 #include "MRawRunHeader.h"
@@ -43,6 +42,6 @@
     if (!fOut->IsOpen())
     {
-        cout << "MRawFileWrite::MRawFileWrite: ERROR: Cannot open file '";
-        cout << fname << "'" << endl;
+        *fLog << "MRawFileWrite::MRawFileWrite: ERROR: Cannot open file '";
+        *fLog << fname << "'" << endl;
     }
 }
@@ -62,5 +61,5 @@
     if (!fRawEvtHeader)
     {
-        cout << "MRawFileWrite::PreProcess - ERROR: MRawEvtHeader not found... aborting." << endl;
+        *fLog << "MRawFileWrite::PreProcess - ERROR: MRawEvtHeader not found... aborting." << endl;
         return kFALSE;
     }
@@ -69,5 +68,5 @@
     if (!fRawEvtData)
     {
-        cout << "MRawFileWrite::PreProcess - ERROR: MRawEvtData not found... aborting." << endl;
+        *fLog << "MRawFileWrite::PreProcess - ERROR: MRawEvtData not found... aborting." << endl;
         return kFALSE;
     }
@@ -76,5 +75,5 @@
     if (!fRawCrateArray)
     {
-        cout << "MRawFileWrite::PreProcess - ERROR: MRawCrateArray not found... aborting." << endl;
+        *fLog << "MRawFileWrite::PreProcess - ERROR: MRawCrateArray not found... aborting." << endl;
         return kFALSE;
     }
@@ -83,5 +82,5 @@
     if (!fRawEvtTime)
     {
-        cout << "MRawFileWrite::PreProcess - WARNING: MRawEvtTime not found... aborting." << endl;
+        *fLog << "MRawFileWrite::PreProcess - WARNING: MRawEvtTime not found... aborting." << endl;
         return kFALSE;
     }
@@ -90,5 +89,5 @@
     if (!fRawRunHeader)
     {
-        cout << "MRawFileWrite::PreProcess - ERROR: MRawRunHeader not found... aborting." << endl;
+        *fLog << "MRawFileWrite::PreProcess - ERROR: MRawRunHeader not found... aborting." << endl;
         return kFALSE;
     }
Index: trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 608)
+++ trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 609)
@@ -12,6 +12,5 @@
 #include <iomanip.h>
 
-//#include <TClass.h>
-
+#include "MLog.h"
 #include "MArrayS.h"
 
@@ -46,5 +45,5 @@
     if (fMagicNumber != kMagicNumber)
     {
-        cout << "Error: Wrong Magic Number: Not a Magic File!" << endl;
+        *fLog << "Error: Wrong Magic Number: Not a Magic File!" << endl;
         return;
     }
@@ -88,35 +87,35 @@
     // print run header information on screen
     //
-    cout << "MagicNumber:  0x" << hex << fMagicNumber << " - " << (fMagicNumber==0xc0c0?"OK":"Wrong!") << endl;
-    cout << "Version:      " << dec << "Format=" << fFormatVersion << "  ";
-    cout << "Software=" << fSoftVersion << endl;
-    cout << "RunNumber:    " << fRunNumber << " (Type=";
+    *fLog << "MagicNumber:  0x" << hex << fMagicNumber << " - " << (fMagicNumber==0xc0c0?"OK":"Wrong!") << endl;
+    *fLog << "Version:      " << dec << "Format=" << fFormatVersion << "  ";
+    *fLog << "Software=" << fSoftVersion << endl;
+    *fLog << "RunNumber:    " << fRunNumber << " (Type=";
     switch (fRunType)
     {
     case 0:
-        cout << "Data";
+        *fLog << "Data";
         break;
     case 1:
-        cout << "Pedestal";
+        *fLog << "Pedestal";
         break;
     case 2:
-        cout << "Calibration";
+        *fLog << "Calibration";
         break;
     }
-    cout << ")" << endl;
-    cout << "ProjectName: '" << fProjectName << "'" << endl;
-    cout << "Source:      '" << fSourceName << "' " << "  ";
-    cout << fSourceEpochChar << dec << fSourceEpochDate << endl;
-    cout << "Date:         " << setprecision(1) << setiosflags(ios::fixed) << fMJD << " (MJD)  " << fDateYear << "/" << fDateMonth << "/" << fDateDay << endl;
-    cout << "Crates:       " << fNumCrates << " x " << fNumPixInCrate << " Pixel/Crate = " << fNumCrates*fNumPixInCrate << " Pixel/Evt" << endl;
-    cout << "Samples:      " << fNumSamplesLoGain << "/" << fNumSamplesHiGain << " (lo/hi) = " << (fNumSamplesLoGain+fNumSamplesHiGain) * fNumCrates * fNumPixInCrate /1024 << "kB/Evt" << endl;
-    cout << "Evt Counter:  " << fNumEvents << endl;
+    *fLog << ")" << endl;
+    *fLog << "ProjectName: '" << fProjectName << "'" << endl;
+    *fLog << "Source:      '" << fSourceName << "' " << "  ";
+    *fLog << fSourceEpochChar << dec << fSourceEpochDate << endl;
+    *fLog << "Date:         " << setprecision(1) << setiosflags(ios::fixed) << fMJD << " (MJD)  " << fDateYear << "/" << fDateMonth << "/" << fDateDay << endl;
+    *fLog << "Crates:       " << fNumCrates << " x " << fNumPixInCrate << " Pixel/Crate = " << fNumCrates*fNumPixInCrate << " Pixel/Evt" << endl;
+    *fLog << "Samples:      " << fNumSamplesLoGain << "/" << fNumSamplesHiGain << " (lo/hi) = " << (fNumSamplesLoGain+fNumSamplesHiGain) * fNumCrates * fNumPixInCrate /1024 << "kB/Evt" << endl;
+    *fLog << "Evt Counter:  " << fNumEvents << endl;
 
-    cout << hex;
+    *fLog << hex;
     for (int i=0; i<GetNumPixel(); i++)
-        cout << setfill('0') << setw(3) << (*fPixAssignment)[i] << " ";
-    cout << hex << endl;
+        *fLog << setfill('0') << setw(3) << (*fPixAssignment)[i] << " ";
+    *fLog << hex << endl;
 
-    cout << endl;
+    *fLog << endl;
 }
 
Index: trunk/MagicSoft/Mars/readraw.cc
===================================================================
--- trunk/MagicSoft/Mars/readraw.cc	(revision 608)
+++ trunk/MagicSoft/Mars/readraw.cc	(revision 609)
@@ -1,3 +1,3 @@
-#include <iostream.h>
+//#include <iostream.h>
 
 #include <TSystem.h>
@@ -11,4 +11,5 @@
 #include "MEvtLoop.h"
 
+#include "MLog.h"
 #include "MTime.h"
 #include "MRawRunHeader.h"
@@ -31,10 +32,10 @@
 int main(const int argc, const char **argv)
 {
-    cout << "==================================================" << endl ;
-    cout << "                   ReadRaw v0.1" << endl;
-    cout << "      MARS Merging and Preprocessing Program" << endl ;
-    cout << "            Compiled on <" << __DATE__ << ">" << endl ;
-    cout << "==================================================" << endl ;
-    cout << endl;
+    gLog << "==================================================" << endl ;
+    gLog << "                   ReadRaw v0.1" << endl;
+    gLog << "      MARS Merging and Preprocessing Program" << endl ;
+    gLog << "            Compiled on <" << __DATE__ << ">" << endl ;
+    gLog << "==================================================" << endl ;
+    gLog << endl;
 
     //
@@ -43,6 +44,6 @@
     if (argc!=2)
     {
-        cout << "Sorry the usage is:" << endl;
-        cout << "   readraw inputfile" << endl << endl;
+        gLog << "Sorry the usage is:" << endl;
+        gLog << "   readraw inputfile" << endl << endl;
         return -1;
     }
@@ -58,5 +59,5 @@
     if (gSystem->AccessPathName(argv[1], kFileExists))
     {
-        cout << "Sorry, the file '" << argv[1] << "' doesn't exist." << endl;
+        gLog << "Sorry, the file '" << argv[1] << "' doesn't exist." << endl;
         return -1;
     }
@@ -74,5 +75,5 @@
     //  open the file
     //
-    cout << " Open the file " << endl ; 
+    gLog << " Open the file " << endl ; 
     TFile input(argv[1], "READ");
 
@@ -80,10 +81,10 @@
     // open the Run Header and read in
     //
-    cout << " Check the RunHeader " << endl ; 
+    gLog << " Check the RunHeader " << endl ; 
     TTree *runtree = (TTree*) input.Get("RunHeaders") ;
     
     if (!runtree)
     {
-        cout << endl
+        gLog << endl
             << "  WARNING: This file has NO RunHeader "
             << endl << endl ;
@@ -91,5 +92,5 @@
     else
     {
-        cout << " Entries in Tree RunHeaders: " << dec << runtree->GetEntries() << endl ;
+        gLog << " Entries in Tree RunHeaders: " << dec << runtree->GetEntries() << endl ;
 
         runtree->GetBranch("MRawRunHeader")->SetAddress(&runheader);
@@ -102,7 +103,7 @@
     // open the DataTree and read in 
     //
-    cout << " Check the Event Tree " << endl ; 
+    gLog << " Check the Event Tree " << endl ; 
     TTree *evttree = (TTree*) input.Get("Events") ;
-    cout << " Check all the Branches in the Tree " << endl ; 
+    gLog << " Check all the Branches in the Tree " << endl ; 
     
     //
@@ -119,5 +120,5 @@
         const char *name = branch->GetName();
 	
-	if (!strcmp(name, "MRawEvtHeader"))
+        if (!strcmp(name, "MRawEvtHeader"))
             evttree->GetBranch("MRawEvtHeader")->SetAddress(&evtheader);
 
@@ -131,10 +132,9 @@
             evttree->GetBranch("MRawCrateArray")->SetAddress(&evtcrate);
 
-	if ( ! strcmp(name, "MMcTrig") )
-	  evttree->GetBranch("MMcTrig")->SetAddress(&trigmc);
-	
+        if (!strcmp(name, "MMcTrig"))
+            evttree->GetBranch("MMcTrig")->SetAddress(&trigmc);
+
         if (!strcmp(name, "MMcEvt"))
             evttree->GetBranch("MMcEvt")->SetAddress(&evtmc);
-
     } 
 
@@ -144,10 +144,10 @@
     Int_t nent = (Int_t)evttree->GetEntries();
 
-    cout << endl << endl;
-    cout << " Entries in Tree Data: " << dec << nent << endl;
+    gLog << endl << endl;
+    gLog << " Entries in Tree Data: " << dec << nent << endl;
 
     for (Int_t i = 0; i<nent; i++)
     {
-        cout << "Entry: " << i << endl;
+        gLog << "Entry: " << i << endl;
 
         //
Index: trunk/MagicSoft/include-Classes/MMcFormat/MHeaderTrig.cxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MHeaderTrig.cxx	(revision 608)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MHeaderTrig.cxx	(revision 609)
@@ -47,9 +47,10 @@
   //
 
-  cout <<endl << "Monte Carlo Trigger output:" <<endl;
-  cout << " XSTopology Trigger in this run : "<<topology<<endl;
-  cout << " Multiplicity Trigger in this run : "<<multiplicity<<endl;
-  cout << " Trigger Pattern in this run : "<<TriggerPattern[0]<<
-    TriggerPattern[1]<<endl;
-  cout << endl ; 
+    cout << endl;
+    cout << "Monte Carlo Trigger output:" << endl;
+    cout << " XSTopology Trigger in this run:   " << topology << endl;
+    cout << " Multiplicity Trigger in this run: " << multiplicity << endl;
+    cout << " Trigger Pattern in this run:      ";
+    cout << TriggerPattern[0] << ", " << TriggerPattern[1] << endl;
+    cout << endl;
 }
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx	(revision 608)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx	(revision 609)
@@ -154,9 +154,9 @@
   //  print out the data member on screen
   //
-  cout <<endl << "Monte Carlo output:" <<endl;
-  cout << " Particle Id    : " << usPartId ; 
-  cout << " Energy (GeV)   : " << fEnergy  ; 
-  cout << " Impactpar. (m) : " << fImpact  ; 
-  cout << " Photoelectrons : " << usPhotEl ; 
+  cout << endl << "Monte Carlo output:" << endl;
+  cout << " Particle Id:    " << usPartId << endl;
+  cout << " Energy [GeV]:   " << fEnergy  << endl;
+  cout << " Impactpar. [m]: " << fImpact  << endl;
+  cout << " Photoelectrons: " << usPhotEl << endl;
   cout << endl ; 
 }
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.cxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.cxx	(revision 608)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.cxx	(revision 609)
@@ -69,16 +69,16 @@
 
   cout <<endl << "Monte Carlo Trigger output:" <<endl;
-  cout << " First  Level Trigger in this Event : "<<nFirstLevel<<endl; 
-  cout << " Times of first  Level Trigger in this Event : ";
+  cout << " First  Level Trigger in this Event: "<<nFirstLevel<<endl;
+  cout << " Times of first  Level Trigger in this Event: ";
   for (i=0;i<nFirstLevel;i++){
     cout<< timeFirst[i]<<"-";
   }
   cout<<endl;
-  cout << " Pixels of first  Level Trigger in this Event : ";
+  cout << " Pixels of first  Level Trigger in this Event: ";
   for (i=0;i<nFirstLevel;i++){
     cout<<pixelFirst[i]<<"-";
   }
   cout<<endl;
-  cout << " Second Level Trigger in this Event : " << nSecondLevel << endl ; 
+  cout << " Second Level Trigger in this Event: " << nSecondLevel << endl ;
   cout << endl ; 
 }
