Index: trunk/MagicSoft/Mars/mbase/MClone.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MClone.cc	(revision 959)
+++ trunk/MagicSoft/Mars/mbase/MClone.cc	(revision 961)
@@ -25,4 +25,24 @@
 //////////////////////////////////////////////////////////////////////////////
 //                                                                          //
+//  MClone                                                                  //
+//                                                                          //
+//  This task clones a given paramter container. You can either specify     //
+//  the name of the container which should be cloned or a pointer to the    //
+//  container. If you specify a name the preprocessing tries to find the    //
+//  corresponding container in the parameter list.                          //
+//  Cloning in this context means duplicating the object in memory. This    //
+//  may be used if you change an object in the eventloop (eg. the image     //
+//  cleaning is changing the image) and you want to compare both 'version'  //
+//  of this object afterwards.                                              //
+//  The cloned object can be accessed by using MClone::GetClone.            //
+//  To clone the container more than once use several instances of MClone.  //
+//  The object does only exist until a new object is cloned. It is deleted  //
+//  in the destructor.                                                      //
+//                                                                          //
+//  Input Containers:                                                       //
+//   MParContainer                                                          //
+//                                                                          //
+//  Output Containers:                                                      //
+//   -/-                                                                    //
 //                                                                          //
 //////////////////////////////////////////////////////////////////////////////
@@ -52,5 +72,5 @@
 // --------------------------------------------------------------------------
 //
-// Constructor.
+//  Constructor. Remembers the name to search for in the parameter list.
 //
 MClone::MClone(const char *par, const char *name, const char *title)
@@ -63,5 +83,5 @@
 // --------------------------------------------------------------------------
 //
-// Constructor.
+//  Constructor. Remember the pointer of the object which has to be cloned.
 //
 MClone::MClone(const MParContainer *par, const char *name, const char *title)
@@ -74,5 +94,5 @@
 // --------------------------------------------------------------------------
 //
-// Destructor.
+//  Destructor. Deletes the cloned object.
 //
 MClone::~MClone()
@@ -83,29 +103,44 @@
 // --------------------------------------------------------------------------
 //
-// Checks the parameter list for the existance of the parameter container. If
-// the name of it was given in the constructor. It checks also for the
-// existance of the histogram container in the parameter list if a name was
-// given. If it is not available it tried to create a histogram container
-// with the same type as the given object name.
+//  Checks the parameter list for the existance of the parameter container. If
+//  the name of it was given in the constructor.
 //
 Bool_t MClone::PreProcess(MParList *pList)
 {
-    if (!fParContainer)
-    {
-        fParContainer = (MParContainer*)pList->FindObject(fParContainerName);
-        if (!fParContainer)
-        {
-            *fLog << dbginf << fParContainerName << " not found... aborting." << endl;
-            return kFALSE;
-        }
-    }
-    return kTRUE;
+    //
+    // The pointer is already given by the user.
+    //
+    if (fParContainer)
+        return kTRUE;
+
+    //
+    // Try to find the parameter container with the given name in the list
+    //
+    fParContainer = (MParContainer*)pList->FindObject(fParContainerName);
+    if (fParContainer)
+        return kTRUE;
+
+    //
+    // If it couldn't get found stop Eventloop
+    //
+    *fLog << dbginf << fParContainerName << " not found... aborting." << endl;
+    return kFALSE;
 }
 
+// --------------------------------------------------------------------------
+//
+//  Delete the cloned object if one is existing
+//
 void MClone::Clear(Option_t *)
 {
+    //
+    // Check if an object has been initialized
+    //
     if (!fClone)
         return;
 
+    //
+    // Delete it and set the pointer to NULL for the sanity check (above)
+    //
     delete fClone;
     fClone = NULL;
@@ -114,10 +149,17 @@
 // --------------------------------------------------------------------------
 //
-// Fills the data from the parameter conatiner into the histogram container
+//  Deletes an existing clone and clones the object (parameter container)
+//  again.
 //
 Bool_t MClone::Process()
 {
+    //
+    // Delete an existing clone
+    //
     Clear();
 
+    //
+    // Clone the given parameter container
+    //
     fClone = fParContainer->Clone();
 
Index: trunk/MagicSoft/Mars/mbase/MClone.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MClone.h	(revision 959)
+++ trunk/MagicSoft/Mars/mbase/MClone.h	(revision 961)
@@ -15,8 +15,8 @@
 {
 private:
-    const MParContainer *fParContainer;
-    TString fParContainerName;
+    const MParContainer *fParContainer; // pointer to container which has to be cloned
+    TString fParContainerName;          // given name to search for in the parameterlist
 
-    TObject* fClone;
+    TObject* fClone;                    // pointer to the cloned object. deletion is handled by MClone
 
     void Init(const char *name, const char *title);
@@ -34,5 +34,5 @@
     void Clear(Option_t *opt=NULL);
 
-    ClassDef(MClone, 0) // Task to fill the Hillas parameters into histograms
+    ClassDef(MClone, 0) // Task to clone (duplicate) an object in memory
 };
     
Index: trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 959)
+++ trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 961)
@@ -46,7 +46,10 @@
 // Afterwards the PostProcess functions are executed.                       //
 //                                                                          //
