Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 9140)
+++ trunk/MagicSoft/Mars/Changelog	(revision 9141)
@@ -41,8 +41,8 @@
 
    * mreport/MReport.cc:
-     - implemented a new version fix, namely 20080930
+     - implemented a new version fix, namely 200809300
 
    * mreport/MReportCC.cc:
-     - implemented interpretation of new format 200805190
+     - implemented interpretation of new format 200809030
 
 
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 9140)
+++ trunk/MagicSoft/Mars/NEWS	(revision 9141)
@@ -3,8 +3,16 @@
 == <cvs> ==
 
-  ;Database
+ ;general
+
+   * All command line options after -- are now interpreted as 
+     arguments (usually everything which doesn't start with a minus)
+     rather than options (usually everything which starts with a
+     minus). This allows to use file names starting with a -
+
+ ;Database
 
    * Added informations about the DC currents (fMinCurrents, fMedCurrents
-     and fMaxCurrents)
+     and fMaxCurrents). The values are retrieved from the plots showing
+     the average DC currents of all pixels versus time.
 
  ;automatic analyis
@@ -21,4 +29,11 @@
      now steered via database. Consequently the plots are faster and 
      reliable up-to-date. 
+
+ ;merpp
+
+   * Fixed merpping of raw-files (the runheader tree got the name RunHeader
+     instead of RunHeaders)
+
+   * Now allows to merpp files newer than 2008/09/03.
 
 
Index: trunk/MagicSoft/Mars/callisto.cc
===================================================================
--- trunk/MagicSoft/Mars/callisto.cc	(revision 9140)
+++ trunk/MagicSoft/Mars/callisto.cc	(revision 9141)
@@ -153,5 +153,5 @@
     // Evaluate arguments
     //
-    MArgs arg(argc, argv, kTRUE);
+    MArgs arg(argc, argv);
     gLog.Setup(arg);
 
Index: trunk/MagicSoft/Mars/ganymed.cc
===================================================================
--- trunk/MagicSoft/Mars/ganymed.cc	(revision 9140)
+++ trunk/MagicSoft/Mars/ganymed.cc	(revision 9141)
@@ -116,5 +116,5 @@
     // Evaluate arguments
     //
-    MArgs arg(argc, argv, kTRUE);
+    MArgs arg(argc, argv);
     gLog.Setup(arg);
 
Index: trunk/MagicSoft/Mars/mars.cc
===================================================================
--- trunk/MagicSoft/Mars/mars.cc	(revision 9140)
+++ trunk/MagicSoft/Mars/mars.cc	(revision 9141)
@@ -89,5 +89,5 @@
     // Evaluate arguments
     //
-    MArgs arg(argc, argv, kTRUE);
+    MArgs arg(argc, argv);
     gLog.Setup(arg);
 
Index: trunk/MagicSoft/Mars/mbase/MArgs.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MArgs.cc	(revision 9140)
+++ trunk/MagicSoft/Mars/mbase/MArgs.cc	(revision 9141)
@@ -31,5 +31,9 @@
 //
 // Arguments beginning with a trailing '-' are called 'options'.
+//
 // Arguments without a trailing '-' are considered 'arguments'
+//
+// All arguments appearing after '--' on the commandline are
+//  also cosidered as 'arguments'
 //
 //////////////////////////////////////////////////////////////////////////////
@@ -57,8 +61,5 @@
 //  fArgv: A TList containing all other command line arguments
 //
-//  If root==kFALSE all root commandline options are deleted from
-//  the list, namely: -b
-//
-MArgs::MArgs(int argc, char **argv, Bool_t root) : fArgc(argc)
+MArgs::MArgs(int argc, char **argv) : fArgc(argc)
 {
     TString cmdline;
@@ -76,9 +77,27 @@
         fArgv.Add(new MArgsEntry(argv[i]));
     }
-
-    if (root)
-        return;
-
-    HasOnlyAndRemove("-b");
+}
+
+// --------------------------------------------------------------------------
+//
+//  Remove all root commandline options from the list,
+//  namely: -b, -n, -q, -l, -?, -h, --help, -config
+//
+//  Returns the number of found root options (max 8)
+//
+Int_t MArgs::RemoveRootArgs()
+{
+    Int_t n = 0;
+
+    n += HasOnlyAndRemove("-b");
+    n += HasOnlyAndRemove("-n");
+    n += HasOnlyAndRemove("-q");
+    n += HasOnlyAndRemove("-l");
+    n += HasOnlyAndRemove("-?");
+    n += HasOnlyAndRemove("-h");
+    n += HasOnlyAndRemove("--help");
+    n += HasOnlyAndRemove("-config");
+
+    return n;
 }
 
@@ -109,5 +128,5 @@
         TString *s = NULL;
         while ((s=dynamic_cast<TString*>(Next())))
-            if (s->BeginsWith("-"))
+            if (*s!="--" && s->BeginsWith("-"))
                 gLog << *s << endl;
         return;
@@ -119,5 +138,5 @@
         TString *s = NULL;
         while ((s=dynamic_cast<TString*>(Next())))
