Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7732)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7733)
@@ -50,4 +50,12 @@
        of an arrival time extracted outside the fadc range. This
        avoids possible unfortuante coincidences in arrival times.
+
+   * mbadpixels/MBadPixelsTreat.[h,cc]:
+     - added new data member fMaxArrivalTimeDiff, which is the maximum
+       arrival time difference allowed for the badpixel algorithm
+       to determin whether a pixels belongs to a shower
+     - changed the old value (0.5) to 1.0 as suggested by Stefan
+       due to a recent study on the fraction of pixels surviving the
+       image cleaning
 
 
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 7732)
+++ trunk/MagicSoft/Mars/NEWS	(revision 7733)
@@ -3,4 +3,7 @@
  *** Version  <cvs>
 
+   - genetral: changed the binning of the azimuthal profile of the camera
+     such that it is aligned with the 60deg boundaries.
+     
    - merpp: better handling of problems with the TH, TD part of the 
      CC-REPORT for files older than 200507190 and 200412210 
@@ -11,4 +14,18 @@
    - merpp: implementd latest changes in starguider reports (sinc 9th May)
 
+   - callisto: if an arrival time is extracted outside the fadc range is
+     was set to the boundary before. Now a random number is assigned
+     instead to avoid unfortunate coincidences of arrival times just
+     by this arbitrary value.
+
+   - callisto: added a new option to callisto.rc which allows
+     to set the maximum arrival time difference allowed for the 
+     badpixel algorithm to determin whether a pixels belongs to a shower:
+       MJCalibrateSignal.MBadPixelsTreat.MaxArrivalTimeDiff: 1.0
+
+   - callisto: changed the old value (0.5) for MaxArrivalTimeDiff 
+     to 1.0 as suggested by Stefan due to a recent study on the fraction
+     of pixels surviving the image cleaning
+   
    - star: Show also the number of stars correlated correctly by the
      starguider
@@ -34,5 +51,5 @@
      eventloop the first and second loop could be accelerated by ~20%
 
-   - general: Added a missing feature in the MFilterLIst class which
+   - general: Added a missing feature in the MFilterList class which
      prevented MFEnergySlope from working correctly in trainenergy.C
 
Index: trunk/MagicSoft/Mars/callisto.rc
===================================================================
--- trunk/MagicSoft/Mars/callisto.rc	(revision 7732)
+++ trunk/MagicSoft/Mars/callisto.rc	(revision 7733)
@@ -415,4 +415,5 @@
 #MJCalibrateSignal.MBadPixelsCalc.PedestalLevelVariance: 3.0
 #MJCalibrateSignal.MBadPixelsTreat.NumMinNeighbors:    3
+#MJCalibrateSignal.MBadPixelsTreat.MaxArrivalTimeDiff: 1.0
 #MJCalibrateSignal.MBadPixelsTreat.UseInterpolation:   yes
 #MJCalibrateSignal.MBadPixelsTreat.ProcessPedestalEvt: yes
Index: trunk/MagicSoft/Mars/callisto_Dec04Jan05.rc
===================================================================
--- trunk/MagicSoft/Mars/callisto_Dec04Jan05.rc	(revision 7732)
+++ trunk/MagicSoft/Mars/callisto_Dec04Jan05.rc	(revision 7733)
@@ -426,4 +426,5 @@
 #MJCalibrateSignal.MBadPixelsCalc.PedestalLevelVariance: 3.0
 #MJCalibrateSignal.MBadPixelsTreat.NumMinNeighbors:    3
+#MJCalibrateSignal.MBadPixelsTreat.MaxArrivalTimeDiff: 1.0
 #MJCalibrateSignal.MBadPixelsTreat.UseInterpolation:   yes
 #MJCalibrateSignal.MBadPixelsTreat.ProcessPedestalEvt: yes
