Index: trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawEvtData.cc	(revision 604)
+++ 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;
     }