-            if (!s->BeginsWith("-"))
+            if (*s!="--" && !s->BeginsWith("-"))
                 gLog << *s << endl;
         return;
@@ -283,9 +302,17 @@
     Int_t num = 0;
 
-    TIter Next(&fArgv);
-    TString *s = NULL;
-    while ((s=dynamic_cast<TString*>(Next())))
-    {
-        if (s->BeginsWith("-"))
+    Bool_t allarg = kFALSE;
+
+    TIter Next(&fArgv);
+    TString *s = NULL;
+    while ((s=dynamic_cast<TString*>(Next())))
+    {
+        if (*s=="--")
+        {
+            allarg = kTRUE;
+            continue;
+        }
+
+        if (s->BeginsWith("-") && !allarg)
             continue;
 
@@ -305,9 +332,21 @@
     Int_t num = 0;
 
-    TIter Next(&fArgv);
-    TString *s = NULL;
-    while ((s=dynamic_cast<TString*>(Next())))
-        if (!s->BeginsWith("-"))
-            num++;
+    Bool_t allarg = kFALSE;
+
+    TIter Next(&fArgv);
+    TString *s = NULL;
+    while ((s=dynamic_cast<TString*>(Next())))
+    {
+        if (*s=="--")
+        {
+            allarg = kTRUE;
+            continue;
+        }
+
+        if (s->BeginsWith("-") && !allarg)
+            continue;
+
+        num++;
+    }
 
     return num;
@@ -325,6 +364,11 @@
     TString *s = NULL;
     while ((s=dynamic_cast<TString*>(Next())))
+    {
+        if (*s=="--")
+            return num;
+
         if (s->BeginsWith("-"))
             num++;
+    }
 
     return num;
@@ -337,5 +381,5 @@
 Int_t MArgs::GetNumEntries() const
 {
-    return fArgv.GetSize();
+    return fArgv.FindObject("--") ? fArgv.GetSize()-1 : fArgv.GetSize();
 }
 
Index: trunk/MagicSoft/Mars/mbase/MArgs.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MArgs.h	(revision 9140)
+++ trunk/MagicSoft/Mars/mbase/MArgs.h	(revision 9141)
@@ -31,5 +31,5 @@
 
 public:
-    MArgs(int argc, char **argv, Bool_t root=kFALSE);
+    MArgs(int argc, char **argv);
 
     // TObject
@@ -40,4 +40,6 @@
 
     // MArgs
+    Int_t    RemoveRootArgs();
+
     Int_t    GetInt(const TString name) const;
     Double_t GetFloat(const TString name) const;
Index: trunk/MagicSoft/Mars/merpp.cc
===================================================================
--- trunk/MagicSoft/Mars/merpp.cc	(revision 9140)
+++ trunk/MagicSoft/Mars/merpp.cc	(revision 9141)
@@ -152,4 +152,6 @@
         return 2;
     }
+
+    arg.RemoveRootArgs();
 
     const Bool_t  kDebugMem   = arg.HasOnlyAndRemove("--debug-mem");
Index: trunk/MagicSoft/Mars/mhist/MHEvent.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEvent.cc	(revision 9140)
+++ trunk/MagicSoft/Mars/mhist/MHEvent.cc	(revision 9141)
@@ -266,12 +266,11 @@
         s += fRawEvtHeader->GetDAQEvtNumber();
     }
+
     if (fRawEvtHeader && fRawRunHeader)
         s += " of ";
 
     if (fRawRunHeader)
