Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 8259)
+++ trunk/MagicSoft/Mars/Changelog	(revision 8260)
@@ -43,4 +43,7 @@
    * msignal/MExtractTimeAndChargeDigitalFilter.cc:
      - simplified the checks in SetWindowSize
+
+   * msignal/MC_cosmics_weights46.dat, msignal/MC_weights46.dat:
+     - added third column with zeros
 
 
Index: trunk/MagicSoft/Mars/msignal/MC_cosmics_weights46.dat
===================================================================
--- trunk/MagicSoft/Mars/msignal/MC_cosmics_weights46.dat	(revision 8259)
+++ trunk/MagicSoft/Mars/msignal/MC_cosmics_weights46.dat	(revision 8260)
@@ -1,104 +1,104 @@
 # High Gain Weights: 4 10
 # (Amplitude)  (Time)
--0.483688 -0.498619
--0.52105 -0.409251
--0.551668 -0.347732
--0.588621 -0.297486
--0.661896 -0.2371
--0.754507 -0.0572828
--0.809786 0.380243
--0.569956 1.15886
--0.0188177 1.56188
-0.366116 1.43988
-0.560145 1.24361
-0.659133 1.09171
-0.743506 1.01359
-0.842199 0.994443
-1.03659 1.08537
-1.27803 1.17221
-1.52592 1.11221
-1.87086 0.786182
-1.9451 0.195753
-1.84721 -0.202808
-1.74892 -0.438476
-1.6951 -0.598997
-1.63854 -0.777709
-1.55247 -1.00352
-1.32498 -1.37711
-1.00846 -1.77543
-0.590272 -2.03408
--0.111902 -1.86442
--0.42886 -1.06692
--0.383767 -0.46555
--0.258546 -0.122314
--0.237253 -0.0243087
--0.234402 0.036867
--0.236007 0.0905807
--0.22029 0.156137
--0.191449 0.235519
--0.139186 0.309597
--0.0270788 0.320152
-0.0388423 0.213534
-0.0424905 0.116622
+-0.483688 -0.498619     0
+-0.52105 -0.409251      0
+-0.551668 -0.347732     0
+-0.588621 -0.297486     0
+-0.661896 -0.2371       0
+-0.754507 -0.0572828    0
+-0.809786 0.380243      0
+-0.569956 1.15886       0
+-0.0188177 1.56188      0
+0.366116 1.43988        0
+0.560145 1.24361        0
+0.659133 1.09171        0
+0.743506 1.01359        0
+0.842199 0.994443       0
+1.03659 1.08537         0
+1.27803 1.17221         0
+1.52592 1.11221         0
+1.87086 0.786182        0
+1.9451 0.195753         0
+1.84721 -0.202808       0
+1.74892 -0.438476       0
+1.6951 -0.598997        0
+1.63854 -0.777709       0
+1.55247 -1.00352        0
+1.32498 -1.37711        0
+1.00846 -1.77543        0
+0.590272 -2.03408       0
+-0.111902 -1.86442      0
+-0.42886 -1.06692       0
+-0.383767 -0.46555      0
+-0.258546 -0.122314     0
+-0.237253 -0.0243087    0
+-0.234402 0.036867      0
+-0.236007 0.0905807     0
+-0.22029 0.156137       0
+-0.191449 0.235519      0
+-0.139186 0.309597      0
+-0.0270788 0.320152     0
+0.0388423 0.213534      0
+0.0424905 0.116622      0
 # Low Gain Weights: 6 10
 # (Amplitude)  (Time)
