Index: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc
===================================================================
--- trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc	(revision 4464)
+++ trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc	(revision 4465)
@@ -16,8 +16,8 @@
 !
 !
-!   Author(s): Oscar Blanch    12/2001 <mailto:blanch@ifae.es>
-!   Author(s): Thomas Bretz    08/2002 <mailto:tbretz@astro.uni.wuerzburg.de>
+!   Author(s): Oscar Blanch 12/2001 <mailto:blanch@ifae.es>
+!   Author(s): Thomas Bretz 08/2002 <mailto:tbretz@astro.uni.wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2003
+!   Copyright: MAGIC Software Development, 2000-2004
 !
 !
@@ -91,4 +91,15 @@
 // --------------------------------------------------------------------------
 //
+// Returns the status of a pixel. If kSloppyTreatment is set a pixel must
+// be unsuitable to be treated. If not it is enough if it is unreliable
+// (IsBad() checks for any flag)
+//
+Bool_t MBadPixelsTreat::IsPixelBad(Int_t idx) const
+{
+    return TESTBIT(fFlags, kSloppyTreatment) ? (*fBadPixels)[idx].IsUnsuitable() : (*fBadPixels)[idx].IsBad();
+}
+
+// --------------------------------------------------------------------------
+//
 //  - Try to find or create MBlindPixels in parameter list.
 //  - get the MCerPhotEvt from the parlist (abort if missing)
@@ -156,5 +167,5 @@
         // Check whether pixel with idx i is blind
         //
-        if (pix && (*fBadPixels)[i].IsOK())
+        if (pix && !IsPixelBad(i))
             continue;
 
@@ -201,5 +212,5 @@
             // Do not use blind neighbors
             //
-            if ((*fBadPixels)[nidx].IsBad())
+            if (IsPixelBad(nidx))
                 continue;
 
@@ -263,5 +274,5 @@
         // Check whether pixel with idx i is blind
         //
-        if ((*fBadPixels)[i].IsOK())
+        if (!IsPixelBad(i))
             continue;
 
@@ -299,5 +310,5 @@
             // Do not use blind neighbors
             //
-            if ((*fBadPixels)[nidx].IsBad())
+            if (IsPixelBad(nidx))
                 continue;
 
@@ -513,5 +524,5 @@
         MCerPhotPix &pix = (*fEvt)[i];
 
-        if ((*fBadPixels)[pix.GetPixId()].IsBad())
+        if (IsPixelBad(pix.GetPixId()))
             pix.SetPixelUnmapped();
     }
