Index: trunk/MagicSoft/Mars/macros/MagicHillas.C
===================================================================
--- trunk/MagicSoft/Mars/macros/MagicHillas.C	(revision 1221)
+++ trunk/MagicSoft/Mars/macros/MagicHillas.C	(revision 1222)
@@ -40,8 +40,9 @@
 
     //
-    // Here I create MHillasExt, which replaces the usage of MHillas
+    // Uncomment this two line if you want to use MHillasExt instead
+    // of MHillas
     //
-    MHillasExt hext;
-    plist.AddToList(&hext);
+    //MHillasExt hext;
+    //plist.AddToList(&hext);
 
     //
@@ -110,5 +111,5 @@
     MFillH hfill2s("HistSource  [MHHillasSrc]", "HillasSource");
     MFillH hfill2a("HistAntiSrc [MHHillasSrc]", "HillasAntiSrc");
-/*
+
     MWriteRootFile write("hillas.root");
     write.AddContainer("MHillas",       "Hillas");
@@ -116,9 +117,11 @@
     write.AddContainer("HillasAntiSrc", "Hillas");
     write.AddContainer("MHStarMap");
-*/
-    MWriteAsciiFile write("hillas.txt");
-    write.AddContainer("MHillas", "fLength");
-    write.AddContainer("MHillas", "fConc");
-    write.AddContainer("MHillas");
+
+    /*
+     MWriteAsciiFile write("hillas.txt");
+     write.AddContainer("MHillas", "fLength");
+     write.AddContainer("MHillas", "fConc");
+     write.AddContainer("MHillas");
+     */
 
     tlist.AddToList(&read);
@@ -149,6 +152,4 @@
         return;
 
-    return;
-
     tlist.PrintStatistics();
 
Index: trunk/MagicSoft/Mars/manalysis/MHillasExt.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillasExt.cc	(revision 1221)
+++ trunk/MagicSoft/Mars/manalysis/MHillasExt.cc	(revision 1222)
@@ -41,5 +41,4 @@
 
 #include <fstream.h>
-#include <math.h>
 
 #include "MGeomPix.h"
@@ -162,6 +161,6 @@
     m3y /= GetSize();
 
-    fM3Long  = m3x<0 ? -pow(fabs(m3x), 1./3) : pow(fabs(m3x), 1./3); // [mm]
-    fM3Trans = m3y<0 ? -pow(fabs(m3y), 1./3) : pow(fabs(m3y), 1./3); // [mm]
+    fM3Long  = m3x<0 ? -pow(-m3x, 1./3) : pow(m3x, 1./3); // [mm]
+    fM3Trans = m3y<0 ? -pow(-m3y, 1./3) : pow(m3y, 1./3); // [mm]
 
     SetReadyToSave();
@@ -184,5 +183,5 @@
 
 // -------------------------------------------------------------------------
-//
+/*
 void MHillasExt::AsciiWrite(ofstream &fout) const
 {
@@ -196,2 +195,3 @@
     fout << fM3Trans;
 }
+*/
Index: trunk/MagicSoft/Mars/manalysis/MHillasExt.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillasExt.h	(revision 1221)
+++ trunk/MagicSoft/Mars/manalysis/MHillasExt.h	(revision 1222)
@@ -24,4 +24,10 @@
     void Reset();
 
+    Float_t GetConc() const    { return fConc; }
+    Float_t GetConc1() const   { return fConc1; }
+    Float_t GetAsym() const    { return fAsym; }
+    Float_t GetM3Long() const  { return fM3Long; }
+    Float_t GetM3Trans() const { return fM3Trans; }
+
     Bool_t Calc(const MGeomCam &geom, const MCerPhotEvt &pix);
 
@@ -29,5 +35,5 @@
 
     void AsciiRead(ifstream &fin);
-    void AsciiWrite(ofstream &fout) const;
+    //void AsciiWrite(ofstream &fout) const;
 
     ClassDef(MHillasExt, 1) // Storage Container for extended Hillas Parameter
Index: trunk/MagicSoft/Mars/mbase/MParContainer.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 1221)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 1222)
@@ -40,4 +40,5 @@
 
 #include <TClass.h>      // IsA
+#include <TBaseClass.h>  // GetClassPointer
 #include <TROOT.h>       // TROOT::Identlevel
 #include <TMethodCall.h> // TMethodCall, AsciiWrite
@@ -216,15 +217,18 @@
 //  Write out a data member given as a TDataMember object to an output stream.
 //
