Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 5292)
+++ trunk/MagicSoft/Mars/Changelog	(revision 5293)
@@ -19,4 +19,11 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2004/10/20: Markus Gaug
+
+   * msignal/MExtractTimeAndChargeSpline.cc
+     - fixed a small bug concerning the way the second derivatives are 
+       calculated. The effect is less than 1% on the time resolution
+
 
  2004/10/19: Abelardo Moralejo
Index: trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc	(revision 5292)
+++ trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc	(revision 5293)
@@ -341,5 +341,5 @@
 // --------------------------------------------------------------------------
 //
-// Calculates the arrival time for each pixel 
+// Calculates the arrival time and charge for each pixel 
 //
 void MExtractTimeAndChargeSpline::FindTimeAndChargeHiGain(Byte_t *first, Byte_t *logain, Float_t &sum, Float_t &dsum, 
@@ -443,5 +443,7 @@
 
   for (Int_t k=range-2;k>=0;k--)
-    fHiGainSecondDeriv[k] = (fHiGainSecondDeriv[k]*fHiGainSecondDeriv[k+1] + fHiGainFirstDeriv[k])/6.;
+    fHiGainSecondDeriv[k] = fHiGainSecondDeriv[k]*fHiGainSecondDeriv[k+1] + fHiGainFirstDeriv[k];
+  for (Int_t k=range-2;k>=0;k--)
+    fHiGainSecondDeriv[k] /= 6.;
   
   //
@@ -711,5 +713,5 @@
 // --------------------------------------------------------------------------
 //
-// Calculates the arrival time for each pixel 
+// Calculates the arrival time and charge for each pixel 
 //
 void MExtractTimeAndChargeSpline::FindTimeAndChargeLoGain(Byte_t *first, Float_t &sum, Float_t &dsum, 
@@ -791,5 +793,7 @@
   fLoGainSecondDeriv[range-1] = 0.;
   for (Int_t k=range-2;k>=0;k--)
-    fLoGainSecondDeriv[k] = (fLoGainSecondDeriv[k]*fLoGainSecondDeriv[k+1] + fLoGainFirstDeriv[k])/6.;
+    fLoGainSecondDeriv[k] = fLoGainSecondDeriv[k]*fLoGainSecondDeriv[k+1] + fLoGainFirstDeriv[k];
+  for (Int_t k=range-2;k>=0;k--)
+    fLoGainSecondDeriv[k] /= 6.;
   
   //
