Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 2263)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 2264)
@@ -27,4 +27,7 @@
    * mraw/MRawEvtPixelIter.[h,cc]:
      - added GetMax[Hi,Lo]GainSample
+
+   * macros/pixsatrate.C:
+     - added
 
 
Index: /trunk/MagicSoft/Mars/Makefile.conf.linux-gnu
===================================================================
--- /trunk/MagicSoft/Mars/Makefile.conf.linux-gnu	(revision 2263)
+++ /trunk/MagicSoft/Mars/Makefile.conf.linux-gnu	(revision 2264)
@@ -23,4 +23,5 @@
 DEBUG    =
 ARCHDEF  = -D__LINUX__
+DYNLIB   = -shared
 
 # To be tested:
Index: /trunk/MagicSoft/Mars/Makefile.conf.osf1
===================================================================
--- /trunk/MagicSoft/Mars/Makefile.conf.osf1	(revision 2263)
+++ /trunk/MagicSoft/Mars/Makefile.conf.osf1	(revision 2264)
@@ -26,4 +26,5 @@
 DEBUG    = -g  -w0 -msg_display_tag -msg_disable castqualtyp,undpreid,unrfunprm,extrasemi,intconlosbit,nonfundec,partovrd,stoclsnotfirst,boolexprconst
 ARCHDEF  = -D__OSF__ -D__USE_STD_IOSTREAM -DR__ANSISTREAM
+DYNLIB   = -shared
 
 MARS_LIB = -Llib $(SUBDIRS/*/-l&)  $(MARSLIBS)
Index: /trunk/MagicSoft/Mars/Makefile.conf.osf5.1
===================================================================
--- /trunk/MagicSoft/Mars/Makefile.conf.osf5.1	(revision 2263)
+++ /trunk/MagicSoft/Mars/Makefile.conf.osf5.1	(revision 2264)
@@ -26,4 +26,5 @@
 DEBUG    = -g3  -w0 -msg_display_tag -msg_disable castqualtyp,undpreid,unrfunprm,extrasemi,intconlosbit,nonfundec,partovrd,stoclsnotfirst,boolexprconst
 ARCHDEF  = -D__OSF__ -D__USE_STD_IOSTREAM -DR__ANSISTREAM
+DYNLIB   = -shared
 
 MARS_LIB = -Llib $(SUBDIRS/*/-l&)  $(MARSLIBS)
Index: /trunk/MagicSoft/Mars/macros/pixsatrate.C
===================================================================
--- /trunk/MagicSoft/Mars/macros/pixsatrate.C	(revision 2264)
+++ /trunk/MagicSoft/Mars/macros/pixsatrate.C	(revision 2264)
@@ -0,0 +1,115 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Abelardo Moralejo <mailto:moralejo@pd.infn.it>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// pixfirerate.C
+//
+// This macro can help to  find "hot" pixels firing too often
+// or pixels firing too rarely. It plots camera displays showing how many 
+// times the FADC integral of each pixel has been found to be above pedestal
+// by 10, 20, 50, 100 or 200 ADC counts. As "pedestal"  we now use simply 
+// the signal in the first ADC slice, which seemed reasonable from a first
+// look at the available test data.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+void pixsatrate(TString filename="rawfile.root")
+{
+    //
+    // Update frequency by default = 1Hz
+    //
+    MStatusDisplay *d = new MStatusDisplay;
+
+    // Set update time to 5s
+    // d->SetUpdateTime(5000);
+
+    // Disable online update
+    // d->SetUpdateTime(-1);
+
+    d->SetLogStream(&gLog, kTRUE); // Disables output to stdout
+    gLog.SetOutputFile("status.log", kTRUE); // Enable output to file
+    //gLog.EnableOutputDevice(MLog::eStdout); // Enable output to stdout again
+
+    //
+    // Create a empty Parameter List and an empty Task List
+    // The tasklist is identified in the eventloop by its name
+    //
+    MTaskList tlist;
+    MParList  plist;
+    plist.AddToList(&tlist);
+
+    // The geometry container must be created by yourself to make sure
+    // that you don't choose a wrong geometry by mistake
+    //
+    MGeomCamMagic geomcam;
+    plist.AddToList(&geomcam);
+
+    //
+    // Now setup the tasks and tasklist:
+    // ---------------------------------
+    //
+    MReadMarsFile read("Events");
+    read.DisableAutoScheme();
+    read.AddFile(filename);
+    tlist.AddToList(&read);
+
+    MHTriggerLvl0 trigmap(254, "Saturation", "Saturation");
+    trigmap.SetType(1);
+
+    MFillH fillh(trigmap, "MRawEvtData");
+    plist.AddToList(&trigmap);
+    tlist.AddToList(&fillh);
+
+    MEvtLoop evtloop;
+    evtloop.SetParList(&plist);
+    evtloop.SetDisplay(d);
+
+    //
+    // Execute your analysis
+    //
+    if (!evtloop.Eventloop())
+        return;
+
+    tlist.PrintStatistics();
+
+    //
+    // Make sure the display hasn't been deleted by the user while the
+    // eventloop was running.
+    //
+    if ((d = evtloop.GetDisplay()))
+    {
+        // Save data in a postscriptfile (status.ps)
+        d->SaveAsPS();
+        /*
+         * ----------- Write status to a root file ------------
+         *
+         TFile file("status.root", "RECREATE");
+         d->Write();
+         file.Close();
+         delete d;
+         */
+    }
+
+}
Index: /trunk/MagicSoft/Mars/mgui/MCamEvent.cc
===================================================================
--- /trunk/MagicSoft/Mars/mgui/MCamEvent.cc	(revision 2263)
+++ /trunk/MagicSoft/Mars/mgui/MCamEvent.cc	(revision 2264)
@@ -32,6 +32,4 @@
 #include "MCamEvent.h"
 