-Bool_t MParContainer::WriteDataMember(ostream &out, TDataMember *member) const
+Bool_t MParContainer::WriteDataMember(ostream &out, const TDataMember *member) const
 {
     if (!member)
         return kFALSE;
 
-    if (!member->IsPersistent())
-        return kFALSE;
-
-    /*const*/ TMethodCall *call = member->GetterMethod(); //FIXME: Root
+    if (!member->IsPersistent() || member->Property()&kIsStatic)
+        return kFALSE;
+
+    /*const*/ TMethodCall *call = ((TDataMember*)member)->GetterMethod(); //FIXME: Root
     if (!call)
-        return kFALSE;
+    {
+        *fLog << warn << "Sorry, no getter method found for " << member->GetName() << endl;
+        return kFALSE;
+    }
 
     switch (call->ReturnType())
@@ -256,5 +260,27 @@
 Bool_t MParContainer::WriteDataMember(ostream &out, const char *member) const
 {
-    return WriteDataMember(out, IsA()->GetDataMember(member));
+    /*const*/ TClass *cls = IsA()->GetBaseDataMember(member);
+    if (!cls)
+        return kFALSE;
+
+    return WriteDataMember(out, cls->GetDataMember(member));
+}
+
+// --------------------------------------------------------------------------
+//
+//  Write out a data member from a given TList of TDataMembers.
+//  returns kTRUE when at least one member was successfully written
+//
+Bool_t MParContainer::WriteDataMember(ostream &out, const TList *list) const
+{
+    Bool_t rc = kFALSE;
+
+    TDataMember *data = NULL;
+
+    TIter Next(list);
+    while ((data=(TDataMember*)Next()))
+        rc |= WriteDataMember(out, data);
+
+    return rc;
 }
 
@@ -267,14 +293,25 @@
 //  Only data members which are of integer (Bool_t, Int_t, ...) or
 //  floating point (Float_t, Double_t, ...) type are written.
-//
-void MParContainer::AsciiWrite(ostream &out) const
+//  returns kTRUE when at least one member was successfully written
+//
+Bool_t MParContainer::AsciiWrite(ostream &out) const
 {
     // *fLog << warn << "To use the the ascii output of " << GetName();
     // *fLog << " you have to overload " << ClassName() << "::AsciiWrite." << endl;
 
-    TDataMember *data = NULL;
-
-    TIter Next(IsA()->GetListOfDataMembers());
-    while ((data=(TDataMember*)Next()))
-        WriteDataMember(out, data);
-}
+    Bool_t rc = WriteDataMember(out, IsA()->GetListOfDataMembers());
+
+    TIter NextBaseClass(IsA()->GetListOfBases());
+    TBaseClass *base;
+    while ((base = (TBaseClass*) NextBaseClass()))
+    {
+        /*const*/ TClass *cls = base->GetClassPointer();
+
+        if (!cls)
+            continue;
+
+        rc |= WriteDataMember(out, cls->GetListOfDataMembers());
+    }
+
+    return rc;
+}
Index: trunk/MagicSoft/Mars/mbase/MParContainer.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 1221)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 1222)
@@ -67,8 +67,9 @@
 
     Bool_t WriteDataMember(ostream &out, const char *member) const;
-    Bool_t WriteDataMember(ostream &out, TDataMember *member) const;
+    Bool_t WriteDataMember(ostream &out, const TDataMember *member) const;
+    Bool_t WriteDataMember(ostream &out, const TList *list) const;
 
     virtual void AsciiRead(ifstream &fin);
-    virtual void AsciiWrite(ostream &out) const;
+    virtual Bool_t AsciiWrite(ostream &out) const;
 
     ClassDef(MParContainer, 0)  //The basis for all parameter containers
Index: trunk/MagicSoft/Mars/mbase/MWriteAsciiFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MWriteAsciiFile.cc	(revision 1221)
+++ trunk/MagicSoft/Mars/mbase/MWriteAsciiFile.cc	(revision 1222)
@@ -154,5 +154,8 @@
 
         if (memb->GetName()[0]=='\0')
-            cont->AsciiWrite(*fOut);
+        {
+            if (!cont->AsciiWrite(*fOut))
+                continue;
+        }
         else
         {
@@ -167,9 +170,11 @@
     }
 
-    if (written)
-        *fOut << endl;
+    if (!written)
+        return;
+
+    *fOut << endl;
 
     if (num!=0)
-      *fLog << warn << "Warning - given number of containers doesn't fit number of written containers." << endl;
+        *fLog << warn << "Warning - given number of containers doesn't fit number of written containers." << endl;
 }
 
