Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8488)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8489)
@@ -56,7 +56,25 @@
      - added a new Tab to show the time development of the unsuitable
        pixels
+     - added a new tab showing the eveloution of the number of
+       dead pixels
 
    * mjobs/MJCalibration.cc:
      - updated texts in bad pixel display
+
+   * datacenter/macros/fillsignal.C:
+     - replaced CalcUnsuitable by the new members of MHCamera
+     - also fill the maximum number of unsuitable pixels
+     - and fill the maximum number of dead pixels
+
+   * mfilter/MFSoftwareTrigger.cc, mhcalib/MHCalibrationTestCam.cc,
+     mimage/MCameraSmooth.cc:
+     - removed obsolete calls to GetPixById
+
+   * msignal/MSignalCam.[h,cc]:
+     - removed obolete function to access the MSignalPix'
+     - removed obsolete GetPixById
+     - added new function returning the number of unmapped pixels
+     - a little code cleanup
+
 
 
Index: /trunk/MagicSoft/Mars/NEWS
===================================================================
--- /trunk/MagicSoft/Mars/NEWS	(revision 8488)
+++ /trunk/MagicSoft/Mars/NEWS	(revision 8489)
@@ -10,4 +10,11 @@
      calibration (ignoring the interleaved calibrations) into account.
 
+   - database: The database now has two other new values UnsuitableMax and
+     DeadMax. They express the maximum number of pixels which were
+     unsuitable, respectively dead, during the sequence. Because
+     of high pedestal rms (cars passing) a few events with very high
+     numbers of unsuitable pixels can happen. Not to suffer from this
+     effect we don't take the highest 0.1% of the numbers into account.
+
    - general: fixed a bug which caused callisto and star to stop working
      properly because the callisto output was currupted
@@ -28,4 +35,9 @@
      is usefull mainly to judge if an intermediate calibration had
      problems.
+
+   - callisto: Added a new tab "DeadPixTm" which shows the time evolution
+     of the number of dead pixels over the whole sequence. Dead pixels 
+     in this context are unmapped pixels, i.e. pixels which could not
+     be interpolated, and thus are ignored in the further analysis.
 
    - callisto: It is now possible to use the position of the maximum
Index: /trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C	(revision 8488)
+++ /trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C	(revision 8489)
@@ -63,4 +63,5 @@
 
 #include <TFile.h>
+#include <TGraph.h>
 #include <TSQLResult.h>
 
@@ -69,4 +70,5 @@
 #include "MStatusArray.h"
 #include "MHCamera.h"
+#include "MHVsTime.h"
 
 #include "MCalibrationPulseTimeCam.h"
@@ -74,14 +76,4 @@
 
 using namespace std;
-
-Int_t CalcUnsuitable(const MHCamera &cam, Float_t f)
-{
-    Int_t n = 0;
-    for (int i=0; i<cam.GetNbinsX(); i++)
-        if (cam.GetBinContent(i+1)>f)
-            n++;
-
-    return n;
-}
 
 int Process(MSQLServer &serv, TString fname, Bool_t dummy)
@@ -257,6 +249,21 @@
     }
 
