Index: trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 2195)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 2209)
@@ -46,4 +46,11 @@
 using namespace std;
 
+MGeomCam::MGeomCam()
+    : fNumPixels(0), fCamDist(0), fConvMm2Deg(0)
+{
+}
+
+
+
 // --------------------------------------------------------------------------
 //
@@ -52,29 +59,28 @@
 //
 MGeomCam::MGeomCam(UInt_t npix, Float_t dist, const char *name, const char *title)
-    : fNumPixels(npix), fCamDist(dist), fConvMm2Deg(kRad2Deg/(dist*1000))
+    : fNumPixels(npix), fCamDist(dist), fConvMm2Deg(kRad2Deg/(dist*1000)), fPixels(npix)
 {
     fName  = name  ? name  : "MGeomCam";
     fTitle = title ? title : "Storage container for  a camera geometry";
 
-    fPixels = new TObjArray(npix);
-
     //
     // make sure that the destructor delete all contained objects
     //
-    fPixels->SetOwner();
+    fPixels.SetOwner();
 
     for (UInt_t i=0; i<npix; i++)
-        (*fPixels)[i] = new MGeomPix;
+        fPixels[i] = new MGeomPix;
 
     SetReadyToSave();
 }
 
-// --------------------------------------------------------------------------
-//
-//  Destructor delete the pixel array with all pixels
-//
-MGeomCam::~MGeomCam()
+MGeomPix &MGeomCam::operator[](Int_t i)
 {
-    delete fPixels;
+    return *static_cast<MGeomPix*>(fPixels.UncheckedAt(i));
+}
+
+MGeomPix &MGeomCam::operator[](Int_t i) const
+{
+    return *static_cast<MGeomPix*>(fPixels.UncheckedAt(i));
 }
 
@@ -86,6 +92,5 @@
 void MGeomCam::InitOuterRing()
 {
-    for (UInt_t i=0; i<fNumPixels; i++)
-        (*this)[i].CheckOuterRing(*this);
+    fPixels.ForEach(MGeomPix, CheckOuterRing)(*this);
 }
 
@@ -134,9 +139,5 @@
     *fLog << all << " Number of Pixels (" << GetTitle() << "): " << fNumPixels << endl;
 
-    for (UInt_t i=0; i<fNumPixels; i++)
-    {
-        *fLog << " Pixel: " << i << "  ";
-        (*this)[i].Print();
-    }
+    fPixels.Print();
 } 
 
Index: trunk/MagicSoft/Mars/mgeom/MGeomCam.h
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCam.h	(revision 2195)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCam.h	(revision 2209)
@@ -14,11 +14,11 @@
 {
 private:
-    UInt_t   fNumPixels;  // Number of pixels in this camera
-    Float_t  fMaxRadius;  // maximum radius of the camera (eg. for GUI layout)
+    UInt_t    fNumPixels;  // Number of pixels in this camera
+    Float_t   fMaxRadius;  // maximum radius of the camera (eg. for GUI layout)
 
-    Float_t  fCamDist;    // [m] Average distance of the camera from the mirror
-    Float_t  fConvMm2Deg; // conversion factor to convert mm in the camera plain into degrees
+    Float_t   fCamDist;    // [m] Average distance of the camera from the mirror
+    Float_t   fConvMm2Deg; // conversion factor to convert mm in the camera plain into degrees
 
-    TObjArray *fPixels;   // Array of singel pixels storing the geometry
+    TObjArray fPixels;     // Array of singel pixels storing the geometry
 
 protected:
@@ -27,6 +27,6 @@
 
 public:
+    MGeomCam();
     MGeomCam(UInt_t npix, Float_t dist, const char *name=NULL, const char *title=NULL);
-    virtual ~MGeomCam();
 
     virtual TObject *Clone(const char *newname=NULL) const;
@@ -39,6 +39,6 @@
     Float_t GetPixRatio(UInt_t i) const;
 
-    MGeomPix &operator[](Int_t i)       { return *(MGeomPix*)fPixels->UncheckedAt(i); }
-    MGeomPix &operator[](Int_t i) const { return *(MGeomPix*)fPixels->UncheckedAt(i); }
+    MGeomPix &operator[](Int_t i);
+    MGeomPix &operator[](Int_t i) const;
 
     virtual void Print(Option_t *opt=NULL) const;
