Index: trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.cc	(revision 715)
+++ trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.cc	(revision 716)
@@ -9,4 +9,6 @@
 #include <fstream.h>
 
+#include <TArrayC.h>
+
 #include "MLog.h"
 #include "MLogManip.h"
@@ -28,5 +30,75 @@
     // remember file name for opening the file in the preprocessor
     //
-    fFileName = fname;
+    fFileNames = new TArrayC;
+    if (fname)
+        AddFile(fname);
+}
+
+MCT1ReadAscii::~MCT1ReadAscii()
+{
+    delete fFileNames;
+    if (fIn)
+        delete fIn;
+}
+
+void MCT1ReadAscii::AddFile(const char *txt)
+{
+    //
+    // Add this file as the last entry in the chain
+    //
+    const int   sz  = fFileNames->GetSize();
+    const int   tsz = strlen(txt)+1;
+
+    fFileNames->Set(sz+tsz);
+
+    memcpy(fFileNames->GetArray()+sz, txt, tsz);
+}
+
+Bool_t MCT1ReadAscii::OpenNextFile()
+{
+    //
+    // open the input stream and check if it is really open (file exists?)
+    //
+    if (fIn)
+        delete fIn;
+    fIn = NULL;
+
+    const int arrsz = fFileNames->GetSize();
+
+    if (arrsz<1)
+        return kFALSE;
+
+    //
+    // open the file which is the first one in the chain
+    //
+    const char *name = fFileNames->GetArray();
+
+    fIn = new ifstream(name);
+    if (!(*fIn))
+    {
+        *fLog << dbginf << "Cannot open file '" << name << "'" << endl;
+        return kFALSE;
+    }
+
+    //
+    // remove the first entry from the chain
+    //
+    *fLog << "Open file: '" << name << "'" << endl;
+
+    //
+    // create the new char array containing the filenames to process
+    //
+    const int sz  = strlen(name)+1;
+
+    char *dummy = new char[arrsz-sz];
+    memcpy(dummy, name+sz, arrsz-sz);
+
+    //
+    // dummy will be deleted by the destructor of fFileNames
+    //
+    fFileNames->Adopt(arrsz-sz, dummy);
+
+    return kTRUE;
+
 }
 
@@ -38,12 +110,8 @@
 
     //
-    // open the input stream and check if it is really open (file exists?)
-    //
-    fIn = new ifstream(fFileName);
-    if (!(*fIn))
-    {
-        *fLog << dbginf << "Cannot open file." << endl;
-        return kFALSE;
-    }
+    // Try to open at least one (the first) file
+    //
+    if (!OpenNextFile())
+        return kFALSE;
 
     //
@@ -141,8 +209,9 @@
 
     //
-    // check if we are done
+    // check if we are done. Try to open the next file in chain.
+    // If it was possible start reading. If not break the event loop
     //
     if (fIn->eof())
-        return kFALSE;
+        return OpenNextFile() ? kCONTINUE : kFALSE;
 
     //
@@ -163,12 +232,2 @@
 }
 
-Bool_t MCT1ReadAscii::PostProcess()
-{
-    //
-    // close and delete the input stream
-    //
-    delete fIn;
-
-    return kTRUE;
-}
-
Index: trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.h	(revision 715)
+++ trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.h	(revision 716)
@@ -6,4 +6,5 @@
 #endif
 
+class TArrayC;
 class MCerPhotEvt;
 class MPedestalCam;
