Index: trunk/MagicSoft/Mars/mbase/MReadTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MReadTree.cc	(revision 986)
+++ trunk/MagicSoft/Mars/mbase/MReadTree.cc	(revision 988)
@@ -42,4 +42,6 @@
 // calling MReadTree::UseLeaf.                                             //
 //                                                                         //
+// FIXME: An automatic enabeling scheme would be nice.                     //
+//                                                                         //
 // Later we'll use TChain::SetNotify to notify MReadTree if the TChain     //
 // starts to read a new file.                                              //
@@ -258,5 +260,5 @@
 Bool_t MReadTree::Process()
 {
-    return fChain->GetEntry(fNumEntry++, 0) == 0 ? kFALSE : kTRUE;
+    return fChain->GetEntry(fNumEntry++) == 0 ? kFALSE : kTRUE;
 }
 
Index: trunk/MagicSoft/Mars/mbase/MTask.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 986)
+++ trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 988)
@@ -67,5 +67,69 @@
 #include "MTask.h"
 
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MFilter.h"
+
 ClassImp(MTask);
+
+MTask::MTask(const char *name, const char *title)
+    : fFilter(NULL), fIsPreprocessed(kFALSE), fNumExecutions()
+{
+    *fName  = name  ? name  : "MTask";
+    *fTitle = title ? title : "Base class for all tasks (dummy task).";
+}
+
+// --------------------------------------------------------------------------
+//
+// Mapper function for PreProcess.
+// Sets the preprocessed flag dependend on the return value of PreProcess.
+//
+Bool_t MTask::CallPreProcess(MParList *plist)
+{
+    if (!PreProcess(plist))
+        return kFALSE;
+
+    fIsPreprocessed = kTRUE;
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Mapper function for Process.
+// Executes Process dependent on the existance of a filter and its possible
+// return value.
+// If Process is executed, the execution counter is increased.
+//
+inline Bool_t MTask::CallProcess()
+{
+    //
+    // Check for the existance of a filter. If a filter is existing
+    // check for its value. If the value is kFALSE don't execute
+    // this task.
+    //
+    const Bool_t exec = fFilter ? fFilter->IsExpressionTrue() : kTRUE;
+
+    if (!exec)
+        return kTRUE;
+
+    fNumExecutions++;
+    return Process();
+}
+
+// --------------------------------------------------------------------------
+//
+// Mapper function for PreProcess.
+// Calls Postprocess dependent on the state of the preprocessed flag,
+// resets this flag.
+//
+Bool_t MTask::CallPostProcess()
+{
+    if (!fIsPreprocessed)
+        return kTRUE;
+
+    fIsPreprocessed = kFALSE;
+    return PostProcess();
+}
 
 // --------------------------------------------------------------------------
@@ -105,3 +169,15 @@
 }
 
-
+// --------------------------------------------------------------------------
+//
+// Prints the number of times this task has been processed.
+// For convinience the lvl argument results in a number of spaces at the
+// beginning of the line. So that the structur of a tasklist can be
+// identified.
+//
+void MTask::PrintStatistics(const Int_t lvl) const
+{
+    *fLog << setw(lvl) << " " << GetName() << " [";
+    *fLog << ClassName() << "] \t" << fNumExecutions;
+    *fLog << endl;
+}
Index: trunk/MagicSoft/Mars/mbase/MTask.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.h	(revision 986)
+++ trunk/MagicSoft/Mars/mbase/MTask.h	(revision 988)
@@ -23,16 +23,5 @@
 
     Bool_t fIsPreprocessed; // Indicates the success of the PreProcessing (set by MTaskList)
-
-public:
-    MTask() : fFilter(NULL), fIsPreprocessed(kFALSE) {}
-    ~MTask()
-    {
-    }
-
-    const MFilter *GetFilter() const { return fFilter; }
-    void SetFilter(const MFilter *filter) { fFilter=filter; }
-
-    Bool_t IsPreprocessed() const { return fIsPreprocessed; }
-    void SetIsPreprocessed(Bool_t state=kTRUE) { fIsPreprocessed = state; }
+    UInt_t fNumExecutions;  // Number of Excutions
 
     virtual Bool_t PreProcess(MParList *pList);
@@ -40,4 +29,17 @@
     virtual Bool_t PostProcess();
 