-    Int_t unsuitable50 = CalcUnsuitable(*cam, 0.50);
-    Int_t unsuitable01 = CalcUnsuitable(*cam, 0.01);
+    Int_t unsuitable50 = cam->GetNumBinsAboveThreshold(0.50);
+    Int_t unsuitable01 = cam->GetNumBinsAboveThreshold(0.01);
+
+    TString unsuitablemax = "NULL";
+    TString deadmax       = "NULL";
+
+    TGraph *gr = (TGraph*)arr.FindObjectInCanvas("BadPixTm", "TGraph", "BadPixTm");
+    if (gr)
+    {
+        const Int_t p = TMath::FloorNint(gr->GetN()*0.999);
+        unsuitablemax = Form("%d", TMath::Nint(TMath::KOrdStat(gr->GetN(), gr->GetY(), p)));
+    }
+
+    gr = (TGraph*)arr.FindObjectInCanvas("DeadPixTm", "TGraph", "DeadPixTm");
+    if (gr)
+        deadmax = Form("%d", TMath::Nint(TMath::MaxElement(gr->GetN(), gr->GetY())));
+
 
 /*
@@ -316,4 +323,6 @@
     cout << "  Unsuitable > 50%:       " << setw(6) << unsuitable50 << endl;
     cout << "  Unsuitable >  1%:       " << setw(6) << unsuitable01 << endl;
+    cout << "  UnsuitableMax (99.9%)   " << setw(6) << unsuitablemax << endl;
+    cout << "  DeadMax                 " << setw(6) << deadmax << endl;
     cout << endl;
 
@@ -331,5 +340,6 @@
                          " fPulsePosOffMed=%s,    fPulsePosOffDev=%s,   "
                          " fHiLoGainRatioMed=%s,  fHiLoGainRatioDev=%s,  "
-                         " fUnsuitable50=%d,  fUnsuitable01=%d  "
+                         " fUnsuitable50=%d,  fUnsuitable01=%d, "
+                         " fUnsuitableMax=%s, fDeadMax=%s "
                          " WHERE fSequenceFirst='%d' ",
                          meanrmsinner.Data(),  meanrmsouter.Data(),
@@ -342,4 +352,5 @@
                          medhilocal.Data(),   devhilocal.Data(),
                          unsuitable50, unsuitable01,
+                         unsuitablemax.Data(), deadmax.Data(),
                          seq);
 
Index: /trunk/MagicSoft/Mars/mfilter/MFSoftwareTrigger.cc
===================================================================
--- /trunk/MagicSoft/Mars/mfilter/MFSoftwareTrigger.cc	(revision 8488)
+++ /trunk/MagicSoft/Mars/mfilter/MFSoftwareTrigger.cc	(revision 8489)
@@ -110,31 +110,27 @@
 Int_t MFSoftwareTrigger::CountPixels(Int_t idx, Float_t tm0) const
 {
-    // Try to get the pixel information of a pixel with this index
-    MSignalPix *pix = fEvt->GetPixById(idx);
-
-    // If a pixel with this index is not existing... do nothing.
-    if (!pix)
-        return 0;
+    // get the pixel information of a pixel with this index
+    MSignalPix &pix = (*fEvt)[idx];
 
     // If pixel already assigned to a cluster
-    if (pix->TestBit(kWasChecked))
-        return 0;
-
-    if (pix->IsPixelUnmapped())
+    if (pix.TestBit(kWasChecked))
+        return 0;
+
+    if (pix.IsPixelUnmapped())
         return 0;
 
     // Assign the new island number num to this used pixel
-    pix->SetBit(kWasChecked);
+    pix.SetBit(kWasChecked);
 
     // Get the size of this pixel and check threshold
-    const Double_t size = pix->GetNumPhotons()*fCam->GetPixRatio(idx);
+    const Double_t size = pix.GetNumPhotons()*fCam->GetPixRatio(idx);
     if (size<fThreshold)
         return 0;
 
-    const Float_t tm1 = pix->GetArrivalTime();
+    const Float_t tm1 = pix.GetArrivalTime();
     if (TMath::Abs(tm1-tm0)>fTimeWindow)
         return 0;
 
-    //pix->SetBit(kAboveThreshold);
+    //pix.SetBit(kAboveThreshold);
 
     Int_t num = 1;
Index: /trunk/MagicSoft/Mars/mhcalib/MHCalibrationTestCam.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhcalib/MHCalibrationTestCam.cc	(revision 8488)
+++ /trunk/MagicSoft/Mars/mhcalib/MHCalibrationTestCam.cc	(revision 8489)
@@ -230,19 +230,14 @@
     {
 
-      MHCalibrationPix &histhi = (*this)[i];
-
-      const MSignalPix *pix = calibration->GetPixById(i);
-      if (!pix)
-        continue;
-
-      const Float_t   signal = pix->GetNumPhotons();
-
+      const MSignalPix &pix = (*calibration)[i];
+
+      const Float_t signal = pix.GetNumPhotons();
       if (signal < 0.0001)
-        continue;
-      
+          continue;
+
       const Int_t aidx   = (*fGeom)[i].GetAidx();
       const Int_t sector = (*fGeom)[i].GetSector();
 
-      histhi.FillHistAndArray(signal) ;
+      (*this)[i].FillHistAndArray(signal);
 
       sumareahi  [aidx]   += signal;
Index: /trunk/MagicSoft/Mars/mimage/MCameraSmooth.cc
===================================================================
--- /trunk/MagicSoft/Mars/mimage/MCameraSmooth.cc	(revision 8488)
+++ /trunk/MagicSoft/Mars/mimage/MCameraSmooth.cc	(revision 8489)
@@ -120,10 +120,7 @@
                 const UShort_t nid = gpix.GetNeighbor(j);
 
-                const MSignalPix *evtpix = fEvt->GetPixById(nid);
-                if (evtpix)
-                {
-                    photons[i] += evtpix->GetNumPhotons();
-                    errors[i]  += evtpix->GetErrorPhot();
-                }
+                const MSignalPix &evtpix = (*fEvt)[nid];
+                photons[i] += evtpix.GetNumPhotons();
+                errors[i]  += evtpix.GetErrorPhot();
                 num++;
             }
Index: /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 8488)
+++ /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 8489)
@@ -603,7 +603,14 @@
     histbp.SetMinimum(0);
 
+    MHVsTime histdp("MSignalCam.GetNumPixelsUnmapped");
+    histdp.SetName("DeadPixTm");
+    histdp.SetTitle("Number of dead/unmapped pixels;;N");
+    histdp.SetMinimum(0);
+
     // Task to fill the histogram
-    MFillH fillB(&histbp, "MTime", "FillBadTime");
+    MFillH fillB(&histbp, "MTime", "FillBadPixTm");
+    MFillH fillD(&histdp, "MTime", "FillDeadPixTm");
     fillB.SetNameTab("BadPixTm");
+    fillD.SetNameTab("DeadPixTm");
 
     /*
@@ -765,4 +772,5 @@
     tlist2.AddToList(&fill9);
     tlist2.AddToList(&fillB);
+    tlist2.AddToList(&fillD);
     if (extractor1->HasLoGain())
     {
Index: /trunk/MagicSoft/Mars/msignal/MSignalCam.cc
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MSignalCam.cc	(revision 8488)
+++ /trunk/MagicSoft/Mars/msignal/MSignalCam.cc	(revision 8489)
@@ -18,5 +18,5 @@
 !   Author(s): Thomas Bretz, 03/2005 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2005
+!   Copyright: MAGIC Software Development, 2000-2007
 !
 !
@@ -38,6 +38,6 @@
 #include <fstream>
 
+#include <TArrayI.h>
 #include <TArrayD.h>
-#include <TCanvas.h>
 
 #include "MLog.h"
@@ -68,36 +68,13 @@
 // --------------------------------------------------------------------------
 //
-// This is not yet implemented like it should.
-//
-/*
-void MSignalCam::Draw(Option_t* option) 
-{
-    //
-    //   FIXME!!! Here the Draw function of the CamDisplay
-    //   should be called to add the CamDisplay to the Pad.
-    //   The drawing should be done in MCamDisplay::Paint
-    //
-
-    //    MGeomCam *geom = fType ? new MGeomCamMagic : new MGeomCamCT1;
-    //    MCamDisplay *disp = new MCamDisplay(geom);
-    //    delete geom;
-    //    disp->DrawPhotNum(this);
-}
-*/
-
-// --------------------------------------------------------------------------
-//
 // reset counter and delete netries in list.
 //
 void MSignalCam::Reset()
 {
-    //fNumPixels        =  0;
     fNumSinglePixels  =  0;
     fSizeSinglePixels =  0;
     fSizeSubIslands   =  0;
     fSizeMainIsland   =  0;
-    //fMaxIndex         = -1;
     fNumIslands       = -1;
-    //fLut.Set(0);
 
     fNumPixelsSaturatedHiGain = -1;
@@ -106,14 +83,4 @@
     fPixels->R__FOR_EACH(TObject, Clear)();
 }