-    {
-        s += "M";
         s += fRawRunHeader->GetStringID();
-    }
+
     if (fTime)
     {
Index: trunk/MagicSoft/Mars/mjobs/MJMerpp.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJMerpp.cc	(revision 9140)
+++ trunk/MagicSoft/Mars/mjobs/MJMerpp.cc	(revision 9141)
@@ -150,5 +150,5 @@
     read.SetForceMode(fForceProcessing);
 
-    write.AddContainer("MRawRunHeader",  "RunHeader");
+    write.AddContainer("MRawRunHeader",  "RunHeaders");
     write.AddContainer("MTime",          "Events");
     write.AddContainer("MRawEvtHeader",  "Events");
Index: trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 9140)
+++ trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 9141)
@@ -492,9 +492,9 @@
 Bool_t MRawRunHeader::Fixes()
 {
-    if (fFormatVersion>8)
+    if (fFormatVersion>8 && fRunNumber>326152)
     {
         fNumEvents--;
         fNumEventsRead--;
-        *fLog << inf << "Format >V8: Stored number of events decreased by 1." << endl;
+        *fLog << inf << "Format >V8 and No>326152: Stored number of events decreased by 1." << endl;
     }
 
Index: trunk/MagicSoft/Mars/mreport/MReport.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReport.cc	(revision 9140)
+++ trunk/MagicSoft/Mars/mreport/MReport.cc	(revision 9141)
@@ -167,4 +167,5 @@
 //    200510250  | 53813.5 |         |  200603190
 //    200604010  | 53863.5 |         |  200605080
+//    200605190  | 54711.5 |         |  200809030
 //
 Int_t MReport::Interprete(TString &str, const MTime &start, const MTime &stop, Int_t ver)
@@ -200,4 +201,7 @@
         ver=200605080;
 
+    if (ver==200605190 && GetMjd()>54711.5)
+        ver=200809030;
+
     // Interprete body (contents) of report
     const Int_t rc = InterpreteBody(str, ver);
Index: trunk/MagicSoft/Mars/mreport/MReportCC.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportCC.cc	(revision 9140)
+++ trunk/MagicSoft/Mars/mreport/MReportCC.cc	(revision 9141)
@@ -114,5 +114,4 @@
     if (n!=6)
     {
-        cout << n << endl;
         *fLog << warn << "WARNING - Wrong number of arguments (should be 6)." << endl;
         return kFALSE;
@@ -120,4 +119,45 @@
 
     str.Remove(0, len);
+
+    if (ver>=200809030)
+    {
+        if (!CheckTag(str, "SCHEDULE "))
+            return kFALSE;
+
+        str = str.Strip(TString::kBoth);
+
+        // [Sourcename] sourcecategory
+        const Ssiz_t pos1 = str.First(' ');
+        if (pos1<0)
+        {
+            *fLog << warn << "WARNING - Wrong number of arguments (should be 1 or 2)." << endl;
+            return kFALSE;
+        }
+
+        const TString str1 = str(0, pos1);
+
+        str.Remove(0, pos1);
+        str = str.Strip(TString::kBoth);
+
+        if (!str1.IsDigit())
+        {
+            const Ssiz_t pos2 = str.First(' ');
+            if (pos2<0)
+            {
+                *fLog << warn << "WARNING - Wrong number of arguments (should be 1 or 2)." << endl;
+                return kFALSE;
+            }
+
+            const TString str2 = str(0, pos2);
+
+            str.Remove(0, pos2);
+
+            if (!str2.IsDigit())
+            {
+                *fLog << warn << "WARNING - Wrong type of second argument." << endl;
+                return kFALSE;
+            }
+        }
+    }
 
     return kTRUE;
Index: trunk/MagicSoft/Mars/readdaq.cc
===================================================================
--- trunk/MagicSoft/Mars/readdaq.cc	(revision 9140)
+++ trunk/MagicSoft/Mars/readdaq.cc	(revision 9141)
@@ -79,4 +79,6 @@
     }
 
+    arg.RemoveRootArgs();
+
     //
     // Set verbosity to highest level.
Index: trunk/MagicSoft/Mars/readraw.cc
===================================================================
--- trunk/MagicSoft/Mars/readraw.cc	(revision 9140)
+++ trunk/MagicSoft/Mars/readraw.cc	(revision 9141)
@@ -88,4 +88,6 @@
         return 2;
     }
+
+    arg.RemoveRootArgs();
 
     // Set usage of decimal values
Index: trunk/MagicSoft/Mars/showlog.cc
===================================================================
--- trunk/MagicSoft/Mars/showlog.cc	(revision 9140)
+++ trunk/MagicSoft/Mars/showlog.cc	(revision 9141)
@@ -80,4 +80,6 @@
         return 2;
     }
+
+    arg.RemoveRootArgs();
 
     const Bool_t kNoColors = arg.HasOnly("--no-colors") || arg.HasOnly("-a");
Index: trunk/MagicSoft/Mars/showplot.cc
===================================================================
--- trunk/MagicSoft/Mars/showplot.cc	(revision 9140)
+++ trunk/MagicSoft/Mars/showplot.cc	(revision 9141)
@@ -148,5 +148,5 @@
     // Evaluate arguments
     //
-    MArgs arg(argc, argv, kTRUE);
+    MArgs arg(argc, argv);
     gLog.Setup(arg);
 
Index: trunk/MagicSoft/Mars/sinope.cc
===================================================================
--- trunk/MagicSoft/Mars/sinope.cc	(revision 9140)
+++ trunk/MagicSoft/Mars/sinope.cc	(revision 9141)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: sinope.cc,v 1.13 2008-06-02 08:46:36 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: sinope.cc,v 1.14 2008-10-13 14:53:24 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -301,5 +301,5 @@
     // Evaluate arguments
     //
-    MArgs arg(argc, argv, kTRUE);
+    MArgs arg(argc, argv);
     gLog.Setup(arg);
 
Index: trunk/MagicSoft/Mars/sponde.cc
===================================================================
--- trunk/MagicSoft/Mars/sponde.cc	(revision 9140)
+++ trunk/MagicSoft/Mars/sponde.cc	(revision 9141)
@@ -94,5 +94,5 @@
     // Evaluate arguments
     //
-    MArgs arg(argc, argv, kTRUE);
+    MArgs arg(argc, argv);
     gLog.Setup(arg);
 
Index: trunk/MagicSoft/Mars/star.cc
===================================================================
--- trunk/MagicSoft/Mars/star.cc	(revision 9140)
+++ trunk/MagicSoft/Mars/star.cc	(revision 9141)
@@ -102,5 +102,5 @@
     // Evaluate arguments
     //
-    MArgs arg(argc, argv, kTRUE);
+    MArgs arg(argc, argv);
     gLog.Setup(arg);
 
