Index: trunk/MagicSoft/Mars/mgui/MCamEvent.cc
===================================================================
--- trunk/MagicSoft/Mars/mgui/MCamEvent.cc	(revision 7349)
+++ trunk/MagicSoft/Mars/mgui/MCamEvent.cc	(revision 7438)
@@ -62,4 +62,6 @@
 Double_t MCamEvent::GetCameraMean(const MGeomCam &cam, Int_t type) const
 {
+    return GetCameraStat(cam, type)[0];
+    /*
     Int_t    num  = 0;
     Double_t mean = 0;
@@ -74,3 +76,70 @@
     }
     return num == 0 ? 0 : mean/num;
+    */
 }
+
+// --------------------------------------------------------------------------
+//
+// Return the rms of all corresponding GetPixelContent
+//
+Double_t MCamEvent::GetCameraRMS(const MGeomCam &cam, Int_t type) const
+{
+    return GetCameraStat(cam, type)[1];
+    /*
+    Int_t    num  = 0;
+    Double_t sum = 0;
+    Double_t sq  = 0;
+
+    for (unsigned int i=0; i<cam.GetNumPixels(); i++)
+    {
+        Double_t val;
+        if (!GetPixelContent(val, i, cam, type))
+            continue;
+
+        sum += val;
+        sq  += val;
+        num ++;
+    }
+
+    if (num==0)
+        return 0;
+
+    sum /= num;
+    sq  /= num;
+
+    return TMath::Sqrt(sq-sum*sum);
+    */
+}
+
+// --------------------------------------------------------------------------
+//
+// Return the rms of all corresponding GetPixelContent
+//
+TArrayD MCamEvent::GetCameraStat(const MGeomCam &cam, Int_t type) const
+{
+    Int_t    num = 0;
+    Double_t sum = 0;
+    Double_t sq  = 0;
+
+    for (unsigned int i=0; i<cam.GetNumPixels(); i++)
+    {
+        Double_t val;
+        if (!GetPixelContent(val, i, cam, type))
+            continue;
+
+        sum += val;
+        sq  += val;
+        num ++;
+    }
+
+    if (num==0)
+        return 0;
+
+    sum /= num;
+    sq  /= num;
+
+    TArrayD stat(2);
+    stat[0] = sum;
+    stat[1] = TMath::Sqrt(sq-sum*sum);
+    return stat;
+}
Index: trunk/MagicSoft/Mars/mgui/MCamEvent.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/MCamEvent.h	(revision 7349)
+++ trunk/MagicSoft/Mars/mgui/MCamEvent.h	(revision 7438)
@@ -2,6 +2,6 @@
 #define MARS_MCamEvent
 
-#ifndef ROOT_TROOT
-#include <TROOT.h>
+#ifndef ROOT_TArrayD
+#include <TArrayD.h>
 #endif
 
@@ -18,4 +18,6 @@
 
     virtual Double_t GetCameraMean(const MGeomCam &cam, Int_t type=0) const;
+    virtual Double_t GetCameraRMS(const MGeomCam &cam, Int_t type=0) const;
+    virtual TArrayD  GetCameraStat(const MGeomCam &cam, Int_t type=0) const;
 
     ClassDef(MCamEvent, 0) // A camera event
