Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 3267)
+++ trunk/MagicSoft/Mars/Changelog	(revision 3268)
@@ -10,4 +10,8 @@
    * mraw/MRawEvtPixelIter.h
      - include GetNumHiGainSamples and GetNumLoGainSamples
+
+   * mcalib/MExtractBlindPixel.[h,cc]
+     - included const Getter to MRawEvtPixelIter
+     - included calculation of pedestals in PostProcess
 
 
Index: trunk/MagicSoft/Mars/mcalib/MExtractBlindPixel.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MExtractBlindPixel.cc	(revision 3267)
+++ trunk/MagicSoft/Mars/mcalib/MExtractBlindPixel.cc	(revision 3268)
@@ -40,4 +40,7 @@
 #include "MRawEvtPixelIter.h"
 
+#include "MPedestalCam.h"
+#include "MPedestalPix.h"
+
 #include "MExtractedSignalBlindPixel.h"
 
@@ -49,5 +52,5 @@
 const Byte_t MExtractBlindPixel::fgSaturationLimit = 254;
 const Byte_t MExtractBlindPixel::fgFirst =  3;
-const Byte_t MExtractBlindPixel::fgLast  = 14;
+const Byte_t MExtractBlindPixel::fgLast  = 16;
 
 // --------------------------------------------------------------------------
@@ -98,4 +101,10 @@
     }
 
+    fPedestals = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam"));
+    if (!fPedestals)
+    {
+        *fLog << err << AddSerialNumber("MPedestalCam") << " not found... aborting." << endl;
+        return kFALSE;
+    }
 
     fBlindPixel = (MExtractedSignalBlindPixel*)pList->FindCreateObj(AddSerialNumber("MExtractedSignalBlindPixel"));
@@ -177,7 +186,29 @@
       *fLog << warn << "WARNING - saturation occurred in the Blind Pixel " << endl;
 
+    //
+    // catch the pointer to the event, because MHCalibrationChargeBlindPix will need it later
+    //
+    fPixelIter = &pixel;
+
     fBlindPixel->SetReadyToSave();
 
     return kTRUE;
+}
+
+Int_t MExtractBlindPixel::PostProcess()
+{
+
+    MPedestalPix &pedpix  = (*fPedestals)[fBlindPixelIdx];    
+
+    if (&pedpix)
+    {
+	 fPed       = pedpix.GetPedestal()   * fNumSamples;
+	 fPedErr    = pedpix.GetPedestalRms()* fNumSamples / TMath::Sqrt((Float_t)fPedestals->GetTotalEntries());
+	 fPedRms    = pedpix.GetPedestalRms()* TMath::Sqrt((Float_t)fNumSamples);
+	 fPedRmsErr = fPedErr/2.;
+    }
+
+    return kTRUE;
+
 }
 
Index: trunk/MagicSoft/Mars/mcalib/MExtractBlindPixel.h
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MExtractBlindPixel.h	(revision 3267)
+++ trunk/MagicSoft/Mars/mcalib/MExtractBlindPixel.h	(revision 3268)
@@ -17,5 +17,5 @@
 class MRawEvtData;
 class MRawRunHeader;
-
+class MRawEvtPixelIter;
 class MPedestalCam;
 class MExtractedSignalBlindPixel;
@@ -33,4 +33,6 @@
   MRawEvtData         *fRawEvt;       // raw event data (time slices)
   MRawRunHeader       *fRunHeader;    // RunHeader information
+  MRawEvtPixelIter    *fPixelIter;    // pointer to the MRawEvt information
+  MPedestalCam        *fPedestals;    // pointer to the pedestal information
   
   Byte_t  fFirst;
@@ -42,6 +44,12 @@
   UInt_t  fBlindPixelIdx;
 
+  Float_t fPed;
+  Float_t fPedErr;
+  Float_t fPedRms;
+  Float_t fPedRmsErr;
+
   Int_t  PreProcess(MParList *pList);
   Int_t  Process();
+  Int_t  PostProcess();
   void   StreamPrimitive(ofstream &out) const;
   
@@ -50,8 +58,15 @@
   MExtractBlindPixel(const char *name=NULL, const char *title=NULL);
 
+  const MRawEvtPixelIter *GetPixelIter()    const { return fPixelIter; }
+
   // Setters
   void SetRange(const Byte_t first=fgFirst, const Byte_t last=fgLast);
   void SetSaturationLimit(const Byte_t lim=fgSaturationLimit) { fSaturationLimit = lim; }
-  void SetBlindPixelIdx( const UInt_t idx=fgBlindPixelIdx  ) { fBlindPixelIdx = idx;   }  
+  void SetBlindPixelIdx(  const UInt_t idx=fgBlindPixelIdx  ) { fBlindPixelIdx   = idx; }  
+
+  Float_t GetPed()       const { return fPed;       }
+  Float_t GetPedErr()    const { return fPedErr;    }
+  Float_t GetPedRms()    const { return fPedRms;    }
+  Float_t GetPedRmsErr() const { return fPedRmsErr; }
 
   ClassDef(MExtractBlindPixel, 0) // Task to fill the Extracted BlindPixel Containers from raw data
@@ -59,2 +74,3 @@
 
 #endif
+
