Index: trunk/MagicSoft/Mars/mfbase/MF.cc
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MF.cc	(revision 5755)
+++ trunk/MagicSoft/Mars/mfbase/MF.cc	(revision 5875)
@@ -391,4 +391,15 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Return a comma seperated list of all data members used in the chain.
+// This is mainly used in MTask::AddToBranchList
+//
+TString MF::GetDataMember() const
+{
+    *fLog << dbg << "MF::GetDataMember" << endl;
+    return fF->GetDataMember();
+}
+
 void MF::StreamPrimitive(ofstream &out) const
 {
Index: trunk/MagicSoft/Mars/mfbase/MF.h
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MF.h	(revision 5755)
+++ trunk/MagicSoft/Mars/mfbase/MF.h	(revision 5875)
@@ -38,4 +38,5 @@
 
     TString GetRule() const { return fF ? fF->GetRule() : MFilter::GetRule(); }
+    TString GetDataMember() const;
 
     Bool_t IsExpressionTrue() const;
Index: trunk/MagicSoft/Mars/mfbase/MFDataChain.cc
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MFDataChain.cc	(revision 5755)
+++ trunk/MagicSoft/Mars/mfbase/MFDataChain.cc	(revision 5875)
@@ -142,4 +142,8 @@
 }
 
+// --------------------------------------------------------------------------
+//
+//  Crahses if default constructor called.
+//
 void MFDataChain::StreamPrimitive(ofstream &out) const
 {
@@ -157,9 +161,11 @@
 }
 
+// --------------------------------------------------------------------------
+//
+//  Crahses if default constructor called.
+//
 TString MFDataChain::GetRule() const
 {
-    TString ret;// = "{";
-    ret += fData.GetRule();
-    //ret += "}";
+    TString ret(fData.GetRule());
     ret += fFilterType==kELowerThan?"<":">";
 
@@ -169,2 +175,14 @@
     return ret;
 }
+
+// --------------------------------------------------------------------------
+//
+//  Crahses if default constructor called.
+//
+TString MFDataChain::GetDataMember() const
+{
+    TString ret(fData.GetDataMember());
+    ret += ",";
+    ret += fCond->GetDataMember();
+    return ret;
+}
Index: trunk/MagicSoft/Mars/mfbase/MFDataChain.h
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MFDataChain.h	(revision 5755)
+++ trunk/MagicSoft/Mars/mfbase/MFDataChain.h	(revision 5875)
@@ -44,5 +44,7 @@
 
     void Print(Option_t *opt = "") const;
+
     TString GetRule() const;
+    TString GetDataMember() const;
 
     void SetVariables(const TArrayD &arr)
Index: trunk/MagicSoft/Mars/mfbase/MFDataMember.cc
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MFDataMember.cc	(revision 5755)
+++ trunk/MagicSoft/Mars/mfbase/MFDataMember.cc	(revision 5875)
@@ -167,2 +167,7 @@
     return ret+str.Strip(TString::kBoth);
 }
+
+TString MFDataMember::GetDataMember() const
+{
+    return fData.GetDataMember();
+}
Index: trunk/MagicSoft/Mars/mfbase/MFDataMember.h
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MFDataMember.h	(revision 5755)
+++ trunk/MagicSoft/Mars/mfbase/MFDataMember.h	(revision 5875)
@@ -37,5 +37,7 @@
 
     void Print(Option_t *opt = "") const;
+
     TString GetRule() const;
+    TString GetDataMember() const;
 
     void SetVariables(const TArrayD &arr) { fData.SetVariables(arr); }
Index: trunk/MagicSoft/Mars/mfbase/MFilterList.cc
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MFilterList.cc	(revision 5755)
+++ trunk/MagicSoft/Mars/mfbase/MFilterList.cc	(revision 5875)
@@ -232,4 +232,6 @@
     *fLog << "Done." << endl;
 
+    AddToBranchList(filter->GetDataMember());
+
     return kTRUE;
 }
@@ -415,4 +417,27 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Return the data members existing in this array in a comma-seperated list
+// (This is mainly used for MTask::AddToBranchList)
+//
+TString MFilterList::GetDataMember() const
+{
+    TString str;
+
+    TIter Next(&fFilters);
+    MFilter *filter = NULL;
+    while ((filter=(MFilter*)Next()))
+    {
+        if (filter->GetDataMember().IsNull())
+            continue;
+
+        str += ",";
+        str += filter->GetDataMember();
+    }
+    return str;
+}
+
+
 void MFilterList::SetVariables(const TArrayD &arr)
 {
Index: trunk/MagicSoft/Mars/mfbase/MFilterList.h
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MFilterList.h	(revision 5755)
+++ trunk/MagicSoft/Mars/mfbase/MFilterList.h	(revision 5875)
@@ -49,6 +49,8 @@
 
     void Print(Option_t *opt = "") const;
+
     TString GetRule() const { return GetRule(""); }
     TString GetRule(Option_t *opt) const;
+    TString GetDataMember() const;
 
     Int_t PreProcess(MParList *pList);
