Index: trunk/MagicSoft/Mars/macros/readCT1.C
===================================================================
--- trunk/MagicSoft/Mars/macros/readCT1.C	(revision 594)
+++ trunk/MagicSoft/Mars/macros/readCT1.C	(revision 595)
@@ -19,13 +19,21 @@
   // MReadCT1Ascii *readct1 = new MReadCT1Ascii("/hd10/www/Anal_MAGIC/CT1_99_on1.dat") ; 
 
-
-  
   cout << readct1->PreProcess(plist) << endl ; 
 
   Int_t icount = 0 ; 
+
+  MCamDisplay display(0) ; 
+
   while ( readct1->Process() == kTRUE )
     {
       cout << "Event: " << icount++  << endl  ;
-      //      phevt->Print() ;  
+      
+      if ( icount == 3 ) 
+	phevt->Print() ;
+      
+      display->Draw( phevt )  ; 
+
+      gClient->HandleInput();   
+      if(getchar()=='e') break;  
     } 
 
Index: trunk/MagicSoft/Mars/manalysis/MNphotEvent.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MNphotEvent.cc	(revision 594)
+++ trunk/MagicSoft/Mars/manalysis/MNphotEvent.cc	(revision 595)
@@ -6,5 +6,5 @@
 
 #include "MCamGeom.h"
-//#include "MCamDisplay.h"
+#include "MCamDisplay.h"
 #include "MHexagon.h"
 
@@ -62,13 +62,10 @@
   // 
   
-  //   MCamDisplay disp(fType)  ; 
+  MCamDisplay *disp = new MCamDisplay(fType)  ; 
   
-  //   for (Int_t i=0; i<fNbPixels; i++)
-  //     {
-  //       disp.SetPixelColor( ((MNphotPix *) fPixels->At(i))->GetPixId(), 
-  // 			  ((MNphotPix *) fPixels->At(i))->GetPhotons()) ; 
-  //     } 
-  //   disp.Draw() ; 
+  disp->Draw( this ) ; 
   
+  //  disp->Draw() ; 
+
 }
 
@@ -106,2 +103,11 @@
 }
   
+Int_t MNphotEvent::GetPixelId(Int_t i ) 
+{ 
+  return ( ( (MNphotPix *) fPixels->At(i))->GetPixId() ) ; 
+} 
+
+Float_t MNphotEvent::GetPhotons(Int_t i ) 
+{ 
+  return ( ( (MNphotPix *) fPixels->At(i))->GetPhotons() ) ; 
+} 
Index: trunk/MagicSoft/Mars/manalysis/MNphotEvent.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MNphotEvent.h	(revision 594)
+++ trunk/MagicSoft/Mars/manalysis/MNphotEvent.h	(revision 595)
@@ -62,5 +62,5 @@
   MNphotEvent(const char *name=NULL, const char *title=NULL) ; 
 
-  void Draw(Option_t* option) ; 
+  void Draw(Option_t* option = "" ) ; 
 
   Int_t    GetNbPixels() ; 
@@ -72,5 +72,8 @@
   void Print() ; 
 
-  ClassDef(MNphotEvent, 1)    // class for Nphotons Events
+  Int_t GetPixelId(Int_t i ) ; 
+  Float_t GetPhotons(Int_t i ) ; 
+  
+    ClassDef(MNphotEvent, 1)    // class for Nphotons Events
 };
 
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 594)
+++ 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 
 
 
