Index: trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc
===================================================================
--- trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc	(revision 5505)
+++ trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc	(revision 5507)
@@ -151,4 +151,5 @@
 #include "MExtractPedestal.h"
 #include "MExtractTimeAndCharge.h"
+#include "MExtractTimeAndChargeDigitalFilter.h"
 
 #include "MParList.h"
@@ -420,6 +421,16 @@
   
   if (fExtractor)
-    fExtractor->InitArrays();
-  
+    {
+      fExtractor->InitArrays();
+      SetExtractWindow(fExtractor->GetHiGainFirst(),(Int_t)fExtractor->GetNumHiGainSamples());
+      if (fExtractor->InheritsFrom("MExtractTimeAndChargeDigitalFilter"))
+        {
+          MExtractTimeAndChargeDigitalFilter* df = (MExtractTimeAndChargeDigitalFilter*)fExtractor;
+          if (!df->IsWeightsSet())
+            if (!df->ReadWeightsFile(df->GetNameWeightsFile()))
+              return kFALSE;
+        }
+    }
+
   Print();
 
@@ -510,7 +521,7 @@
 
   // 4. Scale the mean, variance and AB-noise to the number of slices:
-  ped    /= fExtractWinSize;
-  var    /= fExtractWinSize;
-  abOffs /= fExtractWinSize;
+  ped    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
+  var    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
+  abOffs /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
   
   // 5. Calculate the RMS from the Variance:
@@ -549,7 +560,7 @@
   // 4. Scale the mean, variance and AB-noise to the number of slices:
   //
-  ped    /= fExtractWinSize;
-  var    /= fExtractWinSize;
-  abOffs /= fExtractWinSize;
+  ped    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
+  var    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
+  abOffs /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
   //
   // 5. Scale the mean, variance and AB-noise to the number of pixels:
@@ -596,7 +607,7 @@
   // 4. Scale the mean, variance and AB-noise to the number of slices:
   //
-  ped    /= fExtractWinSize;
-  var    /= fExtractWinSize;
-  abOffs /= fExtractWinSize;
+  ped    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
+  var    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
+  abOffs /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
   //
   // 5. Scale the mean, variance and AB-noise to the number of pixels:
Index: trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc
===================================================================
--- trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc	(revision 5505)
+++ trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc	(revision 5507)
@@ -137,5 +137,4 @@
 
 #include "MExtractTimeAndCharge.h"
-#include "MExtractTimeAndChargeDigitalFilter.h"
 
 #include "MParList.h"
@@ -243,15 +242,5 @@
 
   if (fExtractor)
-    {
-      SetExtractWindow(fExtractor->GetHiGainFirst(),(Int_t)fExtractor->GetNumHiGainSamples());
-      lastavailable = losamples-1;
-      if (fExtractor->InheritsFrom("MExtractTimeAndChargeDigitalFilter"))
-        {
-          MExtractTimeAndChargeDigitalFilter* df = (MExtractTimeAndChargeDigitalFilter*)fExtractor;
-          if (!df->IsWeightsSet())
-            if (!df->ReadWeightsFile(df->GetNameWeightsFile()))
-              return kFALSE;
-        }
-    }
+    lastavailable = losamples-1;
 
   // If the size is not yet set, set the size
Index: trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc
===================================================================
--- trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc	(revision 5505)
+++ trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc	(revision 5507)
@@ -122,5 +122,4 @@
 
 #include "MExtractTimeAndCharge.h"
-#include "MExtractTimeAndChargeDigitalFilter.h"
 
 #include "MParList.h"
@@ -204,16 +203,4 @@
 {
 
-  if (fExtractor)
-    {
-      SetExtractWindow(fExtractor->GetHiGainFirst(),(Int_t)fExtractor->GetNumHiGainSamples());
-      if (fExtractor->InheritsFrom("MExtractTimeAndChargeDigitalFilter"))
-        {
-          MExtractTimeAndChargeDigitalFilter* df = (MExtractTimeAndChargeDigitalFilter*)fExtractor;
-          if (!df->IsWeightsSet())
-            if (!df->ReadWeightsFile(df->GetNameWeightsFile()))
-              return kFALSE;
-        }
-    }
-  
   MExtractPedestal::ReInit(pList);
 
@@ -470,4 +457,7 @@
 {
 
+  if (fRunHeader->GetRunNumber() == 38996)
+    return kTRUE;
+  
   if (fRunHeader->GetRunNumber() < gkFirstRunWithFinalBits)
     return kFALSE;
