Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 8891)
+++ trunk/MagicSoft/Mars/Changelog	(revision 8892)
@@ -18,4 +18,41 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2008/05/19 Thomas Bretz
+
+   * Makefile.conf.general, Makefile.conf.linux:
+     - distinguish between := (eval once) and = (eval every access)
+
+   * mbase/BaseLinkDef.h, mbase/Makefile:
+     - added MObjLookup
+
+   * mbase/MobjLookup.[h,cc]:
+     - added
+
+   * mbase/MEvtLoop.cc:
+     - set progress bar position to 0 before PreProcessing
+
+   * mdata/MDataMember.[h,cc]:
+     - added a member function to get a string
+
+   * mfilter/MFCosmics.cc:
+     - fixed a typo in a comment
+
+   * mhbase/MH.[h,cc]:
+     - improved SetBinning for newer root-versions
+     - improved SetBinning to correctly support axis with labels
+       (keeps the binning unchanged)
+
+   * mjobs/MJPedestal.cc:
+     - deny level1 and level2 triggers choosing pedestal events
+
+   * mraw/MRawRunHeader.h:
+     - added a member function returning the RunLength (stop-start)
+
+   * mtrigger/MTriggerPattern.[h,cc]:
+     - wrapped some comments
+     - improved comments
+
+
 
  2008/05/15 Thomas Bretz
Index: trunk/MagicSoft/Mars/Makefile.conf.general
===================================================================
--- trunk/MagicSoft/Mars/Makefile.conf.general	(revision 8891)
+++ trunk/MagicSoft/Mars/Makefile.conf.general	(revision 8892)
@@ -3,7 +3,7 @@
 #
 
-ROOTLIBS   =  `root-config --libs` -lASImage -lMinuit -lHistPainter -lThread
-ROOTGLIBS  =  `root-config --glibs` -lASImage -lMinuit -lHistPainter -lThread
-ROOTCFLAGS =  `root-config --cflags`
+ROOTLIBS   := $(shell root-config --libs) -lASImage -lMinuit -lHistPainter -lThread
+ROOTGLIBS  := $(shell root-config --glibs) -lASImage -lMinuit -lHistPainter -lThread
+ROOTCFLAGS := $(shell root-config --cflags)
 
 #
@@ -17,5 +17,5 @@
 #   export MARSLIBS="-lX11 -lXpm -L/usr/X11R6/lib"
 #
-DEFINES	 = -DMARSVER=\"\<cvs\>\" -D__MARS__ $(ARCHDEF) $(MARSDEFINES)
+DEFINES	 := -DMARSVER=\"\<cvs\>\" -D__MARS__ $(ARCHDEF) $(MARSDEFINES)
 
 CXXFLAGS = $(ROOTCFLAGS) $(INCLUDES) $(OPTIM) $(DEBUG) $(DEFINES)
Index: trunk/MagicSoft/Mars/Makefile.conf.linux
===================================================================
--- trunk/MagicSoft/Mars/Makefile.conf.linux	(revision 8891)
+++ trunk/MagicSoft/Mars/Makefile.conf.linux	(revision 8892)
@@ -9,17 +9,17 @@
 # compilers
 
-CC       = gcc
-CXX      = g++
-F77      = f77
-AR       = ar -rc
+CC       := gcc
+CXX      := g++
+F77      := f77
+AR       := ar -rc
 
 #
 #  ----->>>   settings for compilation
 #
-OPTIM    = -O5 -Wall -fno-exceptions -fPIC -Wpointer-arith -Wcast-align -Wconversion -Woverloaded-virtual
+OPTIM    := -O5 -Wall -fno-exceptions -fPIC -Wpointer-arith -Wcast-align -Wconversion -Woverloaded-virtual
 # ggc 3.2: removed -fnonnull-objects -Wtraditional -Wnested-externs
-DEBUG    = 
-ARCHDEF  = -D__LINUX__
-SOFLAG   = -shared
+DEBUG    :=
+ARCHDEF  := -D__LINUX__
+SOFLAG   := -shared
 
 # For debugging information use '-g'
@@ -27,6 +27,6 @@
 
 #MARS_LIB = -Llib $(SUBDIRS:%=-l%) $(MARSLIBS)
