Index: trunk/MagicSoft/Mars/mimage/MCameraSmooth.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MCameraSmooth.cc	(revision 2179)
+++ trunk/MagicSoft/Mars/mimage/MCameraSmooth.cc	(revision 2209)
@@ -66,5 +66,5 @@
 //  - get MGeomCam from the parameter list
 //
-Bool_t MCameraSmooth::PreProcess (MParList *pList)
+Int_t MCameraSmooth::PreProcess (MParList *pList)
 {
     fEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
@@ -89,5 +89,5 @@
 // Do the smoothing
 //
-Bool_t MCameraSmooth::Process()
+Int_t MCameraSmooth::Process()
 {
     const UShort_t entries = fEvt->GetNumPixels();
Index: trunk/MagicSoft/Mars/mimage/MCameraSmooth.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MCameraSmooth.h	(revision 2179)
+++ trunk/MagicSoft/Mars/mimage/MCameraSmooth.h	(revision 2209)
@@ -23,11 +23,11 @@
     Bool_t fUseCentralPixel;  // use also the central pixel
 
+    Int_t PreProcess(MParList *pList);
+    Int_t Process();
+
 public:
     MCameraSmooth(Byte_t cnt=1, const char *name=NULL, const char *title=NULL);
 
     void SetUseCetralPixel(Bool_t b=kTRUE) { fUseCentralPixel=kTRUE; }
-
-    Bool_t PreProcess(MParList *pList);
-    Bool_t Process();
 
     ClassDef(MCameraSmooth, 0) // task to smooth the camera contants
Index: trunk/MagicSoft/Mars/mimage/MHillasCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasCalc.cc	(revision 2179)
+++ trunk/MagicSoft/Mars/mimage/MHillasCalc.cc	(revision 2209)
@@ -90,5 +90,5 @@
 // MNewImagePar, too.
 //
-Bool_t MHillasCalc::PreProcess(MParList *pList)
+Int_t MHillasCalc::PreProcess(MParList *pList)
 {
     // necessary
@@ -147,5 +147,5 @@
 // If the calculation wasn't sucessfull skip this event
 //
-Bool_t MHillasCalc::Process()
+Int_t MHillasCalc::Process()
 {
     if (TestFlag(kCalcHillas))
@@ -176,5 +176,5 @@
 //  is calculated with respect to the number of executions of this task.
 //
-Bool_t MHillasCalc::PostProcess()
+Int_t MHillasCalc::PostProcess()
 {
     if (GetNumExecutions()==0)
Index: trunk/MagicSoft/Mars/mimage/MHillasCalc.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasCalc.h	(revision 2179)
+++ trunk/MagicSoft/Mars/mimage/MHillasCalc.h	(revision 2209)
@@ -37,7 +37,7 @@
     Int_t        fFlags;
 
-    Bool_t PreProcess(MParList *pList);
-    Bool_t Process();
-    Bool_t PostProcess();
+    Int_t PreProcess(MParList *pList);
+    Int_t Process();
+    Int_t PostProcess();
 
 public:
Index: trunk/MagicSoft/Mars/mimage/MHillasSrcCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasSrcCalc.cc	(revision 2179)
+++ trunk/MagicSoft/Mars/mimage/MHillasSrcCalc.cc	(revision 2209)
@@ -72,5 +72,5 @@
 // -------------------------------------------------------------------------
 //
-Bool_t MHillasSrcCalc::PreProcess(MParList *pList)
+Int_t MHillasSrcCalc::PreProcess(MParList *pList)
 {
     fHillas = (MHillas*)pList->FindObject(fHillasInput, "MHillas");
@@ -103,5 +103,5 @@
 // -------------------------------------------------------------------------
 //
-Bool_t MHillasSrcCalc::Process()
+Int_t MHillasSrcCalc::Process()
 {
 
@@ -120,5 +120,5 @@
 //  is calculated with respect to the number of executions of this task.
 //
-Bool_t MHillasSrcCalc::PostProcess()
+Int_t MHillasSrcCalc::PostProcess()
 {
     if (GetNumExecutions()==0)
Index: trunk/MagicSoft/Mars/mimage/MHillasSrcCalc.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasSrcCalc.h	(revision 2179)
+++ trunk/MagicSoft/Mars/mimage/MHillasSrcCalc.h	(revision 2209)
@@ -25,7 +25,7 @@
     void StreamPrimitive(ofstream &out) const;
 
-    Bool_t PreProcess(MParList *plist);
-    Bool_t Process();
-    Bool_t PostProcess();
+    Int_t PreProcess(MParList *plist);
+    Int_t Process();
+    Int_t PostProcess();
 
 public:
Index: trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc	(revision 2179)
+++ trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc	(revision 2209)
@@ -316,9 +316,7 @@
 //  Returns the maximum Pixel Id (used for ispixused in CleanStep2)
 //
-Int_t MImgCleanStd::CleanStep1Std()
+void MImgCleanStd::CleanStep1Std()
 {
     const Int_t entries = fEvt->GetNumPixels();
-
-    Int_t max = entries;
 
     //
@@ -339,10 +337,5 @@
         if (entry * ratio <= fCleanLvl1 * noise)
             pix.SetPixelUnused();
-
-        if (id>max)
-            max = id;
-    }
-
-    return max;
+    }
 }
 
@@ -358,9 +351,7 @@
 //  Returns the maximum Pixel Id (used for ispixused in CleanStep2)
 //
-Int_t MImgCleanStd::CleanStep1Dem()
+void MImgCleanStd::CleanStep1Dem()
 {
     const Int_t entries = fEvt->GetNumPixels();
-
-    Int_t max = entries;
 
     //
@@ -380,9 +371,5 @@
         if (entry * ratio <= fCleanLvl1 * fInnerNoise)
             pix.SetPixelUnused();
-
-        if (id>max)
-            max = id;
-    }
-    return max;
+    }
 }
 
@@ -394,15 +381,15 @@
 // Returns the maximum Pixel Id (used for ispixused in CleanStep2)
 //
-Int_t MImgCleanStd::CleanStep1()
+void MImgCleanStd::CleanStep1()
 {
    switch (fCleaningMethod)
     {
     case kStandard:
-        return CleanStep1Std();
+        CleanStep1Std();
+        return;
     case kDemocratic:
-        return CleanStep1Dem();
-    }
-
-    return 0;
+        CleanStep1Dem();
+        return;
+    }
 }
 
@@ -415,5 +402,5 @@
 //  Takes the maximum pixel id from CleanStep1 as an argument
 //
-void MImgCleanStd::CleanStep2(Int_t max)
+void MImgCleanStd::CleanStep2()
 {
     const Int_t entries = fEvt->GetNumPixels();
@@ -425,5 +412,5 @@
     // (MCerPhotEvt::IsPixelUsed) all the time.
     //
-    Byte_t *ispixused = new Byte_t[max+1];
+    Byte_t *ispixused = new Byte_t[fCam->GetNumPixels()];
 
     for (Int_t i=0; i<entries; i++)
@@ -463,5 +450,5 @@
             }
         }
-	
+
 	if (hasNeighbor == kFALSE)
             pix.SetPixelUnused();
@@ -640,5 +627,5 @@
 //  if not create one and add them to the list
 //
-Bool_t MImgCleanStd::PreProcess (MParList *pList)
+Int_t MImgCleanStd::PreProcess (MParList *pList)
 {
     fCam = (MGeomCam*)pList->FindObject("MGeomCam");
@@ -673,11 +660,11 @@
 // Cleans the image.
 //
-Bool_t MImgCleanStd::Process()
+Int_t MImgCleanStd::Process()
 {
     if (fSgb)
         fInnerNoise = fSgb->GetSigmabarInner();
 
-    const Int_t max = CleanStep1();
-    CleanStep2(max);
+    CleanStep1();
+    CleanStep2();
     CleanStep3();
 
Index: trunk/MagicSoft/Mars/mimage/MImgCleanStd.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MImgCleanStd.h	(revision 2179)
+++ trunk/MagicSoft/Mars/mimage/MImgCleanStd.h	(revision 2209)
@@ -38,6 +38,6 @@
     void StreamPrimitive(ofstream &out) const;
 
-    Int_t  CleanStep1Dem();
-    Int_t  CleanStep1Std();
+    void   CleanStep1Dem();
+    void   CleanStep1Std();
     Bool_t CleanStep3Dem(const MCerPhotPix &pix);
     Bool_t CleanStep3Std(const MCerPhotPix &pix);
@@ -45,15 +45,14 @@
     void   CleanStep4(UShort_t r, MCerPhotPix &pix);
 
+    void  CleanStep1();
+    void  CleanStep2();
+    void  CleanStep3();
+
+    Int_t PreProcess(MParList *pList);
+    Int_t Process();
+
 public:
     MImgCleanStd(const Float_t lvl1=3.0, const Float_t lvl2=2.5,
               const char *name=NULL, const char *title=NULL);
-
-    Int_t CleanStep1();
-    void  CleanStep2(Int_t max);
-    void  CleanStep3();
-
-    Bool_t PreProcess(MParList *pList);
-    Bool_t Process();
-
     void Print(Option_t *o="") const;
 
Index: trunk/MagicSoft/Mars/mimage/MNewImageParCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MNewImageParCalc.cc	(revision 2179)
+++ trunk/MagicSoft/Mars/mimage/MNewImageParCalc.cc	(revision 2209)
@@ -72,5 +72,5 @@
 // -------------------------------------------------------------------------
 //
-Bool_t MNewImageParCalc::PreProcess(MParList *pList)
+Int_t MNewImageParCalc::PreProcess(MParList *pList)
 {
     fHillas = (MHillas*)pList->FindObject(fHillasInput, "MHillas");
@@ -113,5 +113,5 @@
 // -------------------------------------------------------------------------
 //
-Bool_t MNewImageParCalc::Process()
+Int_t MNewImageParCalc::Process()
 {
 
Index: trunk/MagicSoft/Mars/mimage/MNewImageParCalc.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MNewImageParCalc.h	(revision 2179)
+++ trunk/MagicSoft/Mars/mimage/MNewImageParCalc.h	(revision 2209)
@@ -28,6 +28,6 @@
     //Int_t       fErrors;
 
-    Bool_t PreProcess(MParList *plist);
-    Bool_t Process();
+    Int_t PreProcess(MParList *plist);
+    Int_t Process();
     //Bool_t PostProcess();
 
