Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8090)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8091)
@@ -44,4 +44,18 @@
    * mdata/MDataPhrase.cc:
      - improved output in case of failure
+
+   * manalysis/MFiltercutsCalc.[h,cc], mbase/MContinue.cc,
+     mjoptim/MJOptimize.cc, mjtrain/MJTrainRanForest.cc,
+     mtools/MTFillMatrix.cc:
+     - replaced MFDataChain by MFDataPhrase
+
+   * mfbase/FBaseLinkDef.h, mfbase/Makefile:
+     - added new class MFDataPhrase
+
+   * mfbase/MF.[h,cc]:
+     - replaced all the parsing stuff by the usage of MFDataPhrase
+
+   * mfbase/MFDataPhrase.[h,cc]:
+     - added
 
 
Index: /trunk/MagicSoft/Mars/NEWS
===================================================================
--- /trunk/MagicSoft/Mars/NEWS	(revision 8090)
+++ /trunk/MagicSoft/Mars/NEWS	(revision 8091)
@@ -3,13 +3,9 @@
  *** <cvs>
 
-   - mtools: MRolke.[cc,h]: Modification of TRolke from root_v5.12.00b.
+   - general: MRolke.[cc,h]: Modification of TRolke from root_v5.12.00b.
      Class for calculation of confidence intervals (upper limits). 
      Use model 3 or 4 for upper limit calculation for MAGIC observations.
      Please read the class instruction of TRolke for more information.
 
-
-
- *** <cvs>
-
    - general: The programs now return 0xfe if the requested resource file
      doesn't exist.
@@ -17,4 +13,8 @@
    - general: Errors comming from root itself are now not output to
      stderr anymore but to our default (colored) log-stream.
+
+   - general: Changed the interface to TFormula such that now everything
+     is parsed by TFormula, which should allow to use phrases even
+     without paranthesis correctly parsed.
 
 
Index: /trunk/MagicSoft/Mars/manalysis/MFiltercutsCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MFiltercutsCalc.cc	(revision 8090)
+++ /trunk/MagicSoft/Mars/manalysis/MFiltercutsCalc.cc	(revision 8091)
@@ -40,6 +40,5 @@
 #include "MLogManip.h"
 
-#include "MF.h"
-#include "MFDataChain.h"
+#include "MFDataPhrase.h"
 #include "MParList.h"
 #include "MFilterList.h"
@@ -98,14 +97,15 @@
 }
 
+/*
 // --------------------------------------------------------------------------
 //
 // There is MUCH space for speed improvement!
-// Add MF(lo<name && name<up) to the filter list (&&),
-// for more details see MF::MF(), too.
+// Add MFDataPhrase(lo<name && name<up) to the filter list (&&),
+// for more details see MFDataPhrase::MFDataPhrase(), too.
 //
 void MFiltercutsCalc::AddCut(const char *name, Double_t lo, Double_t up)
 {
-    AddToList(new MFDataChain(name, '>', lo));
-    AddToList(new MFDataChain(name, '<', up));
+    AddToList(new MFDataPhrase(Form("%s>%.15f", name, lo));
+    AddToList(new MFDataPhrase(name, '<', up));
 }
 
@@ -113,6 +113,6 @@
 //
 // There is MUCH space for speed improvement!
-// Add MF(fabs(name)<val) to the filter list (&&),
-// for more details see MF::MF(), too.
+// Add MFDataPhrase(fabs(name)<val) to the filter list (&&),
+// for more details see MFDataPhrase::MFDataPhrase(), too.
 //
 void MFiltercutsCalc::AddCut(const char *name, Double_t val)
@@ -120,4 +120,5 @@
     AddToList(new MFDataChain(Form("fabs(%s)", name), '<', val));
 }
+*/
 
 // --------------------------------------------------------------------------
@@ -125,9 +126,9 @@
 // There is MUCH space for speed improvement!
 // Add 'cut' as MF(cut) to the filter list (&&),
-// for more details see MF::MF(), too.
+// for more details see MFDataPhrase::MFDataPhrase(), too.
 //
 void MFiltercutsCalc::AddCut(const char *cut)
 {
-    AddToList(new MF(cut));
+    AddToList(new MFDataPhrase(cut));
 }
 