-MARS_LIB = -Llib $(MARSLIBS)
-INCLUDES = -I. $(SUBDIRS:%=-I%)
+MARS_LIB := -Llib $(MARSLIBS)
+INCLUDES  = -I. $(SUBDIRS:%=-I%)
 
 # uncomment this for quiet compilation
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 8891)
+++ trunk/MagicSoft/Mars/NEWS	(revision 8892)
@@ -37,4 +37,6 @@
    * the histogram classes MH3 and MHn now support profile histograms
 
+   * the histogram classes MH3 and MHn now support labels at the axis
+
    * the Random Forest Train-classes (MJTRain*) now store the used datasets
      in the output file
@@ -72,4 +74,10 @@
       in the run-header disagrees now an error is raised (this can 
       happen in not well simulated Monte Carlo files)
+
+    * In the case of MUX-data pedestal events with the lvl1 trigger flag
+      could survive into the pedestal calculation -- fixed.
+
+    * Tab "TrigPat" added showing the distribution of the trigger pattern
+      as found in the run-files (normalized with the run length)
 
  ;star
@@ -104,4 +112,5 @@
     * the Monte Carlo events after cuts are now written to the output file
       if an output file given
+
 
 
Index: trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 8891)
+++ trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 8892)
@@ -26,4 +26,5 @@
 #pragma link C++ namespace MARS;
 #pragma link C++ namespace MMath;
+//#pragma link C++ namespace UTF8;
 #pragma link C++ class MString+;
 #pragma link C++ class MEnv+;
@@ -70,4 +71,6 @@
 #pragma link C++ class MArrayI;
 
+#pragma link C++ class MObjLookup+;
+
 #pragma link C++ class MTime+;
 #pragma link C++ function operator<<(ostream&, const MTime&);
Index: trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 8891)
+++ trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 8892)
@@ -249,4 +249,7 @@
     }
 #endif
+
+    if (fProgress)
+        fProgress->SetPosition(0);
 
     //
Index: trunk/MagicSoft/Mars/mbase/MObjLookup.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MObjLookup.cc	(revision 8892)
+++ trunk/MagicSoft/Mars/mbase/MObjLookup.cc	(revision 8892)
@@ -0,0 +1,92 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  5/2008 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: CheObs Software Development, 2008
+!
+!
+\* ======================================================================== */
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+//
+//////////////////////////////////////////////////////////////////////////////
+#include "MObjLookup.h"
+
+#include <TNamed.h>
+#include <TObjString.h>
+
+ClassImp(MObjLookup);
+
+// --------------------------------------------------------------------------
+//
+// Delete all elements with kCenDelete set or all elements in case of
+// kIsOwener is set
+//
+MObjLookup::~MObjLookup()
+{
+    TExMapIter iter(&fMap);
+
+    Long_t key;
+    Long_t value;
+
+    while (iter.Next(key, value))
+    {
+        TObject *o = (TObject*)value;
+        if (o->TestBit(kCanDelete) || TestBit(kIsOwner))
+            delete o;
+    }
+}
+
+// --------------------------------------------------------------------------
+//
+// Add a TObjString to the table
+//
+void MObjLookup::Add(Long_t key, const char *txt)
+{
+    TObject *o=new TObjString(txt);
+
+    o->SetBit(kCanDelete);
+
+    Add(key,o);
+}
+
+// --------------------------------------------------------------------------
+//
+// Add a TNames to the table
+//
+void MObjLookup::Add(Long_t key, const char *name, const char *title)
+{
+    TObject *o=new TNamed(name, title);
+
+    o->SetBit(kCanDelete);
+
+    Add(key,o);
+}
+
+// --------------------------------------------------------------------------
+//
+// Search for the object corresponding to key. If no object is found,
+// fDefault is returned instead.
+//
+TObject *MObjLookup::GetObj(Long_t key) const
+{
+    TObject *o = (TObject*)const_cast<TExMap&>(fMap).GetValue(key);
+    return o ? o : fDefault;
+}
Index: trunk/MagicSoft/Mars/mbase/MObjLookup.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MObjLookup.h	(revision 8892)
+++ trunk/MagicSoft/Mars/mbase/MObjLookup.h	(revision 8892)
@@ -0,0 +1,52 @@
+#ifndef MARS_MObjLookup
+#define MARS_MObjLookup
+
+#ifndef ROOT_TExMap
+#include <TExMap.h>
+#endif
+
+class MObjLookup : public TObject
+{
+private:
+    TExMap   fMap;
+    TObject *fDefault;
+
+    enum {
+        kIsOwner = BIT(14),
+    };
+
+public:
+    MObjLookup() : fDefault(0) { }
+    ~MObjLookup();
+
+    // Add a new object
+    void Add(Long_t key, TObject *obj) { fMap.Add(key, Long_t(obj)); }
+    void Add(Long_t key, const char *txt);
+    void Add(Long_t key, const char *name, const char *title);
+
+    // Get an object
+    TObject *GetObj(Long_t key) const;
+
+    TObject *operator[](Long_t key) const { return GetObj(key); }
+
+    const char *GetObjName(Long_t key) const { const TObject *o=GetObj(key); return o?o->GetName():NULL; }
+    const char *GetObjTitle(Long_t key) const { const TObject *o=GetObj(key); return o?o->GetTitle():NULL; }
+
+    // Number of entrues
+    Int_t GetSize() const { return fMap.GetSize(); }
+
+    // Owenership
+    void SetOnwer(Bool_t b=kTRUE) { b ? SetBit(kIsOwner) : ResetBit(kIsOwner); }
+
+    // Default returned if no obj found (deletion is user responsibility)
+    void SetDefault(TObject *o) { fDefault = o; }
+    TObject *GetDefault() { return fDefault; }
+
+    // Direct access to the TExMap
+    const TExMap &GetMap() const { return fMap; }
+          TExMap &GetMap()       { return fMap; }
+
+    ClassDef(MObjLookup, 1) // A class providing a fast lookup table key(int)->TObject
+};
+
+#endif
Index: trunk/MagicSoft/Mars/mbase/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mbase/Makefile	(revision 8891)
+++ trunk/MagicSoft/Mars/mbase/Makefile	(revision 8892)
@@ -62,5 +62,6 @@
            MPrint.cc \
            MZlib.cc \
