Index: trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 2234)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 2236)
@@ -97,4 +97,25 @@
 // --------------------------------------------------------------------------
 //
+// Calculate the highest sector index+1 of all pixels, please make sure
+// the the sector numbers are continous.
+//
+void MGeomCam::CalcNumSectors()
+{
+    fNumSectors = 0;
+
+    for (UInt_t i=0; i<fNumPixels; i++)
+    {
+        const MGeomPix &pix = (*this)[i];
+        const UInt_t s = pix.GetSector();
+
+        if (s>fNumSectors)
+            fNumSectors = s;
+    }
+
+    fNumSectors++;
+}
+
+// --------------------------------------------------------------------------
+//
 // 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 2234)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCam.h	(revision 2236)
@@ -22,6 +22,9 @@
     TObjArray fPixels;     // Array of singel pixels storing the geometry
 
+    UInt_t    fNumSectors; // Number of sectors
+
 protected:
     void CalcMaxRadius();
+    void CalcNumSectors();
     void InitOuterRing();
 
@@ -32,9 +35,10 @@
     virtual TObject *Clone(const char *newname=NULL) const;
 
-    Float_t GetCameraDist() const      { return fCamDist; }
-    Float_t GetConvMm2Deg() const      { return fConvMm2Deg; }
+    Float_t GetCameraDist() const { return fCamDist; }
+    Float_t GetConvMm2Deg() const { return fConvMm2Deg; }
 
-    UInt_t  GetNumPixels() const       { return fNumPixels; }
-    Float_t GetMaxRadius() const       { return fMaxRadius; }
+    UInt_t  GetNumPixels() const  { return fNumPixels; }
+    Float_t GetMaxRadius() const  { return fMaxRadius; }
+    UInt_t  GetNumSectors() const { return fNumSectors; }
     Float_t GetPixRatio(UInt_t i) const;
 
Index: trunk/MagicSoft/Mars/mgeom/MGeomCamCT1.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCamCT1.cc	(revision 2234)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCamCT1.cc	(revision 2236)
@@ -56,4 +56,5 @@
     CreateCam();
     CreateNN();
+    CalcNumSectors();
     CalcMaxRadius();
 } 
Index: trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000.cc	(revision 2234)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000.cc	(revision 2236)
@@ -52,4 +52,5 @@
     CreateCam();
     CreateNN();
+    CalcNumSectors();
     CalcMaxRadius();
 }
Index: trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000HG.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000HG.cc	(revision 2234)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000HG.cc	(revision 2236)
@@ -56,4 +56,5 @@
     CreateCam();
     CreateNN();
+    CalcNumSectors();
     CalcMaxRadius();
 }
Index: trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc	(revision 2234)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc	(revision 2236)
@@ -53,4 +53,5 @@
     CreateCam();
     CreateNN();
+    CalcNumSectors();
     CalcMaxRadius();
 }
@@ -221,5 +222,5 @@
         -034.641                                                                         // 576
     };
-
+/*
     const Float_t dtemp[577] = {
         30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  //   0
@@ -296,11 +297,43 @@
         60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 568
         60.00  };                                                // 576
+*/
+    const Byte_t sector[577] = {
+        0, 1, 2, 3, 4, 5, 6, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
+        1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 1,
+        1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5,
+        6, 6, 6, 6, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,
+        4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 1, 1, 1, 1,
+        1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4,
+        4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1,
+        1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4,
+        4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 1, 1,
+        1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,
+        3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5,
+        6, 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
+        2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4,
+        4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6,
+        6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2,
+        2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4,
+        4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6,
+        6, 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
+        3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5,
+        5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 1, 1,
+        1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4,
+        4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1,
+        1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4,
+        4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
+        1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3,
+        3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5,
+        5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+        2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4,
+        4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6,
+        6, 6, 6, 6, 6, 6, 6 };
 
     //
     //   fill the pixels list with this data
     //
-
     for (UInt_t i=0; i<GetNumPixels(); i++)
-        (*this)[i].Set(xtemp[i], ytemp[i], dtemp[i]) ;
+        (*this)[i].Set(xtemp[i], ytemp[i], i>396?60:30, sector[i]);
 }
 
Index: trunk/MagicSoft/Mars/mgeom/MGeomCamMagicHG.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCamMagicHG.cc	(revision 2234)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCamMagicHG.cc	(revision 2236)
@@ -53,4 +53,5 @@
     CreateCam();
     CreateNN();
+    CalcNumSectors();
     CalcMaxRadius();
 }
@@ -983,5 +984,5 @@
 
     for (UInt_t i=0; i<GetNumPixels(); i++)
-        (*this)[i].Set(xtemp[i], ytemp[i], dtemp[i]) ;
+        (*this)[i].Set(xtemp[i], ytemp[i], dtemp[i]);
 }
 
Index: trunk/MagicSoft/Mars/mgeom/MGeomPix.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomPix.cc	(revision 2234)
+++ trunk/MagicSoft/Mars/mgeom/MGeomPix.cc	(revision 2236)
@@ -56,5 +56,5 @@
 // Initializes one pixel
 //
-MGeomPix::MGeomPix(Float_t x, Float_t y, Float_t r) : fX(x), fY(y), fD(r)
+MGeomPix::MGeomPix(Float_t x, Float_t y, Float_t r, UInt_t s) : fX(x), fY(y), fD(r), fSector(s)
 {
     //  default constructor
Index: trunk/MagicSoft/Mars/mgeom/MGeomPix.h
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomPix.h	(revision 2234)
+++ trunk/MagicSoft/Mars/mgeom/MGeomPix.h	(revision 2236)
@@ -25,10 +25,12 @@
     Short_t fNeighbors[6]; // the IDs of the pixel next to it (we are assuming an hexagonal geometry)
 
+    UInt_t fSector; // Number of sector the pixels corresponds to
+
 public:
-    MGeomPix(Float_t x=0, Float_t y=0, Float_t d=0);
+    MGeomPix(Float_t x=0, Float_t y=0, Float_t d=0, UInt_t s=0);
 
     void Print(Option_t *opt=NULL) const;
 
-    void Set(Float_t x, Float_t y, Float_t d) { fX=x; fY=y; fD=d; }
+    void Set(Float_t x, Float_t y, Float_t d, UInt_t s=0) { fX=x; fY=y; fD=d; fSector=s; }
 
     void SetNeighbors(Short_t i0=-1, Short_t i1=-1, Short_t i2=-1,
@@ -36,12 +38,15 @@
 
     void CheckOuterRing(const MGeomCam &cam);
-
-    void SetX(Float_t x) { fX = x; }
-    void SetY(Float_t y) { fY = y; }
-    void SetD(Float_t d) { fD = d; }
+    /*
+     void SetX(Float_t x) { fX = x; }
+     void SetY(Float_t y) { fY = y; }
+     void SetD(Float_t d) { fD = d; }
+     void SetSector(UInt_t s) { fSector = s; }
+     */
 
     Float_t GetX() const  { return fX; }
     Float_t GetY() const  { return fY; }
     Float_t GetD() const  { return fD; }
+    UInt_t  GetSector() const { return fSector; }
 
     Float_t GetA() const;
