Index: trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.cc
===================================================================
--- trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.cc	(revision 5725)
+++ trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.cc	(revision 5725)
@@ -0,0 +1,290 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Nicola Galante  12/2004 <mailto:nicola.galante@pi.infn.it>
+!   Author(s): Thomas Bretz  12/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2004
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+//   MFTriggerPattern
+//
+//  A Filter for testing the trigger performance using Trigger Pattern
+//
+/////////////////////////////////////////////////////////////////////////////
+#include "MFTriggerPattern.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MParList.h"
+#include "MTriggerPattern.h"
+
+ClassImp(MFTriggerPattern);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//
+// Default constructor. The default is to allow passing any trigger pattern.
+//
+MFTriggerPattern::MFTriggerPattern(const char *name, const char *title)
+    : fPattern(0), fMaskRequiredPrescaled(0), fMaskRequiredUnprescaled(0),
+      fMaskDeniedPrescaled(0), fMaskDeniedUnprescaled(0)
+{
+    fName  = name  ? name  : "MFTriggerPattern";
+    fTitle = title ? title : "Filter on Trigger Pattern";
+}
+
+// --------------------------------------------------------------------------
+//
+// Copy constructor
+//
+MFTriggerPattern::MFTriggerPattern(MFTriggerPattern &trigpatt)
+: MFilter(trigpatt)
+{
+    fMaskRequiredPrescaled   = trigpatt.fMaskRequiredPrescaled;
+    fMaskRequiredUnprescaled = trigpatt.fMaskRequiredUnprescaled;
+}
+
+
+// --------------------------------------------------------------------------
+//
+Int_t MFTriggerPattern::PreProcess(MParList *pList)
+{
+    fPattern = (MTriggerPattern*)pList->FindObject("MTriggerPattern");
+    if (!fPattern)
+    {
+	*fLog << err << "MTriggerPattern not found... abort." << endl;
+	return kFALSE;
+    }
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+Int_t MFTriggerPattern::Process()
+{
+    fResult = kFALSE;
+
+    const Byte_t p = fPattern->GetPrescaled();
+    const Byte_t u = fPattern->GetUnprescaled();
+
+    // Check whether at least one bit fits our neeeds
+    if (p & fMaskRequiredPrescaled == fMaskRequiredPrescaled)
+        fResult = kTRUE;
+
+    if (u & fMaskRequiredUnprescaled == fMaskRequiredUnprescaled)
+        fResult = kTRUE;
+
+    // Now overwrite the result if one of the bits is denied
+    if (p & fMaskDeniedPrescaled)
+        fResult = kFALSE;
+
+    if (u & fMaskDeniedUnprescaled)
+        fResult = kFALSE;
+
+    return kTRUE;
+}
+
+void MFTriggerPattern::RequireTriggerLvl1(Bool_t prescaled)
+{
+    prescaled ? fMaskRequiredPrescaled |= MTriggerPattern::kTriggerLvl1 : fMaskRequiredUnprescaled |= MTriggerPattern::kTriggerLvl1;
+}
+
+void MFTriggerPattern::RequireTriggerLvl2(Bool_t prescaled)
+{
+    prescaled ? fMaskRequiredPrescaled |= MTriggerPattern::kTriggerLvl2 : fMaskRequiredUnprescaled |= MTriggerPattern::kTriggerLvl2;
+}
+
+void MFTriggerPattern::RequireCalibration(Bool_t prescaled)
+{
+    prescaled ? fMaskRequiredPrescaled |= MTriggerPattern::kCalibration : fMaskRequiredUnprescaled |= MTriggerPattern::kCalibration;
+}
+
+void MFTriggerPattern::RequirePedestal(Bool_t prescaled)
+{
+    prescaled ? fMaskRequiredPrescaled |= MTriggerPattern::kPedestal    : fMaskRequiredUnprescaled |= MTriggerPattern::kPedestal;
+}
+
+void MFTriggerPattern::RequirePinDiode(Bool_t prescaled)
+{
+    prescaled ? fMaskRequiredPrescaled |= MTriggerPattern::kPinDiode    : fMaskRequiredUnprescaled |= MTriggerPattern::kPinDiode;
+}
+
+
+void MFTriggerPattern::DenyTriggerLvl1(Bool_t prescaled)
+{
+    prescaled ? fMaskDeniedPrescaled |= MTriggerPattern::kTriggerLvl1 : fMaskDeniedUnprescaled |= MTriggerPattern::kTriggerLvl1;
+}
+
+void MFTriggerPattern::DenyTriggerLvl2(Bool_t prescaled)
+{
+    prescaled ? fMaskDeniedPrescaled |= MTriggerPattern::kTriggerLvl2 : fMaskDeniedUnprescaled |= MTriggerPattern::kTriggerLvl2;
+}
+
+void MFTriggerPattern::DenyCalibration(Bool_t prescaled)
+{
+    prescaled ? fMaskDeniedPrescaled |= MTriggerPattern::kCalibration : fMaskDeniedUnprescaled |= MTriggerPattern::kCalibration;
+}
+
+void MFTriggerPattern::DenyPedestal(Bool_t prescaled)
+{
+    prescaled ? fMaskDeniedPrescaled |= MTriggerPattern::kPedestal    : fMaskDeniedUnprescaled |= MTriggerPattern::kPedestal;
+}
+
+void MFTriggerPattern::DenyPinDiode(Bool_t prescaled)
+{
+    prescaled ? fMaskDeniedPrescaled |= MTriggerPattern::kPinDiode    : fMaskDeniedUnprescaled |= MTriggerPattern::kPinDiode;
+}
+
+// -------------------------------------------------------------------------
+//
+// Low level settings. USE THESE ONLY IF YOU ARE AN EXPERT!
+//
+// You can concatenate bits either by using MTriggerPatter:
+//   eg. MTriggerPattern::kTriggerLvl1 & MTiggerPattern::kTriggerLvl2
+// of by hexadecimal values:
+//   eg. 0xab
+//
+//  while 0xab can be decoded like:
+//
+//                                   8421 8421
+//       0xa=10=8+2 0xb=11=8+2+1 --> 1010 1011
+//
+// or vice versa it is easy to get a hexadecimal number from a bit pattern,
+//   eg.
+//
+//       8421 8421
+//       0101 1101  -->  4+1=5=0x5 8+4+1=13=0xd --> 0x5d
+//
+void MFTriggerPattern::SetMaskRequired(const Byte_t mask, Bool_t prescaled)
+{
+    prescaled ? fMaskRequiredPrescaled = mask : fMaskRequiredUnprescaled = mask;
+}
+
+// -------------------------------------------------------------------------
+//
+// Low level settings. USE THESE ONLY IF YOU ARE AN EXPERT!
+//
+// You can concatenate bits either by using MTriggerPatter:
+//   eg. MTriggerPattern::kTriggerLvl1 & MTiggerPattern::kTriggerLvl2
+// of by hexadecimal values:
+//   eg. 0xab
+//
+//  while 0xab can be decoded like:
+//
+//                                   8421 8421
+//       0xa=10=8+2 0xb=11=8+2+1 --> 1010 1011
+//
+// or vice versa it is easy to get a hexadecimal number from a bit pattern,
+//   eg.
+//
+//       8421 8421
+//       0101 1101  -->  4+1=5=0x5 8+4+1=13=0xd --> 0x5d
+//
+void MFTriggerPattern::SetMaskDenied(const Byte_t mask, Bool_t prescaled)
+{
+    prescaled ? fMaskDeniedPrescaled  = mask : fMaskDeniedUnprescaled  = mask;
+}
+
+// -------------------------------------------------------------------------
+//
+// Create the mask to allow a particular (un)prescaled trigger pattern.
+//
+// Possible arguments are (upper/lower case is ignored):
+//
+//           "LT1"  : Trigger Level 1 flag
+//           "CAL"  : Calibration flag
+//           "LT2"  : Trigger Level 2 flag
+//           "PED"  : Pedestal flag
+//           "PIND" : Pin Diode flag
+// 
+// concatenations of these strings are allowed and considered as 
+// a logic "and", while trigger pattern flags not considered are
+// anyway allowed. To deny a particular trigger pattern use
+// the method Deny
+// Example: patt = "lt1 lt2" allows events with trigger pattern flags
+// {LT1,CAL,LT2} but not events with flags {LT1,CAL}.
+//
+void MFTriggerPattern::Require(TString patt, Bool_t prescaled)
+{
+    if (patt.Contains("LT1", TString::kIgnoreCase))
+        RequireTriggerLvl1(prescaled);
+
+    if (patt.Contains("LT2", TString::kIgnoreCase))
+        RequireTriggerLvl2(prescaled);
+
+    if (patt.Contains("CAL", TString::kIgnoreCase))
+        RequireCalibration(prescaled);
+
+    if (patt.Contains("PED", TString::kIgnoreCase))
+        RequirePedestal(prescaled);
+
+    if (patt.Contains("PIND", TString::kIgnoreCase))
+        RequirePinDiode(prescaled);
+}
+
+// -------------------------------------------------------------------------
+//
+// Create the mask to deny a particular (un)prescaled trigger pattern.
+//
+// This method is there because is not possible to deny trigger patterns
+// using only the Require pattern. Possible arguments are (upper/lower
+// case is ignored):
+//
+//           "LT1"  : Trigger Level 1 flag
+//           "CAL"  : Calibration flag
+//           "LT2"  : Trigger Level 2 flag
+//           "PED"  : Pedestal flag
+//           "PIND" : Pin Diode flag
+// 
+// concatenations of these strings are allowed and considered as 
+// a logic "and", while trigger pattern flags not considered are
+// anyway allowed.
+//
+// Example: patt = "lt1 lt2" deny events with trigger pattern flags
+// {LT1,CAL,LT2} but not events with flags {LT1,CAL}.
+//
+void MFTriggerPattern::Deny(TString patt, Bool_t prescaled)
+{
+    if (patt.Contains("LT1", TString::kIgnoreCase))
+        DenyTriggerLvl1(prescaled);
+
+    if (patt.Contains("LT2", TString::kIgnoreCase))
+        DenyTriggerLvl2(prescaled);
+
+    if (patt.Contains("CAL", TString::kIgnoreCase))
+        DenyCalibration(prescaled);
+
+    if (patt.Contains("PED", TString::kIgnoreCase))
+        DenyPedestal(prescaled);
+
+    if (patt.Contains("PIND", TString::kIgnoreCase))
+        DenyPinDiode(prescaled);
+}
+
+// --------------------------------------------------------------------------
+//
+Bool_t MFTriggerPattern::IsExpressionTrue() const
+{
+    return fResult;
+}
Index: trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.h
===================================================================
--- trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.h	(revision 5725)
+++ trunk/MagicSoft/Mars/mtrigger/MFTriggerPattern.h	(revision 5725)
@@ -0,0 +1,53 @@
+#ifndef MARS_MFTriggerPattern
+#define MARS_MFTriggerPattern
+
+#ifndef MARS_MFilter
+#include "MFilter.h"
+#endif
+
+class MTriggerPattern;
+
+class MFTriggerPattern : public MFilter
+{
+private:
+    MTriggerPattern *fPattern;        //!
+
+    Byte_t fMaskRequiredPrescaled;    // Mask for filtering Trigger Pattern allowed
+    Byte_t fMaskRequiredUnprescaled;  // Mask for filtering Trigger Pattern allowed
+    Byte_t fMaskDeniedPrescaled;      // Mask for filtering Trigger Pattern denied
+    Byte_t fMaskDeniedUnprescaled;    // Mask for filtering Trigger Pattern denied
+
+    Bool_t fResult;                   //!
+
+    Int_t PreProcess(MParList *pList);
+    Int_t Process();
+
+    Bool_t IsExpressionTrue() const;
+
+public:
+    MFTriggerPattern(const char *name=NULL, const char *title=NULL);
+    MFTriggerPattern(MFTriggerPattern &trigpatt);
+
+    void RequireTriggerLvl1(Bool_t prescaled=kFALSE);
+    void RequireTriggerLvl2(Bool_t prescaled=kFALSE);
+    void RequireCalibration(Bool_t prescaled=kFALSE);
+    void RequirePedestal(Bool_t prescaled=kFALSE);
+    void RequirePinDiode(Bool_t prescaled=kFALSE);
+
+    void DenyTriggerLvl1(Bool_t prescaled=kFALSE);
+    void DenyTriggerLvl2(Bool_t prescaled=kFALSE);
+    void DenyCalibration(Bool_t prescaled=kFALSE);
+    void DenyPedestal(Bool_t prescaled=kFALSE);
+    void DenyPinDiode(Bool_t prescaled=kFALSE);
+
+    void Require(TString patt, Bool_t prescaled=kFALSE);
+    void Deny(TString patt, Bool_t prescaled=kFALSE);
+
+    // Low level settings. USE THESE ONLY IF YOU ARE AN EXPERT!
+    void SetMaskRequired(const Byte_t mask, Bool_t prescaled=kFALSE);
+    void SetMaskDenied(const Byte_t mask, Bool_t prescaled=kFALSE);
+
+    ClassDef(MFTriggerPattern, 1) // A Filter for the Trigger Pattern
+};
+
+#endif
Index: trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.cc
===================================================================
--- trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.cc	(revision 5725)
+++ trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.cc	(revision 5725)
@@ -0,0 +1,56 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Nicola Galante  12/2004 <mailto:nicola.galante@pi.infn.it>
+!   Author(s): Thomas Bretz  12/2004 <mailto:nicola.galante@pi.infn.it>
+!
+!   Copyright: MAGIC Software Development, 2004
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+//   MTriggerPattern
+//
+//  A container to store the decoded trigger pattern.
+//
+// The idea is, that this container will never change the meaning of its
+// variables, while the trigger pattern itself could.
+//
+// If new 'features' are necessary the decoding (MTriggerPatternDecode)
+// must be changed to correctly decode the pattern into the existing
+// MTriggerPattern. If new information is decoded you may have to
+// add new variables to this container. Don't forget to increase the
+// class version number (ClassDef) and document your change HERE.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include "MTriggerPattern.h"
+
+ClassImp(MTriggerPattern);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//
+// Default constructor
+//
+MTriggerPattern::MTriggerPattern(const char *name, const char *title)
+    : fPrescaled(0), fUnprescaled(0)
+{
+    fName  = name  ? name  : "MTriggerPattern";
+    fTitle = title ? title : "Container for decoded trigger pattern";
+}
Index: trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.h
===================================================================
--- trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.h	(revision 5725)
+++ trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.h	(revision 5725)
@@ -0,0 +1,37 @@
+#ifndef MARS_MTriggerPattern
+#define MARS_MTriggerPattern
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+class MTriggerPattern : public MParContainer
+{
+    friend class MTriggerPatternDecode;
+
+public:
+    enum Pattern_t {
+        kTriggerLvl1 = BIT(1),
+        kCalibration = BIT(2), // Pulse Trigger
+        kTriggerLvl2 = BIT(3), // LUT Pseudo Size selection
+        kPedestal    = BIT(4),
+        kPinDiode    = BIT(5)
+        //kUnused      = BIT(6)
+        //kUnused      = BIT(7)
+        //kUnused      = BIT(8)
+    };
+
+private:
+    Byte_t fPrescaled;   // Bit Pattern as defined above
+    Byte_t fUnprescaled; // Bit Pattern as defined above
+
+public:
+    MTriggerPattern(const char *name, const char *title);
+
+    Byte_t GetPrescaled() const   { return fPrescaled; }
+    Byte_t GetUnprescaled() const { return fUnprescaled; }
+
+    ClassDef(MTriggerPattern, 1) // Container storing the decoded trigger pattern
+};
+
+#endif
Index: trunk/MagicSoft/Mars/mtrigger/MTriggerPatternDecode.cc
===================================================================
--- trunk/MagicSoft/Mars/mtrigger/MTriggerPatternDecode.cc	(revision 5725)
+++ trunk/MagicSoft/Mars/mtrigger/MTriggerPatternDecode.cc	(revision 5725)
@@ -0,0 +1,114 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Nicola Galante  12/2004 <mailto:nicola.galante@pi.infn.it>
+!   Author(s): Nicola Galante  12/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2004
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+//   MTriggerPatternDecode
+//
+//  Decodes the trigger pattern from MRawEvtData into MTriggerPattern.
+//
+// Input:
+//   MRawEvtData
+//
+// Output:
+//   MTriggerPattern
+//
+/////////////////////////////////////////////////////////////////////////////
+#include "MTriggerPatternDecode.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MParList.h"
+#include "MRawEvtHeader.h"
+#include "MTriggerPattern.h"
+
+ClassImp(MTriggerPatternDecode);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//
+// Default constructor
+//
+MTriggerPatternDecode::MTriggerPatternDecode(const char *name, const char *title)
+{
+    fName  = name  ? name  : "MTriggerPatternDecode";
+    fTitle = title ? title : "Task to decode Trigger Pattern";
+}
+
+// --------------------------------------------------------------------------
+//
+Int_t MTriggerPatternDecode::PreProcess(MParList *pList)
+{
+    fEvtHeader = (MRawEvtHeader *)pList->FindObject("MRawEvtHeader");
+    if (!fEvtHeader)
+    {
+	*fLog << err << "MRawEvtHeader not found... abort." << endl;
+	return kFALSE;
+    }
+
+    fPattern = (MTriggerPattern*)pList->FindCreateObj("MTriggerPattern");
+    if (!fPattern)
+    {
+	*fLog << err << "MRawEvtHeader not found... abort." << endl;
+	return kFALSE;
+    }
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+Int_t MTriggerPatternDecode::Process()
+{
+    UInt_t pattern = ~fEvtHeader->GetTriggerID();
+
+    // The the trigger pattern is currently written with inverted bits,
+    // but in the future this could be changed. In this case the file version
+    // number of the raw-data format must be checked. It tells you the
+    // file format (meaning of the bits)
+    // If for some reason the file-format has not been correctly changed
+    // use the run-number to decide whether the bits must be inverted or not.
+
+    // Trigger Pattern is a number of 16 bits, but if the machine
+    // is a 64 bits then the bit inversion the first 16 bits are set to 1,
+    // possibly giving problems with the filtering with the masks.
+    // Because UInt_t by definition is a 32 bit number on any
+    // machine (see root manual) no check is needed.
+    // The simplest workaround is:
+    //   pattern &= 0xffffffff;
+
+    // For the moment the meaning of the bits in
+    // MRawEvtHeader::GetTriggerID and in MTriggerPattern::fTriggerPattern
+    // are identical - this may change in the future! In this case
+    // the decoding HERE must be changed - NOT MTriggerPattern.
+    // If an enhancement of the information stored in MTriggerPattern
+    // is necessary ADD new variables! Don't change the meaning of the old
+    // ones!
+    fPattern->fPrescaled   =  pattern     & 0xff;
+    fPattern->fUnprescaled = (pattern>>8) & 0xff;
+
+    return kTRUE;
+}
Index: trunk/MagicSoft/Mars/mtrigger/MTriggerPatternDecode.h
===================================================================
--- trunk/MagicSoft/Mars/mtrigger/MTriggerPatternDecode.h	(revision 5725)
+++ trunk/MagicSoft/Mars/mtrigger/MTriggerPatternDecode.h	(revision 5725)
@@ -0,0 +1,72 @@
+#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
Index: trunk/MagicSoft/Mars/mtrigger/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mtrigger/Makefile	(revision 4993)
+++ trunk/MagicSoft/Mars/mtrigger/Makefile	(revision 5725)
@@ -19,5 +19,5 @@
 #  connect the include files defined in the config.mk file
 #
-INCLUDES = -I. -I../mbase -I../mgui
+INCLUDES = -I. -I../mbase -I../mgui -I../mraw -I../mcalib
 
 SRCFILES = MTriggerIPR.cc \
@@ -25,5 +25,8 @@
 	   MTriggerBit.cc\
 	   MTriggerPrescFact.cc\
-	   MTriggerLiveTime.cc
+	   MTriggerLiveTime.cc \
+           MTriggerPattern.cc \
+           MTriggerPatternDecode.cc \
+           MFTriggerPattern.cc
 
 ############################################################
Index: trunk/MagicSoft/Mars/mtrigger/TriggerLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mtrigger/TriggerLinkDef.h	(revision 4993)
+++ trunk/MagicSoft/Mars/mtrigger/TriggerLinkDef.h	(revision 5725)
@@ -11,3 +11,7 @@
 #pragma link C++ class MTriggerLiveTime+;
 
+#pragma link C++ class MTriggerPattern+;
+#pragma link C++ class MTriggerPatternDecode+;
+#pragma link C++ class MFTriggerPattern+;
+
 #endif
