Index: trunk/MagicSoft/Mars/mbase/MLut.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLut.cc	(revision 9450)
+++ trunk/MagicSoft/Mars/mbase/MLut.cc	(revision 9462)
@@ -70,7 +70,7 @@
 //
 // Check if it is a default lut which would just map every entry to itself
-// An empty Lut is a default lut
-//
-Bool_t MLut::IsDefault() const
+// An empty Lut is a default column
+//
+Bool_t MLut::IsDefaultCol() const
 {
     if (IsEmpty())
@@ -92,5 +92,5 @@
 // Setup a default lut which just maps n-entris to themself
 //
-void MLut::SetDefault(UInt_t n)
+void MLut::SetDefaultCol(UInt_t n)
 {
     Delete();
@@ -106,4 +106,49 @@
     fMinEntries = 1;
     fMaxEntries = 1;
+
+    fMaxIndex = n;
+}
+
+// --------------------------------------------------------------------------
+//
+// Check if it is a default lut which would just map all entries to one.
+// An empty Lut is a default row
+//
+Bool_t MLut::IsDefaultRow() const
+{
+    if (IsEmpty())
+        return kTRUE;
+
+    if (GetEntriesFast()!=1)
+        return kFALSE;
+
+    const MArrayI &idx = GetRow(0);
+
+    // Loop over all rows
+    for (UInt_t x=0; x<idx.GetSize(); x++)
+        if (UInt_t(idx[x])!=x)
+            return kFALSE;
+
+    return kTRUE;
+}
+
+
+// --------------------------------------------------------------------------
+//
+// Setup a default lut which maps all n-entris to one
+//
+void MLut::SetDefaultRow(UInt_t n)
+{
+    Delete();
+
+    MArrayI &idx = *new MArrayI(n);
+
+    for (UInt_t y=0; y<n; y++)
+        idx[y] = y;
+
+    Add(&idx);
+
+    fMinEntries = n;
+    fMaxEntries = n;
 
     fMaxIndex = n;
@@ -288,5 +333,5 @@
 // Write a lut to a stream.
 //
-Int_t MLut::WriteStream(ostream &out)
+Int_t MLut::WriteStream(ostream &out) const
 {
     const Int_t n = GetEntriesFast();
@@ -329,5 +374,5 @@
 // Write a lut to a file
 //
-Int_t MLut::WriteFile(const char *fname)
+Int_t MLut::WriteFile(const char *fname) const
 {
     TString expname(fname);
@@ -344,2 +389,8 @@
     return WriteStream(fout);
 }
+
+void MLut::Print(const Option_t *o) const
+{
+    gLog << all;
+    WriteStream(gLog);
+}
Index: trunk/MagicSoft/Mars/mbase/MLut.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLut.h	(revision 9450)
+++ trunk/MagicSoft/Mars/mbase/MLut.h	(revision 9462)
@@ -36,5 +36,6 @@
     Bool_t HasConstantLength() const { return fMinEntries==fMaxEntries; }
     Bool_t IsEmpty() const { return fMaxEntries==0; }
-    Bool_t IsDefault() const;
+    Bool_t IsDefaultCol() const;
+    Bool_t IsDefaultRow() const;
 
     // MLut conversions
@@ -43,12 +44,17 @@
 
     // Setter
-    void SetDefault(UInt_t n);
+    void SetDefaultCol(UInt_t n);
+    void SetDefaultRow(UInt_t n);
 
     // MLut I/O
     Int_t ReadStream(istream &in);
-    Int_t WriteStream(ostream &out);
+    Int_t WriteStream(ostream &out) const;
 
     Int_t ReadFile(const char *fname);
-    Int_t WriteFile(const char *fname);
+    Int_t WriteFile(const char *fname) const;
+
+    // TObject
+    void Print(const Option_t *o="") const;
+    void Print(const Option_t *o, const Option_t *o2) const { Print(o); }
 
     ClassDef(MLut, 1) // A simple and fast easy-to-use look-up-table
Index: trunk/MagicSoft/Mars/mbase/MParList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 9450)
+++ trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 9462)
@@ -184,4 +184,10 @@
         return kFALSE;
 
+    if (cont==this)
+    {
+        *fLog << err << dbginf << "Error: It is not allowed to add a parameter list to itself." << endl;
+        return kFALSE;
+    }
+
     //
     // Get Name of new container
@@ -223,5 +229,5 @@
         if (!fContainer->FindObject(where))
         {
-            *fLog << dbginf << "Error: Cannot find parameter container after which the new one should be added!" << endl;
+            *fLog << err << dbginf << "Error: Cannot find parameter container after which the new one should be added!" << endl;
             return kFALSE;
         }
@@ -230,5 +236,5 @@
     if (!cont->InheritsFrom(MParContainer::Class()))
     {
-        *fLog << dbginf << "Error: Cantainer MUST derive from MParContainer!" << endl;
+        *fLog << err << dbginf << "Error: Cantainer MUST derive from MParContainer!" << endl;
         return kFALSE;
     }