@@ -135,5 +136,5 @@
 //
 // There is MUCH space for speed improvement!
-// Add cut to filter list (&&), for more details see MF::MF(), too.
+// Add cut to filter list (&&), for more details see MFDataPhrase::MFDataPhrase(), too.
 //
 void MFiltercutsCalc::AddCut(MFilter *f)
Index: /trunk/MagicSoft/Mars/manalysis/MFiltercutsCalc.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MFiltercutsCalc.h	(revision 8090)
+++ /trunk/MagicSoft/Mars/manalysis/MFiltercutsCalc.h	(revision 8091)
@@ -36,6 +36,6 @@
     TString GetHadronnessName() const { return fHadronnessName; }
 
-    void AddCut(const char *name, Double_t lo, Double_t up);
-    void AddCut(const char *name, Double_t val);
+    //void AddCut(const char *name, Double_t lo, Double_t up);
+    //void AddCut(const char *name, Double_t val);
     void AddCut(const char *cut);
     void AddCut(MFilter *f);
Index: /trunk/MagicSoft/Mars/mdata/MDataPhrase.cc
===================================================================
--- /trunk/MagicSoft/Mars/mdata/MDataPhrase.cc	(revision 8090)
+++ /trunk/MagicSoft/Mars/mdata/MDataPhrase.cc	(revision 8091)
@@ -352,6 +352,6 @@
     {
         *fLog << err << dbginf << "Syntax Error: TFormula::Compile failed..."<< endl;
-        *fLog << " > " << rule << endl;
-        *fLog << " > " << txt << endl;
+        *fLog << " Full Rule:   " << rule << endl;
+        *fLog << " Parsed Rule: " << txt << endl;
         Clear();
         return kFALSE;
Index: /trunk/MagicSoft/Mars/mfbase/FBaseLinkDef.h
===================================================================
--- /trunk/MagicSoft/Mars/mfbase/FBaseLinkDef.h	(revision 8090)
+++ /trunk/MagicSoft/Mars/mfbase/FBaseLinkDef.h	(revision 8091)
@@ -12,4 +12,5 @@
 #pragma link C++ class MFDataChain+;
 #pragma link C++ class MFDataMember+;
+#pragma link C++ class MFDataPhrase+;
 #pragma link C++ class MFRealTimePeriod+;
 
Index: /trunk/MagicSoft/Mars/mfbase/MF.cc
===================================================================
--- /trunk/MagicSoft/Mars/mfbase/MF.cc	(revision 8090)
+++ /trunk/MagicSoft/Mars/mfbase/MF.cc	(revision 8091)
@@ -88,7 +88,7 @@
 #include "MParList.h"
 
-#include "MFilterList.h"
-#include "MFDataChain.h"
-#include "MFDataMember.h"
+//#include "MFilterList.h"
+#include "MFDataPhrase.h"
+//#include "MFDataMember.h"
 
 #include "MLog.h"
@@ -123,4 +123,6 @@
 
     *fLog << inf << "Parsing filter rule... " << flush;
+    fF = new MFDataPhrase(text);
+    /*
     if (!(fF=ParseString(text, 1)))
     {
@@ -128,5 +130,5 @@
         return;
     }
-
+    */
     *fLog << inf << "found: ";
     fF->Print();
@@ -143,5 +145,5 @@
         delete fF;
 }
-
+/*
 // --------------------------------------------------------------------------
 //
@@ -348,4 +350,5 @@
     return filter0;
 }
+*/
 
 // --------------------------------------------------------------------------
