Index: trunk/MagicSoft/Mars/mbase/MParContainer.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 9017)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 9025)
@@ -750,4 +750,79 @@
 // --------------------------------------------------------------------------
 //
+// Check if an object can be created through gROOT->GetClass(classname)
+// return the correspodning TClass or NULL if this is not possible.
+// A message containing the reason is returned in msg.
+//
+TClass *MParContainer::GetClass(const char *classname, TString &msg)
+{
+    TClass *cls = gROOT->GetClass(classname);
+    Int_t rcc = 0;
+    if (!cls)
+        rcc = 1;
+    else
+    {
+        if (!cls->Property())
+            rcc = 5;
+        if (!cls->Size())
+            rcc = 4;
+        if (!cls->IsLoaded())
+            rcc = 3;
+        if (!cls->HasDefaultConstructor())
+            rcc = 2;
+    }
+
+    // Everything is ok.
+    if (rcc==0)
+        return cls;
+
+    msg += "Cannot create instance of class '";
+    msg += classname;
+    msg += "': ";
+
+    switch (rcc)
+    {
+    case 1:
+        msg += "gROOT->GetClass() returned NULL.";
+        break;
+    case 2:
+        msg += "no default constructor.";
+        break;
+    case 3:
+        msg += "not loaded.";
+        break;
+    case 4:
+        msg += "zero size.";
+        break;
+    case 5:
+        msg += "no property.";
+        break;
+    default:
+        msg += "Unknown error.";
+        break;
+    }
+
+    return 0;
+}
+
+// --------------------------------------------------------------------------
+//
+// Check if an object can be created through gROOT->GetClass(classname)
+// return the correspodning TClass or NULL if this is not possible.
+// A message with the reason is ouput.
+//
+TClass *MParContainer::GetClass(const char *classname, MLog *log)
+{
+    TString msg;
+    TClass *cls = GetClass(classname, msg);
+
+    if (!cls && log)
+        *log << msg << endl;
+
+    return cls;
+}
+
+
+// --------------------------------------------------------------------------
+//
 // Read the contents/setup of a parameter container/task from a TEnv
 // instance (steering card/setup file).
Index: trunk/MagicSoft/Mars/mbase/MParContainer.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 9017)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 9025)
@@ -151,4 +151,7 @@
     MParContainer *GetNewObject(const char *name, TClass *base=MParContainer::Class()) const;
 
+    static TClass *GetClass(const char *classname, TString &msg);
+    static TClass *GetClass(const char *classname, MLog *log=NULL);
+
     void RecursiveRemove(TObject *obj);
 
Index: trunk/MagicSoft/Mars/mbase/MParList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 9017)
+++ trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 9025)
@@ -130,5 +130,5 @@
 
     TIter Next(fContainer);
-    TObject *o;
+    TObject *o=0;
     while ((o=Next()))
         if (o->TestBit(kCanDelete))
@@ -136,7 +136,6 @@
 
     // FIXME? If fContainer is owner do we have to remove the object
-    //   from fAutodelete due to the acces when checking for a
+    //   from fAutodelete due to the access when checking for a
     //   garbage collection?
-
     delete fContainer;
     delete fAutodelete;
@@ -572,42 +571,8 @@
     // try to get class from root environment
     //
-    TClass *cls = gROOT->GetClass(cname);
-    Int_t rc = 0;
+    *fLog << err;
+    TClass *cls = GetClass(cname, fLog);
     if (!cls)
-        rc =1;
-    else
-    {
-        if (!cls->Property())
-            rc = 5;
-        if (!cls->Size())
-            rc = 4;
-        if (!cls->IsLoaded())
-            rc = 3;
-        if (!cls->HasDefaultConstructor())
-            rc = 2;
-    }
-
-    if (rc)
-    {
-        *fLog << err << dbginf << "Cannot create new instance of class '" << cname << "': ";
-        switch (rc)
-        {
-        case 1:
-            *fLog << "gROOT->GetClass() returned NULL." << endl;
-            return NULL;
-        case 2:
-            *fLog << "no default constructor." << endl;
-            return NULL;
-        case 3:
-            *fLog << "not loaded." << endl;
-            return NULL;
-        case 4:
-            *fLog << "zero size." << endl;
-            return NULL;
-        case 5:
-            *fLog << "no property." << endl;
-            return NULL;
-        }
-    }
+        return NULL;
 
     if (!cls->InheritsFrom(MParContainer::Class()))
@@ -811,11 +776,12 @@
     // try to get class from root environment
     //
-    TClass *cls = gROOT->GetClass(cname);
+    TClass *cls = GetClass(cname);
     if (!cls)
-    {
-        //
-        // if class is not existing in the root environment
-        //
-        gLog << dbginf << "Class '" << cname << "' not existing in dictionary." << endl;
+        return list;
+
+    if (!cls->InheritsFrom(MParContainer::Class()))
+    {
+        *fLog << err << dbginf << "Cannot create new instance of class '" << cname << "': " << endl;
+        *fLog << "Class doesn't inherit from MParContainer." << endl;
         return list;
     }
