Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 8225)
+++ trunk/MagicSoft/Mars/Changelog	(revision 8226)
@@ -23,4 +23,11 @@
      - fixed a bug in SetupRuns introduced yesterday which made the
        setup fail if SetupRuns were called more than once.
+
+   * mfileio/MReadTree.[h,cc]:
+     - added function returning the number of files in the chain
+
+   * mfileio/MReadMarsFile.cc:
+     - added a check which correlates the number of entries in
+       RunHeaders with the number of files
 
 
Index: trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc	(revision 8225)
+++ trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc	(revision 8226)
@@ -255,4 +255,6 @@
     }
 
+    // Check if really one file conatains one RunHeader
+    // (FIXME: Do the check more properly)
     if (fRun->GetEntries() < fRun->GetNumFiles())
     {
Index: trunk/MagicSoft/Mars/mfileio/MReadTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 8225)
+++ trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 8226)
@@ -1152,4 +1152,17 @@
 // --------------------------------------------------------------------------
 //
+// Get number of files in chain. (-1 is returned if chain is not
+// initialized.
+//
+Int_t MReadTree::GetNumFiles() const
+{
+    if (!fChain)
+        return -1;
+
+    return fChain->GetListOfFiles()->GetEntries();
+}
+
+// --------------------------------------------------------------------------
+//
 //  Return the number of the file in the chain, -1 in case of an error
 //
Index: trunk/MagicSoft/Mars/mfileio/MReadTree.h
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadTree.h	(revision 8225)
+++ trunk/MagicSoft/Mars/mfileio/MReadTree.h	(revision 8226)
@@ -77,4 +77,5 @@
     TString GetFullFileName() const;
     Int_t   GetFileIndex() const;
+    Int_t   GetNumFiles() const;
 
     virtual void AddNotify(TObject *obj);
