Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 3948)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 3949)
@@ -37,4 +37,10 @@
 
  2004/05/03: Markus Gaug
+
+   * mraw/MRawEvtPixelIter.cc
+     - corrected bug in GetIdxMaxLoGainSamples() which looped over 
+       one slice too much 
+	end = fLoGainPos + fNumLoGainSamples + 1 replaced by:
+	end = fLoGainPos + fNumLoGainSamples
 
    * msignal/MTimeExtractor.[h,cc]
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc	(revision 3948)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc	(revision 3949)
@@ -239,12 +239,13 @@
     return -1; // means: not found
   
+  Byte_t *ptr = fLoGainPos+lofirst+1;
   Byte_t *max = fLoGainPos+lofirst;
-  Byte_t *ptr = max+1;
-
-  const Byte_t *end = fLoGainPos + fNumLoGainSamples + 1;
-  
+  const Byte_t *end = fLoGainPos + fNumLoGainSamples;
+	
   do if (*ptr>*max) max = ptr;
   while (++ptr != end);
   
+  gLog << count << endl;
+
   return max-fLoGainPos;
 }
@@ -293,4 +294,5 @@
 Byte_t MRawEvtPixelIter::GetMaxLoGainSample() const
 {
+
     Byte_t max = 0;
 