-0.0446612 -0.385273
-0.038191 -0.00418687
-0.0386966 0.0212324
-0.0402881 0.0744799
-0.0415794 0.229615
-0.0598731 0.44332
-0.0758477 0.661518
-0.101509 1.10641
-0.159323 1.64997
-0.497256 2.83685
-0.245087 3.27499
-0.140546 2.46177
-0.58086 2.2849
-0.632721 2.45587
-0.72819 2.52835
-0.889583 2.48099
-0.980812 2.50031
-1.09885 2.55892
-1.21374 2.78769
-1.61928 3.08069
-1.38544 1.95583
-1.31998 1.1792
-1.50633 0.591226
-1.50916 0.0793899
-1.5008 -0.33188
-1.47339 -0.575386
-1.45362 -0.915309
-1.40214 -1.31593
-1.34175 -1.77904
-1.0661 -2.05471
-1.31087 -1.49798
-1.33793 -1.34758
-1.10172 -1.21719
-1.08133 -1.09356
-1.04007 -0.981455
-0.976745 -1.08299
-0.930979 -1.14774
-0.874203 -1.18348
-0.816708 -1.20126
-0.587354 -1.92869
-0.783078 -1.89621
-0.792771 -1.03439
-0.622278 -0.781807
-0.61184 -0.745831
-0.578792 -0.683741
-0.537336 -0.596328
-0.51443 -0.592858
-0.482294 -0.560586
-0.462351 -0.827587
-0.317989 -1.05649
-0.459672 -0.775035
-0.468287 -0.619961
-0.374182 -0.31635
-0.376946 -0.225242
-0.367075 -0.347444
-0.340737 -0.393231
-0.321054 -0.187384
-0.320654 -0.225558
-0.302148 -0.399499
-0.232954 -0.607578
+0.0446612 -0.385273     0
+0.038191 -0.00418687    0
+0.0386966 0.0212324     0
+0.0402881 0.0744799     0
+0.0415794 0.229615      0
+0.0598731 0.44332       0
+0.0758477 0.661518      0
+0.101509 1.10641        0
+0.159323 1.64997        0
+0.497256 2.83685        0
+0.245087 3.27499        0
+0.140546 2.46177        0
+0.58086 2.2849          0
+0.632721 2.45587        0
+0.72819 2.52835         0
+0.889583 2.48099        0
+0.980812 2.50031        0
+1.09885 2.55892         0
+1.21374 2.78769         0
+1.61928 3.08069         0
+1.38544 1.95583         0
+1.31998 1.1792          0
+1.50633 0.591226        0
+1.50916 0.0793899       0
+1.5008 -0.33188         0
+1.47339 -0.575386       0
+1.45362 -0.915309       0
+1.40214 -1.31593        0
+1.34175 -1.77904        0
+1.0661 -2.05471         0
+1.31087 -1.49798        0
+1.33793 -1.34758        0
+1.10172 -1.21719        0
+1.08133 -1.09356        0
+1.04007 -0.981455       0
+0.976745 -1.08299       0
+0.930979 -1.14774       0
+0.874203 -1.18348       0
+0.816708 -1.20126       0
+0.587354 -1.92869       0
+0.783078 -1.89621       0
+0.792771 -1.03439       0
+0.622278 -0.781807      0
+0.61184 -0.745831       0
+0.578792 -0.683741      0
+0.537336 -0.596328      0
+0.51443 -0.592858       0
+0.482294 -0.560586      0
+0.462351 -0.827587      0
+0.317989 -1.05649       0
+0.459672 -0.775035      0
+0.468287 -0.619961      0
+0.374182 -0.31635       0
+0.376946 -0.225242      0
+0.367075 -0.347444      0
+0.340737 -0.393231      0
+0.321054 -0.187384      0
+0.320654 -0.225558      0
+0.302148 -0.399499      0
+0.232954 -0.607578      0
Index: trunk/MagicSoft/Mars/msignal/MC_weights46.dat
===================================================================
--- trunk/MagicSoft/Mars/msignal/MC_weights46.dat	(revision 8259)
+++ trunk/MagicSoft/Mars/msignal/MC_weights46.dat	(revision 8260)
@@ -1,104 +1,104 @@
 # High Gain Weights: 4 10
 # (Amplitude)  (Time)