-	   MThread.cc
+	   MThread.cc \
+           MObjLookup.cc
 
 ############################################################
Index: trunk/MagicSoft/Mars/mdata/MDataMember.cc
===================================================================
--- trunk/MagicSoft/Mars/mdata/MDataMember.cc	(revision 8891)
+++ trunk/MagicSoft/Mars/mdata/MDataMember.cc	(revision 8892)
@@ -93,21 +93,33 @@
 // --------------------------------------------------------------------------
 //
+// Check if accessing fCall is safe
+//
+Bool_t MDataMember::CheckGet() const
+{
+    if (!fObject)
+    {
+        *fLog << err << "ERROR - MDataMember::Get: fObject not initialized ";
+        *fLog << "(not PreProcessed)... returning 0." << endl;
+        return kFALSE;
+    }
+
+    if (!fCall)
+    {
+        *fLog << err << "ERROR - MDataMemberGet: No TMethodCall for " << fDataMember << " of ";
+        *fLog << fObject->GetName() << " available... returning 0." << endl;
+        return kFALSE;
+    }
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
 // Returns the value you requested
 //
 Double_t MDataMember::GetValue() const
 {
-    if (!fObject)
-    {
-        *fLog << err << "ERROR - MDataMember::GetValue: fObject not initialized ";
-        *fLog << "(not PreProcessed)... returning 0." << endl;
+    if (!CheckGet())
         return 0;
-    }
-
-    if (!fCall)
-    {
-        *fLog << err << "No TMethodCall for " << fDataMember << " of ";
-        *fLog << fObject->GetName() << " available... returning 0." << endl;
-        return 0;
-    }
 
     switch (fCall->ReturnType())
@@ -127,4 +139,29 @@
         *fLog << fObject->GetName() << " neither int nor float... returning 0." << endl;
         return 0;
+    }
+}
+
+// --------------------------------------------------------------------------
+//
+// Returns the string you requested
+//
+const char *MDataMember::GetString() const
+{
+    if (!CheckGet())
+        return NULL;
+
+    switch (fCall->ReturnType())
+    {
+    case TMethodCall::kString:
+        {
+            char *c=NULL;
+            fCall->Execute(fObject, &c);
+            return c;
+        }
+
+    default:
+        *fLog << err << "DataMember " << fDataMember << " of ";
+        *fLog << fObject->GetName() << " not a char*... returning NULL." << endl;
+        return NULL;
     }
 }
