Index: trunk/MagicSoft/Mars/macros/CT1Hillas.C
===================================================================
--- trunk/MagicSoft/Mars/macros/CT1Hillas.C	(revision 698)
+++ trunk/MagicSoft/Mars/macros/CT1Hillas.C	(revision 698)
@@ -0,0 +1,64 @@
+void CT1Hillas()
+{
+    //
+    // This is a demonstration program which calculates the Hillas
+    // parameter out of a CT1 dataset.
+
+    //
+    // Create a empty Parameter List and an empty Task List
+    // The tasklist is identified in the eventloop by its name
+    //
+    MParList  plist;
+
+    MTaskList tlist;
+    plist->AddToList(&tlist);
+
+    //
+    // The geometry container must be created by yourself to make sure
+    // that you don't choos a wrong geometry by chance
+    //
+    MGeomCamMagic camct1;
+    plist->AddToList(&camct1);
+
+    //
+    // The Hillas histograms (MHHillas) could be created automatically
+    // but to make sure, that they are not deleted when the macro is
+    // finished you must create them yourself and add it to the list
+    //
+    MHHillas *hists = new MHHillas;
+    plist->AddToList(hists);
+
+    //
+    // Now setup the tasks and tasklist:
+    //
+    //  1) read in the data from a ct1 ascii file
+    //  2) clean the image
+    //  3) calculate hillas
+    //  4) fill the hillas into the histograms
+    //
+    MCT1ReadAscii readct1("CT1_99_on1.dat") ;
+    MImgCleanStd  clean;
+    MHillasCalc   hcalc;
+    MFillHHillas  hfill;
+
+    tlist.AddToList(&readct1);
+    tlist.AddToList(&clean);
+    tlist.AddToList(&hcalc);
+    tlist.AddToList(&hfill);
+
+    //
+    // Create and setup the eventloop
+    //
+    MEvtLoop evtloop;
+    evtloop.SetParList(&plist);
+
+    //
+    // Execute your analysis
+    //
+    evtloop.Eventloop();
+
+    //
+    // After the analysis is finished we can display the histograms
+    //
+    hists->Draw();
+}
Index: trunk/MagicSoft/Mars/macros/readCT1.C
===================================================================
--- trunk/MagicSoft/Mars/macros/readCT1.C	(revision 695)
+++ trunk/MagicSoft/Mars/macros/readCT1.C	(revision 698)
@@ -3,7 +3,7 @@
     MParList plist;
 
-    MGeomCamMagic camct1;
-    MHillas       hillas;
-    MTaskList     tlist;
+    MGeomCamCT1 camct1;
+    MHillas     hillas;
+    MTaskList   tlist;
 
     plist->AddToList(&camct1);
@@ -12,7 +12,9 @@
 
     MCT1ReadAscii readct1("CT1_99_on1.dat") ;
-    MHillasCalc hcalc;
+    MImgCleanStd  clean;
+    MHillasCalc   hcalc;
 
     tlist.AddToList(&readct1);
+    tlist.AddToList(&clean);
     tlist.AddToList(&hcalc);
 
@@ -40,13 +42,5 @@
             break;
 
-        phevt.CleanLevel1();
-        phevt.CleanLevel2();
-        display.DrawPhotNum(&phevt);
-        gClient->HandleInput();
-        if(getchar()=='q')
-            break;
-
-        phevt.CleanLevel3();
-
+        clean.Process();
         hcalc.Process();
 
