Index: trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc
===================================================================
--- trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc	(revision 8357)
+++ trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc	(revision 8361)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MPedCalcFromLoGain.cc,v 1.36 2007-03-01 21:20:41 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MPedCalcFromLoGain.cc,v 1.37 2007-03-04 12:00:30 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -214,5 +214,7 @@
         return kFALSE;
 
-    CheckExtractionWindow(fRunHeader->GetNumSamplesHiGain());
+    const Int_t nhi = fRunHeader->GetNumSamplesHiGain();
+    const Int_t nlo = fRunHeader->GetNumSamplesLoGain();
+    CheckExtractionWindow(nlo>0?nhi:0);
 
     return kTRUE;
@@ -227,7 +229,9 @@
 Int_t MPedCalcFromLoGain::Calc()
 {
+    const Int_t nhi = fRunHeader->GetNumSamplesHiGain();
+    const Int_t nlo = fRunHeader->GetNumSamplesLoGain();
+
     // Real Process
     MRawEvtPixelIter pixel(fRawEvt);
-
     while (pixel.Next())
     {
@@ -240,6 +244,6 @@
         UInt_t ab[2];
         const Float_t sum = fExtractor ?
-            CalcExtractor(pixel, pixel.GetNumHiGainSamples()) :
-            CalcSums(pixel, pixel.GetNumHiGainSamples(), ab[0], ab[1]);
+            CalcExtractor(pixel, nlo>0?nhi:0) :
+            CalcSums(pixel, nlo>0?nhi:0, ab[0], ab[1]);
 
         const UInt_t aidx   = (*fGeom)[idx].GetAidx();
Index: trunk/MagicSoft/Mars/mpedestal/MPedestalSubtractedEvt.cc
===================================================================
--- trunk/MagicSoft/Mars/mpedestal/MPedestalSubtractedEvt.cc	(revision 8357)
+++ trunk/MagicSoft/Mars/mpedestal/MPedestalSubtractedEvt.cc	(revision 8361)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MPedestalSubtractedEvt.cc,v 1.2 2007-01-15 12:06:15 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MPedestalSubtractedEvt.cc,v 1.3 2007-03-04 12:01:37 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -105,6 +105,6 @@
     Byte_t *p0 = GetSamplesRaw(idx);
 
-    Byte_t *sathi0 = 0; // first saturating hi-gain slice
-    Byte_t *sathi1 = 0; // last  saturating hi-gain slice
+    Byte_t *sat0 = 0; // first saturating slice
+    Byte_t *sat1 = 0; // last  saturating slice
 
     Int_t num = 0;
@@ -115,13 +115,13 @@
         if (*ptr>=limit)
         {
-            sathi1 = ptr;
-            if (!sathi0)
-                sathi0 = ptr;
+            sat1 = ptr;
+            if (!sat0)
+                sat0 = ptr;
             num++;
         }
     }
 
-    last  = sathi1 ? sathi1-p0 : -1;
-    first = sathi0 ? sathi0-p0 : -1;
+    last  = sat1 ? sat1-p0 : -1;
+    first = sat0 ? sat0-p0 : -1;
 
     return num;
@@ -138,5 +138,5 @@
 // Warning: No range checks and no sanity checks are done!
 //
-Int_t MPedestalSubtractedEvt::GetMax(const Int_t idx, const Int_t first, const Int_t last, Int_t &val) const
+Int_t MPedestalSubtractedEvt::GetMax(const Int_t idx, const Int_t first, const Int_t last, UInt_t &val) const
 {
     // Get pointer to first slice to be considered
Index: trunk/MagicSoft/Mars/mpedestal/MPedestalSubtractedEvt.h
===================================================================
--- trunk/MagicSoft/Mars/mpedestal/MPedestalSubtractedEvt.h	(revision 8357)
+++ trunk/MagicSoft/Mars/mpedestal/MPedestalSubtractedEvt.h	(revision 8361)
@@ -41,11 +41,11 @@
     Int_t GetSaturation(const Int_t idx, Int_t limit, Int_t &first, Int_t &last) const;
     //void  InterpolateSaturation(const Int_t idx, Int_t limit, Int_t first, Int_t last) const;
-    Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last, Int_t &val) const;
+    Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last, UInt_t &val) const;
     Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last) const
     {
-        Int_t val;
+        UInt_t val;
         return GetMax(pixidx, first, last, val);
     }
-    Int_t GetMax(const Int_t pixidx, Int_t &val) const
+    Int_t GetMax(const Int_t pixidx, UInt_t &val) const
     {
         return GetMax(pixidx, 0, fNumSamples, val);
@@ -54,5 +54,5 @@
     Int_t GetMax(const Int_t pixidx) const
     {
-        Int_t val;
+        UInt_t val;
         return GetMax(pixidx, 0, fNumSamples, val);
     }