+public:
+    MTask(const char *name=NULL, const char *title=NULL);
+    virtual ~MTask()
+    {
+    }
+
+    void SetFilter(const MFilter *filter) { fFilter=filter; }
+    virtual void PrintStatistics(const Int_t lvl=0) const;
+
+    Bool_t CallPreProcess(MParList *plist);
+    Bool_t CallProcess();
+    Bool_t CallPostProcess();
+
     ClassDef(MTask, 0)		//Abstract base class for a task
 };
Index: trunk/MagicSoft/Mars/mbase/MTaskList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 986)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 988)
@@ -49,5 +49,5 @@
 #include "MLog.h"
 #include "MLogManip.h"
-#include "MFilter.h"
+
 #include "MParList.h"
 #include "MInputStreamID.h"
@@ -232,8 +232,6 @@
         *fLog << task->GetName() << "... " << flush;
 
-        if (!task->PreProcess(fParList))
+        if (!task->CallPreProcess(fParList))
             return kFALSE;
-
-        task->SetIsPreprocessed();
     }
 
@@ -278,20 +276,11 @@
 
         //
-        // Check for the existance of a filter. If a filter is existing
-        // check for its value. If the value is kFALSE don't execute
-        // this task.
-        //
-        const MFilter *filter = task->GetFilter();
-
-        const Bool_t rc = filter ? filter->IsExpressionTrue() : kTRUE;
-
-        if (!rc)
-            continue;
-
-        //
-        // if it has the right stream id execute the Process() function
+        // if it has the right stream id execute the CallProcess() function
         // and check what the result of it is.
-        //
-        switch (task->Process())
+        // The CallProcess() function increases the execution counter and
+        // calls the Process() function dependent on the existance and
+        // return value of a filter.
+        //
+        switch (task->CallProcess())
         {
         case kTRUE:
@@ -312,4 +301,7 @@
             //
             return kTRUE;
+
+        default:
+            *fLog << "MTaskList::Process: Unknown return value from MTask::Process()... ignored." << endl;
         }
     }
@@ -349,14 +341,8 @@
     while ( (task=(MTask*)Next()) )
     {
-        if (!task->IsPreprocessed())
-            continue;
+        if (!task->CallPostProcess())
+            return kFALSE;
 
         *fLog << task->GetName() << "... " << flush;
-
-        //
-        // FIXME: should we only skip this task?
-        //
-        if (!task->PostProcess())
-            return kFALSE;
     }
 
@@ -367,7 +353,46 @@
 
 // --------------------------------------------------------------------------
-void MTaskList::Print(Option_t *t)
-{
-    *fLog << "TaskList: " << this->GetName() << " <" <<  this->GetTitle() << ">" << endl;
+//
+//  Prints the number of times all the tasks in the list has been.
+//  For convinience the lvl argument results in a number of spaces at the
+//  beginning of the line. So that the structur of a tasklist can be
+//  identified. Use MTaskList::PrintStatistics without an argument.
+//
+void MTaskList::PrintStatistics(const Int_t lvl) const
+{
+    if (lvl==0)
+    {
+        *fLog << endl;
+        *fLog << "Execution Statistics: " << endl;
+        *fLog << "---------------------" << endl;
+        *fLog << GetName() << " [" << ClassName() << "]" << endl;
+    }
+    else
+    {
+        *fLog << setw(lvl) << " " << GetName() << " [";
+        *fLog << ClassName() << "]" << endl;
+    }
+
+    //
+    //  create the Iterator for the TaskList
+    //
+    TIter Next(&fTasks);
+
+    MTask *task=NULL;
+    //
+    //  loop over all tasks for postprocessing
+    //  only tasks which have successfully been preprocessed are postprocessed.
+    //
+    while ( (task=(MTask*)Next()) )
+        task->PrintStatistics(lvl+1);
+
+    if (lvl==0)
+        *fLog << endl;
+}
+
+// --------------------------------------------------------------------------
+void MTaskList::Print(Option_t *t) const
+{
+    *fLog << "TaskList: " << GetName() << " <" << GetTitle() << ">" << endl;
 
     fTasks.Print();
Index: trunk/MagicSoft/Mars/mbase/MTaskList.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 986)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 988)
@@ -27,4 +27,7 @@
     MParList      *fParList;
 
+    UInt_t *fCntContinue;
+    UInt_t *fCntTrue;
+
     enum { kIsOwner = BIT(14) };
 
@@ -46,5 +49,6 @@
     Bool_t PostProcess();
 
-    void Print(Option_t *opt = "");
+    void Print(Option_t *opt = "") const;
+    void PrintStatistics(const Int_t lvl=0) const;
     void SetOwner(Bool_t enable=kTRUE);
 
