Index: trunk/MagicSoft/Mars/macros/readCT1.C
===================================================================
--- trunk/MagicSoft/Mars/macros/readCT1.C	(revision 654)
+++ trunk/MagicSoft/Mars/macros/readCT1.C	(revision 655)
@@ -1,60 +1,44 @@
-{{
-  
-  //  load the shared lib
-  //  gSystem->Load("lib/mars.so") ; 
-  
-  MTaskList *tlist = new MTaskList() ; 
-  MParList  *plist = new MParList() ; 
+void readCT1()
+{
+    MParList  *plist = new MParList() ;
 
-  //
-  
-  MCerPhotEvt *phevt = new MCerPhotEvt() ; 
+    MCT1ReadAscii *readct1 = new MCT1ReadAscii("CT1_99_on1.dat") ;
 
-  plist->AddToList( phevt ) ; 
-  
-  //MReadCT1Ascii *readct1 = new MReadCT1Ascii("/hd10/www/Anal_MAGIC/MCCT1_99_ga20.dat") ; 
+    if (!readct1->PreProcess(plist))
+        return;
 
-  MReadCT1Ascii *readct1 = new MReadCT1Ascii("/hd10/www/Anal_MAGIC/CT1_99_on1.dat") ; 
+    MCerPhotEvt *phevt = (MCerPhotEvt*)plist->FindObject("MCerPhotEvt");
 
-  cout << readct1->PreProcess(plist) << endl ; 
+    Int_t icount = 0 ;
+    MCamDisplay display(0) ;
 
-  Int_t icount = 0 ; 
-  MCamDisplay display(0) ; 
+    while ( readct1->Process() )
+    {
+        cout << "Event: " << icount++  << endl  ;
 
-  //display.SetAutoScale(kFALSE) ; 
+        if (icount >= 45 )
+        {
+            display->DrawPhotNum( phevt ) ;
 
-  while ( readct1->Process() == kTRUE )
-    {
-      cout << "Event: " << icount++  << endl  ;
-      
-      if (icount >= 45 ) { 
-	
-	display->Draw( phevt )  ; 
+            gClient->HandleInput();
+            if(getchar()=='q')
+                break;
 
-	gClient->HandleInput();   
-	if(getchar()=='q')
-	  break;
-	
-	
-	phevt->CleanLevel1() ; 
-	phevt->CleanLevel2() ; 
-	display->Draw( phevt )  ; 
-	gClient->HandleInput();   
-	if(getchar()=='q')
-	  break;
+            phevt->CleanLevel1() ;
+            phevt->CleanLevel2() ;
+            display->DrawPhotNum( phevt ) ;
+            gClient->HandleInput();
+            if(getchar()=='q')
+                break;
 
-	phevt->CleanLevel3() ; 
-	
-	display->Draw( phevt )  ; 
-	gClient->HandleInput();   
-	if(getchar()=='q')
-	  break;
+            phevt->CleanLevel3() ;
 
-      } 
-     phevt->Print() ;
-
+            display->DrawPhotNum( phevt ) ;
+            gClient->HandleInput();
+            if(getchar()=='q')
+                break;
+        }
     } 
 
-  cout << readct1->PostProcess() << endl ; 
-}}
-
+    readct1->PostProcess();
+}