--0.483688 -0.498619
--0.52105 -0.409251
--0.551668 -0.347732
--0.588621 -0.297486
--0.661896 -0.2371
--0.754507 -0.0572828
--0.809786 0.380243
--0.569956 1.15886
--0.0188177 1.56188
-0.366116 1.43988
-0.560145 1.24361
-0.659133 1.09171
-0.743506 1.01359
-0.842199 0.994443
-1.03659 1.08537
-1.27803 1.17221
-1.52592 1.11221
-1.87086 0.786182
-1.9451 0.195753
-1.84721 -0.202808
-1.74892 -0.438476
-1.6951 -0.598997
-1.63854 -0.777709
-1.55247 -1.00352
-1.32498 -1.37711
-1.00846 -1.77543
-0.590272 -2.03408
--0.111902 -1.86442
--0.42886 -1.06692
--0.383767 -0.46555
--0.258546 -0.122314
--0.237253 -0.0243087
--0.234402 0.036867
--0.236007 0.0905807
--0.22029 0.156137
--0.191449 0.235519
--0.139186 0.309597
--0.0270788 0.320152
-0.0388423 0.213534
-0.0424905 0.116622
+-0.483688 -0.498619           0
+-0.52105 -0.409251            0
+-0.551668 -0.347732           0
+-0.588621 -0.297486           0
+-0.661896 -0.2371             0
+-0.754507 -0.0572828          0
+-0.809786 0.380243            0
+-0.569956 1.15886             0
+-0.0188177 1.56188            0
+0.366116 1.43988              0
+0.560145 1.24361              0
+0.659133 1.09171              0
+0.743506 1.01359              0
+0.842199 0.994443             0
+1.03659 1.08537               0
+1.27803 1.17221               0
+1.52592 1.11221               0
+1.87086 0.786182              0
+1.9451 0.195753               0
+1.84721 -0.202808             0
+1.74892 -0.438476             0
+1.6951 -0.598997              0
+1.63854 -0.777709             0
+1.55247 -1.00352              0
+1.32498 -1.37711              0
+1.00846 -1.77543              0
+0.590272 -2.03408             0
+-0.111902 -1.86442            0
+-0.42886 -1.06692             0
+-0.383767 -0.46555            0
+-0.258546 -0.122314           0
+-0.237253 -0.0243087          0
+-0.234402 0.036867            0
+-0.236007 0.0905807           0
+-0.22029 0.156137             0
+-0.191449 0.235519            0
+-0.139186 0.309597            0
+-0.0270788 0.320152           0
+0.0388423 0.213534            0
+0.0424905 0.116622            0
 # Low Gain Weights: 6 10
 # (Amplitude)  (Time)
