Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 1332)
+++ trunk/MagicSoft/Mars/Changelog	(revision 1333)
@@ -1,3 +1,17 @@
                                                                   -*-*- END -*-*-
+ 2002/05/13: Thomas Bretz
+
+   * mbase/MReadTree.cc:
+     - changed the Notify-workaround from GetEntry to LoadTree.
+
+   * mfilter/MFDataMember.[h,cc]:
+     - changed class to use MDataMember instead of a direct access to
+       TMethodCall
+
+   * mfilter/Makefile:
+     - added path to mdata
+
+
+
  2002/05/06: Thomas Bretz
 
Index: trunk/MagicSoft/Mars/mbase/MReadTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MReadTree.cc	(revision 1332)
+++ trunk/MagicSoft/Mars/mbase/MReadTree.cc	(revision 1333)
@@ -83,12 +83,12 @@
     virtual void   SetNotify(TObject *obj) { fNotify = obj; fNotified = kFALSE; }
 
-    Int_t GetEntry(Int_t entry=0, Int_t getall=0)
-    {
-        // --------------------------------------------------------------------------
-        //
-        // This is the code from TChain::GetEntry but skips the
+    Int_t LoadTree(Int_t entry)
+    {
+        //
+        // This is the code from TChain::LoadTree but skips the
         // notification in LoadTree. If LoadTree raises the notification
         // a flag is set and the notification is done by hand. If it
-        // has not been successfull 0 is returned.
+        // has not been successfull -15 is returned.
+        // This is to support return values from Notify()/Reinit()
         //
         TObject *notify = GetNotify();
@@ -96,9 +96,9 @@
         SetNotify(this);
 
-        Int_t rc = 0;
-
-        if (LoadTree(entry) >= 0)
-            if (!fNotified || (notify && notify->Notify()))
-                rc = fTree->GetEntry(fReadEntry, getall);
+        Int_t rc = TChain::LoadTree(entry);
+
+        if (rc >= 0 && fNotified && notify)
+            if (!notify->Notify())
+                rc = -15;
 
         SetNotify(notify);
Index: trunk/MagicSoft/Mars/mfilter/MFDataMember.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFDataMember.cc	(revision 1332)
+++ trunk/MagicSoft/Mars/mfilter/MFDataMember.cc	(revision 1333)
@@ -58,7 +58,10 @@
 MFDataMember::MFDataMember(const char *member, const char type, const Double_t val,
                            const char *name, const char *title)
+    : fData(member), fValue(val)
 {
     fName  = name  ? name  : "MFDataMember";
     fTitle = title ? title : "Filter using any data member of a class";
+
+    AddToBranchList(member);
 
     fFilterType = (type=='<' ? kELowerThan : kEGreaterThan);
@@ -66,10 +69,4 @@
     if (type!='<' && type!='>')
         *fLog << warn << dbginf << "Warning: Neither '<' nor '>' specified... using '>'." << endl;
-
-    fValue = val;
-
-    fDataMember = member;
-
-    AddToBranchList(fDataMember);
 }
 
@@ -78,27 +75,5 @@
 Bool_t MFDataMember::PreProcess(MParList *plist)
 {
-    TString cname(fDataMember);
-    TString mname(fDataMember);
-
-    const char *dot = strrchr(cname, '.');
-
-    if (dot)
-    {
-        const int pos = dot-cname;
-
-        cname.Remove(pos);
-        mname.Remove(0, pos+1);
-    }
-
-    fObject = (MParContainer*)plist->FindObject(cname);
-    if (!fObject)
-    {
-        *fLog << err << "Object '" << cname << "' not in parameter list... aborting." << endl;
-        return kFALSE;
-    }
-
-    fMethodCall = fObject->GetterMethod(mname);
-
-    return fMethodCall ? kTRUE : kFALSE;
+    return fData.PreProcess(plist);
 }
 
@@ -107,39 +82,20 @@
 Bool_t MFDataMember::Process()
 {
-    Double_t v;
-    switch (fMethodCall->ReturnType())
-    {
-    case TMethodCall::kLong:
-        Long_t l;
-        fMethodCall->Execute(fObject, l);
-        v = l;
-        break;
-
-    case TMethodCall::kDouble:
-        fMethodCall->Execute(fObject, v);
-        break;
-
-    default:
-        *fLog << err << "DataMember " << fDataMember << " of ";
-        *fLog << fObject->GetName() << " neither int nor float... abort." << endl;
-        return kFALSE;
-    }
-
     switch (fFilterType)
     {
     case kELowerThan:
-        fResult = (v < fValue);
-        break;
+        fResult = (fData.GetValue() < fValue);
+        return kTRUE;
     case kEGreaterThan:
-        fResult = (v > fValue);
-        break;
+        fResult = (fData.GetValue() > fValue);
+        return kTRUE;
     }
 
-    return kTRUE;
+    return kFALSE;
 }
 
 void MFDataMember::Print(Option_t *) const
 {
-    *fLog << fDataMember << (fFilterType==kELowerThan?"<":">");
-    *fLog << fValue << flush;
+    fData.Print();
+    *fLog << (fFilterType==kELowerThan?"<":">") << fValue << flush;
 }
Index: trunk/MagicSoft/Mars/mfilter/MFDataMember.h
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFDataMember.h	(revision 1332)
+++ trunk/MagicSoft/Mars/mfilter/MFDataMember.h	(revision 1333)
@@ -11,15 +11,14 @@
 #include "MFilter.h"
 #endif
+#ifndef MARS_MDataMember
+#include "MDataMember.h"
+#endif
 
 class MParList;
-class TMethodCall;
 
 class MFDataMember : public MFilter
 {
 private:
-    TString        fDataMember; // Data member which should be used for the filter
-
-    MParContainer *fObject;     // Object from which the value is retrieved
-    TMethodCall   *fMethodCall; // Method call to the getter method of the requested value
+    MDataMember fData;
 
     typedef enum { kELowerThan, kEGreaterThan } FilterType_t;
@@ -29,9 +28,6 @@
     Double_t fValue;
 
-    void Init(const char type, const Int_t val,
-              const char *name, const char *title);
-
 public:
-    MFDataMember(const char *member, const char type, const Double_t deg,
+    MFDataMember(const char *member, const char type, const Double_t val,
                  const char *name=NULL, const char *title=NULL);
 
Index: trunk/MagicSoft/Mars/mfilter/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mfilter/Makefile	(revision 1332)
+++ trunk/MagicSoft/Mars/mfilter/Makefile	(revision 1333)
@@ -20,5 +20,5 @@
 # @endcode 
 
-INCLUDES = -I. -I../mbase -I../mmc -I../manalysis
+INCLUDES = -I. -I../mbase -I../mmc -I../manalysis -I../mdata
 
 # @code 
@@ -34,4 +34,5 @@
 	   MF.cc \
 	   MFDataMember.cc \
+	   MFDataChain.cc \
 	   MFAlpha.cc
 