Index: trunk/MagicSoft/Mars/callisto_MarApr05.rc
===================================================================
--- trunk/MagicSoft/Mars/callisto_MarApr05.rc	(revision 7732)
+++ trunk/MagicSoft/Mars/callisto_MarApr05.rc	(revision 7733)
@@ -415,4 +415,5 @@
 #MJCalibrateSignal.MBadPixelsCalc.PedestalLevelVariance: 3.0
 #MJCalibrateSignal.MBadPixelsTreat.NumMinNeighbors:    3
+#MJCalibrateSignal.MBadPixelsTreat.MaxArrivalTimeDiff: 1.0
 #MJCalibrateSignal.MBadPixelsTreat.UseInterpolation:   yes
 #MJCalibrateSignal.MBadPixelsTreat.ProcessPedestalEvt: yes
Index: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc
===================================================================
--- trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc	(revision 7732)
+++ trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc	(revision 7733)
@@ -18,6 +18,7 @@
 !   Author(s): Oscar Blanch 12/2001 <mailto:blanch@ifae.es>
 !   Author(s): Thomas Bretz 08/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Stefan Ruegamer <mailto:snruegam@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2004
+!   Copyright: MAGIC Software Development, 2000-2006
 !
 !
@@ -107,5 +108,5 @@
 MBadPixelsTreat::MBadPixelsTreat(const char *name, const char *title)
     : fGeomCam(0), fEvt(0), fBadPixels(0), fPedPhot1(0), fPedPhot2(0),
-    fFlags(0), fNumMinNeighbors(3)
+    fFlags(0), fNumMinNeighbors(3), fMaxArrivalTimeDiff(1.0)
 {
     fName  = name  ? name  : gsDefName.Data();
@@ -425,6 +426,4 @@
 void MBadPixelsTreat::InterpolateTimes() const
 {
-    const Double_t tdiffshoweredge = 0.5;
-
     const Int_t n = fEvt->GetNumPixels();
     for (int i=0; i<n; i++)
@@ -471,5 +470,5 @@
 
             // Calculate mean arrival time of pixel probably inside the shower
-            if (TMath::Abs(tm1 - tm2)<tdiffshoweredge)
+            if (TMath::Abs(tm1 - tm2)<fMaxArrivalTimeDiff)
             {
                 sum2 += tm1+tm2;
@@ -601,4 +600,5 @@
 //   MBadPixelsTreat.ProcessPedestalEvt:  no
 //   MBadPixelsTreat.NumMinNeighbors:     3
+//   MBadPixelsTreat.MaxArrivalTimeDiff:  1.0
 //
 Int_t MBadPixelsTreat::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
@@ -640,4 +640,9 @@
         SetNumMinNeighbors(GetEnvValue(env, prefix, "NumMinNeighbors", fNumMinNeighbors));
     }
+    if (IsEnvDefined(env, prefix, "MaxArrivalTimeDiff", print))
+    {
+        rc = kTRUE;
+        SetMaxArrivalTimeDiff(GetEnvValue(env, prefix, "MaxArrivalTimeDiff", fMaxArrivalTimeDiff));
+    }
     return rc;
 }
Index: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h
===================================================================
--- trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h	(revision 7732)
+++ trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h	(revision 7733)
@@ -24,6 +24,7 @@
     TList fPedPhotCams;
 
-    Byte_t fFlags;       // flag for the method which is used
-    Byte_t fNumMinNeighbors;
+    Byte_t  fFlags;                // flag for the method which is used
+    Byte_t  fNumMinNeighbors;      // Number of neighbors required
+    Float_t fMaxArrivalTimeDiff;   // Maximum allowed arrival time difference of neighboring pixels
 
     TList fNamePedPhotCams;
@@ -95,5 +96,6 @@
     Bool_t IsUseInterpolation() const   { return TESTBIT(fFlags, kUseInterpolation); }
 
-    void SetNumMinNeighbors(Byte_t num) { fNumMinNeighbors=num; }
+    void SetNumMinNeighbors(Byte_t num)   { fNumMinNeighbors=num; }
+    void SetMaxArrivalTimeDiff(Float_t d) { fMaxArrivalTimeDiff=d; }
     void AddNamePedPhotCam(const char *name="MPedPhotCam");
     void SetNamePedPhotCam(const char *name)
