#ifndef MARS_MFDataChain
#define MARS_MFDataChain

/////////////////////////////////////////////////////////////////////////////
//                                                                         //
// MFDataChain                                                                 //
//                                                                         //
/////////////////////////////////////////////////////////////////////////////

#ifndef MARS_MFilter
#include "MFilter.h"
#endif
#ifndef MARS_MDataChain
#include "MDataChain.h"
#endif

class MParList;

class MFDataChain : public MFilter
{
private:
    MDataChain fData;

    typedef enum { kELowerThan, kEGreaterThan } FilterType_t;
    FilterType_t fFilterType;

    Bool_t  fResult;           //!
    Double_t fValue;

    void StreamPrimitive(ofstream &out) const;

public:
    MFDataChain(const char *member, const char type, const Double_t val,
                const char *name=NULL, const char *title=NULL);

    Bool_t IsExpressionTrue() const { return fResult; }
    Bool_t PreProcess(MParList *pList);
    Bool_t Process();

    void Print(Option_t *opt = "") const;
    TString GetRule() const;

    ClassDef(MFDataChain, 1) // A Filter for cuts in any data member
};

#endif
