Index: trunk/MagicSoft/Mars/mgui/MCamDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mgui/MCamDisplay.cc	(revision 2178)
+++ trunk/MagicSoft/Mars/mgui/MCamDisplay.cc	(revision 2189)
@@ -47,4 +47,5 @@
 #include <TCanvas.h>
 #include <TArrayF.h>
+#include <TRandom.h>
 #include <TClonesArray.h>
 
@@ -85,4 +86,5 @@
     fLegend    = NULL;
     fLegText   = NULL;
+    fPhotons   = NULL;
     fArrowX    = NULL;
     fArrowY    = NULL;
@@ -93,5 +95,5 @@
     fMaximum = 1;
 
-    fNotify = new TList;
+    fNotify  = NULL;
 }
 
@@ -199,23 +201,37 @@
 MCamDisplay::~MCamDisplay()
 {
-    fPixels->Delete();
-    fLegend->Delete();
-    fLegText->Delete();
-    fPhotons->Delete();
-
-    delete fPixels;
-    delete fLegend;
-    delete fLegText;
-    delete fPhotons;
-
-    delete fArrowX;
-    delete fArrowY;
-
-    delete fLegRadius;
-    delete fLegDegree;
-
-    delete fGeomCam;
-
-    delete fNotify;
+    if (fPixels)
+    {
+        fPixels->Delete();
+        delete fPixels;
+    }
+    if (fLegend)
+    {
+        fLegend->Delete();
+        delete fLegend;
+    }
+    if (fLegText)
+    {
+        fLegText->Delete();
+        delete fLegText;
+    }
+    if (fPhotons)
+    {
+        fPhotons->Delete();
+        delete fPhotons;
+    }
+
+    if (fArrowX)
+        delete fArrowX;
+    if (fArrowY)
+        delete fArrowY;
+    if (fLegRadius)
+        delete fLegRadius;
+    if (fLegDegree)
+        delete fLegDegree;
+    if (fGeomCam)
+        delete fGeomCam;
+    if (fNotify)
+        delete fNotify;
 }
 
@@ -227,4 +243,18 @@
 // created.
 //
+// To draw a camera into its own pad do something like:
+//
+// TCanvas *c = new TCanvas;
+// c->Divide(2,1);
+// MGeomCamMagic m;
+// MCamDisplay *d=new MCamDisplay(&m);
+// d->FillRandom();
+// c->cd(1);
+// gPad->SetBorderMode(0);
+// gPad->Divide(1,1);
+// gPad->cd(1);
+// d->Draw();
+// d->SetBit(kCanDelete);
+//
 void MCamDisplay::Draw(Option_t *option)
 {
@@ -235,11 +265,5 @@
     pad->SetBorderMode(0);
     pad->SetFillColor(16);
-    //pad->Modified();
-    /*
-    pad->Divide(1,1);
-    pad->cd(1);
-    gPad->SetBorderMode(0);
-    gPad->SetFillColor(16);
-*/
+
     AppendPad("");
 }
@@ -492,4 +516,16 @@
 }
 
+void MCamDisplay::FillRandom()
+{
+    Reset();
+
+    // FIXME: Security check missing!
+    for (UInt_t idx=0; idx<fNumPixels; idx++)
+    {
+        fData[idx] = gRandom->Uniform();
+        (*this)[idx].SetBit(kIsUsed);
+    }
+}
+
 // ------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mgui/MCamDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/MCamDisplay.h	(revision 2178)
+++ trunk/MagicSoft/Mars/mgui/MCamDisplay.h	(revision 2189)
@@ -45,5 +45,5 @@
     Float_t        fRange;       // the range in millimeters of the present geometry
 
-    TArrayI        fColors;
+    TArrayI        fColors;      // Color conversion table
 
     TArrow        *fArrowX;      // Coordinate System
@@ -58,9 +58,9 @@
     TClonesArray  *fPhotons;     // array of reflector photons
  
-    TArrayF        fData;
+    TArrayF        fData;        //
     Float_t        fMinimum;
     Float_t        fMaximum;
 
-    TList         *fNotify;
+    TList         *fNotify;      //!
 
     //TGStatusBar   *fStatusBar;
@@ -96,4 +96,5 @@
     void  Fill(const MCamEvent &event, Int_t type=0);
     void  Fill(const TArrayF &event, Bool_t ispos=kTRUE);
+    void  FillRandom();
 
     void  DrawPixelNumbers();
@@ -122,5 +123,5 @@
     //void SetStatusBar(TGStatusBar *bar) { fStatusBar = bar; }
 
-    ClassDef(MCamDisplay, 0) // Displays the magic camera
+    ClassDef(MCamDisplay, 1) // Displays the magic camera
 };
 
Index: trunk/MagicSoft/Mars/mgui/MHexagon.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/MHexagon.h	(revision 2178)
+++ trunk/MagicSoft/Mars/mgui/MHexagon.h	(revision 2189)
@@ -66,5 +66,5 @@
     Float_t GetD() const { return fD; }
 
-    ClassDef(MHexagon, 0)    // A hexagon for MAGIC
+    ClassDef(MHexagon, 1)    // A hexagon for MAGIC
 };
 
