Index: /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc	(revision 1547)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc	(revision 1548)
@@ -16,7 +16,8 @@
 !
 !
-!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@uni-sw.gwdg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Markus Gaus 10/2002 <mailto:markus@ifae.es>
+!
+!   Copyright: MAGIC Software Development, 2000-2002
 !
 !
@@ -168,4 +169,24 @@
 // --------------------------------------------------------------------------
 //
+// returns the sum of squares of all hi gain fadc sample of the actual pixel
+//
+ULong_t MRawEvtPixelIter::GetSumSqrHiGainSamples() const
+{
+    //
+    // return the sum of the squares of the hi gain samples of the present pixel
+    //
+    Byte_t *ptr = fHiGainPos;
+    const Byte_t *end = ptr + fNumHiGainSamples;
+
+    ULong_t sum=0;
+
+    do sum += (*ptr)*(*ptr);
+    while (++ptr != end);
+
+    return sum;
+}
+
+// --------------------------------------------------------------------------
+//
 // returns the sum of all lo gain fadc samples of the actual pixel.
 // if no lo gain information is available 0 is returned.
@@ -189,2 +210,25 @@
     return sum;
 }
+
+// --------------------------------------------------------------------------
+//
+// returns the sum of squares of all hi gain fadc sample of the actual pixel
+//
+ULong_t MRawEvtPixelIter::GetSumSqrLoGainSamples() const
+{
+    //
+    // return the sum of the lo gain samples squares of the present pixel
+    //
+    if (!HasLoGain())
+        return 0;
+
+    Byte_t *ptr = fLoGainPos;
+    const Byte_t *end = ptr + fNumLoGainSamples;
+
+    ULong_t sum=0;
+
+    do sum += (*ptr)*(*ptr);
+    while (++ptr != end);
+
+    return sum;
+}
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h	(revision 1547)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h	(revision 1548)
@@ -78,4 +78,5 @@
 
     ULong_t GetSumHiGainSamples() const;
+    ULong_t GetSumSqrHiGainSamples() const;
 
     Bool_t HasLoGain() const
@@ -97,5 +98,5 @@
 
     ULong_t GetSumLoGainSamples() const;
-
+    ULong_t GetSumSqrLoGainSamples() const;
 
     void Reset();
