Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 5373)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 5374)
@@ -40,4 +40,7 @@
      - added treatment of IsNoiseCalculation() for the "integral" 
        method.
+
+   * msignal/MExtractTimeAndChargeSlidingWindow.cc
+     - added treatment of IsNoiseCalculation().
 
 
Index: /trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSlidingWindow.cc
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSlidingWindow.cc	(revision 5373)
+++ /trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSlidingWindow.cc	(revision 5374)
@@ -246,5 +246,5 @@
   Int_t count = 0;  // counter to recognize the AB-flag
 
-  Float_t pedes        = ped.GetPedestal();
+  const Float_t pedes  = ped.GetPedestal();
   const Float_t ABoffs = ped.GetPedestalABoffset();
 
@@ -276,4 +276,7 @@
       sat++;
   
+  if (IsNoiseCalculation())
+    return;
+   
   //
   // Calculate the i-th sum as
@@ -287,15 +290,15 @@
   for (p=first; p+fWindowSizeHiGain<end; p++)
     {
-
+      
       const Int_t ids      = fHiGainFirst + count + fWindowSizeHiGain;
       const Float_t signal = (Float_t)*(p+fWindowSizeHiGain) - PedMean[(ids+abflag) & 0x1];      
       sum                 += signal - fHiGainSignal[count];
       fHiGainSignal[count + fWindowSizeHiGain] = signal;
-
+      
       if (sum>max)
-	{
-	  max   = sum;
+        {
+          max   = sum;
           idx   = count+1;
-	}
+        }
       count++;
     }
@@ -303,5 +306,5 @@
   if (fHiLoLast != 0)
     {
-
+      
       // 
       // overlap bins
@@ -311,5 +314,5 @@
       while (p < end && l < logain+fHiLoLast)
         {
-
+          
           const Int_t   ids    = fHiGainFirst + count + fWindowSizeHiGain;
           const Float_t signal = (Float_t)*l - PedMean[(ids+abflag) & 0x1];          
@@ -319,5 +322,5 @@
           if (*l++ >= fSaturationLimit)
             sat++;
-
+          
           if (sum>max)
             {
@@ -327,5 +330,5 @@
           p++;
         }
-
+      
       if (fHiLoLast > fWindowSizeHiGain)
         {
@@ -339,5 +342,5 @@
               if (*(l+fWindowSizeHiGain) >= fSaturationLimit)
                 sat++;
-
+              
               if (sum>max)
                 {
@@ -346,7 +349,7 @@
                 }
               l++;
-            }
-        }
-    }
+            } /* while (l < logain + fHiLoLast) */
+        } /* if (fHiLoLast > fWindowSizeHiGain) */
+    } /* if (fHiLoLast != 0) */
 
   //
@@ -416,4 +419,7 @@
       sat++;
   
+  if (IsNoiseCalculation())
+    return;
+
   //
   // Calculate the i-th sum as
Index: /trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc	(revision 5373)
+++ /trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc	(revision 5374)
@@ -684,5 +684,5 @@
       // 
       Int_t startslice = IsNoiseCalculation() ? 0 : (Int_t)(fAbMaxPos - fRiseTime);
-      Int_t lastslice  = IsNoiseCalculation() ? (Int_t)(fRiseTime+fFallTim) : (Int_t)(fAbMaxPos + fFallTime);
+      Int_t lastslice  = IsNoiseCalculation() ? (Int_t)(fRiseTime+fFallTime) : (Int_t)(fAbMaxPos + fFallTime);
       
       if (startslice < 0)
@@ -1035,5 +1035,5 @@
       // 
       Int_t startslice = IsNoiseCalculation() ? 0 : (Int_t)(fAbMaxPos - fRiseTime);
-      Int_t lastslice  = IsNoiseCalculation() ? (Int_t)(fRiseTime+fFallTim) : (Int_t)(fAbMaxPos + fFallTime + 1);
+      Int_t lastslice  = IsNoiseCalculation() ? (Int_t)(fRiseTime+fFallTime) : (Int_t)(fAbMaxPos + fFallTime + 1);
       
       if (startslice < 0)