-0.0446612 -0.385273
-0.038191 -0.00418687
-0.0386966 0.0212324
-0.0402881 0.0744799
-0.0415794 0.229615
-0.0598731 0.44332
-0.0758477 0.661518
-0.101509 1.10641
-0.159323 1.64997
-0.497256 2.83685
-0.245087 3.27499
-0.140546 2.46177
-0.58086 2.2849
-0.632721 2.45587
-0.72819 2.52835
-0.889583 2.48099
-0.980812 2.50031
-1.09885 2.55892
-1.21374 2.78769
-1.61928 3.08069
-1.38544 1.95583
-1.31998 1.1792
-1.50633 0.591226
-1.50916 0.0793899
-1.5008 -0.33188
-1.47339 -0.575386
-1.45362 -0.915309
-1.40214 -1.31593
-1.34175 -1.77904
-1.0661 -2.05471
-1.31087 -1.49798
-1.33793 -1.34758
-1.10172 -1.21719
-1.08133 -1.09356
-1.04007 -0.981455
-0.976745 -1.08299
-0.930979 -1.14774
-0.874203 -1.18348
-0.816708 -1.20126
-0.587354 -1.92869
-0.783078 -1.89621
-0.792771 -1.03439
-0.622278 -0.781807
-0.61184 -0.745831
-0.578792 -0.683741
-0.537336 -0.596328
-0.51443 -0.592858
-0.482294 -0.560586
-0.462351 -0.827587
-0.317989 -1.05649
-0.459672 -0.775035
-0.468287 -0.619961
-0.374182 -0.31635
-0.376946 -0.225242
-0.367075 -0.347444
-0.340737 -0.393231
-0.321054 -0.187384
-0.320654 -0.225558
-0.302148 -0.399499
-0.232954 -0.607578
+0.0446612 -0.385273           0
+0.038191 -0.00418687          0
+0.0386966 0.0212324           0
+0.0402881 0.0744799           0
+0.0415794 0.229615            0
+0.0598731 0.44332             0
+0.0758477 0.661518            0
+0.101509 1.10641              0
+0.159323 1.64997              0
+0.497256 2.83685              0
+0.245087 3.27499              0
+0.140546 2.46177              0
+0.58086 2.2849                0
+0.632721 2.45587              0
+0.72819 2.52835               0
+0.889583 2.48099              0
+0.980812 2.50031              0
+1.09885 2.55892               0
+1.21374 2.78769               0
+1.61928 3.08069               0
+1.38544 1.95583               0
+1.31998 1.1792                0
+1.50633 0.591226              0
+1.50916 0.0793899             0
+1.5008 -0.33188               0
+1.47339 -0.575386             0
+1.45362 -0.915309             0
+1.40214 -1.31593              0
+1.34175 -1.77904              0
+1.0661 -2.05471               0
+1.31087 -1.49798              0
+1.33793 -1.34758              0
+1.10172 -1.21719              0
+1.08133 -1.09356              0
+1.04007 -0.981455             0
+0.976745 -1.08299             0
+0.930979 -1.14774             0
+0.874203 -1.18348             0
+0.816708 -1.20126             0
+0.587354 -1.92869             0
+0.783078 -1.89621             0
+0.792771 -1.03439             0
+0.622278 -0.781807            0
+0.61184 -0.745831             0
+0.578792 -0.683741            0
+0.537336 -0.596328            0
+0.51443 -0.592858             0
+0.482294 -0.560586            0
+0.462351 -0.827587            0
+0.317989 -1.05649             0
+0.459672 -0.775035            0
+0.468287 -0.619961            0
+0.374182 -0.31635             0
+0.376946 -0.225242            0
+0.367075 -0.347444            0
+0.340737 -0.393231            0
+0.321054 -0.187384            0
+0.320654 -0.225558            0
+0.302148 -0.399499            0
+0.232954 -0.607578            0
Index: trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc	(revision 8259)
+++ trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc	(revision 8260)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MExtractTimeAndChargeDigitalFilter.cc,v 1.75 2006-11-02 17:54:22 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MExtractTimeAndChargeDigitalFilter.cc,v 1.76 2007-01-16 14:14:37 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -46,4 +46,10 @@
 // setting all weights to 1
 //
+// The digital filter can even do a little extrapolation around the
+// extraction window. For real Pulses having their maximum around
+// slice 0 the extracted time is similar to a gaussian around 0 with
+// sigma 0.4.
+//
+//
 // Input Containers:
 //   MRawEvtData
@@ -125,8 +131,21 @@
 void MExtractTimeAndChargeDigitalFilter::SetWindowSize(Int_t windowh, Int_t windowl)
 {
-  fWindowSizeHiGain = windowh;
-  fWindowSizeLoGain = windowl;
-  
-  const Int_t availhirange = (Int_t)(fHiGainLast-fHiGainFirst+1);
+    if (windowh > fHiGainLast-fHiGainFirst+1)
+    {
+        *fLog << err << "ERROR - The new hi-gain window size exceeds the extraction range." << endl;
+        return;
+    }
+
+    if (windowl > fLoGainLast-fLoGainFirst+1)
+    {
+        *fLog << err << "ERROR - The new hi-gain window size exceeds the extraction range." << endl;
+        return;
+    }
+
+    fWindowSizeHiGain = windowh;
+    fWindowSizeLoGain = windowl;
+
+  /*
+  const Int_t availhirange = (Int_t)();
 
   if (fWindowSizeHiGain > availhirange)
@@ -167,5 +186,5 @@
           *fLog << warn << GetDescriptor() << ": Low Gain window size set to two samples" << endl;
         }
-    }
+    }*/
   // 
   // We need here the effective number of samples which is about 2.5 in the case of a window