-/*
-void MSignalCam::FixSize()
-{
-    fLut.Set(fMaxIndex+1);
-
-    if (fPixels->GetEntriesFast() == (Int_t)fNumPixels)
-        return;
-
-    fPixels->ExpandCreateFast(fNumPixels);
-}*/
 
 // --------------------------------------------------------------------------
@@ -134,30 +101,22 @@
 // --------------------------------------------------------------------------
 //
-// Checks if in the pixel list is an entry with pixel id
-//
-Bool_t MSignalCam::IsPixelExisting(Int_t id) const
-{
-    return GetPixById(id) ? kTRUE : kFALSE;
-} 
-
-// --------------------------------------------------------------------------
-//
-//   Checks if in the pixel list is an entry with pixel id
-//
-Bool_t MSignalCam::IsPixelUsed(Int_t id) const
-{
-    const MSignalPix *pix = GetPixById(id);
-    return pix ? pix->IsPixelUsed() : kFALSE;
-} 
-
-// --------------------------------------------------------------------------
-//
-//   Checks if in the pixel list is an entry with pixel id
-//
-Bool_t MSignalCam::IsPixelCore(Int_t id) const
-{
-    const MSignalPix *pix = GetPixById(id);
-    return pix ? pix->IsPixelCore() : kFALSE;
-} 
+//   Count and return the number of unmapped pixels
+//
+Int_t MSignalCam::GetNumPixelsUnmapped() const
+{
+    const UInt_t n = GetNumPixels();
+
+    if (n <= 0)
+        return -1;
+
+    Int_t cnt=0;
+    for (UInt_t i=0; i<n; i++)
+    {
+        if ((*this)[i].IsPixelUnmapped())
+            cnt++;
+    }
+
+    return cnt;
+}
 
 // --------------------------------------------------------------------------
