Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7345)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7346)
@@ -18,4 +18,12 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2005/09/09 Thomas Bretz
+
+   * mgeom/MGeomPix.cc:
+     - fixed a problem with incorrectly set bits for outermost
+       pixels (introduced with the latest changes)
+
+
+
  2005/09/09 Daniela Dorner
 
Index: trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 7345)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 7346)
@@ -67,17 +67,6 @@
 // --------------------------------------------------------------------------
 //
-// Default Constructor
-/*
-MGeomCam::MGeomCam()
-    : fNumPixels(0), fCamDist(0), fConvMm2Deg(0),  fMaxRadius(1), fMinRadius(1)
-{
-    fName  = "MGeomCam";
-    fTitle = "Storage container for a camera geometry";
-}
-*/
-// --------------------------------------------------------------------------
-//
-// Initializes a Camera Geometry with npix pixels. All pixels
-// are deleted when the corresponding array is deleted.
+// Default Constructor. Initializes a Camera Geometry with npix pixels. All
+// pixels are deleted when the corresponding array is deleted.
 //
 MGeomCam::MGeomCam(UInt_t npix, Float_t dist, const char *name, const char *title)
@@ -141,18 +130,4 @@
 // --------------------------------------------------------------------------
 //
-// Returns the distance between the pixels i and j. -1 if an index
-// doesn't exist. The default for j is 0. Assuming that 0 is the index
-// for a central pixel you can get the distance to the camera center.
-//
-Float_t MGeomCam::GetDist(UShort_t i, UShort_t j) const
-{
-    if (i>=fNumPixels || j>=fNumPixels)
-        return -1;
-
-    return (*this)[i].GetDist((*this)[j]);
-}
-
-// --------------------------------------------------------------------------
-//
 //  Set the kIsOuterRing flag for all pixels which have a outermost pixel
 //  as Next Neighbor and don't have the kIsOutermostRing flag itself.
@@ -244,4 +219,18 @@
             fMaxRadius[0] = maxr;
     }
+}
+
+// --------------------------------------------------------------------------
+//
+// Returns the distance between the pixels i and j. -1 if an index
+// doesn't exist. The default for j is 0. Assuming that 0 is the index
+// for a central pixel you can get the distance to the camera center.
+//
+Float_t MGeomCam::GetDist(UShort_t i, UShort_t j) const
+{
+    if (i>=fNumPixels || j>=fNumPixels)
+        return -1;
+
+    return (*this)[i].GetDist((*this)[j]);
 }
 
Index: trunk/MagicSoft/Mars/mgeom/MGeomCam.h
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCam.h	(revision 7345)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCam.h	(revision 7346)
@@ -35,5 +35,4 @@
 
 protected:
-
     void CalcMaxRadius();
     void CalcNumSectors();
@@ -41,7 +40,5 @@
     void InitOuterRing();
 
-
 public:
-    //MGeomCam();
     MGeomCam(UInt_t npix=0, Float_t dist=1, const char *name=NULL, const char *title=NULL);
 
@@ -70,5 +67,5 @@
 
     Float_t GetDist(UShort_t i, UShort_t j=0) const;
-    
+
     UInt_t  GetNumSectors()                const  { return fNumSectors; }
     UInt_t  GetNumAreas()                  const  { return fNumAreas; }
Index: trunk/MagicSoft/Mars/mgeom/MGeomPix.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomPix.cc	(revision 7345)
+++ trunk/MagicSoft/Mars/mgeom/MGeomPix.cc	(revision 7346)
@@ -103,6 +103,5 @@
     fNumNeighbors = i;
 
-    if (fNumNeighbors<5)
-        SetBit(kIsInOutermostRing);
+    fNumNeighbors<5 ? SetBit(kIsInOutermostRing) : ResetBit(kIsInOutermostRing);
 }
 
@@ -116,4 +115,6 @@
     if (IsInOutermostRing())
         return;
+
+    ResetBit(kIsInOuterRing);
 
     for (int i=0; i<fNumNeighbors; i++)
