Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 5415)
+++ trunk/MagicSoft/Mars/Changelog	(revision 5416)
@@ -39,4 +39,8 @@
      - adapt the histogram ranges slightly because I have found high 
        intensity calibration events creating non desired overflows.
+
+   * msignal/MExtractTimeAndChargeSlidingWindow.cc
+     - fixed a bug in the setting of the window which set always the
+       default before.
 
 
Index: trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSlidingWindow.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSlidingWindow.cc	(revision 5415)
+++ trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSlidingWindow.cc	(revision 5416)
@@ -150,5 +150,8 @@
 {
   
-  const Byte_t availhirange = (fHiGainLast-fHiGainFirst+1) & ~1;
+  fWindowSizeHiGain = windowh;
+  fWindowSizeLoGain = windowl;
+
+  const Byte_t availhirange = fHiGainLast-fHiGainFirst+1;
 
   if (fWindowSizeHiGain > availhirange)
@@ -162,13 +165,13 @@
     }
   
-  if (fWindowSizeHiGain<2) 
-    {
-      fWindowSizeHiGain = 2;
-      *fLog << warn << GetDescriptor() << ": High Gain window size too small, set to two samples" << endl;
+  if (fWindowSizeHiGain<1) 
+    {
+      fWindowSizeHiGain = 1;
+      *fLog << warn << GetDescriptor() << ": High Gain window size too small, set to one sample" << endl;
     }
   
   if (fLoGainLast != 0 && fWindowSizeLoGain != 0)
     {
-      const Byte_t availlorange = (fLoGainLast-fLoGainFirst+1) & ~1;
+      const Byte_t availlorange = fLoGainLast-fLoGainFirst+1;
       
       if (fWindowSizeLoGain > availlorange)
@@ -180,10 +183,4 @@
                 << ": Will set window size to: " << (int)availlorange << endl;
           fWindowSizeLoGain = availlorange;
-        }
-      
-      if (fWindowSizeLoGain<2) 
-        {
-          fWindowSizeLoGain = 2;
-          *fLog << warn << GetDescriptor() << ": Low Gain window size too small set to two samples" << endl;
         }
     }
