Index: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc
===================================================================
--- trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc	(revision 6705)
+++ trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.cc	(revision 6858)
@@ -53,5 +53,5 @@
 //
 //  Input Containers:
-//   MCerPhotEvt
+//   MSignalCam
 //   MPedPhotCam
 //   MBadPixelsCam
@@ -59,5 +59,5 @@
 //
 //  Output Containers:
-//   MCerPhotEvt
+//   MSignalCam
 //
 /////////////////////////////////////////////////////////////////////////////
@@ -79,6 +79,6 @@
 #include "MGeomCam.h"
 
-#include "MCerPhotPix.h"
-#include "MCerPhotEvt.h"
+#include "MSignalPix.h"
+#include "MSignalCam.h"
 
 #include "MPedPhotPix.h"
@@ -88,5 +88,5 @@
 #include "MBadPixelsCam.h"
 
-#include "MArrivalTime.h"
+//#include "MArrivalTime.h"
 
 ClassImp(MBadPixelsTreat);
@@ -132,5 +132,5 @@
 //
 //  - Try to find or create MBlindPixels in parameter list.
-//  - get the MCerPhotEvt from the parlist (abort if missing)
+//  - get the MSignalCam from the parlist (abort if missing)
 //  - if no pixels are given by the user try to determin the starfield
 //    from the monte carlo run header.
@@ -145,8 +145,8 @@
     }
 
-    fEvt = (MCerPhotEvt*)pList->FindObject(AddSerialNumber("MCerPhotEvt"));
+    fEvt = (MSignalCam*)pList->FindObject(AddSerialNumber("MSignalCam"));
     if (!fEvt)
     {
-        *fLog << err << AddSerialNumber("MCerPhotEvt") << " not found... aborting." << endl;
+        *fLog << err << AddSerialNumber("MSignalCam") << " not found... aborting." << endl;
         return kFALSE;
     }
@@ -191,23 +191,8 @@
             {
                 *fLog << err << AddSerialNumber(o->GetName()) << " [MPedPhotCam] not found... aborting." << endl;
-                //*fLog << " Use  MBadPixelsTreat::SetProcessPedestalRun(kFALSE)  and" << endl;
-                //*fLog << " MBadPixelsTreat::SetProcessPedestalEvt(kFALSE) to switch" << endl;
-                //*fLog << " Pedestal treatment off." << endl;
                 return kFALSE;
             }
 
             fPedPhotCams.Add(p);
-        }
-    }
-
-    fTimes = 0;
-    if (IsProcessTimes())
-    {
-        fTimes = (MArrivalTime*)pList->FindObject(AddSerialNumber("MArrivalTime"));
-        if (!fTimes)
-        {
-            *fLog << err << AddSerialNumber("MArrivalTime") << " not found... aborting." << endl;
-            *fLog << " Use MBadPixelsTreat::SetProcessTimes(kFALSE) to switch time interpolation off." << endl;
-            return kFALSE;
         }
     }
