Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 2298)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 2299)
@@ -20,4 +20,40 @@
    * mranforest/MRanForestFill.[h,cc]:
      - default fNumTrees set to -1 tree (all trees)
+
+   * manalysis/MBlindPixelCalc.[h,cc]:
+     - interpolate Pedestal, too
+     - Only count 'valid' pixels
+     
+   * mfileio/MRead.[h,cc]:
+     - enhanced AddFiles
+     
+   * mhist/MHCamEvent.[h,cc]:
+     - Added PrintOutlayers
+
+   * mhist/MHCamera.[h,cc]:
+     - added GetNumPixels
+     - added default to GetMean and GetRMS
+
+   * mhist/MHTriggerLvl0.[h,cc]:
+     - added PrintOutlayers
+
+   * merpp.cc:
+     - added more arguments
+     - replace .raw by .root if no root file given
+     - automatic extension adding
+     
+   * mbase/MEvtLoop.[h,cc]:
+     - added estimated run time
+     - in Process: Changes type of rc from Bool_t to Int_t 
+     
+   * mmain/MStatusDisplay.cc:
+     - changed order in Tab-menu
+     
+   * mraw/MRawFileRead.cc:
+     - consistency check for 0xc0c1 files
+     
+   * mraw/MRawRunHeader.cc:
+     - initialize variables
+     - added 0xc0c1 support
 
 
Index: /trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 2298)
+++ /trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 2299)
@@ -267,5 +267,5 @@
 }
 
-Bool_t MEvtLoop::ProcessGuiEvents(Int_t num)
+Bool_t MEvtLoop::ProcessGuiEvents(Int_t num, Int_t entries)
 {
     if (!fProgress || gROOT->IsBatch())
@@ -320,5 +320,10 @@
             txt += " (";
             txt += speed;
-            txt += "Evts/s)";
+            txt += "Evts/s, est: ";
+            txt += (int)((long int)(t0-t2)*entries/(60000.*(num-start)));
+            txt += "m";
+            //txt += (int)fmod(entries/(1000.*(num-start)/(long int)(t0-t2)), 60);
+            //txt += "s";
+            txt += ")";
         }
         fDisplay->SetStatusLine1(txt);
@@ -416,5 +421,5 @@
         {
             numcnts++;
-            if (!ProcessGuiEvents(++dummy))
+            if (!ProcessGuiEvents(++dummy, entries))
                 break;
         }
@@ -424,5 +429,5 @@
         {
             numcnts++;
-            if (!ProcessGuiEvents(maxcnt - dummy))
+            if (!ProcessGuiEvents(maxcnt - dummy, entries))
                 break;
         }
Index: /trunk/MagicSoft/Mars/mbase/MEvtLoop.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MEvtLoop.h	(revision 2298)
+++ /trunk/MagicSoft/Mars/mbase/MEvtLoop.h	(revision 2299)
@@ -37,5 +37,5 @@
     void StreamPrimitive(ofstream &out) const;
 
-    Bool_t ProcessGuiEvents(Int_t num);
+    Bool_t ProcessGuiEvents(Int_t num, Int_t entries);
 
 public:
Index: /trunk/MagicSoft/Mars/merpp.cc
===================================================================
--- /trunk/MagicSoft/Mars/merpp.cc	(revision 2298)
+++ /trunk/MagicSoft/Mars/merpp.cc	(revision 2299)
@@ -39,8 +39,9 @@
 {
     gLog << "Sorry the usage is:" << endl;
-    gLog << "   merpp [-vn] inputfile outputfile [compression level]" << endl << endl;
+    gLog << "   merpp [-a0] [-vn] [-cn] inputfile[.raw] [outputfile[.root]]" << endl << endl;
     gLog << "     input file:   Magic DAQ binary file." << endl;
     gLog << "     ouput file:   Merpped root file." << endl;
-    gLog << "     compr. level: 1..9 [default=1]" << endl;
+    gLog << "     -a0: Do not use Ansii codes." << endl;
+    gLog << "     -cn: Compression level n=1..9 [default=1]" << endl;
     gLog << "     -vn: Verbosity level n [default=2]" << endl << endl;
 }
@@ -49,5 +50,4 @@
 {
     MArgs arg(argc, argv);
-    arg.Print();
 
     gLog << "==================================================" << endl ;
@@ -60,7 +60,17 @@
 
     //
+    // Set verbosity to highest level.
+    //
+    gLog.SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2);
+
+    if (arg.HasOption("-a") && arg.GetIntAndRemove("-a")==0)
+        gLog.SetNoColors();
+
+    const int kComprlvl = arg.HasOption("-c") ? arg.GetIntAndRemove("-c") : 1;
+
+    //
     // check for the right usage of the program
     //
