Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 3494)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 3495)
@@ -28,4 +28,9 @@
    * mcalib/MHCalibrationChargeCam.cc
      - replaced Rel. Err. Limit for outliers in Phe's from 5 sigma to 7
+
+   * mraw/MRawEvtPixelIter.[h,cc]
+     - function GetIdxMaxLoGainSamples can be called optionally with 
+       offset (because first "loGain" samples are often in reality 
+       hiGain with high values.
 
 
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc	(revision 3494)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc	(revision 3495)
@@ -233,17 +233,18 @@
 // last one is returned.
 //
-Short_t MRawEvtPixelIter::GetIdxMaxLoGainSample() const
-{
-    if (!HasLoGain())
-        return -1; // means: not found
-
-    Byte_t *ptr = fLoGainPos+1;
-    Byte_t *max = fLoGainPos;
-    const Byte_t *end = ptr + fNumLoGainSamples;
-
-    do if (*ptr>*max) max = ptr;
-    while (++ptr != end);
-
-    return max-fLoGainPos;
+Short_t MRawEvtPixelIter::GetIdxMaxLoGainSample(const Byte_t lofirst) const
+{
+
+  if (!HasLoGain())
+    return -1; // means: not found
+  
+  Byte_t *ptr = fLoGainPos+lofirst;
+  Byte_t *max = ptr;
+  const Byte_t *end = fLoGainPos + fNumLoGainSamples;
+  
+  do if (*ptr>*max) max = ptr;
+  while (++ptr != end);
+  
+  return max-fLoGainPos;
 }
 
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h	(revision 3494)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h	(revision 3495)
@@ -87,5 +87,5 @@
     Byte_t  GetMaxLoGainSample() const;
     Byte_t  GetIdxMaxHiGainSample() const;
-    Short_t GetIdxMaxLoGainSample() const;
+    Short_t GetIdxMaxLoGainSample(const Byte_t lofirst=0) const;
     Short_t GetIdxMaxHiLoGainSample() const;
 
