Index: trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc	(revision 7364)
+++ trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc	(revision 7430)
@@ -232,5 +232,10 @@
     }
 
-    // New weights set
+    //
+    // shift the times back to the right reference (start counting from 0)
+    //
+    // The high-gain has the extraction offset (fHiGainFirst) already included
+    // here for speed reason. The low-gain has a changing extraction offset,
+    // so it will be added at every event (in FindTimeAndChargeLoGain)
     fTimeShiftHiGain = 0.5 + 1./fBinningResolutionHiGain + fHiGainFirst;
     fTimeShiftLoGain = 0.5 + 1./fBinningResolutionLoGain;
@@ -474,6 +479,6 @@
       return;
 
-  time = max_p + fTimeShiftHiGain + (Float_t)fHiGainFirst /* this shifts the time to the start of the rising edge */
-      - ((Float_t)t_iter)/fBinningResolutionHiGain;
+  // here, the first high-gain slice is already included in the fTimeShiftHiGain
+  time = fTimeShiftHiGain + max_p - Float_t(t_iter)/fBinningResolutionHiGain;
 
   const Float_t timefineadjust = time_sum/sum;
