Index: trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 994)
+++ trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 995)
@@ -37,5 +37,4 @@
 
 #pragma link C++ class MRootFileBranch;
-#pragma link C++ class MRootFileTree;
 
 #pragma link C++ class MWriteFile;
Index: trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc	(revision 994)
+++ trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc	(revision 995)
@@ -44,7 +44,7 @@
 
 ClassImp(MRootFileBranch);
-ClassImp(MRootFileTree);
-
 ClassImp(MWriteRootFile);
+
+#define kSaveNow BIT(1)
 
 // --------------------------------------------------------------------------
@@ -100,5 +100,5 @@
     // Delete the file. This'll also close the file (if open)
     //
-    delete fOut; 
+    delete fOut;
 }
 
@@ -107,23 +107,13 @@
 // Prints all trees with the actually number of written entries to log-out.
 //
-void MWriteRootFile::Print(Option_t *)
-{
-    *fLog << "File: " << GetFileName() << endl;
-    *fLog << "--------------------------------------------------" << endl;
-
-    MRootFileTree *entry;
-
-    //
-    // Loop over all tree entries
-    //
+void MWriteRootFile::Print(Option_t *) const
+{
+    cout << "File: " << GetFileName() << endl;
+    cout << "--------------------------------------------------" << endl;
+
+    TTree *t;
     TObjArrayIter Next(&fTrees);
-    while ((entry=(MRootFileTree*)Next()))
-    {
-        //
-        // Print out the name and the number of actually written entries.
-        //
-        *fLog << entry->GetTree()->GetName() << ": \t";
-        *fLog << entry->GetNumEntries() << " entries." << endl;
-    }
+    while ((t=(TTree*)Next()))
+        cout << t->GetName() << ": \t" << t->GetEntries() << " entries." << endl;
 }
 
@@ -185,6 +175,6 @@
 
     //
-    //
     // loop over all branches which are 'marked' as branches to get written.
+    //
     TObjArrayIter Next(&fBranches);
     while ((entry=(MRootFileBranch*)Next()))
@@ -221,6 +211,6 @@
         //
         const char *cname  = cont->GetName();
-        const char *tname  = entry->GetTreeName();
-        const char *ttitle = entry->GetTreeTitle();
+        const char *tname  = entry->GetName();
+        const char *ttitle = entry->GetTitle();
 
         //
@@ -228,5 +218,5 @@
         // the container name.
         //
-        if (!tname)
+        if (tname[0] == '\0')
             tname = cname;
 
@@ -239,14 +229,9 @@
             //
             // if the tree doesn't exist create a new tree. Use the tree
-            // name as title if title is NULL
+            // name as title if title is NULL.
+            // And add the tree to the list of trees
             //
             tree = new TTree(tname, ttitle ? ttitle : tname);
-
-            //
-            // Create a new entry in the list of trees, which are stored to
-            // the file. Add it to the list.
-            //
-            MRootFileTree *entry = new MRootFileTree(tree);
-            fTrees.AddLast(entry);
+            fTrees.AddLast(tree);
 
             *fLog << "Created Tree " << tname << "." << endl;
@@ -258,10 +243,10 @@
         // Add a pointer to the entry in the tree list to this branch-entry
         //
-        MRootFileTree *loop;
+        TObject *obj;
         TObjArrayIter NextTree(&fTrees);
-        while ((loop=(MRootFileTree*)NextTree()))
-        {
-            if (loop->GetTree() == tree)
-                entry->SetTree(loop);
+        while ((obj=NextTree()))
+        {
+            if (obj == tree)
+                entry->SetTree((TTree*)obj);
         }
 
@@ -320,10 +305,10 @@
     while ((obj=NextBranch()))
     {
-        MRootFileBranch *entry = (MRootFileBranch*)obj;
+        MRootFileBranch *b = (MRootFileBranch*)obj;
 
         //
         // Check for the Write flag
         //
-        if (!entry->GetContainer()->IsReadyToSave())
+        if (!b->GetContainer()->IsReadyToSave())
             continue;
 
@@ -332,5 +317,5 @@
         // the corresponding tree entry.
         //
-        entry->GetTree()->SetWriteFlag();
+        b->GetTree()->SetBit(kSaveNow);
     }
 
@@ -341,20 +326,19 @@
     while ((obj=NextTree()))
     {
-        MRootFileTree *entry = (MRootFileTree*)obj;
+        TTree *t = (TTree*)obj;
 
         //
         // Check the write flag of the tree
         //
-        if (!entry->HasWriteFlag())
+        if (!t->TestBit(kSaveNow))
             continue;
 
         //
-        // If the write flag is set, fill the tree (with the corrasponding
+        // If the write flag is set, fill the tree (with the corresponding
         // branches/containers), delete the write flag and increase the number
         // of written/filled entries.
         //
-        entry->GetTree()->Fill();
-        entry->DelWriteFlag();
-        (*entry)++;
+        t->Fill();
+        t->ResetBit(kSaveNow);
     }
 }
Index: trunk/MagicSoft/Mars/mbase/MWriteRootFile.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MWriteRootFile.h	(revision 994)
+++ trunk/MagicSoft/Mars/mbase/MWriteRootFile.h	(revision 995)
@@ -71,5 +71,5 @@
     MWriteRootFile(const char *fname,
                    const Option_t *opt="RECREATE",
-                   const char *ftitle="Unnamed",
+                   const char *ftitle="Untitled",
                    const Int_t comp=9,
                    const char *name=NULL,
