Index: trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 1451)
+++ trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 1471)
@@ -54,4 +54,5 @@
 #include "MEvtLoop.h"
 
+#include <fstream.h>     // ofstream, SavePrimitive
 #include <iostream.h>
 
@@ -274,2 +275,11 @@
 }
 
+void MEvtLoop::SavePrimitive(ofstream &out, Option_t *)
+{
+    fParList->SavePrimitive(out);
+
+    out << "   MEvtLoop evtloop;" << endl;
+    out << "   evtloop.SetParList(&" << ToLower(fParList->GetName()) << ")" << endl;
+    out << "   if (!evtloop.Eventloop())" << endl;
+    out << "      return;" << endl;
+}
Index: trunk/MagicSoft/Mars/mbase/MEvtLoop.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEvtLoop.h	(revision 1451)
+++ trunk/MagicSoft/Mars/mbase/MEvtLoop.h	(revision 1471)
@@ -46,4 +46,6 @@
     Bool_t Eventloop(Int_t maxcnt=-1, const char *tlist="MTaskList");
 
+    void SavePrimitive(ofstream &out, Option_t *o="");
+
     ClassDef(MEvtLoop, 0) // Class to execute the tasks in a tasklist
 };
Index: trunk/MagicSoft/Mars/mbase/MParContainer.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 1451)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 1471)
@@ -346,2 +346,10 @@
     return call;
 }
+
+void MParContainer::SavePrimitive(ofstream &out, Option_t *o="")
+{
+    out << "   // SavePrimitive not overloaded... using default." << endl;
+    out << "   " << ClassName() << " " << ToLower(fName) << "(\"";
+    out << fName << "\", \"" << fTitle << "\");" << endl;
+}
+
Index: trunk/MagicSoft/Mars/mbase/MParContainer.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 1451)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 1471)
@@ -61,4 +61,5 @@
     virtual void        Print(Option_t *option="") const;
     virtual Int_t       Sizeof() const;
+    virtual void        SavePrimitive(ofstream &out, Option_t *o="");
 
     virtual void   SetLogStream(MLog *lg) { fLog = lg; }
Index: trunk/MagicSoft/Mars/mbase/MParList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 1451)
+++ trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 1471)
@@ -41,4 +41,6 @@
 #include "MParList.h"
 
+#include <fstream.h>     // ofstream, SavePrimitive
+
 #include <TNamed.h>
 #include <TClass.h>
@@ -657,2 +659,17 @@
     return list;
 }
+
+void MParList::SavePrimitive(ofstream &out, Option_t *o="")
+{
+    out << "   MParList " << ToLower(fName) << ";" << endl << endl;
+
+    TIter Next(fContainer);
+
+    TObject *cont = NULL;
+    while ((cont=Next()))
+    {
+        cont->SavePrimitive(out, "");
+        out << "   " << ToLower(fName) << ".AddToList(&";
+        out << ToLower(cont->GetName()) << ");" << endl << endl;
+    }
+}
Index: trunk/MagicSoft/Mars/mbase/MParList.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParList.h	(revision 1451)
+++ trunk/MagicSoft/Mars/mbase/MParList.h	(revision 1471)
@@ -78,4 +78,5 @@
 
     void Print(Option_t *t = NULL) const;
+    void SavePrimitive(ofstream &out, Option_t *o="");
 
     ClassDef(MParList, 0) // list of parameter containers (MParContainer)
Index: trunk/MagicSoft/Mars/mbase/MTaskList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 1451)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 1471)
@@ -57,4 +57,6 @@
 #include "MTaskList.h"
 
+#include <fstream.h>     // ofstream, SavePrimitive
+
 #include <TClass.h>
 #include <TBaseClass.h>
@@ -512,2 +514,17 @@
 }
 
+
+void MTaskList::SavePrimitive(ofstream &out, Option_t *o="")
+{
+    out << "   MTaskList " << ToLower(fName) << ";" << endl << endl;
+
+    TIter Next(fTasks);
+
+    TObject *cont = NULL;
+    while ((cont=Next()))
+    {
+        cont->SavePrimitive(out, "");
+        out << "   " << ToLower(fName) << ".AddToList(&";
+        out << ToLower(cont->GetName()) << ");" << endl << endl;
+    }
+}
Index: trunk/MagicSoft/Mars/mbase/MTaskList.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 1451)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 1471)
@@ -56,4 +56,6 @@
     void SetOwner(Bool_t enable=kTRUE);
 
+    void SavePrimitive(ofstream &out, Option_t *o="");
+
     const TList *GetList() const { return fTasks; }
 