@@ -245,5 +230,5 @@
     for (UShort_t i=0; i<entries; i++)
     {
-        MCerPhotPix *pix = fEvt->GetPixById(i);
+        MSignalPix *pix = fEvt->GetPixById(i);
 
         //
@@ -255,5 +240,5 @@
         //
         // Get a pointer to this pixel. If it is not yet existing
-        // create a new entry for this pixel in MCerPhotEvt
+        // create a new entry for this pixel in MSignalCam
         //
         if (!pix)
@@ -301,5 +286,5 @@
             // Check whether the neighbor has a signal stored
             //
-            const MCerPhotPix *evtpix = fEvt->GetPixById(nidx);
+            const MSignalPix *evtpix = fEvt->GetPixById(nidx);
             if (!evtpix)
                 continue;
@@ -416,5 +401,5 @@
         if (num < fNumMinNeighbors)
         {
-            MCerPhotPix *pix =fEvt->GetPixById(i);
+            MSignalPix *pix =fEvt->GetPixById(i);
             if (!pix)
                 pix = fEvt->AddPixel(i, 0, 0);
@@ -454,5 +439,5 @@
 void MBadPixelsTreat::InterpolateTimes() const
 {
-    Int_t n = fTimes->GetSize();
+    Int_t n = fEvt->GetNumPixels();
 
     for (int i=0; i<n; i++)
@@ -474,5 +459,5 @@
         for (unsigned int j=0; j<time.GetSize(); j++)
         {
-            const Double_t t = (*fTimes)[gpix.GetNeighbor(j)];
+            const Double_t t = (*fEvt)[j].GetArrivalTime();
             if (t>=0)
                 time[n0++] = t;
@@ -498,163 +483,7 @@
         // FIXME: Request a minimum number of neighbors to take action?
         if (p0>=0 && p1>=0 && TMath::Abs(time[p0] - time[p1])<250)
-            fTimes->SetTime(i, (time[p0]+time[p1])/2);
-    }
-}
-
-// --------------------------------------------------------------------------
-//
-//  Replaces each pixel (signal, signal error, pedestal, pedestal rms)
-//  by the average of its surrounding pixels.
-//  If TESTBIT(fFlags, kUseCentralPixel) is set the central pixel is also
-//  included.
-//
-//  NT: Informations about the interpolated pedestals are added. 
-//      When the option Interpolated is called, the blind pixel with the new
-//      values of signal and fluttuation is included in the calculation of
-//      the Image Parameters.
-//
-/*
-void MBadPixelsTreat::Interpolate() const
-{
-    const UShort_t entries = fGeomCam->GetNumPixels();
-
-    //
-    // Create arrays
-    //
-    TArrayD nphot(entries);
-    TArrayD perr(entries);
-    TArrayD ped(entries);
-    TArrayD pedrms(entries);
- 
-    //
-    // Loop over all pixels
-    //
-    for (UShort_t i=0; i<entries; i++)
-    {
-        MCerPhotPix *pix = fEvt->GetPixById(i);
-
-        //
-        // Check whether pixel with idx i is blind
-        //
-        if (pix && (*fBadPixels)[i].IsOK())
-            continue;
-
-        //
-        // Get a pointer to this pixel. If it is not yet existing
-        // create a new entry for this pixel in MCerPhotEvt
-        //
-        if (!pix)
-        {
-            pix = fEvt->AddPixel(i, 0, 0);
-            (*fBadPixels)[i].SetUnsuitable(MBadPixelsPix::kUnsuitableEvt);
-        }
-
-        //
-        // Get the corresponding geometry and pedestal
-        //
-        const MGeomPix &gpix    = (*fGeomCam)[i];
-        const MPedPhotPix &ppix = (*fPedPhot)[i];
-
-        // Do Not-Use-Central-Pixel
-        const Bool_t nucp = !TESTBIT(fFlags, kUseCentralPixel);
-
-        Int_t num = nucp ? 0 : 1;
-
-        nphot[i]  = nucp ? 0 : pix->GetNumPhotons();
-        ped[i]    = nucp ? 0 : ppix.GetMean();
-        perr[i]   = nucp ? 0 : Pow2(pix->GetErrorPhot());
-        pedrms[i] = nucp ? 0 : Pow2(ppix.GetRms());
-
-        //
-	// The values are rescaled to the small pixels area for the right comparison
-        //
-        const Double_t ratio = fGeomCam->GetPixRatio(i);
-
-        if (nucp)
-        {
-            nphot[i]  *= ratio;
-            perr[i]   *= ratio;
-            ped[i]    *= ratio;
-            pedrms[i] *= ratio;
-        }
-
-        //
-        // Loop over all its neighbors
-        //
-        const Int_t n = gpix.GetNumNeighbors();
-        for (int j=0; j<n; j++)
-        {
-            const UShort_t nidx = gpix.GetNeighbor(j);
-
-            //
-            // Do not use blind neighbors
-            //
-            if ((*fBadPixels)[nidx].IsBad())
-                continue;
-
-            //
-            // Check whether the neighbor has a signal stored
-            //
-            const MCerPhotPix *evtpix = fEvt->GetPixById(nidx);
-            if (!evtpix)
-                continue;
-
-            //
-            // Get the geometry for the neighbor
-            //
-            const Double_t nratio = fGeomCam->GetPixRatio(nidx);
-            MPedPhotPix &nppix    = (*fPedPhot)[nidx];
-
-            //
-	    // The error is calculated as the quadratic sum of the errors
-	    //
-            nphot[i]  += nratio*evtpix->GetNumPhotons();
-            ped[i]    += nratio*nppix.GetMean();
-            perr[i]   += nratio*Pow2(evtpix->GetErrorPhot());
-	    pedrms[i] += nratio*Pow2(nppix.GetRms());
-
-            num++;
-        }
-
-        if (num<fNumMinNeighbors)
-        {
-            pix->SetPixelUnmapped();
-            nphot[i]  = 0;
-            ped[i]    = 0;
-            perr[i]   = 0;
-            pedrms[i] = 0;
-            continue;
-        }
-
-        //
-	// Now the mean is calculated and the values rescaled back to the pixel area
-        //
-	nphot[i] /= num*ratio;
-        ped[i]   /= num*ratio;
-        perr[i]   = TMath::Sqrt(perr[i]/(num*ratio));
-        pedrms[i] = TMath::Sqrt(pedrms[i]/(num*ratio));
-
-    }
-
-    //
-    // Now the new pixel values are calculated and can be replaced in
-    // the corresponding containers
-    //
-    for (UShort_t i=0; i<entries; i++)
-    {
-        //
-        // Do not use blind neighbors
-        //
-        if ((*fBadPixels)[i].IsOK())
-            continue;
-
-        //
-        // It must exist, we have created it in the loop before.
-        //
-        fEvt->GetPixById(i)->Set(nphot[i], perr[i]);
-        (*fPedPhot)[i].Set(ped[i], pedrms[i]);
-    }
-}
-*/
+            (*fEvt)[i].SetArrivalTime((time[p0]+time[p1])/2);
+    }
+}
 
 // --------------------------------------------------------------------------
@@ -673,8 +502,6 @@
     for (UShort_t i=0; i<entries; i++)
     {
-        MCerPhotPix &pix = (*fEvt)[i];
-
-        if (IsPixelBad(pix.GetPixId()))
-            pix.SetPixelUnmapped();
+        if (IsPixelBad(i))
+            (*fEvt)[i].SetPixelUnmapped();
     }
 }
Index: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h
===================================================================
--- trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h	(revision 6705)
+++ trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h	(revision 6858)
@@ -7,7 +7,6 @@
 
 class MGeomCam;
-class MCerPhotEvt;
+class MSignalCam;
 class MPedPhotCam;
-class MArrivalTime;
 class MBadPixelsCam;
 
@@ -16,7 +15,5 @@
 private:
     MGeomCam      *fGeomCam;   //!
-    //MPedPhotCam   *fPedPhot;   //!
-    MCerPhotEvt   *fEvt;       //!
-    MArrivalTime  *fTimes;     //!
+    MSignalCam    *fEvt;       //!
     MBadPixelsCam *fBadPixels; //!
 
@@ -26,5 +23,4 @@
     Byte_t fNumMinNeighbors;
 
-    //TString fNamePedPhotCam; // name of the 'MPedPhotCam' container
     TList fNamePedPhotCams;
 
