Index: trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 1483)
+++ trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 1488)
@@ -49,4 +49,6 @@
 ClassImp(MWriteRootFile);
 
+static const TString gsDefName  = "MWriteRootFile";
+static const TString gsDefTitle = "Task which writes a root-output file";
 // --------------------------------------------------------------------------
 //
@@ -56,6 +58,6 @@
 MWriteRootFile::MWriteRootFile() : fOut(NULL)
 {
-    fName  = "MWriteRootFile";
-    fTitle = "Task which writes a root-output file";
+    fName  = gsDefName;
+    fTitle = gsDefTitle;
 
     fBranches.SetOwner();
@@ -76,6 +78,6 @@
                                const char *title)
 {
-    fName  = name  ? name  : "MWriteRootFile";
-    fTitle = title ? title : "Task which writes a root-output file";
+    fName  = name  ? name  : gsDefName.Data();
+    fTitle = title ? title : gsDefTitle.Data();
 
     //
@@ -409,6 +411,14 @@
     out << fOut->GetOption() << "\", \"";
     out << fOut->GetTitle() << "\", ";
-    out << fOut->GetCompressionLevel() << ", \"";
-    out << fName << "\", \"" << fTitle << "\");" << endl;;
+    out << fOut->GetCompressionLevel();
+
+    if (fName!=gsDefName || fTitle!=gsDefTitle)
+    {
+        out << ", \"" << fName << "\"";
+        if (fTitle!=gsDefTitle)
+            out << ", \"" << fTitle << "\"";
+    }
+    out << ");" << endl;
+
 
     MRootFileBranch *entry;
@@ -416,4 +426,6 @@
     while ((entry=(MRootFileBranch*)Next()))
     {
+        out << "   " << GetUniqueName() << ".AddContainer(";
+
         if  (entry->GetContainer())
         {
@@ -424,6 +436,9 @@
             out << "\"" << entry->GetContName() << "\"";
 
-        out << ", \"" << entry->GetName() << "\", \"";
-        out << entry->GetTitle() << "\");" << endl;
+        out << ", \"" << entry->GetName() << "\"";
+        if ((TString)entry->GetTitle()!="")
+            out << ", \"" << entry->GetTitle() << "\"";
+
+        out <<");" << endl;
     }
 }
