Index: trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc	(revision 2648)
+++ trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc	(revision 2649)
@@ -259,4 +259,27 @@
 // --------------------------------------------------------------------------
 //
+// Returns the index of the maximum FADC slice from high gain at first. If 
+// high gain is saturated it returns the low gain one. 
+// Att! Here the index range is from 1 to 15. 
+// 0 means that an error occured (hi-gain saturated and no lo-gain available).
+// 
+
+Byte_t MRawEvtPixelIter::GetIdxMaxHiLoGainSample() const
+{
+    Byte_t maxi = 0;
+
+    if (this.GetMaxHiGainSample() == 255) 
+    {
+	 if (this.HasLoGain())
+	    maxi = this.GetIdxMaxLoGainSample();
+    }
+    else
+         maxi = this.GetIdxMaxHiGainSample();
+
+    return maxi+1;
+}
+
+// --------------------------------------------------------------------------
+//
 // Returns the maximum signal of all sliced in the hi gain samples
 //
Index: trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h	(revision 2648)
+++ trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h	(revision 2649)
@@ -87,4 +87,5 @@
     Byte_t GetMaxHiGainSample() const;
     Byte_t GetMaxLoGainSample() const;
+    Byte_t GetIdxMaxHiLoGainSample() const;
 
     Bool_t HasLoGain() const