Index: trunk/MagicSoft/Mars/mdata/MDataMember.h
===================================================================
--- trunk/MagicSoft/Mars/mdata/MDataMember.h	(revision 8891)
+++ trunk/MagicSoft/Mars/mdata/MDataMember.h	(revision 8892)
@@ -22,4 +22,6 @@
     enum { kIsInt = BIT(14) };
 
+    Bool_t CheckGet() const;
+
 public:
     MDataMember(const char *member=NULL) : fObject(NULL), fCall(NULL)
@@ -32,4 +34,5 @@
 
     Double_t GetValue() const;
+    const char *GetString() const;
     Bool_t PreProcess(const MParList *plist);
 
Index: trunk/MagicSoft/Mars/mfilter/MFCosmics.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFCosmics.cc	(revision 8891)
+++ trunk/MagicSoft/Mars/mfilter/MFCosmics.cc	(revision 8892)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MFCosmics.cc,v 1.16 2006-11-02 20:00:02 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MFCosmics.cc,v 1.17 2008-05-19 14:04:11 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -216,5 +216,5 @@
     //
     // If the camera contains more than fMaxEmptyPixels
-    // presumed pixels due to cosmics, then the event is discarted.
+    // presumed pixels due to cosmics, then the event is discarded.
     //
     return cosmicpix > fMaxEmptyPixels*allpix;
Index: trunk/MagicSoft/Mars/mhbase/MH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MH.cc	(revision 8891)
+++ trunk/MagicSoft/Mars/mhbase/MH.cc	(revision 8892)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.36 2007-08-25 15:30:24 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.37 2008-05-19 14:04:12 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -212,5 +212,40 @@
 // --------------------------------------------------------------------------
 //
-// Applies a given binning to a 1D-histogram
+// If labels are set for this axis the correct MBinning corresponding
+// to the existing label range is returned (this is necessary to
+// maintain the correct number of bins in the histogram)
+// otherwise the given binning is returned.
+//
+MBinning MH::GetBinningForLabels(TAxis &x, const MBinning *bins)
+{
+    if (!x.GetLabels())
+        return *bins;
+
+    const Int_t n = TMath::Max(x.GetLabels()->GetEntries(), 1);
+    return MBinning(n, 0, n);
+}
+
+// --------------------------------------------------------------------------
+//
+// If Labels are set this function deletes the fXbins Array from
+// the axis (which makes the axis a variable bin-size axis)
+// and sets the Nbins, Xmin and Xmax according to the number of labels.
+//
+void MH::RestoreBinningForLabels(TAxis &x)
+{
+    if (!x.GetLabels())
+        return;
+
+    const Int_t n = TMath::Max(x.GetLabels()->GetEntries(), 1);
+    x.Set(n, 0, n);
+
+    const_cast<TArrayD*>(x.GetXbins())->Set(0);
+}
+
+// --------------------------------------------------------------------------
+//
+// Applies a given binning to a 1D-histogram. In case the axis has labels
+// (e.g. GetXaxis()->GetLabels()) the binning is set according to the
+// labels.
 //
 void MH::SetBinning(TH1 *h, const MBinning *binsx)
@@ -225,4 +260,5 @@
 #endif
 
+#if ROOT_VERSION_CODE < ROOT_VERSION(5,12,00)
     // All this is reset by TAxis::Set
     const TAttAxis att(x);
@@ -247,4 +283,9 @@
     x.SetTimeDisplay(tm);
     x.SetTimeFormat(tf);
+#else
+    if (!x.GetLabels())
+        h->SetBins(binsx->GetNumBins(), binsx->GetEdges());
+#endif
+
 
 #if ROOT_VERSION_CODE < ROOT_VERSION(3,03,03)
@@ -255,5 +296,7 @@
 // --------------------------------------------------------------------------
 //
-// Applies given binnings to the two axis of a 2D-histogram
+// Applies given binnings to the two axis of a 2D-histogram.
+// In case the axis has labels (e.g. GetXaxis()->GetLabels())
+// the binning is set according to the labels.
 //
 void MH::SetBinning(TH2 *h, const MBinning *binsx, const MBinning *binsy)
