Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 3390)
+++ trunk/MagicSoft/Mars/Changelog	(revision 3392)
@@ -4,4 +4,21 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2004/03/04: Thomas Bretz
+
+   * mgeom/MGeomCam.[h,cc]:
+     - added new data member fNumAreas
+     - added new function CalcNumAreas
+     - increased class version to 3
+
+   * mgeom/MGeomCamMagic.cc:
+     - added setting of area index
+
+   * mgeom/MGeomPix.[h,cc]:
+     - added fAidx data member
+     - added getter function fAidx
+     - increased class version to 3
+
+
+
  2004/03/03: Thomas Bretz
 
@@ -39,6 +56,9 @@
      - The calculation of the arrival times is made only when needed
        (when the HalfMax is over the pedestal)
+
    * mtools/MCubicSpline.cc
      - Commented out an annoying warn
+
+
 
  2004/03/03: Abelardo Moralejo
Index: trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 3390)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 3392)
@@ -45,4 +45,8 @@
 //  - added fPixRatioSqrt
 //
+// Version 3:
+// ----------
+//  - added fNumAreas
+//
 /////////////////////////////////////////////////////////////////////////////
 #include "MGeomCam.h"
@@ -166,4 +170,24 @@
 // --------------------------------------------------------------------------
 //
+// Calculate the highest area index+1 of all pixels, please make sure
+// the the area indices are continous.
+//
+void MGeomCam::CalcNumAreas()
+{
+    fNumAreas = 0;
+
+    for (UInt_t i=0; i<fNumPixels; i++)
+    {
+        const UInt_t s = (*this)[i].GetAidx();
+
+        if (s>fNumAreas)
+            fNumAreas = s;
+    }
+
+    fNumAreas++;
+}
+
+// --------------------------------------------------------------------------
+//
 // Calculate the maximum radius of the camera. This is ment for GUI layout.
 //
@@ -235,2 +259,24 @@
     return (TObject*)IsA()->New();
 }
+/*
+void MGeomCam::Streamer(TBuffer &R__b)
+{
+   // Stream an object of class MGeomCam.
+
+    if (R__b.IsReading())
+    {
+        MGeomCam::Class()->ReadBuffer(R__b, this);
+
+        UInt_t R__s, R__c;
+        Version_t R__v = b.ReadVersion(&R__s, &R__c);
+        if (R__v > 2) {
+            MGeomCam::Class()->ReadBuffer(b, this, R__v, R__s, R__c);
+
+        Version_t v = MGeomCam::Class()->GetClassVersion();
+   }
+   else
+   {
+       MGeomCam::Class()->WriteBuffer(R__b, this);
+   }
+}
+*/
Index: trunk/MagicSoft/Mars/mgeom/MGeomCam.h
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCam.h	(revision 3390)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCam.h	(revision 3392)
@@ -29,12 +29,15 @@
 
     UInt_t    fNumSectors;   // Number of sectors
+    UInt_t    fNumAreas;     // Number of different pixel sizes
 
 protected:
     void CalcMaxRadius();
     void CalcNumSectors();
+    void CalcNumAreas();
     void InitOuterRing();
     void InitGeometry()
     {
         CalcNumSectors();
+        CalcNumAreas();
         CalcMaxRadius();
         CalcPixRatio();
@@ -60,4 +63,5 @@
     Float_t GetMaxRadius() const  { return fMaxRadius; }
     UInt_t  GetNumSectors() const { return fNumSectors; }
+    UInt_t  GetNumAreas() const   { return fNumAreas; }
     Float_t GetPixRatio(UInt_t i) const;
     Float_t GetPixRatioSqrt(UInt_t i) const;
@@ -68,5 +72,5 @@
     virtual void Print(Option_t *opt=NULL) const;
 
-    ClassDef(MGeomCam, 2)  // Geometry base class for the camera
+    ClassDef(MGeomCam, 3)  // Geometry base class for the camera
 };
 
Index: trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc	(revision 3390)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc	(revision 3392)
@@ -329,5 +329,6 @@
     //
     for (UInt_t i=0; i<GetNumPixels(); i++)
-        (*this)[i].Set(xtemp[i], ytemp[i], i>396?60:30, sector[i]);
+        (*this)[i].Set(xtemp[i], ytemp[i], i>396?60:30, sector[i], i>396?1:0);
+    // (*this)[i].Set(xtemp[i], ytemp[i], i>396?60:30, i>396?sector[i]+6:sector[i]);
 }
 
Index: trunk/MagicSoft/Mars/mgeom/MGeomPix.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomPix.cc	(revision 3390)
+++ trunk/MagicSoft/Mars/mgeom/MGeomPix.cc	(revision 3392)
@@ -44,4 +44,8 @@
 //  - added fA
 //
+// Version 3:
+// ----------
+//  - added fAidx
+//
 //
 // FIXME: According to an agreement we have to change the name 'Id' to 'idx'
@@ -67,8 +71,8 @@
 // Initializes one pixel
 //
-MGeomPix::MGeomPix(Float_t x, Float_t y, Float_t r, UInt_t s)
+MGeomPix::MGeomPix(Float_t x, Float_t y, Float_t r, UInt_t s, UInt_t a)
 {
     //  default constructor
-    Set(x, y, r, s);
+    Set(x, y, r, s, a);
 }
 
Index: trunk/MagicSoft/Mars/mgeom/MGeomPix.h
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomPix.h	(revision 3390)
+++ trunk/MagicSoft/Mars/mgeom/MGeomPix.h	(revision 3392)
@@ -28,11 +28,12 @@
 
     UInt_t fSector;        // Number of sector the pixels corresponds to
+    UInt_t fAidx;          // Area index of the pixel
 
 public:
-    MGeomPix(Float_t x=0, Float_t y=0, Float_t d=0, UInt_t s=0);
+    MGeomPix(Float_t x=0, Float_t y=0, Float_t d=0, UInt_t s=0, UInt_t aidx=0);
 
     void Print(Option_t *opt=NULL) const;
 
-    void Set(Float_t x, Float_t y, Float_t d, UInt_t s=0) { fX=x; fY=y; fD=d; fA=d*d*gsTan60/2; fSector=s; }
+    void Set(Float_t x, Float_t y, Float_t d, UInt_t s=0, UInt_t aidx=0) { fX=x; fY=y; fD=d; fA=d*d*gsTan60/2; fSector=s; fAidx=aidx; }
 
     void SetNeighbors(Short_t i0=-1, Short_t i1=-1, Short_t i2=-1,
@@ -46,5 +47,6 @@
     UInt_t  GetSector() const { return fSector; }
 
-    Float_t GetA() const { return fA; /*fD*fD*gsTan60/2;*/ }
+    Float_t GetA() const    { return fA; /*fD*fD*gsTan60/2;*/ }
+    Int_t   GetAidx() const { return fAidx; }
 
     Byte_t  GetNumNeighbors() const { return fNumNeighbors; }
@@ -65,7 +67,6 @@
      */
 
-    ClassDef(MGeomPix, 1) // Geometry class describing the geometry of one pixel
+    ClassDef(MGeomPix, 3) // Geometry class describing the geometry of one pixel
 };
 
 #endif
-
