Index: trunk/MagicSoft/Mars/macros/readCT1.C
===================================================================
--- trunk/MagicSoft/Mars/macros/readCT1.C	(revision 592)
+++ trunk/MagicSoft/Mars/macros/readCT1.C	(revision 592)
@@ -0,0 +1,31 @@
+{{
+  
+  //  load the shared lib
+  gSystem->Load("lib/mars.so") ; 
+  
+  MTaskList *tlist = new MTaskList() ; 
+  MParList  *plist = new MParList() ; 
+
+  //
+  
+  MNphotEvent *phevt = new MNphotEvent() ; 
+
+  plist->AddToList( phevt ) ; 
+  
+  MReadCT1Ascii *readct1 = new MReadCT1Ascii("/hd10/www/Anal_MAGIC/MCCT1_99_ga20.dat") ; 
+
+  // MReadCT1Ascii *readct1 = new MReadCT1Ascii("/hd10/www/Anal_MAGIC/CT1_99_on1.dat") ; 
+
+  
+  cout << readct1->PreProcess(plist) << endl ; 
+
+  Int_t icount = 0 ; 
+  while ( readct1->Process() == kTRUE )
+    {
+      cout << "Event: " << icount++  << endl  ;
+      //      phevt->Print() ;  
+    } 
+
+  cout << readct1->PostProcess() << endl ; 
+}}
+
Index: trunk/MagicSoft/Mars/manalysis/AnalysisIncl.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/AnalysisIncl.h	(revision 591)
+++ trunk/MagicSoft/Mars/manalysis/AnalysisIncl.h	(revision 592)
@@ -4,3 +4,5 @@
 #include <TClonesArray.h>
 
+#include "MParContainer.h"
+
 #endif // __CINT__
Index: trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h	(revision 591)
+++ trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h	(revision 592)
@@ -8,4 +8,7 @@
 #pragma link C++ class MNphotEvent; 
 
+#pragma link C++ class MReadCT1Ascii; 
+
+
 
 #endif
Index: trunk/MagicSoft/Mars/manalysis/MNphotEvent.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MNphotEvent.h	(revision 591)
+++ trunk/MagicSoft/Mars/manalysis/MNphotEvent.h	(revision 592)
@@ -1,4 +1,8 @@
 #ifndef MNPHOTEVENT_H
 #define MNPHOTEVENT_H
+
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
 
 #include <iostream>
@@ -46,5 +50,5 @@
 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
-class MNphotEvent : public TObject
+class MNphotEvent : public MParContainer
 {
  private: 
Index: trunk/MagicSoft/Mars/manalysis/MReadCT1Ascii.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MReadCT1Ascii.cc	(revision 592)
+++ trunk/MagicSoft/Mars/manalysis/MReadCT1Ascii.cc	(revision 592)
@@ -0,0 +1,95 @@
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MReadCT1Ascii                                                           //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MReadCT1Ascii.h"
+
+
+#include <stdio.h>
+#include <iostream.h>
+#include <fstream.h>
+
+#include "MParList.h"
+#include "MNphotEvent.h"
+
+ClassImp(MReadCT1Ascii)
+
+MReadCT1Ascii::MReadCT1Ascii(const char *fname,
+			     const char *name, 
+			     const char *title)
+{
+    *fName  = name  ? name  : "MReadCT1Ascii";
+    *fTitle = title ? title : "Task to loop over events in CT1 ascii file";
+
+    // open the input stream
+
+    fFileName = fname;
+}
+
+Bool_t MReadCT1Ascii::PreProcess(MParList *pList)
+{
+  // Preprocessing 
+
+  //  open the file cout << fFileName << endl ; 
+  
+  fInputfile = fopen( fFileName, "r" ) ; 
+ 
+  if ( fInputfile == 0 ) 
+    return kFALSE ; 
+  
+  //  look for the MNphotEvent class in the plist
+
+    
+  fNphot = (MNphotEvent*)pList->FindObject("MNphotEvent");
+  
+  if (!fNphot )
+    {
+      cout << "MRawCT1Ascii::PreProcess - WARNING: MNphotEvent not found... exit" << endl;
+      return kFALSE ; 
+    }
+
+  return kTRUE;
+}
+
+Bool_t MReadCT1Ascii::Process()
+{
+  fNphot->Clear() ; 
+  
+  Int_t   dummyI ; 
+  Float_t dummyF ; 
+
+  //    read in the first five numbers 
+
+  fscanf ( fInputfile, "%d", &dummyI ) ; 
+  if ( feof ( fInputfile ) != 0 ) 
+    return kFALSE ; 
+
+  fscanf ( fInputfile, "%d", &dummyI ) ; 
+  fscanf ( fInputfile, "%d", &dummyI ) ; 
+  fscanf ( fInputfile, "%d", &dummyI ) ; 
+  fscanf ( fInputfile, "%d", &dummyI ) ; 
+
+  //    read in the next 127 numbers as the pixels
+
+  for (Int_t i = 0; i<127; i++ )
+    {
+      fscanf ( fInputfile, "%f", &dummyF ) ;
+      
+      
+      if ( dummyF > 0.0 ) { 
+	fNphot->AddPixel(i, dummyF, 0. ) ; 
+      } 
+      
+    }
+
+  return kTRUE;
+}
+
+Bool_t MReadCT1Ascii::PostProcess()
+{
+  fclose( fInputfile ) ;   
+  return kTRUE;
+}
+
Index: trunk/MagicSoft/Mars/manalysis/MReadCT1Ascii.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MReadCT1Ascii.h	(revision 592)
+++ trunk/MagicSoft/Mars/manalysis/MReadCT1Ascii.h	(revision 592)
@@ -0,0 +1,31 @@
+#ifndef MREADCT1ASCII_H
+#define MREADCT1ASCII_H
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MNphotEvent ; 
+
+class MReadCT1Ascii : public MTask
+{
+ private:
+  TString fFileName;  //! the file name of the string
+
+  FILE*   fInputfile ; //! the inputfile 
+
+  MNphotEvent *fNphot ; //! the data container for all data. 
+
+ public:
+  MReadCT1Ascii(const char *filename, 
+		const char *name=NULL, 
+		const char *title=NULL);
+  
+  Bool_t PreProcess(MParList *pList);
+  Bool_t Process();
+  Bool_t PostProcess();
+  
+  ClassDef(MReadCT1Ascii, 1)	// Reads the CT1 data file
+};
+    
+#endif
Index: trunk/MagicSoft/Mars/manalysis/Makefile
===================================================================
--- trunk/MagicSoft/Mars/manalysis/Makefile	(revision 591)
+++ trunk/MagicSoft/Mars/manalysis/Makefile	(revision 592)
@@ -31,5 +31,6 @@
 .SUFFIXES: .c .cc .cxx .h .hxx .o 
 
-SRCFILES = MNphotEvent.cc
+SRCFILES = MNphotEvent.cc \
+	   MReadCT1Ascii.cc
 
 SRCS    = $(SRCFILES)
Index: trunk/MagicSoft/include-Classes/MMcFormat/Makefile
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/Makefile	(revision 591)
+++ trunk/MagicSoft/include-Classes/MMcFormat/Makefile	(revision 592)
@@ -33,5 +33,5 @@
 SRCFILES = MHeaderTrig.cxx \
 	   MMcEvt.cxx \
-           MMcTrig.cxx
+           MMcTrig.cxx 
 
 SRCS    = $(SRCFILES)
