Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 5363)
+++ trunk/MagicSoft/Mars/Changelog	(revision 5364)
@@ -26,4 +26,7 @@
        weights are quasi randomly chosen and applied to the first slices
        available in the set range
+   * msignal/MC_weights.dat
+    - new weights file using 6 slices for the digital filter, especially
+      made for MC pulses
 
  2004/11/09: Markus Gaug
Index: trunk/MagicSoft/Mars/msignal/MC_weights.dat
===================================================================
--- trunk/MagicSoft/Mars/msignal/MC_weights.dat	(revision 5364)
+++ trunk/MagicSoft/Mars/msignal/MC_weights.dat	(revision 5364)
@@ -0,0 +1,126 @@
+# High Gain Weights: 6 10
+# (Amplitude)  (Time) 
+ 0.114296 0.0169978
+ 0.115618 -0.0337873
+ 0.121215 -0.110726
+ 0.123261 -0.233438
+ 0.118248 -0.520165
+ -0.00433869 -0.785199
+ -0.13492 -0.853144
+ -0.340104 -0.821485
+ -0.498277 -0.737567
+ -0.60761 -0.654527
+ -0.66427 -0.4999
+ -0.7085 -0.336229
+ -0.765321 -0.149596
+ -0.820842 0.0977778
+ -0.891178 0.760617
+ -0.707161 1.47408
+ -0.452758 1.77189
+ -0.00503306 1.85263
+ 0.367852 1.8104
+ 0.65434 1.7716
+ 0.903442 1.62159
+ 1.05086 1.46518
+ 1.2189 1.43384
+ 1.41125 1.5519
+ 1.74245 1.41265
+ 2.06077 0.869214
+ 2.17577 0.349692
+ 2.18454 -0.18143
+ 2.0973 -0.556001
+ 1.98096 -0.845524
+ 1.74345 -1.02173
+ 1.63746 -1.1677
+ 1.48997 -1.44829
+ 1.29281 -1.8999
+ 0.853884 -2.12568
+ 0.351164 -1.78779
+ 0.06319 -1.37452
+ -0.191084 -0.789326
+ -0.278569 -0.434076
+ -0.320115 -0.198029
+ -0.021779 -0.145102
+ -0.0300082 -0.0777275
+ -0.052372 -0.0125135
+ -0.0700991 0.0846583
+ -0.0562428 0.142396
+ -0.0218608 0.140618
+ 0.000197343 0.130058
+ 0.0286493 0.0935811
+ 0.040315 0.0573219
+ 0.0466449 0.0288847
+ -0.192093 0.119442
+ -0.180622 0.123773
+ -0.161189 0.136938
+ -0.138763 0.158398
+ -0.101815 0.178314
+ -0.0597207 0.160502
+ -0.0328508 0.12062
+ -0.0114579 0.0716731
+ -0.00132899 0.0499316
+ 0.00461485 0.0354438
+# Low Gain Weights: 6 10
+# (Amplitude)  (Time) 
+ 0.114296 0.0169978
+ 0.115618 -0.0337873
+ 0.121215 -0.110726
+ 0.123261 -0.233438
+ 0.118248 -0.520165
+ -0.00433869 -0.785199
+ -0.13492 -0.853144
+ -0.340104 -0.821485
+ -0.498277 -0.737567
+ -0.60761 -0.654527
+ -0.66427 -0.4999
+ -0.7085 -0.336229
+ -0.765321 -0.149596
+ -0.820842 0.0977778
+ -0.891178 0.760617
+ -0.707161 1.47408
+ -0.452758 1.77189
+ -0.00503306 1.85263
+ 0.367852 1.8104
+ 0.65434 1.7716
+ 0.903442 1.62159
+ 1.05086 1.46518
+ 1.2189 1.43384
+ 1.41125 1.5519
+ 1.74245 1.41265
+ 2.06077 0.869214
+ 2.17577 0.349692
+ 2.18454 -0.18143
+ 2.0973 -0.556001
+ 1.98096 -0.845524
+ 1.74345 -1.02173
+ 1.63746 -1.1677
+ 1.48997 -1.44829
+ 1.29281 -1.8999
+ 0.853884 -2.12568
+ 0.351164 -1.78779
+ 0.06319 -1.37452
+ -0.191084 -0.789326
+ -0.278569 -0.434076
+ -0.320115 -0.198029
+ -0.021779 -0.145102
+ -0.0300082 -0.0777275
+ -0.052372 -0.0125135
+ -0.0700991 0.0846583
+ -0.0562428 0.142396
+ -0.0218608 0.140618
+ 0.000197343 0.130058
+ 0.0286493 0.0935811
+ 0.040315 0.0573219
+ 0.0466449 0.0288847
+ -0.192093 0.119442
+ -0.180622 0.123773
+ -0.161189 0.136938
+ -0.138763 0.158398
+ -0.101815 0.178314
+ -0.0597207 0.160502
+ -0.0328508 0.12062
+ -0.0114579 0.0716731
+ -0.00132899 0.0499316
+ 0.00461485 0.0354438
+
+
Index: trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc	(revision 5363)
+++ trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc	(revision 5364)
@@ -307,4 +307,6 @@
       }
 
+      //  if (IsNoiseCalculation()) return;
+
       if (sum>fmax)
       {
@@ -340,4 +342,5 @@
   
   sum = 0.;
+  time_sum = 0.;
   //
   // Slide with a window of size fWindowSizeHiGain over the sample 
@@ -347,5 +350,6 @@
   {
     const Int_t   idx = fBinningResolutionHiGain*sample + fBinningResolutionHalfHiGain + t_iter;
-    const Int_t   ids = max_p + sample;
+    const Int_t   ids = (IsNoiseCalculation()) ? sample : max_p + sample;
+    
     const Float_t pex = ids < 0 ? 0. : 
       ( ids > range ? 0. : fHiGainSignal[ids]-pedmean[(ids+abflag) & 0x1]);
@@ -456,4 +460,5 @@
   
   sum = 0.;
+  time_sum = 0.;
 
   //
@@ -464,5 +469,5 @@
   {
     const Int_t   idx = fBinningResolutionLoGain*sample + fBinningResolutionHalfLoGain + t_iter;
-    const Int_t   ids = max_p + sample;
+    const Int_t   ids = (IsNoiseCalculation()) ? sample : max_p + sample;;
     const Float_t pex = ids < 0 ? 0. : 
       ( ids > range ? 0. : fLoGainSignal[ids]-pedmean[(ids+abflag) & 0x1]);