@@ -261,4 +304,7 @@
     TAxis &x = *h->GetXaxis();
     TAxis &y = *h->GetYaxis();
+
+    const MBinning bx(GetBinningForLabels(x, binsx));
+    const MBinning by(GetBinningForLabels(y, binsy));
 
     //
@@ -270,4 +316,5 @@
 #endif
 
+#if ROOT_VERSION_CODE < ROOT_VERSION(5,12,00)
     // All this is reset by TAxis::Set
     const TAttAxis attx(x);
@@ -283,6 +330,6 @@
     // TH1D::fNcells must be set correctly.
     //
-    h->SetBins(binsx->GetNumBins(), 0, 1,
-               binsy->GetNumBins(), 0, 1);
+    h->SetBins(bx.GetNumBins(), 0, 1,
+               by.GetNumBins(), 0, 1);
 
     //
@@ -290,6 +337,6 @@
     // in one of the two given histograms
     //
-    x.Set(binsx->GetNumBins(), binsx->GetEdges());
-    y.Set(binsy->GetNumBins(), binsy->GetEdges());
+    x.Set(bx.GetNumBins(), bx.GetEdges());
+    y.Set(by.GetNumBins(), by.GetEdges());
 
     // All this is reset by TAxis::Set
@@ -300,4 +347,11 @@
     x.SetTimeFormat(tfx);
     y.SetTimeFormat(tfy);
+#else
+    h->SetBins(bx.GetNumBins(), bx.GetEdges(),
+               by.GetNumBins(), by.GetEdges());
+#endif
+
+    RestoreBinningForLabels(x);
+    RestoreBinningForLabels(y);
 
 #if ROOT_VERSION_CODE < ROOT_VERSION(3,03,03)
@@ -310,4 +364,6 @@
 //
 // Applies given binnings to the three axis of a 3D-histogram
+// In case the axis has labels (e.g. GetXaxis()->GetLabels())
+// the binning is set according to the labels.
 //
 void MH::SetBinning(TH3 *h, const MBinning *binsx, const MBinning *binsy, const MBinning *binsz)
@@ -319,4 +375,8 @@
     TAxis &y = *h->GetYaxis();
     TAxis &z = *h->GetZaxis();
+
+    const MBinning bx(GetBinningForLabels(x, binsx));
+    const MBinning by(GetBinningForLabels(y, binsy));
+    const MBinning bz(GetBinningForLabels(z, binsz));
 
 #if ROOT_VERSION_CODE < ROOT_VERSION(3,03,03)
@@ -326,4 +386,5 @@
 #endif
 
+#if ROOT_VERSION_CODE < ROOT_VERSION(5,12,00)
     // All this is reset by TAxis::Set
     const TAttAxis attx(x);
@@ -336,4 +397,5 @@
     const TString  tfy(y.GetTimeFormat());
     const TString  tfz(z.GetTimeFormat());
+#endif
 
     //
@@ -342,7 +404,7 @@
     // TH1D::fNcells must be set correctly.
     //
-    h->SetBins(binsx->GetNumBins(), 0, 1,
-               binsy->GetNumBins(), 0, 1,
-               binsz->GetNumBins(), 0, 1);
+    h->SetBins(bx.GetNumBins(), 0, 1,
+               by.GetNumBins(), 0, 1,
+               bz.GetNumBins(), 0, 1);
 
     //
@@ -350,8 +412,13 @@
     // in one of the two given histograms
     //
-    x.Set(binsx->GetNumBins(), binsx->GetEdges());
-    y.Set(binsy->GetNumBins(), binsy->GetEdges());
-    z.Set(binsz->GetNumBins(), binsz->GetEdges());
-
+    x.Set(bx.GetNumBins(), bx.GetEdges());
+    y.Set(by.GetNumBins(), by.GetEdges());
+    z.Set(bz.GetNumBins(), bz.GetEdges());
+
+    RestoreBinningForLabels(x);
+    RestoreBinningForLabels(y);
+    RestoreBinningForLabels(z);
+
+#if ROOT_VERSION_CODE < ROOT_VERSION(5,12,00)
     // All this is reset by TAxis::Set
     attx.Copy(x);
@@ -364,4 +431,5 @@
     y.SetTimeFormat(tfy);
     z.SetTimeFormat(tfz);
+#endif
 
 #if ROOT_VERSION_CODE < ROOT_VERSION(3,03,03)
