Index: trunk/MagicSoft/Mars/mfileio/MReadReports.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadReports.cc	(revision 2560)
+++ trunk/MagicSoft/Mars/mfileio/MReadReports.cc	(revision 2590)
@@ -25,5 +25,37 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// MReadReports                                                                   //
+// MReadReports
+//
+// Read from a file events from different trees ordered in time, eg:
+//
+// Having a file with:
+//
+//      Tree1         Tree2         Tree3
+//      ------------  ------------  -----------
+//      (0) MTime[0]
+//                    (0) MTime[1]
+//      (1) MTime[2]
+//      (2) MTime[3]
+//                                  (0) MTime[1]
+//      (3) MTime[4]
+//
+// MReadReports will read the events in the tree in the following order:
+//   <0> (0) from Tree1
+//   <1> (0) from Tree2
+//   <2> (1) from Tree1
+//   <3> (2) from Tree1
+//   <4> (0) from Tree3
+//   <5> (3) from Tree1
+//   ...
+//
+// To tell MReadReports which Trees to read use: MReadReports::AddTree()
+// To schedule a file for reading use MReadReports::AddFile()
+//
+// All calls to AddTree _must_ be before the calls to AddFile!
+//
+// After reading from a tree with the name 'TreeName' the stream id of
+// the main tasklist ('MTaskList' found in MParList in PreProcess) is
+// set to this name. This means that only tasks having this stream id
+// are executed.
 //
 /////////////////////////////////////////////////////////////////////////////
@@ -45,8 +77,13 @@
 using namespace std;
 
+// --------------------------------------------------------------------------
+//
+// Default constructor. Set fName and fTitle. Instatiate fTrees and fChains.
+// Call SetOwner for fTrees and fChains
+//
 MReadReports::MReadReports()
 {
-    fName = "MRead";
-    fTitle = "MReadReports";
+    fName  = "MRead";
+    fTitle = "Reads events and reports from a root file ordered in time";
 
     fTrees  = new MTaskList("MReadReports");
@@ -57,4 +94,8 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Destructor, delete everything which was allocated by this task...
+//
 MReadReports::~MReadReports()
 {
@@ -76,4 +117,13 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Schedule the contents of this tree for reading. As a default the time
+// branch which is used for the ordering is assumed to by "MTime"+tree.
+// If this is not the case you can overwrite the default specifying the
+// name in time.
+//
+// All calls to AddTree _must_ be before the calls to AddFile!
+//
 void MReadReports::AddTree(const char *tree, const char *time)
 {
@@ -97,4 +147,10 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Schedule a file or several files (using widcards) for reading.
+//
+// All calls to AddTree _must_ be before the calls to AddFile!
+//
 Int_t MReadReports::AddFile(const char *fname, Int_t entries)
 {
@@ -109,4 +165,12 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Find MTaskList and store a pointer to it in fList.
+// Delete all entries in fChains.
+// Create all chains to read the time in the trees in advance.
+// Enable only the time-branch in this chains.
+// PreProcess fTrees (a MTaskList storing MReadTree tasks for reading)
+//
 Int_t MReadReports::PreProcess(MParList *plist)
 {
@@ -162,4 +226,8 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Return the MTime corresponding to this TChain...
+//
 MTime** MReadReports::GetTime(TChain *c) const
 {
@@ -168,4 +236,9 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Check which is the next tree to read from. Read an event from this tree.
+// Sets the StreamId accordingly.
+//
 Int_t MReadReports::Process()
 {
@@ -226,4 +299,8 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// PostProcess all MReadTree tasks in fTrees.
+//
 Int_t MReadReports::PostProcess()
 {
@@ -231,4 +308,8 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// PrintStatistics of this task and of the MReadTree tasks in fTress
+//
 void MReadReports::PrintStatistics(const Int_t lvl, Bool_t title) const
 {
Index: trunk/MagicSoft/Mars/mfileio/MReadReports.h
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadReports.h	(revision 2560)
+++ trunk/MagicSoft/Mars/mfileio/MReadReports.h	(revision 2590)
@@ -17,14 +17,18 @@
 {
 private:
-    MTaskList *fTrees;
-    TList *fChains;
+    MTaskList *fTrees;  // Hold the trees which are scheduled for reading
+    TList     *fChains; // Hold TChains to read the times in advance
 
-    TArrayL fPos;
+    TArrayL    fPos;    // Store the position in each tree/chain
 
-    MTask *fList;
+    MTask     *fList;   // pointer to the task list to set the stream id
 
     MTime** GetTime(TChain *c) const;
 
-    UInt_t GetEntries() { return 0; }
+    UInt_t  GetEntries() { return 0; }
+
+    Int_t   PreProcess(MParList *plist);
+    Int_t   Process();
+    Int_t   PostProcess();
 
 public:
@@ -36,11 +40,7 @@
     void  AddToBranchList(const char *name);
 
-    void PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE) const;
+    void  PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE) const;
 
-    Int_t PreProcess(MParList *plist);
-    Int_t Process();
-    Int_t PostProcess();
-
-    ClassDef(MReadReports, 0)	// Base class for a reading task
+    ClassDef(MReadReports, 0) // Reads events and reports from a root file ordered in time
 };
 
