Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 5203)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 5204)
@@ -26,4 +26,10 @@
       MHCalibrationChargeCam which behaved fine until now. 
 
+  * mpedestal/MPedCalcFromLoGain.cc
+    - fixed the case that a window size of 1. is handed over which 
+      previously set the window size to the next smaller even number, 
+      which is 0. Now, it sets it to 2. This makes this class usable 
+      together with the amplitude spline.
+       
 
  2004/10/06: Hendrik Bartko
Index: /trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc
===================================================================
--- /trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc	(revision 5203)
+++ /trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc	(revision 5204)
@@ -268,4 +268,5 @@
 void MPedCalcFromLoGain::SetWindowSize(Byte_t windowh, Byte_t windowl)
 {
+
     fWindowSizeHiGain = windowh & ~1;
     fWindowSizeLoGain = windowl & ~1;
@@ -284,5 +285,19 @@
         *fLog << int(fWindowSizeLoGain) << " samples " << endl;
     }
-      
+
+    if (fWindowSizeHiGain == 0)
+    {
+        *fLog << warn;
+        *fLog << GetDescriptor() << ": HiGain window currently set to 0, will set it to 2 samples ";
+        fWindowSizeHiGain = 2;
+    }
+    
+    if (fWindowSizeLoGain == 0)
+    {
+        *fLog << warn;
+        *fLog << GetDescriptor() << ": LoGain window currently set to 0, will set it to 2 samples ";
+        fWindowSizeLoGain = 2;
+    }
+    
     const Byte_t availhirange = (fHiGainLast-fHiGainFirst+1) & ~1;
     const Byte_t availlorange = (fLoGainLast-fLoGainFirst+1) & ~1;
@@ -431,5 +446,5 @@
     if (fWindowSizeLoGain==0)
     {
-        *fLog << err << "ERROR - HiGain windows size == 0... abort." << endl;
+        *fLog << err << "ERROR - LoGain windows size == 0... abort." << endl;
         return kFALSE;
     }
@@ -564,8 +579,5 @@
 
     if (fPedestalUpdate)
-    {
-        //fPedestals->ReCalc(*fGeom);
-        fPedestals->SetReadyToSave();
-    }
+      fPedestals->SetReadyToSave();
 
     return kTRUE;
@@ -598,6 +610,6 @@
 
     fPedestals->SetTotalEntries((UInt_t)(sum/npix*(fWindowSizeLoGain+fWindowSizeHiGain)));
+    fPedestals->SetReadyToSave();
     fPedestals->ReCalc(*fGeom);
-    fPedestals->SetReadyToSave();
     return kTRUE;
 }
Index: /trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc
===================================================================
--- /trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc	(revision 5203)
+++ /trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc	(revision 5204)
@@ -237,4 +237,19 @@
           << int(fWindowSizeLoGain) << " samples " << endl;
     
+
+    if (fWindowSizeHiGain == 0)
+    {
+        *fLog << warn;
+        *fLog << GetDescriptor() << ": HiGain window currently set to 0, will set it to 2 samples ";
+        fWindowSizeHiGain = 2;
+    }
+    
+    if (fWindowSizeLoGain == 0)
+    {
+        *fLog << warn;
+        *fLog << GetDescriptor() << ": LoGain window currently set to 0, will set it to 2 samples ";
+        fWindowSizeLoGain = 2;
+    }
+
   const Byte_t availhirange = (fHiGainLast-fHiGainFirst+1) & ~1;
   const Byte_t availlorange = (fLoGainLast-fLoGainFirst+1) & ~1;
