Index: trunk/MagicSoft/Mars/mbase/MParList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 858)
+++ trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 860)
@@ -57,5 +57,5 @@
 {
     *fName  = name  ? name  : "MParList";
-    *fTitle = title ? title : "List of Parameter Containers";
+    *fTitle = title ? title : "A list of Parameter Containers";
 
     //
@@ -100,5 +100,5 @@
 //  If 'where' is given, the object will be added after this.
 //
-Bool_t MParList::AddToList(MParContainer *obj, MParContainer *where)
+Bool_t MParList::AddToList(MParContainer *cont, MParContainer *where)
 {
     //
@@ -106,19 +106,41 @@
     //
 
-    if (!obj) return kTRUE;
-
-    *fLog << "Adding " << obj->GetName() << " to " << GetName() << "... " << flush;
-  //
-    //  check if it is in the list yet
-    //
-    if (fContainer.FindObject(obj))
+    if (!cont)
+        return kFALSE;
+
+    //
+    // Get Name of new container
+    //
+    const char *name = cont->GetName();
+
+    //
+    // Check if the new container is already existing in the list
+    //
+    const TObject *objn = fContainer.FindObject(name);
+    const TObject *objt = fContainer.FindObject(cont);
+
+    if (objn || objt)
     {
-        *fLog << dbginf << "Container already added" << endl;
-        return kTRUE;
+        //
+        // If the container is already in the list ignore it.
+        //
+        if (objt || objn==cont)
+        {
+            *fLog << dbginf << "Warning: Container '" << cont->GetName() << ", 0x" << (void*)cont;
+            *fLog << "' already existing in '" << GetName() << "'... ignoring." << endl;
+            return kTRUE;
+        }
+
+        //
+        // Otherwise add it to the list, but print a warning message
+        //
+        *fLog << dbginf << "Warning: Container with the same name '" << cont->GetName();
+        *fLog << "' already existing in '" << GetName() << "'." << endl;
+        *fLog << "You may not be able to get a pointer to container task by name." << endl;
     }
 
     //
     //  check if you want to add the new parameter container somewhere
-  //  special (in that case you specify "where") 
+    //  special (in that case you specify "where")
     //
     if (where)
@@ -126,10 +148,12 @@
         if (!fContainer.FindObject(where))
         {
-            *fLog << dbginf << "Cannot find parameter container after which the new one should be added!" << endl;
+            *fLog << dbginf << "Error: Cannot find parameter container after which the new one should be added!" << endl;
             return kFALSE;
         }
     }
 
-    fContainer.Add(obj);
+    *fLog << "Adding " << name << " to " << GetName() << "... " << flush;
+
+    fContainer.Add(cont);
     *fLog << "Done." << endl;
 
Index: trunk/MagicSoft/Mars/mbase/MTaskList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 858)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 860)
@@ -27,5 +27,19 @@
 // MTaskList                                                               //
 //                                                                         //
-// Collection of tasks to be processed in the eventloop                    //
+// Collection of tasks.                                                    //
+//                                                                         //
+// A tasklist is necessary to run the eventloop. It contains the scheduled //
+// tasks, which should be executed in your program.                        //
+//                                                                         //
+// To add a task use AddToList.                                            //
+//                                                                         //
+// The tasklist itself is a task, too. You can add a tasklist to another   //
+// tasklist. This makes sense, if you want to filter the execution of      //
+// more than one task of your tasklist using the same filter.              //
+//                                                                         //
+// The tasks in the list are idetified by their names. If more than one    //
+// task has the same name, the tasklist will still work correctly, but     //
+// you might run into trouble trying to get a pointer to a task by name    //
+// from the list.                                                          //
 //                                                                         //
 /////////////////////////////////////////////////////////////////////////////
@@ -47,8 +61,8 @@
 // this name in the parameter list (by MEvtLoop::SetParList)
 //
-MTaskList::MTaskList(const char *title)
-{
-    *fName  = "MTaskList";
-    *fTitle = title ? title : "List for Tasks";
+MTaskList::MTaskList(const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MTaskList";
+    *fTitle = title ? title : "A list for tasks to be executed";
 }
 
@@ -95,21 +109,41 @@
 Bool_t MTaskList::AddToList(MTask *task, const char *type, MTask *where)
 {
+    // FIXME: We agreed to put the task into list in an ordered way.
+
+    //
+    // Sanity check
+    //
     if (!task)
-        return kTRUE;
-
+        return kFALSE;
+
+    //
+    // Get Name of new task
+    //
     const char *name = task->GetName();
 
-    // FIXME: We agreed to put the task into list in an ordered way.
-
-    if (fTasks.FindObject(task))
-    {
-        *fLog << dbginf << "Task already existing." << endl;
-        return kTRUE;
-    }
-
-    if (fTasks.FindObject(name))
-    {
-        *fLog << dbginf << "'" << name << "' exists in List already." << endl;
-        return kTRUE;
+    //
+    // Check if the new task is already existing in the list
+    //
+    const TObject *objn = fTasks.FindObject(name);
+    const TObject *objt = fTasks.FindObject(task);
+
+    if (objn || objt)
+    {
+        //
+        // If the task is already in the list ignore it.
+        //
+        if (objt || objn==task)
+        {
+            *fLog << dbginf << "Warning: Task '" << task->GetName() << ", 0x" << (void*)task;
+            *fLog << "' already existing in '" << GetName() << "'... ignoring." << endl;
+            return kTRUE;
+        }
+
+        //
+        // Otherwise add it to the list, but print a warning message
+        //
+        *fLog << dbginf << "Warning: Task with the same name '" << task->GetName();
+        *fLog << "' already existing in '" << GetName() << "'." << endl;
+        *fLog << "You may not be able to get a pointer to this task by name." << endl;
     }
 
@@ -118,5 +152,5 @@
         if (!fTasks.FindObject(where))
         {
-            *fLog << dbginf << "Cannot find task after which the new task should be scheduled!" << endl;
+            *fLog << dbginf << "Error: Cannot find task after which the new task should be scheduled!" << endl;
             return kFALSE;
         }
Index: trunk/MagicSoft/Mars/mbase/MTaskList.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 858)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 860)
@@ -28,5 +28,5 @@
 
 public:
-    MTaskList(const char *title=NULL);
+    MTaskList(const char *name=NULL, const char *title=NULL);
 
     MTaskList(MTaskList &ts);
