Index: trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 5873)
+++ trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 5874)
@@ -934,5 +934,5 @@
     {
 
-      if (!fExtractor->InheritsFrom("MExtractTimeAndCharge"))
+      if (fExtractor->InheritsFrom("MExtractTimeAndCharge"))
         {
 
@@ -941,4 +941,12 @@
           pedcalc.SetExtractWindow((Int_t)f, win);
           pedlogain.SetExtractWindow((Int_t)(15+f), win);
+
+        }
+      else
+        {
+          const Float_t f = 0.5+fExtractor->GetHiGainFirst();
+          const Float_t n = 0.5+fExtractor->GetNumHiGainSamples();
+          pedcalc.SetExtractWindow((Int_t)f, (Int_t)n);
+          pedlogain.SetExtractWindow((Int_t)(15+f), (Int_t)n);
 
           if (fExtractionType!=kFundamental)
@@ -949,11 +957,4 @@
               fExtractionType=kFundamental;
             }
-        }
-      else
-        {
-          const Float_t f = 0.5+fExtractor->GetHiGainFirst();
-          const Float_t n = 0.5+fExtractor->GetNumHiGainSamples();
-          pedcalc.SetExtractWindow((Int_t)f, (Int_t)n);
-          pedlogain.SetExtractWindow((Int_t)(15+f), (Int_t)n);
         }
       
