Index: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc
===================================================================
--- trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc	(revision 7375)
+++ trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc	(revision 7376)
@@ -49,5 +49,10 @@
 //   SetProcessPedestalRun: process the pedestals once per run/file
 //   SetProcessPedestalEvt: process the pedestal once per event
-//   SetProcessTimes:       also do some rough interpolation of the arrival time
+//   SetProcessTimes:       do interpolation of the arrival time
+//
+// If the arrival time treatment is switched on and "MPedPhotFromExtractor"
+// and "MPedPhotFromExtractorRndm" are found the pixel is filled with
+// a random gaus calculated from these two MPedPhotCams in the case
+// the pixels is detected as background.
 //
 //
@@ -101,5 +106,6 @@
 //
 MBadPixelsTreat::MBadPixelsTreat(const char *name, const char *title)
-  : fFlags(0), fNumMinNeighbors(3)
+    : fGeomCam(0), fEvt(0), fBadPixels(0), fPedPhot1(0), fPedPhot2(0),
+    fFlags(0), fNumMinNeighbors(3)
 {
     fName  = name  ? name  : gsDefName.Data();
@@ -197,4 +203,14 @@
     }
 
+    if (IsProcessTimes())
+    {
+        fPedPhot1 = (MPedPhotCam*)pList->FindObject("MPedPhotFromExtractor",     "MPedPhotCam");
+        fPedPhot2 = (MPedPhotCam*)pList->FindObject("MPedPhotFromExtractorRndm", "MPedPhotCam");
+
+        *fLog << inf << "Additional no-signal-interpolation switched ";
+        *fLog << (fPedPhot1 && fPedPhot2 ? "on" : "off");
+        *fLog << "." << endl;
+    }
+
     if (IsProcessPedestalEvt())
         *fLog << inf << "Processing Pedestals once per event..." << endl;
@@ -475,5 +491,15 @@
         // to the shower.
         if (cnt2<=2)
+        {
             sum2 = gRandom->Uniform(max-min)+min; // FIXME? Set Seed value?
+            if (fPedPhot1 && fPedPhot2)
+            {
+                const Int_t    aidx = gpix.GetAidx();
+                const Double_t mean = fPedPhot1->GetArea(aidx).GetMean();
+                const Double_t rms  = fPedPhot2->GetArea(aidx).GetRms();
+                const Double_t phe  = gRandom->Gaus(mean, rms);
+                (*fEvt)[i].SetNumPhotons(phe);
+            }
+        }
         else
             sum2 /= cnt2*2;
Index: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h
===================================================================
--- trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h	(revision 7375)
+++ trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h	(revision 7376)
@@ -17,4 +17,8 @@
     MSignalCam    *fEvt;       //!
     MBadPixelsCam *fBadPixels; //!
+
+    MPedPhotCam   *fPedPhot1;  //! Pedestal from extractor used for "no-signal" in InterpolateTimes
+    MPedPhotCam   *fPedPhot2;  //! Pedestal from extractor used for "no-signal" in InterpolateTimes
+
 
     TList fPedPhotCams;
