Index: trunk/MagicSoft/Mars/mgui/GuiLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/GuiLinkDef.h	(revision 588)
+++ trunk/MagicSoft/Mars/mgui/GuiLinkDef.h	(revision 589)
@@ -12,4 +12,10 @@
 #pragma link C++ class MGPrototyp;
 
+#pragma link C++ class MHexagon;
+#pragma link C++ class MPixGeom; 
+#pragma link C++ class MCamGeom;
+
+#pragma link C++ class MCamDisplay;
+
 //#pragma link C++ class MDumpEvtHeader;
 
Index: trunk/MagicSoft/Mars/mgui/MCamGeom.cc
===================================================================
--- trunk/MagicSoft/Mars/mgui/MCamGeom.cc	(revision 589)
+++ trunk/MagicSoft/Mars/mgui/MCamGeom.cc	(revision 589)
@@ -0,0 +1,403 @@
+#include "MCamGeom.h"
+
+#include <math.h>
+#include <TClonesArray.h>
+#include "TCanvas.h"
+
+#include "MHexagon.h"
+
+ClassImp(MPixGeom)
+ClassImp(MCamGeom)
+
+MPixGeom::MPixGeom(Float_t x, Float_t y, Float_t r ) 
+{ 
+  //  default constructor
+  fX = x ; 
+  fY = y ; 
+  fR = r ; 
+} 
+
+
+void MPixGeom::Print() 
+{ 
+  //   information about a pixel
+  cout << "MPixGeom:  x= " << fX
+       << "  y= " << fY
+       << "  r= " << fR
+       << endl ; 
+} 
+
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+
+MCamGeom::MCamGeom (Int_t type ) 
+{ 
+  //    default constructor
+
+  if ( type == 1 ) {
+    // set up the Geometry of CT1 
+    
+    fNbPixels = 127 ; 
+    fPixels = new TObjArray ( fNbPixels ) ; 
+    
+    CreateCT1() ; 
+  } 
+  else { 
+    // set up the standard Geometry MAGIC
+    fNbPixels = 577 ; 
+    fPixels = new TObjArray ( fNbPixels ) ; 
+
+    CreateMagic() ; 
+  } 
+} 
+
+void MCamGeom::Draw( Option_t * ) 
+{ 
+  TCanvas *can = new TCanvas("can", "Camera Geometry", 4 ) ; 
+  
+  //   set the range of the canvas
+  if ( fNbPixels == 127 )        // case of CT1
+    can->Range(-175, -175, 175, 175 ) ; 
+  else
+    can->Range(-600, -600, 600, 600 ) ; 
+
+  //   draw all pixels
+  
+  for ( Int_t i=0; i < fNbPixels ; i++ ) {   
+    MHexagon *el = new MHexagon ( GetX(i) , GetY(i) , GetR(i) )    ;   
+    el->Draw() ;     
+  } 
+  
+} 
+
+void MCamGeom::Print() 
+{ 
+  //   Print Information about the Geometry of the camera
+  cout << "++++++++++++++++++++++++++++++++++++++++" << endl ; 
+  cout << " Number of Pixels: " << fNbPixels << endl ; 
+
+  for ( Int_t i=0; i<fNbPixels; i++ ) { 
+    cout << " Pixel: " << i << "  " ; 
+    ((MPixGeom *)fPixels->At(i))->Print() ;  
+  } 
+} 
+
+Int_t MCamGeom::GetNbPixels () 
+{ 
+  //   return the Number of pixels in the MCamGeom class
+  return fNbPixels ; 
+
+} 
+Float_t MCamGeom::GetX(Int_t iPix) 
+{
+  //   return the X coordinate of Pixel iPix 
+
+  return ( ((MPixGeom*) fPixels->At(iPix))->GetX() ) ; 
+} 
+
+Float_t MCamGeom::GetY(Int_t iPix) 
+{
+  //   return the Y coordinate of Pixel iPix 
+  return ( ((MPixGeom*) fPixels->At(iPix))->GetY() ) ;  
+}
+
+Float_t MCamGeom::GetR(Int_t iPix) 
+{
+  //   return the radius r of Pixel iPix 
+  return ( ((MPixGeom*) fPixels->At(iPix))->GetR() ) ; 
+}
+
+
+void MCamGeom::CreateMagic() 
+{ 
+  //   fill the geometry class with the coordinates of the MAGIC camera
+  cout << " Create Magic geometry " << endl ;
+
+  //   here define the hardwire things of the magic telescope
+  //
+  Float_t xtemp[577] = { 
+    0.000,   30.000,   15.000,  -15.000,  -30.000,  -15.000,   15.000,   60.000,
+   45.000,   30.000,    0.000,  -30.000,  -45.000,  -60.000,  -45.000,  -30.000,
+    0.000,   30.000,   45.000,   90.000,   75.000,   60.000,   45.000,   15.000,
+  -15.000,  -45.000,  -60.000,  -75.000,  -90.000,  -75.000,  -60.000,  -45.000,
+  -15.000,   15.000,   45.000,   60.000,   75.000,  120.000,  105.000,   90.000,
+   75.000,   60.000,   30.000,    0.000,  -30.000,  -60.000,  -75.000,  -90.000,
+ -105.000, -120.000, -105.000,  -90.000,  -75.000,  -60.000,  -30.000,    0.000,
+   30.000,   60.000,   75.000,   90.000,  105.000,  150.000,  135.000,  120.000,
+  105.000,   90.000,   75.000,   45.000,   15.000,  -15.000,  -45.000,  -75.000,
+  -90.000, -105.000, -120.000, -135.000, -150.000, -135.000, -120.000, -105.000,
+  -90.000,  -75.000,  -45.000,  -15.000,   15.000,   45.000,   75.000,   90.000,
+  105.000,  120.000,  135.000,  180.000,  165.000,  150.000,  135.000,  120.000,
+  105.000,   90.000,   60.000,   30.000,    0.000,  -30.000,  -60.000,  -90.000,
+ -105.000, -120.000, -135.000, -150.000, -165.000, -180.000, -165.000, -150.000,
+ -135.000, -120.000, -105.000,  -90.000,  -60.000,  -30.000,    0.000,   30.000,
+   60.000,   90.000,  105.000,  120.000,  135.000,  150.000,  165.000,  210.000,
+  195.000,  180.000,  165.000,  150.000,  135.000,  120.000,  105.000,   75.000,
+   45.000,   15.000,  -15.000,  -45.000,  -75.000, -105.000, -120.000, -135.000,
+ -150.000, -165.000, -180.000, -195.000, -210.000, -195.000, -180.000, -165.000,
+ -150.000, -135.000, -120.000, -105.000,  -75.000,  -45.000,  -15.000,   15.000,
+   45.000,   75.000,  105.000,  120.000,  135.000,  150.000,  165.000,  180.000,
+  195.000,  240.000,  225.000,  210.000,  195.000,  180.000,  165.000,  150.000,
+  135.000,  120.000,   90.000,   60.000,   30.000,    0.000,  -30.000,  -60.000,
+  -90.000, -120.000, -135.000, -150.000, -165.000, -180.000, -195.000, -210.000,
+ -225.000, -240.000, -225.000, -210.000, -195.000, -180.000, -165.000, -150.000,
+ -135.000, -120.000,  -90.000,  -60.000,  -30.000,    0.000,   30.000,   60.000,
+   90.000,  120.000,  135.000,  150.000,  165.000,  180.000,  195.000,  210.000,
+  225.000,  270.000,  255.000,  240.000,  225.000,  210.000,  195.000,  180.000,
+  165.000,  150.000,  135.000,  105.000,   75.000,   45.000,   15.000,  -15.000,
+  -45.000,  -75.000, -105.000, -135.000, -150.000, -165.000, -180.000, -195.000,
+ -210.000, -225.000, -240.000, -255.000, -270.000, -255.000, -240.000, -225.000,
+ -210.000, -195.000, -180.000, -165.000, -150.000, -135.000, -105.000,  -75.000,
+  -45.000,  -15.000,   15.000,   45.000,   75.000,  105.000,  135.000,  150.000,
+  165.000,  180.000,  195.000,  210.000,  225.000,  240.000,  255.000,  300.000,
+  285.000,  270.000,  255.000,  240.000,  225.000,  210.000,  195.000,  180.000,
+  165.000,  150.000,  120.000,   90.000,   60.000,   30.000,    0.000,  -30.000,
+  -60.000,  -90.000, -120.000, -150.000, -165.000, -180.000, -195.000, -210.000,
+ -225.000, -240.000, -255.000, -270.000, -285.000, -300.000, -285.000, -270.000,
+ -255.000, -240.000, -225.000, -210.000, -195.000, -180.000, -165.000, -150.000,
+ -120.000,  -90.000,  -60.000,  -30.000,    0.000,   30.000,   60.000,   90.000,
+  120.000,  150.000,  165.000,  180.000,  195.000,  210.000,  225.000,  240.000,
+  255.000,  270.000,  285.000,  330.000,  315.000,  300.000,  285.000,  270.000,
+  255.000,  240.000,  225.000,  210.000,  195.000,  180.000,  165.000,  135.000,
+  105.000,   75.000,   45.000,   15.000,  -15.000,  -45.000,  -75.000, -105.000,
+ -135.000, -165.000, -180.000, -195.000, -210.000, -225.000, -240.000, -255.000,
+ -270.000, -285.000, -300.000, -315.000, -330.000, -315.000, -300.000, -285.000,
+ -270.000, -255.000, -240.000, -225.000, -210.000, -195.000, -180.000, -165.000,
+ -135.000, -105.000,  -75.000,  -45.000,  -15.000,   15.000,   45.000,   75.000,
+  105.000,  135.000,  165.000,  180.000,  195.000,  210.000,  225.000,  240.000,
+  255.000,  270.000,  285.000,  300.000,  315.000,  360.000,  330.000,  300.000,
+  270.000,  240.000,  210.000,  150.000,   90.000,   30.000,  -30.000,  -90.000,
+ -150.000, -210.000, -240.000, -270.000, -300.000, -330.000, -360.000, -360.000,
+ -330.000, -300.000, -270.000, -240.000, -210.000, -150.000,  -90.000,  -30.000,
+   30.000,   90.000,  150.000,  210.000,  240.000,  270.000,  300.000,  330.000,
+  360.000,  420.000,  390.000,  360.000,  330.000,  300.000,  270.000,  240.000,
+  180.000,  120.000,   60.000,    0.000,  -60.000, -120.000, -180.000, -240.000,
+ -270.000, -300.000, -330.000, -360.000, -390.000, -420.000, -420.000, -390.000,
+ -360.000, -330.000, -300.000, -270.000, -240.000, -180.000, -120.000,  -60.000,
+    0.000,   60.000,  120.000,  180.000,  240.000,  270.000,  300.000,  330.000,
+  360.000,  390.000,  420.000,  480.000,  450.000,  420.000,  390.000,  360.000,
+  330.000,  300.000,  270.000,  210.000,  150.000,   90.000,   30.000,  -30.000,
+  -90.000, -150.000, -210.000, -270.000, -300.000, -330.000, -360.000, -390.000,
+ -420.000, -450.000, -480.000, -480.000, -450.000, -420.000, -390.000, -360.000,
+ -330.000, -300.000, -270.000, -210.000, -150.000,  -90.000,  -30.000,   30.000,
+   90.000,  150.000,  210.000,  270.000,  300.000,  330.000,  360.000,  390.000,
+  420.000,  450.000,  480.000,  540.000,  510.000,  480.000,  450.000,  420.000,
+  390.000,  360.000,  330.000,  300.000,  240.000,  180.000,  120.000,   60.000,
+    0.000,  -60.000, -120.000, -180.000, -240.000, -300.000, -330.000, -360.000,
+ -390.000, -420.000, -450.000, -480.000, -510.000, -540.000, -540.000, -510.000,
+ -480.000, -450.000, -420.000, -390.000, -360.000, -330.000, -300.000, -240.000,
+ -180.000, -120.000,  -60.000,    0.000,   60.000,  120.000,  180.000,  240.000,
+  300.000,  330.000,  360.000,  390.000,  420.000,  450.000,  480.000,  510.000,
+  540.000 
+  } ; 
+
+  Float_t ytemp[577] = { 
+    0.000,    0.000,   25.981,   25.981,    0.000,  -25.981,  -25.981,    0.000,
+   25.981,   51.961,   51.961,   51.961,   25.981,    0.000,  -25.981,  -51.961,
+  -51.961,  -51.961,  -25.981,    0.000,   25.981,   51.961,   77.942,   77.942,
+   77.942,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,  -77.942,
+  -77.942,  -77.942,  -77.942,  -51.961,  -25.981,    0.000,   25.981,   51.961,
+   77.942,  103.923,  103.923,  103.923,  103.923,  103.923,   77.942,   51.961,
+   25.981,    0.000,  -25.981,  -51.961,  -77.942, -103.923, -103.923, -103.923,
+ -103.923, -103.923,  -77.942,  -51.961,  -25.981,    0.000,   25.981,   51.961,
+   77.942,  103.923,  129.904,  129.904,  129.904,  129.904,  129.904,  129.904,
+  103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,  -77.942,
+ -103.923, -129.904, -129.904, -129.904, -129.904, -129.904, -129.904, -103.923,
+  -77.942,  -51.961,  -25.981,    0.000,   25.981,   51.961,   77.942,  103.923,
+  129.904,  155.885,  155.885,  155.885,  155.885,  155.885,  155.885,  155.885,
+  129.904,  103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,
+  -77.942, -103.923, -129.904, -155.885, -155.885, -155.885, -155.885, -155.885,
+ -155.885, -155.885, -129.904, -103.923,  -77.942,  -51.961,  -25.981,    0.000,
+   25.981,   51.961,   77.942,  103.923,  129.904,  155.885,  181.865,  181.865,
+  181.865,  181.865,  181.865,  181.865,  181.865,  181.865,  155.885,  129.904,
+  103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,  -77.942,
+ -103.923, -129.904, -155.885, -181.865, -181.865, -181.865, -181.865, -181.865,
+ -181.865, -181.865, -181.865, -155.885, -129.904, -103.923,  -77.942,  -51.961,
+  -25.981,    0.000,   25.981,   51.961,   77.942,  103.923,  129.904,  155.885,
+  181.865,  207.846,  207.846,  207.846,  207.846,  207.846,  207.846,  207.846,
+  207.846,  207.846,  181.865,  155.885,  129.904,  103.923,   77.942,   51.961,
+   25.981,    0.000,  -25.981,  -51.961,  -77.942, -103.923, -129.904, -155.885,
+ -181.865, -207.846, -207.846, -207.846, -207.846, -207.846, -207.846, -207.846,
+ -207.846, -207.846, -181.865, -155.885, -129.904, -103.923,  -77.942,  -51.961,
+  -25.981,    0.000,   25.981,   51.961,   77.942,  103.923,  129.904,  155.885,
+  181.865,  207.846,  233.827,  233.827,  233.827,  233.827,  233.827,  233.827,
+  233.827,  233.827,  233.827,  233.827,  207.846,  181.865,  155.885,  129.904,
+  103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,  -77.942,
+ -103.923, -129.904, -155.885, -181.865, -207.846, -233.827, -233.827, -233.827,
+ -233.827, -233.827, -233.827, -233.827, -233.827, -233.827, -233.827, -207.846,
+ -181.865, -155.885, -129.904, -103.923,  -77.942,  -51.961,  -25.981,    0.000,
+   25.981,   51.961,   77.942,  103.923,  129.904,  155.885,  181.865,  207.846,
+  233.827,  259.808,  259.808,  259.808,  259.808,  259.808,  259.808,  259.808,
+  259.808,  259.808,  259.808,  259.808,  233.827,  207.846,  181.865,  155.885,
+  129.904,  103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,
+  -77.942, -103.923, -129.904, -155.885, -181.865, -207.846, -233.827, -259.808,
+ -259.808, -259.808, -259.808, -259.808, -259.808, -259.808, -259.808, -259.808,
+ -259.808, -259.808, -233.827, -207.846, -181.865, -155.885, -129.904, -103.923,
+  -77.942,  -51.961,  -25.981,    0.000,   25.981,   51.961,   77.942,  103.923,
+  129.904,  155.885,  181.865,  207.846,  233.827,  259.808,  285.788,  285.788,
+  285.788,  285.788,  285.788,  285.788,  285.788,  285.788,  285.788,  285.788,
+  285.788,  285.788,  259.808,  233.827,  207.846,  181.865,  155.885,  129.904,
+  103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,  -77.942,
+ -103.923, -129.904, -155.885, -181.865, -207.846, -233.827, -259.808, -285.788,
+ -285.788, -285.788, -285.788, -285.788, -285.788, -285.788, -285.788, -285.788,
+ -285.788, -285.788, -285.788, -259.808, -233.827, -207.846, -181.865, -155.885,
+ -129.904, -103.923,  -77.942,  -51.961,  -25.981,   34.641,   86.603,  138.564,
+  190.526,  242.487,  294.449,  329.090,  329.090,  329.090,  329.090,  329.090,
+  329.090,  294.449,  242.487,  190.526,  138.564,   86.603,   34.641,  -34.641,
+  -86.603, -138.564, -190.526, -242.487, -294.449, -329.090, -329.090, -329.090,
+ -329.090, -329.090, -329.090, -294.449, -242.487, -190.526, -138.564,  -86.603,
+  -34.641,   34.641,   86.603,  138.564,  190.526,  242.487,  294.449,  346.410,
+  381.051,  381.051,  381.051,  381.051,  381.051,  381.051,  381.051,  346.410,
+  294.449,  242.487,  190.526,  138.564,   86.603,   34.641,  -34.641,  -86.603,
+ -138.564, -190.526, -242.487, -294.449, -346.410, -381.051, -381.051, -381.051,
+ -381.051, -381.051, -381.051, -381.051, -346.410, -294.449, -242.487, -190.526,
+ -138.564,  -86.603,  -34.641,   34.641,   86.603,  138.564,  190.526,  242.487,
+  294.449,  346.410,  398.372,  433.013,  433.013,  433.013,  433.013,  433.013,
+  433.013,  433.013,  433.013,  398.372,  346.410,  294.449,  242.487,  190.526,
+  138.564,   86.603,   34.641,  -34.641,  -86.603, -138.564, -190.526, -242.487,
+ -294.449, -346.410, -398.372, -433.013, -433.013, -433.013, -433.013, -433.013,
+ -433.013, -433.013, -433.013, -398.372, -346.410, -294.449, -242.487, -190.526,
+ -138.564,  -86.603,  -34.641,   34.641,   86.603,  138.564,  190.526,  242.487,
+  294.449,  346.410,  398.372,  450.333,  484.974,  484.974,  484.974,  484.974,
+  484.974,  484.974,  484.974,  484.974,  484.974,  450.333,  398.372,  346.410,
+  294.449,  242.487,  190.526,  138.564,   86.603,   34.641,  -34.641,  -86.603,
+ -138.564, -190.526, -242.487, -294.449, -346.410, -398.372, -450.333, -484.974,
+ -484.974, -484.974, -484.974, -484.974, -484.974, -484.974, -484.974, -484.974,
+ -450.333, -398.372, -346.410, -294.449, -242.487, -190.526, -138.564,  -86.603,
+ -34.641
+  } ; 
+
+  Float_t rtemp[577] = { 
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,30.00,30.00,30.00,
+    30.00,30.00,30.00,30.00,30.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,
+    60.00,60.00,60.00,60.00,60.00,60.00,60.00,60.00,  
+    60.00  } ; 
+  
+  //   fill the pixels list with this data
+  
+  for ( Int_t i = 0 ; i< fNbPixels ; i++ ) {     
+    fPixels->Add( new MPixGeom(xtemp[i], ytemp[i], rtemp[i]) ) ;     
+  }   
+} 
+
+void MCamGeom::CreateCT1() 
+{  
+  //   fill the geometry class with the coordinates of the CT1 camera
+   cout << " Create CT1 geometry " << endl ; 
+   //      use a function from Martin Kestel
+   
+   float  fpixdiameter = 21. ;    // units are cm 
+   int ring_counter=1, ipix; 
+   int num_pix_this_ring;
+   int new_ring_start, end_this_ring;
+   int end_last_ring = 1; 
+   float fang, ffrac_ang, frad;
+   float pi=4.*atan(1.);
+
+   //  add the first pixel to the list 
+
+   fPixels->Add( new MPixGeom(  0. ,0., fpixdiameter ) ) ; 
+   for (ring_counter=1;ring_counter<7;ring_counter++) {
+     /* calc. numofpix in ring number i first */
+     num_pix_this_ring = ring_counter*6;
+     
+     /* get then the start-of-ring pixel number */
+     new_ring_start = end_last_ring;
+     
+     /* .... this means the ring ends with pixnum ... */
+     end_this_ring = end_last_ring + num_pix_this_ring;
+     
+     /* calc. coords for this ring counting from the 
+	starting number to the ending number */
+     for (ipix = 0; 
+	  ipix < num_pix_this_ring; 
+	  ipix++) {
+       fang = 60./(float)ring_counter * (float)ipix;
+       ffrac_ang = fang - 60.*((int)(floor(fang/60.)));
+       fang *= pi/180.;
+       ffrac_ang *= pi/180.;
+       frad = (float)ring_counter * fpixdiameter ;
+       frad *= sqrt(3.)/(2.*sin(2./3.*pi-ffrac_ang));
+      
+       //   fill the ObjArray with the pixels data ; 
+
+       fPixels->Add( new MPixGeom(  frad * cos(fang) ,frad * sin(fang) , fpixdiameter ) ) ; 
+     }
+    
+    /* set the end-of-ring number correctly */
+    end_last_ring = end_this_ring ;
+  }
+
+} 
+
Index: trunk/MagicSoft/Mars/mgui/MCamGeom.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/MCamGeom.h	(revision 589)
+++ trunk/MagicSoft/Mars/mgui/MCamGeom.h	(revision 589)
@@ -0,0 +1,90 @@
+#ifndef MCAMGEOM_H
+#define MCAMGEOM_H
+
+#include <iostream>
+
+#include "MAGIC.h"
+
+class TObjArray ; 
+
+class MPixGeom : public TObject
+{ 
+ private:
+  Float_t  fX ;  //   the x coordinate 
+  Float_t  fY ;  //   the y coordinate
+  Float_t  fR ;  //   the y coordinate
+
+ public:
+  
+  MPixGeom(Float_t x=0. , Float_t y=0., Float_t r=0.) ; 
+  
+  void Print() ; 
+  
+  void SetX ( Float_t x ) 
+    {
+      fX = x ; 
+    }
+  
+  void SetY ( Float_t y ) 
+    {
+      fY = y ; 
+    }
+   
+  void SetR ( Float_t r ) 
+    {
+      fR = r ; 
+    }
+  
+  Float_t GetX() 
+    { 
+      return fX ; 
+    } 
+   
+  Float_t GetY() 
+    { 
+      return fY ; 
+    } 
+  
+  Float_t GetR()
+    { 
+      return fR ; 
+    } 
+  
+
+  ClassDef(MPixGeom, 1)		// Geometric class for the pixel
+} ; 
+
+
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+class MCamGeom
+{
+ private: 
+  Int_t         fNbPixels ;   // 
+  TObjArray     *fPixels   ;  //!
+  
+  void CreateMagic() ; 
+  void CreateCT1() ; 
+  
+ public:
+  
+  MCamGeom( Int_t type=0 ) ; 
+
+  void Draw(Option_t *option = "" ) ; 
+ 
+  Int_t    GetNbPixels() ; 
+  Float_t  GetX(Int_t iPix ) ; 
+  Float_t  GetY(Int_t iPix ) ; 
+  Float_t  GetR(Int_t iPix ) ; 
+  
+  void Print() ; 
+
+  
+
+  ClassDef(MCamGeom, 1)		// Base (abstract) class for a task
+};
+
+#endif
+
Index: trunk/MagicSoft/Mars/mgui/MHexagon.cc
===================================================================
--- trunk/MagicSoft/Mars/mgui/MHexagon.cc	(revision 589)
+++ trunk/MagicSoft/Mars/mgui/MHexagon.cc	(revision 589)
@@ -0,0 +1,206 @@
+#include <stdlib.h>
+#include <fstream.h>
+#include <iostream.h>
+
+#include "TROOT.h" 
+#include "TVirtualPad.h" 
+#include "TMath.h" 
+
+#include "MHexagon.h" 
+
+
+ClassImp(MHexagon) 
+
+  //
+  //  The class MHexagon is needed for the Event Display of
+  //  MAGIC.
+
+
+
+MHexagon::MHexagon() : TObject(), TAttLine(), TAttFill()
+{
+  //   default constructor for MHexagon 
+
+} 
+
+MHexagon::MHexagon(Float_t x, Float_t y, Float_t d ) : TObject(), TAttLine(), TAttFill(0, 1001)
+{ 
+  //    normal constructor for MHexagon
+  fX = x ; 
+  fY = y ; 
+  fD = d ; 
+
+} 
+MHexagon::MHexagon( const MHexagon &hexagon)
+{
+  //    copy constructor for MHexagon 
+  ((MHexagon&) hexagon).Copy(*this) ; 
+} 
+
+MHexagon::~MHexagon()
+{ 
+  //     default destructor for MHexagon
+
+}  
+
+void MHexagon::Copy( TObject &obj ) 
+{ 
+  //     copy this hexagon to hexagon 
+
+  TObject::Copy  ( obj ) ; 
+  TAttLine::Copy (((MHexagon&) obj ) ) ; 
+  TAttFill::Copy (((MHexagon&) obj ) ) ; 
+ 
+  ((MHexagon&) obj).fX = fX ; 
+  ((MHexagon&) obj).fY = fY ; 
+  ((MHexagon&) obj).fD = fD ;     
+} 
+Int_t MHexagon::DistancetoPrimitive( Int_t px, Int_t py ) 
+{ 
+  //   compute the distance of a point (px,py) to the Hexagon 
+  //   this functions needed for graphical primitives, that
+  //   means without this function you are not able to interact
+  //   with the graphical primitive with the mouse!!!
+  //
+  //   All calcutations are running in pixel coordinates
+  
+  //       compute the distance of the Point to the center of the Hexagon
+
+  Int_t  pxhex = gPad->XtoAbsPixel( fX ) ; 
+  Int_t  pyhex = gPad->YtoAbsPixel( fY ) ; 
+
+  Double_t DistPointHexagon = TMath::Sqrt( Double_t ((pxhex-px)*(pxhex-px) + (pyhex-py)*(pyhex-py))) ; 
+  Double_t cosa = TMath::Abs(px-pxhex) / DistPointHexagon ; 
+  Double_t sina = TMath::Abs(py-pyhex) / DistPointHexagon ; 
+
+  //       comput the distance to pixel border 
+  
+  Double_t   dx = fD * cosa / 2 ; 
+  Double_t   dy = fD * sina / 2 ; 
+  
+  Double_t   xborder = fX + dx ; 
+  Double_t   yborder = fY + dy ; 
+
+  Int_t  pxborder = gPad->XtoAbsPixel( xborder ) ; 
+  Int_t  pyborder = gPad->YtoAbsPixel( yborder ) ; 
+  
+  Double_t DistBorderHexagon = TMath::Sqrt( Double_t ((pxborder-pxhex)*(pxborder-pxhex)+(pyborder-pyhex)*(pyborder-pyhex))) ;  
+  
+ 
+  //       compute the distance from the border of Pixel  
+  //       here in the first implementation is just circle inside
+
+  if ( DistBorderHexagon <  DistPointHexagon )
+    return 999999 ; 
+  else   
+    //  return Int_t ( DistBorderHexagon - DistPointHexagon ) ; 
+    return 0 ; 
+} 
+
+
+void MHexagon::Draw(Option_t *option ) 
+{ 
+  //   Draw this ellipse with its current attributes
+  AppendPad(option) ; 
+} 
+
+void MHexagon::DrawHexagon( Float_t x, Float_t y, Float_t d ) 
+{ 
+  //   Draw this ellipse with new coordinate
+  
+  MHexagon *newhexagon = new MHexagon(x, y, d ) ; 
+  TAttLine::Copy(*newhexagon) ; 
+  TAttFill::Copy(*newhexagon) ; 
+
+  newhexagon->SetBit (kCanDelete) ; 
+  newhexagon->AppendPad() ; 
+} 
+
+void MHexagon::ExecuteEvent(Int_t event, Int_t px, Int_t py ) { 
+  //    This is the first test of implementing a clickable interface
+  //    for one pixel
+
+  switch ( event ) { 
+
+  case kButton1Down: 
+    
+    printf ("\n kButton1Down \n" ) ; 
+    SetFillColor(2) ;
+    gPad->Modified() ; 
+    break;     
+
+  case kButton1Double: 
+    SetFillColor(0) ;
+    gPad->Modified() ; 
+    break;     
+    //  case kMouseEnter:  
+    //     printf ("\n Mouse inside object \n" ) ; 
+    //     break; 
+  } 
+
+} 
+
+
+
+void MHexagon::ls( Option_t *)
+{
+  //     list this hexagon with its attributes
+  TROOT::IndentLevel() ; 
+  printf ("%s:  X= %f  Y= %f R= %f \n", GetName, fX, fY, fD ) ; 
+} 
+
+void MHexagon::Paint(Option_t * ) 
+{
+  //     paint this hexagon with its attribute
+
+  PaintHexagon(fX, fY, fD ) ; 
+} 
+
+
+void MHexagon::PaintHexagon (Float_t inX, Float_t inY, Float_t inD ) 
+{ 
+  //      draw this hexagon with the coordinates
+
+  const Int_t np =  6 ; 
+  
+  Float_t dx[np+1] = { .5   , 0.    , -.5   , -.5   , 0.    ,  .5   , .5    } ; 
+  Float_t dy[np+1] = { .2886,  .5772,  .2886, -.2886, -.5772, -.2886, .2886 } ; 
+
+  static Float_t x[np+1], y[np+1] ; 
+  
+  TAttLine::Modify() ;    // Change line attributes only if neccessary
+  TAttFill::Modify() ;    // Change fill attributes only if neccessary
+    
+  //  calculate the positions of the pixel corners
+
+  for ( Int_t i=0; i<=np; i++ ) { 
+    x[i] = inX + dx[i]* inD ; 
+    y[i] = inY + dy[i]* inD ; 
+  } 
+
+  //   paint the pixel (hopefully) 
+  
+  if ( GetFillColor() ) gPad->PaintFillArea(np, x, y) ; 
+  if ( GetLineStyle() ) gPad->PaintPolyLine(np+1, x, y) ; 
+  
+} 
+
+void MHexagon::Print( Option_t * )
+{
+  //     print/dump this hexagon with its attributes
+  printf ("Ellipse:  X= %f  Y= %f R= %f ", fX, fY, fD ) ; 
+  
+  if ( GetLineColor() != 1 ) printf (" Color=%d", GetLineColor() ) ; 
+  if ( GetLineStyle() != 1 ) printf (" Color=%d", GetLineStyle() ) ; 
+  if ( GetLineWidth() != 1 ) printf (" Color=%d", GetLineWidth() ) ;
+
+  if ( GetFillColor() != 0 ) printf (" FillColor=%d", GetFillColor() ) ; 
+
+  printf ("\n") ; 
+} 
+
+
+
+
+
+
Index: trunk/MagicSoft/Mars/mgui/MHexagon.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/MHexagon.h	(revision 589)
+++ trunk/MagicSoft/Mars/mgui/MHexagon.h	(revision 589)
@@ -0,0 +1,57 @@
+#ifndef M_HEXAGON
+#define M_HEXAGON
+
+//////////////////////////////////////////////////////////////
+//
+//   MHexagon
+//
+//   A Hexagon for the MAGIC event display
+//
+//////////////////////////////////////////////////////////////
+
+#ifndef ROOT_TObject
+#include "TObject.h" 
+#endif 
+
+#ifndef ROOT_TAttLine
+#include "TAttLine.h"
+#endif 
+
+#ifndef ROOT_TAttFill
+#include "TAttFill.h" 
+#endif 
+
+class MHexagon : public TObject, public TAttLine, public TAttFill 
+{ 
+ protected: 
+  
+  Float_t      fX ;  // X coordinate  of center
+  Float_t      fY ;  // Y coordinate  of center
+  Float_t      fD ;  // diameter D or better distance between opposite sides
+  
+ public: 
+  
+  MHexagon() ; 
+  MHexagon(Float_t x, Float_t y, Float_t d ) ; 
+  MHexagon( const MHexagon &hexagon) ; 
+  virtual ~MHexagon() ; 
+
+  void Copy ( TObject &hexagon ) ; 
+
+  virtual Int_t  DistancetoPrimitive(Int_t px, Int_t py ) ; 
+  virtual void   Draw( Option_t *Option="") ; 
+  virtual void   DrawHexagon( Float_t x, Float_t y, Float_t d ) ; 
+  
+  virtual void   ExecuteEvent(Int_t event, Int_t px, Int_t py ) ;  
+  
+  virtual void   ls (Option_t *Option="") ; 
+  virtual void   Paint(Option_t *Option="") ; 
+  virtual void   PaintHexagon(Float_t x, Float_t y, Float_t d) ; 
+  virtual void   Print(Option_t *Option="") ;
+
+  ClassDef ( MHexagon, 1 )    //  a hexagon for MAGIC
+
+} ; 
+
+#endif  
+
Index: trunk/MagicSoft/Mars/mgui/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mgui/Makefile	(revision 588)
+++ trunk/MagicSoft/Mars/mgui/Makefile	(revision 589)
@@ -56,5 +56,8 @@
 	   MGDataCheckMain.cc \
 	   MGMonteCarloMain.cc \
-	   MGPrototyp.cc
+	   MGPrototyp.cc \
+           MHexagon.cc \
+	   MCamGeom.cc \
+	   MCamDisplay.cc
 
 