Index: trunk/MagicSoft/Mars/mhbase/MH.h
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MH.h	(revision 8891)
+++ trunk/MagicSoft/Mars/mhbase/MH.h	(revision 8892)
@@ -26,4 +26,7 @@
     Byte_t fSerialNumber;   // Serial number (eg of telecope)
     UInt_t fNumExecutions;  // Number of calls to Fill function
+
+    static MBinning GetBinningForLabels(TAxis &x, const MBinning *bins);
+    static void RestoreBinningForLabels(TAxis &x);
 
 public:
Index: trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 8891)
+++ trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 8892)
@@ -1132,6 +1132,10 @@
     MFTriggerPattern ftp2("PedestalFilter");
     ftp2.SetDefault(kTRUE);
+    ftp2.RequirePedestal();
     ftp2.DenyCalibration();
-    ftp2.RequirePedestal();
+
+    // NEW!
+    ftp2.DenyTriggerLvl1();
+    ftp2.DenyTriggerLvl2();
 
     if (!fSequence.IsMonteCarlo() && (!fExtractor || !fExtractor->HasLoGain()))
Index: trunk/MagicSoft/Mars/mraw/MRawRunHeader.h
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawRunHeader.h	(revision 8891)
+++ trunk/MagicSoft/Mars/mraw/MRawRunHeader.h	(revision 8892)
@@ -111,4 +111,5 @@
     const MTime &GetRunStart() const      { return fRunStart; }
     const MTime &GetRunEnd() const        { return fRunStop; }
+    Double_t GetRunLength() const         { return fRunStop-fRunStart; }
     Short_t GetPixAssignment(UShort_t i) const;
     UShort_t GetMaxPixId() const;
Index: trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.cc
===================================================================
--- trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.cc	(revision 8891)
+++ trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.cc	(revision 8892)
@@ -96,14 +96,14 @@
 // otherway you will have it. 
 // 
-// To select events by the trigger pattern you should use MFTriggerPattern filter.
-// This filter uses Require- and Deny- methods to select your trigger pattern.
-// Require- methods requires that your trigger bit is ON, otherway the event
-// is kicked out. Deny- methods requires that your trigger bit is OFF, otherway
-// your event is kicked out. Other bits not selected by your Require- or Deny- call
-// are ignored. Let's give an example. You want to select all events that have
-// both LT1 and LT2 trigger but which are not calibration neither Pin Diode events. 
-// You should look at unprescaled bits to be sure
-// about which were the initial triggers. Then you can implement in your macro
-// something like:
+// To select events by the trigger pattern you should use MFTriggerPattern
+// filter. This filter uses Require- and Deny- methods to select your
+// trigger pattern. Require- methods requires that your trigger bit is ON,
+// otherway the event is kicked out. Deny- methods requires that your
+// trigger bit is OFF, otherway your event is kicked out. Other bits not
+// selected by your Require- or Deny- call are ignored. Let's give an
+// example. You want to select all events that have both LT1 and LT2
+// trigger but which are not calibration neither Pin Diode events. You
+// should look at unprescaled bits to be sure about which were the initial
+// triggers. Then you can implement in your macro something like:
 // 
 //      MFTriggerPattern ftrigpatt;
Index: trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.h
===================================================================
--- trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.h	(revision 8891)
+++ trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.h	(revision 8892)
@@ -12,10 +12,10 @@
 public:
     enum Pattern_t {
-        kTriggerLvl1 = BIT(0),
-        kCalibration = BIT(1), // Pulse Trigger
-        kTriggerLvl2 = BIT(2), // LUT Pseudo Size selection
-        kPedestal    = BIT(3),
-        kPinDiode    = BIT(4),
-        kSumTrigger  = BIT(5)  // Flag for an event taken with sum trigger
+        kTriggerLvl1 = BIT(0), //  1:
+        kCalibration = BIT(1), //  2: Pulse Trigger
+        kTriggerLvl2 = BIT(2), //  4: LUT Pseudo Size selection
+        kPedestal    = BIT(3), //  8:
+        kPinDiode    = BIT(4), // 16:
+        kSumTrigger  = BIT(5)  // 32: Flag for an event taken with sum trigger
         //kUnused      = BIT(6)
         //kUnused      = BIT(7)