+//                                                                          //
+//  Maybe we can add a TProgressMeter sometimes later to be able to show    //
+//  the progress graphically...                                             //
+//                                                                          //
+//                                                                          //
 //////////////////////////////////////////////////////////////////////////////
-#include "MEvtLoop.h"
-
 #include <iostream.h>
 
@@ -98,5 +101,5 @@
 //
 // The proprocessing part of the eventloop. Be careful, this is
-// for developers use only!
+// for developers or use in special jobs only!
 //
 Bool_t MEvtLoop::PreProcess(const char *tlist)
@@ -144,5 +147,5 @@
 //
 // The processing part of the eventloop. Be careful, this is
-// for developers use only!
+// for developers or use in special jobs only!
 //
 void MEvtLoop::Process(Int_t maxcnt) const
@@ -200,5 +203,5 @@
 //
 //  The postprocessing part of the eventloop. Be careful, this is
-//  for developers use only!
+// for developers or use in special jobs only!
 //
 Bool_t MEvtLoop::PostProcess() const
@@ -218,10 +221,22 @@
     Bool_t rc = PreProcess();
 
+    //
+    // If all Tasks were PreProcesses successfully start Processing.
+    //
     if (rc)
         Process(maxcnt);
 
+    //
+    // Now postprocess all tasks. Only successfully preprocessed tasks are
+    // postprocessed. If the Postprocessing of one task fail return an error.
+    //
     if (!PostProcess())
         return kFALSE;
 
+    //
+    // If postprocessing of all preprocessed tasks was sucefully return rc.
+    // This gives an error in case the preprocessing has failed already.
+    // Otherwise the eventloop is considered: successfully.
+    //
     return rc;
 }
Index: trunk/MagicSoft/Mars/mbase/MFilter.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MFilter.cc	(revision 959)
+++ trunk/MagicSoft/Mars/mbase/MFilter.cc	(revision 961)
@@ -61,6 +61,6 @@
 //      collected in a MTaskList-object or are conected to the same        //
 //      filter.                                                            //
-//    - If you want to use different filters for one task please look for  //
-//      the MFilterList class.                                             //
+//    - If you want to use different filters (combined logically) for one  //
+//      task please look for the MFilterList class.                        //
 //    - Be careful, the return value of IsExpressionTrue is NOT a real     //
 //      boolean. You can return other values, too.                         //
@@ -71,11 +71,4 @@
 
 ClassImp(MFilter);
-
-// --------------------------------------------------------------------------
-//
-Bool_t MFilter::IsExpressionTrue() const
-{
-    return kTRUE;
-}
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mbase/MFilter.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MFilter.h	(revision 959)
+++ trunk/MagicSoft/Mars/mbase/MFilter.h	(revision 961)
@@ -1,12 +1,4 @@
 #ifndef MFILTER_H
 #define MFILTER_H
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MFilter                                                                 //
-//                                                                         //
-// Abstract base class for the filters                                     //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
 
 #ifndef MTASK_H
@@ -24,5 +16,5 @@
     }
 
-    virtual Bool_t IsExpressionTrue() const;
+    virtual Bool_t IsExpressionTrue() const = 0;
 
     virtual Bool_t PreProcess(MParList *pList);
Index: trunk/MagicSoft/Mars/mbase/MFilterList.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MFilterList.h	(revision 959)
+++ trunk/MagicSoft/Mars/mbase/MFilterList.h	(revision 961)
@@ -44,5 +44,5 @@
     void Print(Option_t *opt = "");
 
-    ClassDef(MFilterList, 0)		// List of several filters
+    ClassDef(MFilterList, 0)		// List to combine several filters logically
 };
 