@@ -481,8 +484,10 @@
 
     /*
+     // It is assumed that each filter itself calls MFilter::ReadEnv
+     // to process the Inverted directive
      Bool_t rc = MFilter::ReadEnv(env, prefix, print);
      if (rc==kERROR)
-     return kERROR;
-    */
+        return kERROR;
+        */
     if (IsEnvDefined(env, prefix, "Condition", print))
     {
@@ -523,4 +528,20 @@
         SetAllowEmpty(kFALSE);
 
+        const Int_t fg = rule.First('>');
+        const Int_t fl = rule.First('<');
+
+        if (fg<0 && fl<0)
+        {
+            MFilter *f = (MFilter*)GetNewObject(rule, MFilter::Class());
+            if (!f)
+            {
+                *fLog << err << dbginf << "Syntax Error: '" << rule << "' is neither a MFilter nor conditional sign found." << endl;
+                return kERROR;
+            }
+            fF = f;
+        }
+        else
+            fF = new MFDataPhrase(rule);
+        /*
         if (!(fF=ParseString(rule, 1)))
         {
@@ -528,5 +549,5 @@
             return kERROR;
         }
-
+        */
         if (print)
         {
Index: /trunk/MagicSoft/Mars/mfbase/MF.h
===================================================================
--- /trunk/MagicSoft/Mars/mfbase/MF.h	(revision 8090)
+++ /trunk/MagicSoft/Mars/mfbase/MF.h	(revision 8091)
@@ -23,5 +23,5 @@
     MFilter *fF;                     // Filter
     Bool_t fAllowEmpty;              // Not a Bit to be stored
-
+/*
     Int_t IsRule(TString &txt, TString &rule) const;
     Int_t IsVal(const TString &txt) const;
@@ -30,5 +30,5 @@
     MFilter *ParseRule(TString &txt, MFilter *filter0, Int_t level) const;
     MFilter *ParseString(TString txt, Int_t level);
-
+  */
     void StreamPrimitive(ostream &out) const;
 
Index: /trunk/MagicSoft/Mars/mfbase/MFDataPhrase.cc
===================================================================
--- /trunk/MagicSoft/Mars/mfbase/MFDataPhrase.cc	(revision 8091)
+++ /trunk/MagicSoft/Mars/mfbase/MFDataPhrase.cc	(revision 8091)
@@ -0,0 +1,353 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz  01/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2005
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MF                                                              
+//
+// With this filter you can filter in all variables from Mars parameter
+// containers.
+//
+// In the constructor you can give the filter rule, like
+//   "MHillas.fLength < 15"
+// Where MHillas is the name of the parameter container in the parameter
+// list and fLength is the name of the data member which should be used
+// for the filter rule. If the name of the container is use specified
+// (MyHillas) the name to give would be:
+//   "MyHillas.fLength < 15"
+//
+// Also more difficult rules are allowed, like:
+//   "MHillas.fWidth<0.5 && MHillas.fLength<0.6"
+//
+// You can also use parantheses:
+//   "MHillas.fSize>200 || (MHillas.fWidth<0.5 && MHillas.fLength<0.6)"
+//
+// For more details on available functions and expressions see MDataChain!
+//
+// The allowed logigal conditionals are:
+//   &&: logical and
+//   ||: logical or
+//   ^:  exclusive or
+//
+// As conditional signs, for now, only:
+//   <, >
+// are allowed.
+//
+//
+// Warning: There is no priority rule build in. So better use parantheses
+//   to get correct results. The rule is parsed/evaluated from the left
+//   to the right, which means:
+//
+//   "MHillas.fSize>200 || MHillas.fWidth<0.5 && MHillas.fLength<0.6"
+//
+//    is parses as
+//
+//   "(MHillas.fSize>200 || MHillas.fWidth<0.5) && MHillas.fLength<0.6"
+//
+//
+// FIXME: The possibility to use also complete filters is missing.
+//        Maybe we can use gInterpreter->Calc("") for this.
+//        gROOT->ProcessLineFast("line");
+//
+/////////////////////////////////////////////////////////////////////////////
+#include "MFDataPhrase.h"
+
+#include <fstream>        // ofstream, ...
+
+#include <TMethodCall.h>
+
+#include "MParList.h"
+
+#include "MDataPhrase.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MFDataPhrase);
+
+using namespace std;
+
+const TString MFDataPhrase::gsDefName  = "MFDataPhrase";
+const TString MFDataPhrase::gsDefTitle = "Filter setup by a text-rule";
+
+// --------------------------------------------------------------------------
+//
+// Default Constructor. Don't use.
+//
+MFDataPhrase::MFDataPhrase() : fData(NULL), fAllowEmpty(kFALSE)
+{
+    fName  = gsDefName.Data();
+    fTitle = gsDefTitle.Data();
+}
+
+// --------------------------------------------------------------------------
+//
+// Constructor. For the text describing the filter rule please see
+// the class description above.
+//
+MFDataPhrase::MFDataPhrase(const char *text, const char *name, const char *title) : fAllowEmpty(kFALSE)
+{
+    fName  = name  ? name  : gsDefName.Data();
+    fTitle = title ? title : gsDefTitle.Data();
+
+    *fLog << inf << "Parsing filter rule... " << flush;
+    fData=new MDataPhrase(text);
+    *fLog << inf << "found: ";
+    fData->Print();
+}
+
+// --------------------------------------------------------------------------
+//
+// Destructor. Delete filters.
+//
+MFDataPhrase::~MFDataPhrase()
+{
+    if (fData)
+        delete fData;
+}
+
+// --------------------------------------------------------------------------
+//
+// PreProcess all filters.
+//
+Int_t MFDataPhrase::PreProcess(MParList *plist)
+{
+    if (!fData)
+    {
+        if (IsAllowEmpty())
+            return kTRUE;
+
+        *fLog << err << dbginf << "No filter rule available." << endl;
+        return kFALSE;
+    }
+
+//    fData->SetAccelerator(GetAccelerator());
+
+    if (!fData->PreProcess(plist))
+    {
+        *fLog << err << dbginf << "PreProcessing filters in ";
+        *fLog << fName << " failed." << endl;
+        return kFALSE;
+    }
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Process all filters.
+//
+Int_t MFDataPhrase::Process()
+{
+    if (fData)
+        fResult = fData->GetValue()>0.5;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Postprocess all filters.
+//
+Int_t MFDataPhrase::PostProcess()
+{
+    return kTRUE;
+}
+
+TString MFDataPhrase::GetRule() const
+{
+    return fData ? fData->GetRule() : MFilter::GetRule();
+}
+
+void MFDataPhrase::SetVariables(const TArrayD &arr)
+{
+    if (fData)
+        fData->SetVariables(arr);
+}
+
+// --------------------------------------------------------------------------
+//
+// Return the result of the filter rule. If no filter available the
+// condition is always true
+//
+Bool_t MFDataPhrase::IsExpressionTrue() const
+{
+    return fResult;
+}
+
+// --------------------------------------------------------------------------
+//
+// Return a comma seperated list of all data members used in the chain.
+// This is mainly used in MTask::AddToBranchList
+//
+TString MFDataPhrase::GetDataMember() const
+{
+  return fData ? fData->GetDataMember() : (TString)"";
+}
+
+void MFDataPhrase::StreamPrimitive(ostream &out) const
+{
+    out << "   MF " << GetUniqueName();
+
+    if (!fData)
+    {
+        out << ";" << endl;
+        return;
+    }
+
+    out << "(\"" << fData->GetRule() << "\"";
+        if (fName!=gsDefName || fTitle!=gsDefTitle)
+    {
+        out << "(\"" << fName << "\"";
+        if (fTitle!=gsDefTitle)
+            out << ", \"" << fTitle << "\"";
+    }
+    out << ");" << endl;
+
+}
+
+// --------------------------------------------------------------------------
+//
+// Print the rule.
+// if now filter is set up '<n/a>' is printed.
+//
+void MFDataPhrase::Print(Option_t *opt) const
+{
+    *fLog << all << underline << GetDescriptor() << endl;
+    if (fData)
+        fData->Print();
+    else
+        *fLog << "<n/a>" << endl;
+    *fLog << endl;
+}
+
+// --------------------------------------------------------------------------
+//
+// Check for corresponding entries in resource file and setup filters.
+//
+// Assuming your MF-filter is called (Set/GetName): MyFilter
+//
+// First you can setup whether the filter is inverted or not:
+//     MyFilter.Inverted: yes, no  <default=no>
+//
+// Now setup the condition, eg:
+//     MyFilter.Condition: MHillas.fSize<1000
+// or
+//     MyFilter.Condition: MHillas.fSize>500 && MHillas.fSize<10000
+//
+// If you want to use more difficult filters you can split the
+// condition into subcondistions. Subcondistions are identified
+// by {}-brackets. Avoid trailing 0's! For example:
+//
+//     MyFilter.Condition: MHillas.fSize>500 && {0} && {1}
+//     MyFilter.0: MHillas.fSize>1000
+//     MyFilter.1: MHillas.fSize<10000
+//
+// The numbering must be continous and start with 0. You can use
+// a subcondition more than once. All {}-brackets are simply replaced
+// by the correspodning conditions. The rules how conditions can
+// be written can be found in the class description MDataPhrase.
+//
+Int_t MFDataPhrase::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
+{
+    Bool_t rc = MFilter::ReadEnv(env, prefix, print);
+    if (rc==kERROR)
+        return kERROR;
+
+    if (IsEnvDefined(env, prefix, "Condition", print))
+    {
+        TString rule = GetEnvValue(env, prefix, "Condition", "");
+        rule.ReplaceAll(" ", "");
+
+        Int_t idx=0;
+        while (1)
+        {
+            TString cond;
+            if (IsEnvDefined(env, prefix, Form("%d", idx), print))
+            {
+                cond += "(";
+                cond += GetEnvValue(env, prefix, Form("%d", idx), "");
+                cond += ")";
+            }
+
+            if (cond.IsNull())
+                break;
+
+            rule.ReplaceAll(Form("{%d}", idx), cond);
+            idx++;
+        }
+
+        if (fData)
+        {
+            delete fData;
+            fData = 0;
+        }
+
+        if (rule.IsNull())
+        {
+            *fLog << warn << GetDescriptor() << " ::ReadEnv - WARNING: Empty condition found." << endl;
+            SetAllowEmpty();
+            return kTRUE;
+        }
+
+        SetAllowEmpty(kFALSE);
+
+        fData = new MDataPhrase(rule);
+        /*
+        if (!(fF=ParseString(rule, 1)))
+        {
+            *fLog << err << "MFDataPhrase::ReadEnv - ERROR: Parsing '" << rule << "' failed." << endl;
+            return kERROR;
+        }
+        */
+        if (print)
+        {
+            *fLog << inf << "found: ";
+            fData->Print();
+            *fLog << endl;
+        }
+    }
+    else
+    {
+        if (!fData)
+        {
+            *fLog << warn << GetDescriptor() << " ::ReadEnv - WARNING: No condition found." << endl;
+            SetAllowEmpty();
+            return kFALSE;
+        }
+    }
+
+    if (fData->ReadEnv(env, prefix, print)==kERROR)
+        return kERROR;
+
+    // This is a workaround, because MFilter::ReadEnv and fF->ReadEnv
+    // might check for "Inverted" in this case both gets inverted
+    // and double-inversion is no inversion
+    /*
+    if (IsEnvDefined(env, prefix, "Inverted", print))
+        if (GetEnvValue(env, prefix, "Inverted", kFALSE)==kTRUE)
+            SetInverted(kFALSE);*/
+
+    return kTRUE;
+}
Index: /trunk/MagicSoft/Mars/mfbase/MFDataPhrase.h
===================================================================
--- /trunk/MagicSoft/Mars/mfbase/MFDataPhrase.h	(revision 8091)
+++ /trunk/MagicSoft/Mars/mfbase/MFDataPhrase.h	(revision 8091)
@@ -0,0 +1,62 @@
+#ifndef MARS_MFDataPhrase
+#define MARS_MFDataPhrase
+
+#ifndef MARS_MFilter
+#include "MFilter.h"
+#endif
+
+class MData;
+class MParList;
+class TMethodCall;
+
+class MFDataPhrase : public MFilter
+{
+private:
+    static const TString gsDefName;  //!
+    static const TString gsDefTitle; //!
+
+    MData *fData;
+    Bool_t fAllowEmpty;              // Not a Bit to be stored
+
+    Bool_t fResult; //!
+
+    Int_t IsRule(TString &txt, TString &rule) const;
+    Int_t IsVal(const TString &txt) const;
+    Int_t IsAlNum(TString txt) const;
+
+    MFilter *ParseRule(TString &txt, MFilter *filter0, Int_t level) const;
+    MFilter *ParseString(TString txt, Int_t level);
+
+    void StreamPrimitive(ostream &out) const;
+
+public:
+    MFDataPhrase();
+    MFDataPhrase(const char *text, const char *name=NULL, const char *title=NULL);
+    ~MFDataPhrase();
+
+    // MF
+    void SetAllowEmpty(Bool_t b=kTRUE) { fAllowEmpty = b; }
+    Bool_t IsAllowEmpty() const { return fAllowEmpty; }
+
+    // MFilter
+    TString GetRule() const;
+    TString GetDataMember() const;
+
+    Bool_t IsExpressionTrue() const;
+
+    // MTask
+    Int_t PreProcess(MParList *pList);
+    Int_t Process();
+    Int_t PostProcess();
+
+    // TObject
+    void Print(Option_t *opt="") const;
+
+    // MParContainer
+    void SetVariables(const TArrayD &arr);
+    Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
+
+    ClassDef(MFDataPhrase, 1) // A Filter for cuts in any data member
+};
+
+#endif
Index: /trunk/MagicSoft/Mars/mfbase/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mfbase/Makefile	(revision 8090)
+++ /trunk/MagicSoft/Mars/mfbase/Makefile	(revision 8091)
@@ -16,4 +16,5 @@
 
 SRCFILES = MF.cc \
+	   MFDataPhrase.cc \
            MFilterList.cc \
            MFEventSelector.cc \
Index: /trunk/MagicSoft/Mars/mjoptim/MJOptimize.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjoptim/MJOptimize.cc	(revision 8090)
+++ /trunk/MagicSoft/Mars/mjoptim/MJOptimize.cc	(revision 8091)
@@ -113,5 +113,5 @@
 
 // filters
-#include "MF.h"
+#include "MFDataPhrase.h"
 #include "MFilterList.h"
 
@@ -319,5 +319,5 @@
 void MJOptimize::AddFilter(const char *rule)
 {
-    fFilter.Add(new MF(rule));
+    fFilter.Add(new MFDataPhrase(rule));
 }
 
@@ -330,5 +330,5 @@
 void MJOptimize::AddPreCut(const char *rule)
 {
-    MFilter *f = new MF(rule);
+    MFilter *f = new MFDataPhrase(rule);
     f->SetBit(kCanDelete);
     AddPreCut(f);
Index: /trunk/MagicSoft/Mars/mjtrain/MJTrainRanForest.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjtrain/MJTrainRanForest.cc	(revision 8090)
+++ /trunk/MagicSoft/Mars/mjtrain/MJTrainRanForest.cc	(revision 8091)
@@ -37,5 +37,5 @@
 #include "MLogManip.h"
 
-#include "MF.h"
+#include "MFDataPhrase.h"
 #include "MParameterCalc.h"
 
@@ -54,5 +54,5 @@
 void MJTrainRanForest::AddCut(TList &l, const char *rule)
 {
-    MFilter *f = new MF(rule);
+    MFilter *f = new MFDataPhrase(rule);
     f->SetBit(kCanDelete); //FIXME!!!! Why does not any other list delete it???
     Add(l, f);
Index: /trunk/MagicSoft/Mars/mtools/MTFillMatrix.cc
===================================================================
--- /trunk/MagicSoft/Mars/mtools/MTFillMatrix.cc	(revision 8090)
+++ /trunk/MagicSoft/Mars/mtools/MTFillMatrix.cc	(revision 8091)
@@ -98,5 +98,5 @@
 
 // filters
-#include "MF.h"
+#include "MFDataPhrase.h"
 #include "MFilterList.h"
 #include "MFEventSelector.h"
@@ -202,5 +202,5 @@
 void MTFillMatrix::AddPreCut(const char *rule)
 {
-    MFilter *f = new MF(rule);
+    MFilter *f = new MFDataPhrase(rule);
     f->SetBit(kCanDelete);
     AddPreCut(f);
@@ -369,5 +369,5 @@
     // entries in MTaskList
     tlist.AddToList(fReader);        // Read events
-    tlist.AddToList(fPreTasks);      // PreTasks
+    tlist.AddToList(fPreTasks, 0);   // PreTasks
     if (fPreCuts.GetEntries()>0)
         tlist.AddToList(&cont0);     // PreCuts
@@ -375,5 +375,5 @@
         tlist.AddToList(&cont);      // select a sample of events
     tlist.AddToList(&invsplit);      // process invsplit (which implicitly processes split)
-    tlist.AddToList(fPostTasks);     // PostTasks
+    tlist.AddToList(fPostTasks, 0);  // PostTasks
     if (fDestMatrix1)
         tlist.AddToList(&fill1);     // fill matrix 1
