Index: trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 1457)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 1458)
@@ -78,4 +78,15 @@
 // --------------------------------------------------------------------------
 //
+//  Set the kIsOuterRing flag for all pixels which have a outermost pixel
+//  as Next Neighbor and don't have the kIsOutermostRing flag itself.
+//
+void MGeomCam::InitOuterRing()
+{
+    for (UInt_t i=0; i<fNumPixels; i++)
+        (*this)[i].CheckOuterRing(*this);
+}
+
+// --------------------------------------------------------------------------
+//
 // Calculate the maximum radius of the camera. This is ment for GUI layout.
 //
Index: trunk/MagicSoft/Mars/mgeom/MGeomCam.h
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCam.h	(revision 1457)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCam.h	(revision 1458)
@@ -24,7 +24,7 @@
 protected:
     void CalcMaxRadius();
+    void InitOuterRing();
 
 public:
-
     MGeomCam(UInt_t npix, Float_t dist, const char *name=NULL, const char *title=NULL);
 
Index: trunk/MagicSoft/Mars/mgeom/MGeomCamCT1.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCamCT1.cc	(revision 1457)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCamCT1.cc	(revision 1458)
@@ -200,4 +200,6 @@
       (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2],
                               nn[i][3], nn[i][4], nn[i][5]);
+
+  InitOuterRing();
 }
 
Index: trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc	(revision 1457)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc	(revision 1458)
@@ -896,3 +896,5 @@
       (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2],
                               nn[i][3], nn[i][4], nn[i][5]);
+
+  InitOuterRing();
 }
Index: trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.h
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.h	(revision 1457)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.h	(revision 1458)
@@ -13,5 +13,4 @@
 
 public:
-
     MGeomCamMagic(const char *name=NULL);
 
Index: trunk/MagicSoft/Mars/mgeom/MGeomPix.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomPix.cc	(revision 1457)
+++ trunk/MagicSoft/Mars/mgeom/MGeomPix.cc	(revision 1458)
@@ -39,4 +39,6 @@
 #include "MLog.h"
 #include "MLogManip.h"
+
+#include "MGeomCam.h"
 
 ClassImp(MGeomPix);
@@ -83,4 +85,25 @@
 
     fNumNeighbors = i;
+
+    if (fNumNeighbors<5)
+        SetBit(kIsInOutermostRing);
+}
+
+// --------------------------------------------------------------------------
+//
+//  Set the kIsOuterRing flag if this pixel has a outermost pixel
+//  as Next Neighbor and don't have the kIsOutermostRing flag itself.
+//
+void MGeomPix::CheckOuterRing(const MGeomCam &cam)
+{
+    if (IsInOutermostRing())
+        return;
+
+    for (int i=0; i<fNumNeighbors; i++)
+        if (cam[fNeighbors[i]].IsInOutermostRing())
+        {
+            SetBit(kIsInOuterRing);
+            return;
+        }
 }
 
Index: trunk/MagicSoft/Mars/mgeom/MGeomPix.h
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomPix.h	(revision 1457)
+++ trunk/MagicSoft/Mars/mgeom/MGeomPix.h	(revision 1458)
@@ -6,7 +6,14 @@
 #endif
 
+class MGeomCam;
+
 class MGeomPix : public MParContainer
 { 
 private:
+    enum {
+        kIsInOutermostRing = BIT(14),
+        kIsInOuterRing     = BIT(15)
+    };
+
     Float_t fX;  // [mm] the x coordinate of the center
     Float_t fY;  // [mm] the y coordinate of the center
@@ -14,6 +21,5 @@
 
     Byte_t  fNumNeighbors; // number of valid neighbors
-    Short_t fNeighbors[6]; // the IDs of the pixel next to it
-                           // we are assuming an hexagonal geometry
+    Short_t fNeighbors[6]; // the IDs of the pixel next to it (we are assuming an hexagonal geometry)
 
 public:
@@ -26,4 +32,6 @@
     void SetNeighbors(Short_t i0=-1, Short_t i1=-1, Short_t i2=-1,
                       Short_t i3=-1, Short_t i4=-1, Short_t i5=-1);
+
+    void CheckOuterRing(const MGeomCam &cam);
 
     void SetX(Float_t x) { fX = x; }
@@ -40,4 +48,7 @@
     Short_t GetNeighbor(Byte_t i) const { return fNeighbors[i]; }
 
+    Bool_t IsInOutermostRing() const { return TestBit(kIsInOutermostRing); }
+    Bool_t IsInOuterRing() const     { return TestBit(kIsInOuterRing); }
+
     ClassDef(MGeomPix, 1) // Geometry class describing the geometry of one pixel
 };
