Index: trunk/MagicSoft/Mars/mbase/MTaskList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 7672)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 7682)
@@ -314,4 +314,28 @@
 // --------------------------------------------------------------------------
 //
+// Add all objects in list to the tasklist. If some of them do not
+// inherit from MTask return kFALSE, also if AddToList returns an error
+// for one of the tasks
+//
+Bool_t MTaskList::AddToList(const TList &list)
+{
+    TIter Next(&list);
+    TObject *obj=0;
+    while ((obj=Next()))
+    {
+        if (!obj->InheritsFrom(MTask::Class()))
+        {
+            *fLog << err << "ERROR - Object " << obj->GetName() << " doesn't inherit from MTask..." << endl;
+            return kFALSE;
+        }
+
+        if (!AddToList(obj))
+            return kFALSE;
+    }
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
 //  Find an object in the list.
 //  'name' is the name of the object you are searching for.
Index: trunk/MagicSoft/Mars/mbase/MTaskList.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 7672)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 7682)
@@ -47,4 +47,5 @@
     Bool_t AddToListAfter(MTask *task, const MTask *where, const char *tType="All");
     Bool_t AddToList(MTask *task, const char *tType="All");
+    Bool_t AddToList(const TList &list);
 
     void SetSerialNumber(Byte_t num);
