Index: trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc	(revision 6137)
+++ trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc	(revision 6138)
@@ -395,5 +395,5 @@
       return;
 
-  time = max_p + fTimeShiftHiGain /* this shifts the time to the start of the rising edge */
+  time = max_p + fTimeShiftHiGain + (Float_t)fHiGainFirst /* this shifts the time to the start of the rising edge */
       - ((Float_t)t_iter)/fBinningResolutionHiGain;
 
Index: trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilterPeakSearch.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilterPeakSearch.cc	(revision 6137)
+++ trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilterPeakSearch.cc	(revision 6138)
@@ -77,6 +77,6 @@
 using namespace std;
 
-const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgHiGainFirst             =  1;
-const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgHiGainLast              = 15;
+const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgHiGainFirst             =  0;
+const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgHiGainLast              = 18;
 const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgLoGainFirst             =  3;
 const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgLoGainLast              = 14;
@@ -230,21 +230,22 @@
   // Shift the start slice to the left:
   //
-  if (higainfirst > fOffsetLeftFromPeak)
+  if (higainfirst > fHiGainFirst + fOffsetLeftFromPeak)
     fHiGainFirst = higainfirst - fOffsetLeftFromPeak;
   else
-    *fLog << warn << " High Gain ranges out of limits to the left!!! " << endl;
+    *fLog << warn << " High Gain ranges out of limits to the left!!! " << (Int_t)higainfirst << endl;
 
   //
   // Shift the last slice to the right:
   //
-  if (higainfirst + fOffsetRightFromPeak + fWindowSizeHiGain > hiGainLastsave)
+  if (higainfirst + fOffsetRightFromPeak + fWindowSizeHiGain < hiGainLastsave)
     fHiGainLast  = higainfirst + fOffsetRightFromPeak + fWindowSizeHiGain;
   else 
-    *fLog << warn << " High Gain ranges out of limits to the right!!! " << endl;
+    *fLog << warn << " High Gain ranges out of limits to the right!!! " << (Int_t)higainfirst << endl;
+      
 
   if ( fHiGainFirst+(Int_t)fOffsetLoGain > fLoGainFirst ) 
     fLoGainFirst = fHiGainFirst + (Int_t)fOffsetLoGain;
   else
-    *fLog << warn << " High Gain ranges out of limits to the left!!! " << endl;
+    *fLog << inf << " High Gain ranges out of limits to the left!!! " << (Int_t)fHiGainFirst << endl;
   
   //