-#include "MGeomCam.h"
-
 ClassImp(MCamEvent);
 
Index: /trunk/MagicSoft/Mars/mgui/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mgui/Makefile	(revision 2263)
+++ /trunk/MagicSoft/Mars/mgui/Makefile	(revision 2264)
@@ -22,6 +22,5 @@
 #  connect the include files defined in the config.mk file
 #
-INCLUDES = -I. -I../mbase -I../mgeom -I../manalysis -I../mimage -I../mhist \
-	   -I../mreflector -I../mraw
+INCLUDES = -I. -I../mbase -I../mgeom
 
 #------------------------------------------------------------------------------
Index: /trunk/MagicSoft/Mars/mhist/MHCamera.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 2263)
+++ /trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 2264)
@@ -422,5 +422,5 @@
     // box with the histogram title
     ptitle->SetTextColor(gStyle->GetTitleTextColor());
-#if ROOT_VERSION_CODE > ROOT_VERSION(3,05,00)
+#if ROOT_VERSION_CODE > ROOT_VERSION(3,05,01)
     ptitle->SetTextFont(gStyle->GetTitleFont(""));
 #endif
@@ -487,5 +487,5 @@
 
     // box with the histogram title
-#if ROOT_VERSION_CODE > ROOT_VERSION(3,05,00)
+#if ROOT_VERSION_CODE > ROOT_VERSION(3,05,01)
     ptitle->SetFillColor(gStyle->GetTitleFillColor());
     ptitle->SetTextFont(gStyle->GetTitleFont(""));
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtData.cc	(revision 2263)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtData.cc	(revision 2264)
@@ -480,6 +480,17 @@
         return kFALSE;
 
-    val = Next.GetSumHiGainSamples()-(float)GetNumHiGainSamples()*fHiGainFadcSamples->GetArray()[0];
-    val *= cam.GetPixRatio(idx);
+    switch (type)
+    {
+    case 0:
+        val = Next.GetSumHiGainSamples()-(float)GetNumHiGainSamples()*fHiGainFadcSamples->GetArray()[0];
+        val*= cam.GetPixRatio(idx);
+        break;
+    case 1:
+        val = Next.GetMaxHiGainSample();
+        break;
+    case 2:
+        val = Next.GetMaxLoGainSample();
+        break;
+    }
 
     return kTRUE;
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc	(revision 2263)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc	(revision 2264)
@@ -247,4 +247,34 @@
 // --------------------------------------------------------------------------
 //
+// Returns the maximum signal of all sliced in the hi gain samples
+//
+Byte_t MRawEvtPixelIter::GetMaxHiGainSample() const
+{
+    Byte_t max = 0;
+
+    for (int i=0; i<fNumHiGainSamples; i++)
+        if (fHiGainPos[i]>max)
+            max = fHiGainPos[i];
+
+    return max;
+}
+
+// --------------------------------------------------------------------------
+//
+// Returns the maximum signal of all sliced in the hi gain samples
+//
+Byte_t MRawEvtPixelIter::GetMaxLoGainSample() const
+{
+    Byte_t max = 0;
+
+    for (int i=fNumLoGainSamples-1; i>=0; i--)
+        if (fLoGainPos[i]>max)
+            max = fLoGainPos[i];
+
+    return max;
+}
+
+// --------------------------------------------------------------------------
+//
 // returns the sum of all lo gain fadc samples of the actual pixel.
 // if no lo gain information is available 0 is returned.
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h	(revision 2263)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h	(revision 2264)
@@ -83,4 +83,6 @@
     Byte_t GetNumMaxHiGainSample() const;
     Byte_t GetNumMaxLoGainSample() const;
+    Byte_t GetMaxHiGainSample() const;
+    Byte_t GetMaxLoGainSample() const;
 
     Bool_t HasLoGain() const