Index: trunk/MagicSoft/Mars/mbase/MTask.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 959)
+++ trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 961)
@@ -43,17 +43,23 @@
 //                     As an argument this function gets a pointer to the  //
 //                     parameter list. You can stop the execution by       //
-//                     kFALSE instread of kTRUE.                           //
+//                     returning kFALSE instead of kTRUE. If an error      //
+//                     occured and you return kFALSE make sure, that       //
+//                     any action is closed correctly and all newly        //
+//                     created object are deleted. The PostProcess in      //
+//                     such a case won't be executed by the Tasklist or    //
+//                     Eventloop.                                          //
 //                                                                         //
-//   - Process():      executed for each event in the eventloop. Do in     //
-//                     one task after the other (as the occur in the       //
-//                     tasklist) the action of one task. Only the tasks    //
-//                     with a Stream ID which matches the actual ID of the //
-//                     task list are executed. A task can return kFALSE    //
-//                     to stop the execuition of the pending taks in a     //
-//                     list or kCONTINUE to skip the pending tasks.        //
+//   - Process():      executed for each event in the eventloop. Do it     //
+//                     one task after the other (as they occur in the      //
+//                     tasklist). Only the tasks with a Stream ID          //
+//                     which matches the actual ID of the tasklist         //
+//                     are executed. A task can return kFALSE to           //
+//                     stop the execuition of the tasklist or              //
+//                     kCONTINUE to skip the pending tasks.                //
 //                                                                         //
 //   - PostProcess():  executed after the eventloop. Here you can close    //
 //                     output files, start display of the run parameter,   //
-//                     etc.                                                //
+//                     etc. PostProcess should be executed only if         //
+//                     PreProcess was successfull (returned kTRUE)         //
 //                                                                         //
 /////////////////////////////////////////////////////////////////////////////
@@ -72,5 +78,5 @@
 // the virtual implementation returns kTRUE
 //
-Bool_t MTask::PreProcess( MParList *pList )
+Bool_t MTask::PreProcess(MParList *pList)
 {
     return kTRUE;
Index: trunk/MagicSoft/Mars/mbase/MTaskList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 959)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 961)
@@ -210,5 +210,5 @@
 // --------------------------------------------------------------------------
 //
-// do pre processing (before eventloop) of all tasks in the task-list
+//  do pre processing (before eventloop) of all tasks in the task-list
 //
 Bool_t MTaskList::PreProcess(MParList *pList)
@@ -297,5 +297,5 @@
         case kTRUE:
             //
-            // everything was OK: go on
+            // everything was OK: go on with the next task
             //
             continue;
@@ -319,12 +319,10 @@
 // --------------------------------------------------------------------------
 //
-// do post processing (before eventloop) of all tasks in the task-list
+//  do post processing (before eventloop) of all tasks in the task-list
+//  only tasks which have successfully been preprocessed are postprocessed.
 //
 Bool_t MTaskList::PostProcess()
 {
     *fLog << "Postprocessing... " << flush;
-
-    // FIXME: At the moment all tasks are post processed independ of
-    // whether it was preprocessed or not.
 
     //
@@ -347,4 +345,5 @@
     //
     //  loop over all tasks for postprocessing
+    //  only tasks which have successfully been preprocessed are postprocessed.
     //
     while ( (task=(MTask*)Next()) )
@@ -355,4 +354,7 @@
         *fLog << task->GetName() << "... " << flush;
 
+        //
+        // FIXME: should we only skip this task?
+        //
         if (!task->PostProcess())
             return kFALSE;
Index: trunk/MagicSoft/Mars/mbase/MWriteFile.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MWriteFile.h	(revision 959)
+++ trunk/MagicSoft/Mars/mbase/MWriteFile.h	(revision 961)
@@ -22,5 +22,5 @@
     virtual Bool_t PostProcess();
 
-    ClassDef(MWriteFile, 0)	// Class to write one container to an ascii file
+    ClassDef(MWriteFile, 0)	// Base class for tasks to write single containers to several output formats
 };
 
Index: trunk/MagicSoft/Mars/mbase/MWriteRootFile.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MWriteRootFile.h	(revision 959)
+++ trunk/MagicSoft/Mars/mbase/MWriteRootFile.h	(revision 961)
@@ -99,5 +99,5 @@
                       const char *tname=NULL, const char *ttitle=NULL);
 
-    ClassDef(MWriteRootFile, 0)	// Class to write one container to an ascii file
+    ClassDef(MWriteRootFile, 0)	// Class to write one container to a root file
 };
 
