Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 5333)
+++ trunk/MagicSoft/Mars/Changelog	(revision 5334)
@@ -20,4 +20,14 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2004/11/01: Markus Gaug
+
+   * msignal/MExtractTimeAndChageDigitalFilter.cc
+     - delete the pointer to derivativelo and derivativehi at the end of 
+       the function
+     - reduce the effective number of high-gain samples (used for the 
+       calculation of the pedestal RMS in the calibration) from 6. to 
+       2.5
+
 
  2004/11/01: Markus Meyer and Keiichi Mase
Index: trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc	(revision 5333)
+++ trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc	(revision 5334)
@@ -167,6 +167,10 @@
     }
   
-  fNumHiGainSamples = (Float_t)fWindowSizeHiGain;
-  fNumLoGainSamples = (Float_t)fWindowSizeLoGain;
+  // 
+  // We need here the effective number of samples which is about 2.5 in the case of a window
+  // size of 6. The exact numbers have to be found still.
+  //
+  fNumHiGainSamples = (Float_t)fWindowSizeHiGain/2.5;
+  fNumLoGainSamples = (Float_t)fWindowSizeLoGain/2.5;
   fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples);
   fSqrtLoGainSamples = TMath::Sqrt(fNumLoGainSamples);
@@ -803,4 +807,5 @@
   // Low Gain histograms
   //
+  TH1F *derivativelo = NULL;
   if (shapelo)
     {
@@ -808,9 +813,9 @@
       binwidth = shapelo->GetBinWidth(1);
       
-      TH1F *derivativelo = new TH1F(Form("%s%s",shapelo->GetName(),"_der"),
-                                    Form("%s%s",shapelo->GetTitle()," derivative"),
-                                    nbinslo,
-                                    shapelo->GetBinLowEdge(1),
-                                    shapelo->GetBinLowEdge(nbinslo)+binwidth);
+      derivativelo = new TH1F(Form("%s%s",shapelo->GetName(),"_der"),
+                              Form("%s%s",shapelo->GetTitle()," derivative"),
+                              nbinslo,
+                              shapelo->GetBinLowEdge(1),
+                              shapelo->GetBinLowEdge(nbinslo)+binwidth);
       
       //
@@ -923,5 +928,4 @@
     }
   
-
   ofstream fn(filename.Data());
 
@@ -937,4 +941,8 @@
   for (Int_t i=0; i<nsizehi; i++)
     fn << "\t" << fAmpWeightsLoGain[i] << "\t" << fTimeWeightsLoGain[i] << endl;
+
+  delete derivativehi;
+  if (derivativelo)
+    delete derivativelo;
 
   return kTRUE;