@@ -12,8 +13,11 @@
 {
 private:
-    TString       fFileName;    //! the file name of the string
-    ifstream     *fIn;          //! the inputfile
-    MCerPhotEvt  *fNphot;       //! the data container for all data.
-    MPedestalCam *fPedest;      //! ct1 pedestals
+    TString       fFileName;    // the file name of the string
+    ifstream     *fIn;          // the inputfile
+    MCerPhotEvt  *fNphot;       // the data container for all data.
+    MPedestalCam *fPedest;      // ct1 pedestals
+    TArrayC      *fFileNames;   // Array which stores the \0-terminated filenames
+
+    Bool_t OpenNextFile();
 
     void ReadPedestals();
@@ -21,11 +25,14 @@
 
 public:
-    MCT1ReadAscii(const char *filename,
+    MCT1ReadAscii(const char *filename=NULL,
                   const char *name=NULL,
                   const char *title=NULL);
 
+    ~MCT1ReadAscii();
+
+    void AddFile(const char *fname);
+
     Bool_t PreProcess(MParList *pList);
     Bool_t Process();
-    Bool_t PostProcess();
 
     ClassDef(MCT1ReadAscii, 0)	// Reads the CT1 data file
Index: trunk/MagicSoft/Mars/manalysis/MHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillas.cc	(revision 715)
+++ trunk/MagicSoft/Mars/manalysis/MHillas.cc	(revision 716)
@@ -99,4 +99,9 @@
 Bool_t MHillas::Calc(MGeomCam &geom, MCerPhotEvt &evt)
 {
+    //
+    // Calculate the Hillas parameters from a cerenkov photon event
+    // (The calcualtion is some kind of two dimentional statistics)
+    //
+
     const UInt_t nevt = evt.GetNumPixels();
 
@@ -104,5 +109,5 @@
     // sanity check
     //
-    if (nevt<2)
+    if (nevt <= 2)
         return kFALSE;
 
@@ -115,4 +120,8 @@
     fSize = 0;
 
+    //
+    // FIXME! npix should be retrieved from MCerPhotEvt
+    //
+    UShort_t npix=0;
     for (UInt_t i=0; i<nevt; i++)
     {
@@ -129,5 +138,13 @@
         xmean += nphot * gpix.GetX(); // [mm]
         ymean += nphot * gpix.GetY(); // [mm]
+
+        npix++;
     }
+
+    //
+    // sanity check
+    //
+    if (fSize==0 || npix<=2)
+        return kFALSE;
 
     xmean /= fSize; // [mm]
Index: trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc	(revision 715)
+++ trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc	(revision 716)
@@ -11,5 +11,7 @@
 ClassImp(MImgCleanStd)
 
-MImgCleanStd::MImgCleanStd(const char *name, const char *title)
+MImgCleanStd::MImgCleanStd(const Float_t lvl1, const Float_t lvl2,
+                           const char *name, const char *title)
+    : fCleanLvl1(lvl1), fCleanLvl2(lvl2)
 {
     //
@@ -18,12 +20,13 @@
   
     *fName  = name  ? name  : "MImgCleanStd";
-    *fTitle = name  ? name  : "Task which does a standard image cleaning";
-}
-
-void MImgCleanStd::CleanLevel1()
+    *fTitle = title ? title : "Task which does a standard image cleaning";
+}
+
+void MImgCleanStd::CleanStep1()
 {
     //
     //  This method looks for all pixels with an entry (photons)
     //  that is three times bigger than the noise of the pixel
+    //  (std: 3 sigma, clean level 1)
     //
 
@@ -41,10 +44,10 @@
         const Float_t noise = pix.GetErrorPhot();
 
-        if (entry < 3 * noise )
+        if (entry < fCleanLvl1 * noise )
             pix.SetPixelUnused();
     }
 }
 
-void MImgCleanStd::CleanLevel2()
+void MImgCleanStd::CleanStep2()
 {
     //
@@ -113,10 +116,10 @@
 } 
 
-void MImgCleanStd::CleanLevel3()
+void MImgCleanStd::CleanStep3()
 {
     //
     //   Look for the boundary pixels around the core pixels
-    //   if a pixel has more than 2.5 sigma, and a core neigbor
-    //   it is declared as used.
+    //   if a pixel has more than 2.5 (clean level 2) sigma, and
+    //   a core neigbor it is declared as used.
     //
     const Int_t entries = fEvt->GetNumPixels();
@@ -141,5 +144,5 @@
         const Float_t noise = pix.GetErrorPhot();
 
-        if (entry <= 2.5 * noise )
+        if (entry <= fCleanLvl2 * noise )
             continue;
 
@@ -198,7 +201,7 @@
 Bool_t MImgCleanStd::Process()
 {
-    CleanLevel1();
-    CleanLevel2();
-    CleanLevel3();
+    CleanStep1();
+    CleanStep2();
+    CleanStep3();
 
     return kTRUE;
Index: trunk/MagicSoft/Mars/manalysis/MImgCleanStd.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MImgCleanStd.h	(revision 715)
+++ trunk/MagicSoft/Mars/manalysis/MImgCleanStd.h	(revision 716)
@@ -18,10 +18,14 @@
     MCerPhotEvt *fEvt;
 
+    Float_t fCleanLvl1;
+    Float_t fCleanLvl2;
+
 public:
-    MImgCleanStd(const char *name=NULL, const char *title=NULL) ;
+    MImgCleanStd(const Float_t lvl1=3.0, const Float_t lvl2=2.5,
+                 const char *name=NULL, const char *title=NULL);
 
-    void CleanLevel1();
-    void CleanLevel2();
-    void CleanLevel3();
+    void CleanStep1();
+    void CleanStep2();
+    void CleanStep3();
 
     Bool_t PreProcess (MParList *pList);