@@ -169,9 +128,9 @@
 Float_t MSignalCam::GetNumPhotonsMin(const MGeomCam *geom) const
 {
-    if (GetNumPixels() <= 0)
+    const UInt_t n = GetNumPixels();
+
+    if (n <= 0)
         return -5.;
 
-    const UInt_t n = GetNumPixels();
-
     Float_t minval = FLT_MAX;
 
@@ -181,8 +140,4 @@
         if (!pix.IsPixelUsed())
             continue;
-
-        //const UInt_t id = pix.GetPixId();
-        //if (id<0 || id>=n)
-        //    continue;
 
         Float_t testval = pix.GetNumPhotons();
@@ -206,9 +161,9 @@
 Float_t MSignalCam::GetNumPhotonsMax(const MGeomCam *geom) const
 {
-    if (GetNumPixels() <= 0)
+    const UInt_t n = GetNumPixels();
+
+    if (n <= 0)
         return 50.;
 
-    const UInt_t n = GetNumPixels();
-
     Float_t maxval = -FLT_MAX;
 
@@ -218,8 +173,4 @@
         if (!pix.IsPixelUsed())
             continue;
-
-        //const UInt_t id = pix.GetPixId();
-        //if (id<0 || id>=n)
-        //    continue;
 
         Float_t testval = pix.GetNumPhotons();
@@ -239,10 +190,12 @@
 Float_t MSignalCam::GetRatioMin(const MGeomCam *geom) const
 {
-    if (GetNumPixels() <= 0)
+    const UInt_t n = GetNumPixels();
+
+    if (n <= 0)
         return -5.;
 
     Float_t minval = FLT_MAX;
 
-    for (UInt_t i=0; i<GetNumPixels(); i++)
+    for (UInt_t i=0; i<n; i++)
     {
         const MSignalPix &pix = (*this)[i];
@@ -252,5 +205,5 @@
         Float_t testval = pix.GetNumPhotons()/pix.GetErrorPhot();
         if (geom)
-            testval *= geom->GetPixRatioSqrt(i/*pix.GetPixId()*/);
+            testval *= geom->GetPixRatioSqrt(i);
 
         if (testval < minval)
@@ -267,10 +220,12 @@
 Float_t MSignalCam::GetRatioMax(const MGeomCam *geom) const
 {
-    if (GetNumPixels() <= 0)
+    const UInt_t n = GetNumPixels();
+
+    if (n <= 0)
         return -5.;
 
     Float_t maxval = -FLT_MAX;
 
-    for (UInt_t i=0; i<GetNumPixels(); i++)
+    for (UInt_t i=0; i<n; i++)
     {
         const MSignalPix &pix = (*this)[i];
@@ -280,5 +235,5 @@
         Float_t testval = pix.GetNumPhotons()/pix.GetErrorPhot();
         if (geom)
-            testval *= geom->GetPixRatioSqrt(i/*pix.GetPixId()*/);
+            testval *= geom->GetPixRatioSqrt(i);
 
         if (testval > maxval)
@@ -297,10 +252,12 @@
 Float_t MSignalCam::GetErrorPhotMin(const MGeomCam *geom) const
 {
-    if (GetNumPixels() <= 0)
+    const UInt_t n = GetNumPixels();
+
+    if (n <= 0)
         return 50.;
 
     Float_t minval = FLT_MAX;
 
-    for (UInt_t i=0; i<GetNumPixels(); i++)
+    for (UInt_t i=0; i<n; i++)
     {
         const MSignalPix &pix = (*this)[i];
@@ -311,5 +268,5 @@
 
         if (geom)
-            testval *= geom->GetPixRatio(i/*pix.GetPixId()*/);
+            testval *= geom->GetPixRatio(i);
 
         if (testval < minval)
@@ -327,10 +284,12 @@
 Float_t MSignalCam::GetErrorPhotMax(const MGeomCam *geom) const
 {
-    if (GetNumPixels() <= 0)
+    const UInt_t n = GetNumPixels();
+
+    if (n <= 0)
         return 50.;
 
     Float_t maxval = -FLT_MAX;
 
-    for (UInt_t i=0; i<GetNumPixels(); i++)
+    for (UInt_t i=0; i<n; i++)
     {
         const MSignalPix &pix = (*this)[i];
@@ -341,5 +300,5 @@
 
         if (geom)
-            testval *= geom->GetPixRatio(i/*pix.GetPixId()*/);
+            testval *= geom->GetPixRatio(i);
 
         if (testval > maxval)
@@ -348,86 +307,7 @@
     return maxval;
 }
-/*
-void MSignalCam::RemoveUnusedPixels()
-{
-    // Create iterator
-    TIter Next(fPixels);
-    MSignalPix *pix = NULL;
-
-    fMaxIndex = -1;
-
-    // Remove all unused pixels from list, calculate new fMaxIndex
-    while ((pix=(MSignalPix*)Next()))
-    {
-        if (!pix->IsPixelUsed())
-            fPixels->Remove(pix);
-        else
-            fMaxIndex = TMath::Max(fMaxIndex, pix->GetPixId());
-    }
-
-    // Crompress array
-    fPixels->Compress();
-
-    // Get new number of entries in array
-    fNumPixels=fPixels->GetEntriesFast();
-
-    // Rebuild lookup table
-    RebuildLut();
-}
-*/
-// --------------------------------------------------------------------------
-//
-// Return a pointer to the pixel with the requested idx. NULL if it doesn't
-// exist. The Look-up-table fLut is used. If its size is zero (according
-// to Rene this will happen if an old class object is loaded) we still
-// try to search in the array.
-//
-MSignalPix *MSignalCam::GetPixById(Int_t idx) const
-{
-    return (MSignalPix*)(fPixels->UncheckedAt(idx));
-    /*
-    if (idx<0)
-        return 0;
-
-    if (fLut.GetSize()>0)
-    {
-        if (idx>=fLut.GetSize())
-            return 0;
-        return fLut[idx]<0 ? 0 : (MSignalPix*)(fPixels->UncheckedAt(fLut[idx]));
-    }
-
-    TIter Next(fPixels);
-    MSignalPix *pix = NULL;
-
-    while ((pix=(MSignalPix*)Next()))
-        if (pix->GetPixId()==idx)
-            return pix;
-
-    return NULL;*/
-}
 
 MSignalPix *MSignalCam::AddPixel(Int_t idx, Float_t nph, Float_t er)
 {
-    /*
-    //
-    // If this is too slow or takes to much space we might use
-    // MGeomApply and an InitSize member function instead.
-    //
-    if (idx>=fLut.GetSize())
-    {
-        const Int_t n = fLut.GetSize();
-        fLut.Set(idx*2+1); //idx+1 is slower than idx*2+1
-        for (int i=n; i<idx*2+1; i++)
-            fLut[i] = -1;
-    }
-
-    fLut[idx] = fNumPixels;
-    if (idx>fMaxIndex)
-        fMaxIndex=idx;
-
-    return new ((*fPixels)[fNumPixels++]) MSignalPix(idx, nph, er);
-    */
-    //return new ((*fPixels)[idx]) MSignalPix(nph, er);
-
     MSignalPix *pix = static_cast<MSignalPix*>((*fPixels)[idx]);
     pix->Set(nph, er);
@@ -452,21 +332,17 @@
 Double_t MSignalCam::CalcIsland(const MGeomCam &geom, Int_t idx, Int_t num)
 {
-    // Try to get the pixel information of a pixel with this index
-    MSignalPix *pix = GetPixById(idx);
-
-    // If a pixel with this index is not existing... do nothing.
-    if (!pix)
+    // Get the pixel information of a pixel with this index
+    MSignalPix &pix = (*this)[idx];
+
+    // If an island number was already assigned to this pixel... do nothing.
+    if (pix.GetIdxIsland()>=0)
         return 0;
 
-    // If an island number was already assigned to this pixel... do nothing.
-    if (pix->GetIdxIsland()>=0)
+    // If the pixel is an unused pixel... do nothing.
+    if (!pix.IsPixelUsed())
         return 0;
 
-    // If the pixel is an unused pixel... do nothing.
-    if (!pix->IsPixelUsed())
-        return 0;
-
     // Assign the new island number num to this used pixel
-    pix->SetIdxIsland(num);
+    pix.SetIdxIsland(num);
 
     // Get the geometry information (neighbors) of this pixel
@@ -474,5 +350,5 @@
 
     // Get the size of this pixel
-    Double_t size = pix->GetNumPhotons();
+    Double_t size = pix.GetNumPhotons();
 
     // Now do the same with all its neighbors and sum the
@@ -603,10 +479,11 @@
 Bool_t MSignalCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
 {
-    MSignalPix *pix = GetPixById(idx);
-    if (!pix)
+    if (idx<0 || (UInt_t)idx>GetNumPixels())
         return kFALSE;
 
+    const MSignalPix &pix = (*this)[idx];
+
     // Used inlcudes status unampped
-    if (!pix->IsPixelUsed() && (type<6 || type==8))
+    if (!pix.IsPixelUsed() && (type<6 || type==8))
         return kFALSE;
 
@@ -616,29 +493,29 @@
     {
     case 1: // scaled error of phtoons
-        val = pix->GetErrorPhot()*TMath::Sqrt(ratio);
+        val = pix.GetErrorPhot()*TMath::Sqrt(ratio);
         return kTRUE;
 
     case 2: // significance of number of photons
-        if (pix->GetErrorPhot()<=0)
+        if (pix.GetErrorPhot()<=0)
             return kFALSE;
-        val = pix->GetNumPhotons()*TMath::Sqrt(ratio)/pix->GetErrorPhot();
+        val = pix.GetNumPhotons()*TMath::Sqrt(ratio)/pix.GetErrorPhot();
         return kTRUE;
 
     case 3: // number of photo electrons
-        val = pix->GetNumPhotons();
+        val = pix.GetNumPhotons();
         break;
 
     case 4: // error of signal
-        val = pix->GetErrorPhot();
+        val = pix.GetErrorPhot();
         break;
 
     case 5: // index of island
-        val = pix->GetIdxIsland();
+        val = pix.GetIdxIsland();
         break;
 
     case 6: // arrival time of mapped pixels only
-        if (pix->IsPixelUnmapped())
+        if (pix.IsPixelUnmapped())
             return kFALSE;
-        val = pix->GetArrivalTime();
+        val = pix.GetArrivalTime();
         break;
 
@@ -647,19 +524,19 @@
         // otherwise to many large pixels survive (maybe because the
         // fluctuations scale different than expected)
-        if (pix->IsPixelUnmapped() || pix->GetNumPhotons()<50)
+        if (pix.IsPixelUnmapped() || pix.GetNumPhotons()<50)
             return kFALSE;
-        val = pix->GetArrivalTime();
+        val = pix.GetArrivalTime();
         break;
 
     case 8: // arrival time
-        val = pix->GetArrivalTime();
+        val = pix.GetArrivalTime();
         break;
 
         /*
     case 10: // lo gain time
-        if (pix->IsPixelUnmapped() || !pix->IsLoGainUsed() ||
-            pix->GetNumPhotons()<320)
+        if (pix.IsPixelUnmapped() || !pix.IsLoGainUsed() ||
+            pix.GetNumPhotons()<320)
             return kFALSE;
-        val = pix->GetArrivalTime();
+        val = pix.GetArrivalTime();
         return kTRUE;
 
@@ -668,13 +545,13 @@
         // otherwise to many large pixels survive (maybe because the
         // fluctuations scale different than expected)
-        if (pix->IsPixelUnmapped() || pix->IsLoGainUsed() ||
-            pix->GetNumPhotons()<50)
+        if (pix.IsPixelUnmapped() || pix.IsLoGainUsed() ||
+            pix.GetNumPhotons()<50)
             return kFALSE;
-        val = pix->GetArrivalTime();
+        val = pix.GetArrivalTime();
         return kTRUE;
         */
 
     default:
-        val = pix->GetNumPhotons()*ratio;
+        val = pix.GetNumPhotons()*ratio;
         return kTRUE;
     }
Index: /trunk/MagicSoft/Mars/msignal/MSignalCam.h
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MSignalCam.h	(revision 8488)
+++ /trunk/MagicSoft/Mars/msignal/MSignalCam.h	(revision 8489)
@@ -4,7 +4,4 @@
 #ifndef ROOT_TClonesArray
 #include <TClonesArray.h>
-#endif
-#ifndef ROOT_TArrayI
-#include <TArrayI.h>
 #endif
 #ifndef MARS_MCamEvent
@@ -60,7 +57,5 @@
     Int_t   GetNumPixelsSaturatedLoGain() const { return fNumPixelsSaturatedLoGain; }
 
-    Bool_t  IsPixelExisting(Int_t id) const;
-    Bool_t  IsPixelUsed    (Int_t id) const;
-    Bool_t  IsPixelCore    (Int_t id) const;
+    Int_t   GetNumPixelsUnmapped() const;
 
     Float_t GetNumPhotonsMin(const MGeomCam *geom=NULL) const;
@@ -77,8 +72,5 @@
     MSignalPix &operator[](int i) const { return *(MSignalPix*)(fPixels->UncheckedAt(i)); }
 
-    MSignalPix *GetPixById(Int_t idx) const;
-
     // Functions to change the contained data
-    //void Scale(Double_t f) { fPixels->ForEach(MSignalPix, Scale)(f); }
     Int_t CalcIslands(const MGeomCam &geom);
 