-    if (arg.GetNumArguments()<2 || arg.GetNumArguments()>3)
+    if (arg.GetNumArguments()<1 || arg.GetNumArguments()>2)
     {
         Usage();
@@ -69,14 +79,8 @@
 
     //
-    // Set verbosity to highest level.
-    //
-    gLog.SetDebugLevel(arg.HasOption("-v") ? arg.GetInt("-v") : 2);
-
-    //
     // This is to make argv[i] more readable insidethe code
     //
-    const char *kNamein   = arg.GetArgumentStr(0);
-    const char *kNameout  = arg.GetArgumentStr(1);
-    const int   kComprlvl = arg.GetNumArguments()==3 ? arg.GetArgumentInt(2) : 1;
+    TString kNamein  = arg.GetArgumentStr(0);
+    TString kNameout = arg.GetArgumentStr(1);
 
     //
@@ -85,4 +89,13 @@
     TROOT merpp("merpp", "Mars - Merging and Preprocessing Program");
     merpp.SetBatch();
+
+    if (!kNamein.EndsWith(".raw"))
+        kNamein += ".raw";
+
+    if (kNameout.IsNull())
+        kNameout = kNamein(0, kNamein.Last('.'));
+
+    if (!kNameout.EndsWith(".root"))
+        kNameout += ".root";
 
     //
@@ -117,5 +130,5 @@
 
     //
-    // ---- Tho following is only necessary to supress some output ----
+    // ---- The following is only necessary to supress some output ----
     //
     MRawRunHeader runheader;
Index: /trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc	(revision 2298)
+++ /trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc	(revision 2299)
@@ -194,4 +194,7 @@
     MGPopupMenu *tabmenu = new MGPopupMenu(gClient->GetRoot());
     // tabmenu->AddEntry("Save &As...", kFileSaveAs);
+    tabmenu->AddEntry("Next [&+]",           kTabNext);
+    tabmenu->AddEntry("Previous [&-]",       kTabPrevious);
+    tabmenu->AddSeparator();
     tabmenu->AddEntry("Save As tab-i.&ps",   kTabSaveAsPS);
     tabmenu->AddEntry("Save As tab-i.&gif",  kTabSaveAsGIF);
@@ -202,7 +205,4 @@
     tabmenu->AddSeparator();
     tabmenu->AddEntry("Print with &lpr",     kFilePrint);
-    tabmenu->AddSeparator();
-    tabmenu->AddEntry("Next [&+]",           kTabNext);
-    tabmenu->AddEntry("Previous [&-]",       kTabPrevious);
     tabmenu->Associate(this);
 
Index: /trunk/MagicSoft/Mars/mraw/MRawFileRead.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawFileRead.cc	(revision 2298)
+++ /trunk/MagicSoft/Mars/mraw/MRawFileRead.cc	(revision 2299)
@@ -223,6 +223,10 @@
     {
         fRawCrateArray->GetEntry(i)->ReadEvt(*fIn);
+        if (!*fIn)
+            return kFALSE;
 
         fRawEvtData->ReadEvt(*fIn);
+        if (!*fIn)
+            return kFALSE;
     }
 
Index: /trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 2298)
+++ /trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 2299)
@@ -56,4 +56,22 @@
 
     fPixAssignment = new MArrayS(0);
+
+    fFormatVersion=0;
+    fSoftVersion=0;
+    fRunType=0;
+    fRunNumber=0;
+    fProjectName[0]=0;
+    fSourceName[0]=0;
+    fSourceEpochChar[0]=0;
+    fSourceEpochDate=0;
+    fMJD=0;
+    fDateYear=0;
+    fDateMonth=0;
+    fDateDay=0;
+    fNumCrates=0;
+    fNumPixInCrate=0;
+    fNumSamplesLoGain=0;
+    fNumSamplesHiGain=0;
+    fNumEvents=0;
 }
 
@@ -76,14 +94,17 @@
     // read one RUN HEADER from the input stream
     //
-    fin.read((char*)&fMagicNumber,       2);
+    fin.read((char*)&fMagicNumber, 2);
 
     //
     // check whether the the file has the right file type or not
     //
-    if (fMagicNumber != kMagicNumber)
+    if (fMagicNumber != kMagicNumber && fMagicNumber != kMagicNumber+1)
     {
         *fLog << err << "Error: Wrong Magic Number: Not a Magic File!" << endl;
         return;
     }
+
+    if (fMagicNumber == kMagicNumber && fMagicNumber != kMagicNumber+1)
+        *fLog << warn << "WARNING - This file maybe broken (0xc0c1) - DAQ didn't close it correctly!" << endl;
 
     Byte_t dummy[16];
