Index: trunk/MagicSoft/Mars/mgui/MCamDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mgui/MCamDisplay.cc	(revision 595)
+++ trunk/MagicSoft/Mars/mgui/MCamDisplay.cc	(revision 595)
@@ -0,0 +1,112 @@
+#include "MCamDisplay.h"
+
+#include <math.h>
+#include <TClonesArray.h>
+#include "TCanvas.h"
+#include "TStyle.h"
+
+#include "MHexagon.h"
+#include "MCamGeom.h"
+
+#include "MNphotEvent.h" 
+
+
+ClassImp(MCamDisplay)
+
+MCamDisplay::MCamDisplay (Int_t type ) 
+{ 
+  //    default constructor
+  
+
+  MCamGeom *geometry  = new MCamGeom( type ) ; 
+
+  fNbPixels = geometry->GetNbPixels() ; 
+  fPixels = new TClonesArray("MHexagon", fNbPixels ) ; 
+
+  //  create the hexagons of the display
+  // 
+  
+  TClonesArray &obj = *fPixels ; 
+  
+  for (Int_t i=0; i< fNbPixels; i++ ) 
+    { 
+      new (obj[i]) MHexagon(geometry->GetX(i) , 
+			    geometry->GetY(i) , 
+			    geometry->GetR(i) ) ; 
+    } 
+} 
+
+MCamDisplay::~MCamDisplay() 
+{ 
+  delete fPixels ; 
+} 
+
+
+void MCamDisplay::Init() 
+{ 
+  if ( ! gPad ) new TCanvas("display", "MAGIC display", 0, 0, 600, 500) ;
+
+  for (Int_t i=0; i< fNbPixels; i++) 
+    { 
+      ( (MHexagon*) fPixels->At(i))->Draw() ; 
+    } 
+
+} 
+
+
+void MCamDisplay::Draw(Option_t *option  ) 
+{
+  // 
+
+  //  check if there a pad exists
+
+  if ( ! gPad ) Init() ; 
+
+  gPad->Range (-600, -600, 600, 600) ; 
+  gPad->SetFillColor(22) ; 
+  
+  gStyle->SetPalette(1, 0) ; 
+
+  
+  
+  gPad->Modified() ; 
+  gPad->Update() ; 
+
+  //gPad->Update() ; 
+}  
+
+void MCamDisplay::Draw( MNphotEvent *event) 
+{
+  // 
+
+  // loop over all pixels in the MNphotEvent and
+  // determine the Pixel Id and the content
+  Reset() ; 
+
+  for (Int_t i=0 ; i<event->GetNbPixels() ; i++ )
+    {
+      ( (MHexagon*) fPixels->At( event->GetPixelId(i) ))->SetFillColor((Int_t) event->GetPhotons(i)) ; 
+    } 
+  
+  Draw() ; 
+  
+}  
+
+
+void MCamDisplay::Reset() 
+{
+  for ( Int_t i=0 ; i< fNbPixels ; i++  )
+    { 
+      ( (MHexagon*) fPixels->At(i))->SetFillColor(10) ;
+    } 
+
+} 
+
+void MCamDisplay::TestColor() 
+{
+  for ( Int_t i=0 ; i< 500 ; i++  )
+    { 
+      ( (MHexagon*) fPixels->At(i))->SetFillColor(i) ;
+    } 
+
+} 
Index: trunk/MagicSoft/Mars/mgui/MCamDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/MCamDisplay.h	(revision 595)
+++ trunk/MagicSoft/Mars/mgui/MCamDisplay.h	(revision 595)
@@ -0,0 +1,38 @@
+#ifndef MCAMDISPLAY_H
+#define MCAMDISPLAY_H
+
+#include <iostream>
+
+#include "MAGIC.h"
+
+class TClonesArray ; 
+class MNphotEvent  ; 
+
+class MCamDisplay : public TObject
+{
+ private: 
+  Int_t         fNbPixels ;   // 
+  TClonesArray  *fPixels   ;  //!
+  
+ public:
+  
+  MCamDisplay ( Int_t type=0 ) ; 
+
+  ~MCamDisplay () ; 
+
+  void Init() ;
+
+  void Draw(Option_t *option = "" ) ; 
+  
+  void Draw( MNphotEvent *event) ; 
+
+  void Reset() ; 
+  void TestColor() ; 
+
+  //Int_t    GetNbPixels() ; 
+    
+  ClassDef(MCamDisplay, 1)		// Base (abstract) class for a task
+};
+
+#endif
+
Index: trunk/MagicSoft/Mars/mgui/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mgui/Makefile	(revision 591)
+++ trunk/MagicSoft/Mars/mgui/Makefile	(revision 595)
@@ -27,5 +27,5 @@
 #  connect the include files defined in the config.mk file
 #
-INCLUDES = -I. -I../mbase -I../mraw -I../mdatacheck -I../meventdisp
+INCLUDES = -I. -I../mbase -I../mraw -I../mdatacheck -I../meventdisp -I../manalysis
 
 #
@@ -58,5 +58,6 @@
 	   MGPrototyp.cc \
            MHexagon.cc \
-	   MCamGeom.cc
+	   MCamGeom.cc \
+	   MCamDisplay.cc 
 
 
