#ifndef MARS_MTriggerPatternDecode
#define MARS_MTriggerPatternDecode

/////////////////////////////////////////////////////////////////////////////
//                                                                         //
// MTriggerPatternDecode
//
// auth. N.Galante 
// created 17.11.04                                                       //
//                                                                         //
/////////////////////////////////////////////////////////////////////////////

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

class MParList;
class MRawEvtHeader;
class MTriggerPattern;

class MTriggerPatternDecode : public MFilter
{
private:
//  enum pattern {PLT1=1, PCAL=2, PLT2=4, PPED=8, PPIND=16, 
//		ULT1=256, UCAL=512, ULT2=1024, UPED=2048, UPIND=4096};

   MRawEvtHeader   *fEvtHeader;
   MTriggerPattern *fPattern;

//  UInt_t fMaskAllowed;   // Mask for filtering Trigger Pattern allowed
//  UInt_t fMaskDenied;    // Mask for filtering Trigger Pattern denied
//  UInt_t fPattern;       // Trigger Pattern stored into event
//  UInt_t fMachArch;      

//  Bool_t fBitInv;        // Flag to invert bits of Pattern (1=yes,0=no)
                         // default 1=yes
  //Bool_t fPrescaled;     // Flag to set if using prescaled (=1) or
                         // unprescaled (=0) pattern. Default 1
//  Bool_t fResult;

  Int_t PreProcess(MParList *pList);
  Int_t Process();

public:

  MTriggerPatternDecode(const char *name, const char *title);
  MTriggerPatternDecode(MTriggerPatternDecode &trigpatt);

//  Bool_t IsExpressionTrue() const;

//  void AllowPresTrigger(TString patt);
//  void DenyPresTrigger(TString patt);
//  void AllowUnpresTrigger(TString patt);
//  void DenyUnpresTrigger(TString patt);
//
////  UInt_t GetMaskAllowed() const { return fMaskAllowed; };
//  UInt_t GetMaskDenied() const { return fMaskDenied; };
  //Bool_t GetPrescaled() const { return fPrescaled; };
//  Bool_t GetBitInv() const { return fBitInv; }

//  void SetBitInv(const Bool_t inv) { fBitInv = inv; }
  //void SetPrescaled() { fPrescaled = kTRUE; };
  //void SetUnprescaled() { fPrescaled = kFALSE; };

  // Low level settings. USE THESE ONLY IF YOU ARE AN EXPERT!
//  void SetMaskAllowed(const UInt_t mask) { fMaskAllowed = mask; }
//  void SetMaskDenied(const UInt_t mask) { fMaskDenied = mask; }

  ClassDef(MTriggerPatternDecode, 1) // Task to decode the Trigger Pattern
};

#endif
