Index: trunk/MagicSoft/Mars/mfileio/MWriteAsciiFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MWriteAsciiFile.cc	(revision 1382)
+++ trunk/MagicSoft/Mars/mfileio/MWriteAsciiFile.cc	(revision 1408)
@@ -95,5 +95,5 @@
 
     if (contname)
-       AddContainer(contname);
+       AddColumns(contname);
 }
 
@@ -115,5 +115,5 @@
 
     if (cont)
-        AddContainer(cont);
+        AddColumns(cont);
 }
 
@@ -140,8 +140,89 @@
 // --------------------------------------------------------------------------
 //
+// Tries to get all containers from the ParList which were given by name
+// adds them to the list of pointers to the container which should be
+// written to the ascii file.
+//
+Bool_t MWriteAsciiFile::GetContainer(MParList *plist)
+{
+    TObject *obj=NULL;
+
+    TIter Next(&fList);
+    while ((obj=Next()))
+    {
+        //
+        // MData is the highest class in the inheritance tree
+        //
+        if (obj->InheritsFrom(MData::Class()))
+        {
+            if (!((MData*)obj)->PreProcess(plist))
+                return kFALSE;
+            continue;
+        }
+
+        //
+        // MParContainer is the next class in the inheritance tree
+        //
+        if (obj->InheritsFrom(MParContainer::Class()))
+            continue;
+
+        //
+        // It is neither a MData nor a MParContainer, it must be a TNamed
+        //
+        TObject *o = plist->FindObject(obj->GetName());
+        if (!o)
+            return kFALSE;
+
+        fList[fList.IndexOf(obj)] = o;
+    }
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Check if the containers are ready for writing. If so write them.
+// The containers are written in one line, one after each other.
+// If not all containers are written (because of the IsReadyToSave-flag)
+// a warning message is print.
+//
+void MWriteAsciiFile::CheckAndWrite() const
+{
+    Bool_t written = kFALSE;
+
+    MParContainer *obj = NULL;
+
+    Int_t num = fList.GetEntries();
+
+    TIter Next(&fList);
+    while ((obj=(MParContainer*)Next()))
+    {
+        if (!obj->IsReadyToSave())
+            continue;
+
+        if (!obj->AsciiWrite(*fOut))
+            continue;
+
+        written = kTRUE;
+
+        num--;
+    }
+
+    if (!written)
+        return;
+
+    *fOut << endl;
+
+    if (num!=0)
+        *fLog << warn << "Warning - given number of objects doesn't fit number of written objects." << endl;
+}
+
+// --------------------------------------------------------------------------
+//
 // Add a rule to be written as a column to the ascii file.
 // For more information about rules see MDataChain.
 //
-void MWriteAsciiFile::AddRule(const char *rule)
+//  eg: MWriteAsciiFile::AddColumn("log10(MHillas.fEnergy)/2")
+//
+void MWriteAsciiFile::AddColumn(const TString rule)
 {
     MDataChain *chain = new MDataChain(rule);
@@ -151,25 +232,15 @@
 // --------------------------------------------------------------------------
 //
-// Add another container (by pointer) to be written to the ascii file.
-// The container will be output one after each other in one line.
-// If you want to write only one data member of the container
-// specify the name of the data member (eg. fAlpha) Make sure,
-// that a "GetteMethod" for this data type exists (strip the f and
-// replace it by Get)
-// If you specify a single data member you can add a scale-factor which
-// is (in case of the data member being a floating point value) multiplied
-// with the data member value. This is usefull if you are want to
-// change the scale (unit) of a data member for writing (eg.
-// writing degrees for the hillas parameters instead of the internally
-// used millimeters)
-//
-void MWriteAsciiFile::AddContainer(MParContainer *cont, const TString member, Double_t scale)
-{
-    if (member.IsNull())
-    {
-        fList.Add(cont);
-        return;
-    }
-
+// Add another column to be written to the ascii file. The columns will be
+// output one after each other in one line.
+// Specify the name of the data member to be written (eg fWidth) and
+// a possible scale factor (eg. to transform millimeters to degrees)
+//
+//  eg:
+//       MMcEvt evt;
+//       MWriteAsciiFile::AddColumn(&evt, "fImpact", 0.01);
+//
+void MWriteAsciiFile::AddColumn(MParContainer *cont, const TString member, Double_t scale)
+{
     MData *data = new MDataMember(cont, member);
 
@@ -193,118 +264,29 @@
 // Add another container (by name) to be written to the ascii file.
 // The container will be output one after each other in one line.
-// If you want to write only one data member of the container
-// specify the name of the data member (eg. fAlpha) Make sure,
-// that a "GetteMethod" for this data type exists (strip the f and
-// replace it by Get)
-// If you specify a single data member you can add a scale-factor which
-// is (in case of the data member being a floating point value) multiplied
-// with the data member value. This is usefull if you are want to
-// change the scale (unit) of a data member for writing (eg.
-// writing degrees for the hillas parameters instead of the internally
-// used millimeters)
-//
-void MWriteAsciiFile::AddContainer(const TString cont, const TString member, Double_t scale)
-{
-    if (member.IsNull())
-    {
-        TNamed *name = new TNamed(cont, cont);
-        fList.Add(name);
-        fAutoDel.Add(name);
-        return;
-    }
-
-    MData *data = new MDataMember(Form("%s.%s", (const char*)cont, (const char*)member));
-    if (scale!=1)
-    {
-        MDataList  *list = new MDataList('*');
-        MDataValue *val  = new MDataValue(scale);
-
-        list->SetOwner();
-        list->AddToList(data);
-        list->AddToList(val);
-
-        data = list;
-    }
-    fList.Add(data);
-    fAutoDel.Add(data);
-}
-
-// --------------------------------------------------------------------------
-//
-// Tries to get all containers from the ParList which were given by name
-// adds them to the list of pointers to the container which should be
-// written to the ascii file.
-//
-Bool_t MWriteAsciiFile::GetContainer(MParList *plist)
-{
-    TObject *obj=NULL;
-
-    TIter Next(&fList);
-    while ((obj=Next()))
-    {
-        //
-        // MData is the highest class in the inheritance tree
-        //
-        if (obj->InheritsFrom(MData::Class()))
-        {
-            if (!((MData*)obj)->PreProcess(plist))
-                return kFALSE;
-            continue;
-        }
-
-        //
-        // MParContainer is the next class in the inheritance tree
-        //
-        if (obj->InheritsFrom(MParContainer::Class()))
-            continue;
-
-        //
-        // It is neither a MData nor a MParContainer, it must be a TNamed
-        //
-        TObject *o = plist->FindObject(obj->GetName());
-        if (!o)
-            return kFALSE;
-
-        fList[fList.IndexOf(obj)] = o;
-    }
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Check if the containers are ready for writing. If so write them.
-// The containers are written in one line, one after each other.
-// If not all containers are written (because of the IsReadyToSave-flag)
-// a warning message is print.
-//
-void MWriteAsciiFile::CheckAndWrite() const
-{
-    Bool_t written = kFALSE;
-
-    MParContainer *obj = NULL;
-
-    Int_t num = fList.GetEntries();
-
-    TIter Next(&fList);
-    while ((obj=(MParContainer*)Next()))
-    {
-        if (!obj->IsReadyToSave())
-            continue;
-
-        if (!obj->AsciiWrite(*fOut))
-            continue;
-
-        written = kTRUE;
-
-        num--;
-    }
-
-    if (!written)
-        return;
-
-    *fOut << endl;
-
-    if (num!=0)
-        *fLog << warn << "Warning - given number of objects doesn't fit number of written objects." << endl;
-}
-
+// The output will be done either by MParContainer::AsciiWrite or
+// by the corresponding overloaded function.
+//
+//  eg: MWriteAsciiFile::AddColumns("MMcEvt")
+//
+void MWriteAsciiFile::AddColumns(const TString cont)
+{
+    TNamed *name = new TNamed(cont, cont);
+    fList.Add(name);
+    fAutoDel.Add(name);
+}
+
+// --------------------------------------------------------------------------
+//
+// Add another container (by pointer) to be written to the ascii file.
+// The container will be output one after each other in one line.
+// The output will be done either by MParContainer::AsciiWrite or
+// by the corresponding overloaded function.
+//
+//  eg:
+//      MMcEvt evt;
+//      MWriteAsciiFile::AddColumns(&evt);
+//
+void MWriteAsciiFile::AddColumns(MParContainer *cont)
+{
+    fList.Add(cont);
+}
Index: trunk/MagicSoft/Mars/mfileio/MWriteAsciiFile.h
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MWriteAsciiFile.h	(revision 1382)
+++ trunk/MagicSoft/Mars/mfileio/MWriteAsciiFile.h	(revision 1408)
@@ -35,8 +35,8 @@
     ~MWriteAsciiFile();
 
-    void AddContainer(const TString cname, const TString member="", Double_t scale=1);
-    void AddContainer(MParContainer *cont, const TString member="", Double_t scale=1);
-
-    void AddRule(const char *rule);
+    void AddColumn(const TString rule);
+    void AddColumn(MParContainer *cont, const TString member="", Double_t scale=1);
+    void AddColumns(const TString name);
+    void AddColumns(MParContainer *cont);
 
     ClassDef(MWriteAsciiFile, 0) // Class to write one container to an ascii file
