Index: trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc	(revision 2296)
+++ trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc	(revision 2298)
@@ -78,4 +78,6 @@
 #include "MCerPhotPix.h"
 #include "MCerPhotEvt.h"
+#include "MPedestalPix.h"
+#include "MPedestalCam.h"
 #include "MBlindPixels.h"
 
@@ -122,4 +124,10 @@
         return kFALSE;
     }
+    fPed = (MPedestalCam*)pList->FindObject("MPedestalCam");
+    if (!fEvt)
+    {
+        *fLog << err << dbginf << "MPedestalCam not found... aborting." << endl;
+        return kFALSE;
+    }
 
     fGeomCam = (MGeomCam*)pList->FindObject("MGeomCam");
@@ -165,4 +173,5 @@
     Double_t *nphot = new Double_t[entries];
     Double_t *perr  = new Double_t[entries];
+    Double_t *ped   = new Double_t[entries];
 
     //
@@ -185,8 +194,10 @@
 
         nphot[i] = TESTBIT(fFlags, kUseCentralPixel) ? pix.GetNumPhotons() : 0;
-        perr[i]  = TESTBIT(fFlags, kUseCentralPixel) ? pix.GetErrorPhot()  : 0;
+        perr[i]  = TESTBIT(fFlags, kUseCentralPixel) ? (*fPed)[idx].GetPedestalRms() : 0;
+        ped[i]   = TESTBIT(fFlags, kUseCentralPixel) ? (*fPed)[idx].GetPedestal() : 0;
 
         nphot[i] *= fGeomCam->GetPixRatio(idx);
-        // FIXME: perr[i] ???
+        // FIXME? perr
+        // FIXME? ped
 
         const Int_t n = gpix.GetNumNeighbors();
@@ -199,15 +210,19 @@
 
             const MCerPhotPix *evtpix = fEvt->GetPixById(nidx);
-            if (evtpix)
-            {
-                nphot[i] += evtpix->GetNumPhotons()*fGeomCam->GetPixRatio(nidx);
-                perr[i]  += evtpix->GetErrorPhot();
-                // FIXME: perr[i] ???
-                num++;
-            }
+            if (!evtpix)
+                continue;
+
+            nphot[i] += evtpix->GetNumPhotons()*fGeomCam->GetPixRatio(nidx);
+            perr[i]  += (*fPed)[nidx].GetPedestalRms();
+            ped[i]   += (*fPed)[nidx].GetPedestal();
+            // FIXME? perr
+            // FIXME? ped
+
+            num++;
         }
 
         nphot[i] /= num*fGeomCam->GetPixRatio(idx);
         perr[i]  /= num/*FIXME:???*/;
+        ped[i]   /= num/*FIXME:???*/;
     }
 
@@ -218,9 +233,13 @@
 
             if (fPixels->IsBlind(pix.GetPixId()))
-                pix.Set(nphot[i], perr[i]);
+            {
+                pix.Set(nphot[i], -1);
+                (*fPed)[pix.GetPixId()].Set(ped[i], perr[i]);
+            }
         }
 
     delete nphot;
     delete perr;
+    delete ped;
 }
 
Index: trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.h	(revision 2296)
+++ trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.h	(revision 2298)
@@ -11,6 +11,8 @@
 
 class MGeomCam;
+class MPedestal;
 class MCerPhotEvt;
 class MBlindPixels;
+class MPedestalCam;
 
 class MBlindPixelCalc : public MTask
@@ -20,4 +22,5 @@
     MBlindPixels *fPixels;  //!
     MGeomCam     *fGeomCam; //!
+    MPedestalCam *fPed;     //!
 
     TArrayS fPixelsIdx;  // Pixel Indices for blind pixels, which are entered by the user.
