Index: trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc	(revision 2604)
+++ trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc	(revision 2607)
@@ -190,5 +190,5 @@
     //MReadTree::Notify();
 
-    *fLog << err << "ERROR - ReInit of '" << tlist->GetName() << "' failed." << endl;
+    *fLog << err << "ERROR - ReInit of '" << tlist->GetDescriptor() << "' failed." << endl;
     return kFALSE;
 }
Index: trunk/MagicSoft/Mars/mfileio/MReadReports.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadReports.cc	(revision 2604)
+++ trunk/MagicSoft/Mars/mfileio/MReadReports.cc	(revision 2607)
@@ -70,6 +70,7 @@
 #include "MTime.h"
 #include "MParList.h"
-#include "MReadTree.h"
 #include "MTaskList.h"
+
+#include "MReadMarsFile.h"
 
 ClassImp(MReadReports);
@@ -124,7 +125,7 @@
 // name in time.
 //
-// All calls to AddTree _must_ be before the calls to AddFile!
-//
-void MReadReports::AddTree(const char *tree, const char *time)
+// All calls to AddTree _must_ be BEFORE the calls to AddFile!
+//
+void MReadReports::AddTree(const char *tree, const char *time, Bool_t master)
 {
     /*
@@ -136,7 +137,16 @@
     }
     */
-    MReadTree *t = new MReadTree(tree);
+
+    if (master && TestBit(kHasMaster))
+    {
+        *fLog << warn << GetDescriptor() << " already has a master tree... ignored." << endl;
+        master = kFALSE;
+    }
+
+    MReadTree *t = master ? new MReadMarsFile(tree) : new MReadTree(tree);
     t->SetName(tree);
     t->SetTitle(time?time:"");
+    if (master)
+        t->SetBit(kHasMaster);
 
     if (!fEnableAutoScheme)
@@ -154,5 +164,5 @@
 // Schedule a file or several files (using widcards) for reading.
 //
-// All calls to AddTree _must_ be before the calls to AddFile!
+// All calls to AddTree _must_ be BEFORE the calls to AddFile!
 //
 Int_t MReadReports::AddFile(const char *fname, Int_t entries)
@@ -188,4 +198,10 @@
     while ((tree=(MReadTree*)NextT()))
     {
+        if (((TChain*)tree->fChain)->GetListOfFiles()->GetEntries()==0)
+        {
+            *fLog << warn << "No files for Tree " << tree->GetName() << "... skipped." << endl;
+            continue;
+        }
+
         TString tn(tree->GetTitle());
         if (tn.IsNull())
@@ -224,5 +240,5 @@
     }
 
-    fPos.Set(i);
+    fPosEntry.Set(i);
 
     return fTrees->CallPreProcess(plist);
@@ -241,4 +257,62 @@
 // --------------------------------------------------------------------------
 //
+// Do not use if fChains->GetSize()==0 !!!
+//
+Int_t MReadReports::FindNextTime()
+{
+    Int_t i=0;
+
+    TIter NextC(fChains);
+    TChain *c=0;
+
+    Int_t nmin=0;
+    MTime tmin(**GetTime((TChain*)NextC()));
+
+    while ((c=(TChain*)NextC()))
+    {
+        MTime &t = **GetTime(c);
+        i++;
+
+        if (t >= tmin)
+            continue;
+
+        tmin = t;
+        nmin = i;
+    }
+    return nmin;
+}
+
+/*
+Bool_t MReadReports::Notify()
+{
+    Bool_t same = kTRUE;
+    for (int i=1; i<fPosTree.GetSize(); i++)
+        if (fPosTree[i]!=fPosTree[0])
+        {
+            same = kFALSE;
+            break;
+        }
+
+    Int_t tn = chain->GetTreeNumber();
+
+    Bool_t read=kFALSE;
+    if (fPosTree[nmin] != tn)
+    {
+        fPosTree[nmin] = tn;
+        read = kTRUE;
+    }
+
+    if (!same || !read)
+        return kTRUE;
+
+
+    *fLog << dbg << "Read Run Headers!" << endl;
+
+    return kTRUE;
+}
+*/
+
+// --------------------------------------------------------------------------
+//
 // Check which is the next tree to read from. Read an event from this tree.
 // Sets the StreamId accordingly.
@@ -248,37 +322,18 @@
     while (fChains->GetSize())
     {
-        Int_t i=0;
-
-        MTime tmin;
-
-        Int_t nmin=0;
-
-        TIter NextC(fChains);
-        TChain *c=0;
-        while ((c=(TChain*)NextC()))
+        const Int_t nmin=FindNextTime();
+
+        TChain *chain = (TChain*)fChains->At(nmin);
+
+        //Int_t before = chain->GetTreeNumber();
+        if (chain->GetEntry(++fPosEntry[nmin])>0)
         {
-            MTime &t = **GetTime(c);
-
-            if (i==0)
-                tmin = t;
-
-            if (t < tmin)
+            MTask *task = (MTask*)fTrees->GetList()->At(nmin);
+
+            if (task->CallProcess())
             {
-                tmin = t;
-                nmin = i;
+                fList->SetStreamId(task->GetName());
+                return kTRUE;
             }
-            i++;
-        }
-
-        TChain *chain = (TChain*)fChains->At(nmin);
-
-        chain->GetEntry(++fPos[nmin]);
-
-        // FIXME: Use Stream ID and call CallProcess() ?
-        Bool_t rc = ((MTask*)fTrees->GetList()->At(nmin))->CallProcess();
-        if (rc)
-        {
-            fList->SetStreamId(fTrees->GetList()->At(nmin)->GetName());
-            return kTRUE;
         }
 
Index: trunk/MagicSoft/Mars/mfileio/MReadReports.h
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadReports.h	(revision 2604)
+++ trunk/MagicSoft/Mars/mfileio/MReadReports.h	(revision 2607)
@@ -17,14 +17,16 @@
 {
 private:
-    MTaskList *fTrees;  // Hold the trees which are scheduled for reading
-    TList     *fChains; // Hold TChains to read the times in advance
+    MTaskList *fTrees;    // Hold the trees which are scheduled for reading
+    TList     *fChains;   // Hold TChains to read the times in advance
 
-    TArrayL    fPos;    // Store the position in each tree/chain
+    TArrayL    fPosEntry; // Store the position in each tree/chain
+    TArrayL    fPosTree;  // Number of Tree in file.
 
-    MTask     *fList;   // pointer to the task list to set the stream id
+    MTask     *fList;     // pointer to the task list to set the stream id
 
     Bool_t     fEnableAutoScheme;
 
     MTime** GetTime(TChain *c) const;
+    Int_t   FindNextTime();
 
     UInt_t  GetEntries() { return 0; }
@@ -34,9 +36,20 @@
     Int_t   PostProcess();
 
+    //Bool_t  Notify();
+
+    enum {
+        //MReadTree::kChainWasChanged = BIT(14)
+        kHasMaster = BIT(15)
+    };
+
 public:
     MReadReports(); 
     ~MReadReports(); 
 
-    void  AddTree(const char *tree, const char *time=NULL);
+    void  AddTree(const char *tree, const char *time=NULL, Bool_t master=kFALSE);
+    void  AddTree(const char *tree, Bool_t master)
+    {
+        AddTree(tree, NULL, master);
+    }
     Int_t AddFile(const char *fname, Int_t entries=-1);
     void  AddToBranchList(const char *name);
@@ -44,5 +57,5 @@
     void  PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE) const;
 
-    void  EnableAutoScheme(Bool_t e=kTRUE) { fEnableAutoScheme = e; }
+    void  EnableAutoScheme(Bool_t e=kTRUE) { fEnableAutoScheme = e; } // Must be called BEFORE AddTree!
 
     ClassDef(MReadReports, 0) // Reads events and reports from a root file ordered in time
Index: trunk/MagicSoft/Mars/mfileio/MReadTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 2604)
+++ trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 2607)
@@ -192,5 +192,5 @@
                 continue;
 
-            *fLog << err << "ERROR - File corrupttion detected:" << endl;
+            *fLog << err << "ERROR - File corruption detected:" << endl;
             *fLog << "  Due to several circumstances (such at a bug in MReadTree or wrong" << endl;
             *fLog << "  usage of the file UPDATE mode) you may have produced a file in which" << endl;
@@ -232,5 +232,15 @@
     *fLog << GetNumEntry()-1 << ")" << endl;
 
-    //fNotify->Notify();
+    if (!fNotify)
+        return kTRUE;
+
+    TIter Next(fNotify);
+    TObject *o=NULL;
+    while ((o=Next()))
+        if (!o->Notify())
+        {
+            *fLog << err << "Calling Notify() for object " << o->GetName() << " failed... abort." << endl;
+            return kFALSE;
+        }
 
     return kTRUE;
