Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 6869)
+++ trunk/MagicSoft/Mars/Changelog	(revision 6870)
@@ -56,4 +56,16 @@
    * mjobs/MJStar.cc:
      - replaced MCerPhotEvt by MSignalCam
+
+   * msignal/cosmics_weights46.dat, msignal/calibration_weightsUV46.dat,
+     mjobs/hilocalib_df46.root:
+     - added
+
+  * mbase/MLogHtml.cc:
+     - fixed a bug in Underline which cause a crash if fOut==NULL
+     - output a message if file cannot be opened
+
+   * mhcalib/MHCalibrationPulseTimeCam.cc:
+     - for some output there was a replacement of pix.GetPixId()
+       by hist.GetName() <undocumented>
 
 
@@ -178,4 +190,31 @@
      - removed MFSelStandard
      - removed MFSelFinal
+
+
+
+ 2005/03/19 Markus Gaug
+ 
+   * mjobs/hilocalib_df46.root
+     - added new intercalibration file for digital filter 4sl higain 
+       and 6 slices logain
+
+   * mjobs/MJCalibration.cc
+      - exchanged intercalibration file from hilocalib_df_4.root to  
+        hilocalib_df46.root
+
+   * mjobs/MJPedestal.cc
+     - exchanged two (Int_t)'s by TMath::Nint().
+     - undocumented(!) change to the calculation of the extraction
+       range (PulsePosCheck)
+
+   * callisto.rc
+     - exchanged default weights file for Digital filter from
+       cosmics_weights4.dat to cosmics_weights46.dat and from 
+       calibration_weights_UV4.dat to calibration_weights_UV46.dat!
+       This change is absolutely necessary, given the new results from 
+       Nuria about the signal resolution in the low gain which gets worse
+       than the intrinsic Poisson jitter above 350 phes. Also the time
+       resolution is too bad. This was not known before we had the  
+       correct low-gain MC pulse.
 
 
Index: trunk/MagicSoft/Mars/callisto.rc
===================================================================
--- trunk/MagicSoft/Mars/callisto.rc	(revision 6869)
+++ trunk/MagicSoft/Mars/callisto.rc	(revision 6870)
@@ -100,10 +100,10 @@
 # weights file depending on what you are extracting
 # -------------------------------------------------------------------------
-MJPedestalC2.ExtractSignal.WeightsFile:          msignal/calibration_weights_UV4.dat
-MJPedestalY2.ExtractSignal.WeightsFile:          msignal/cosmics_weights4.dat
-MJPedestalY3.ExtractSignal.WeightsFile:          msignal/cosmics_weights4.dat
-MJCalibration.ExtractSignal.WeightsFile:         msignal/calibration_weights_UV4.dat
-MJCalibrateSignal.ExtractSignal.WeightsFile:     msignal/cosmics_weights4.dat
-MJCalibrateSignal.ExtractInterlaced.WeightsFile: msignal/calibration_weights_UV4.dat
+MJPedestalC2.ExtractSignal.WeightsFile:          msignal/calibration_weights_UV46.dat
+MJPedestalY2.ExtractSignal.WeightsFile:          msignal/cosmics_weights46.dat
+MJPedestalY3.ExtractSignal.WeightsFile:          msignal/cosmics_weights46.dat
+MJCalibration.ExtractSignal.WeightsFile:         msignal/calibration_weights_UV46.dat
+MJCalibrateSignal.ExtractSignal.WeightsFile:     msignal/cosmics_weights46.dat
+MJCalibrateSignal.ExtractInterlaced.WeightsFile: msignal/calibration_weights_UV46.dat
 #MJCalibrateSignal.ExtractSignal.LoGainStretch:     1.5
 #MJCalibrateSignal.ExtractInterlaced.LoGainStretch: 1.5
@@ -203,5 +203,5 @@
 # Use this if you want to change the higain-vs. logain intercalibration
 # -------------------------------------------------------------------------
-#MJCalibration.HiLoCalibFile:    mjobs/hilocalib_df4.root
+#MJCalibration.HiLoCalibFile:    mjobs/hilocalib_df46.root
 #MJCalibration.HiLoCalibration:  yes
 
@@ -309,5 +309,5 @@
 #MJPedestalY2.PulsePosCheck: yes
 #MJPedestalY2.ExtractWinLeft:  2.5
-#MJPedestalY2.ExtractWinRight: 5.0
+#MJPedestalY2.ExtractWinRight: 4.5
 
 # -------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mbase/MLogHtml.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLogHtml.cc	(revision 6869)
+++ trunk/MagicSoft/Mars/mbase/MLogHtml.cc	(revision 6870)
@@ -47,4 +47,6 @@
         delete fOut;
         fOut = NULL;
+
+        cerr << "Cannot open file " << name << ": " << strerror(errno) << endl;
         return;
     }
@@ -81,4 +83,7 @@
 void MLogHtml::Underline()
 {
+    if (!fOut)
+        return;
+
     *fOut << "<u>";
     fUnderline = kTRUE;
Index: trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc	(revision 6869)
+++ trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc	(revision 6870)
@@ -547,5 +547,5 @@
     {
       *fLog << warn << GetDescriptor()
-	    << ": Only overflow or underflow in hi-gain pixel: " << pix.GetPixId() << endl;
+	    << ": Only overflow or underflow in hi-gain pixel: " << hist.GetName() << endl;
       return;
     }  
Index: trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 6869)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 6870)
@@ -178,5 +178,5 @@
 const Int_t MJCalibration::gkThirdBlindPixelInstallation   = 43308;
 const TString MJCalibration::fgReferenceFile = "mjobs/calibrationref.rc";
-const TString MJCalibration::fgHiLoCalibFile = "mjobs/hilocalib_df4.root";
+const TString MJCalibration::fgHiLoCalibFile = "mjobs/hilocalib_df46.root";
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 6869)
+++ trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 6870)
@@ -33,4 +33,7 @@
 #include "MJPedestal.h"
 
+// C/C++ includes
+#include <fstream>
+
 // root classes
 #include <TF1.h>
@@ -86,6 +89,4 @@
 #include "MFTriggerPattern.h"
 
-#include <fstream>
-
 ClassImp(MJPedestal);
 
@@ -94,6 +95,7 @@
 const TString  MJPedestal::fgReferenceFile   = "mjobs/pedestalref.rc";
 const TString  MJPedestal::fgBadPixelsFile   = "mjobs/badpixels_0_559.rc";
-const Float_t  MJPedestal::fgExtractWinLeft  = 2.5;
-const Float_t  MJPedestal::fgExtractWinRight = 5.0;
+const Float_t  MJPedestal::fgExtractWinLeft  = 3.5;
+const Float_t  MJPedestal::fgExtractWinRight = 4.5;
+
 // --------------------------------------------------------------------------
 //
@@ -1291,5 +1293,5 @@
         // Get the ranges for the new extractor setting
         //
-        const Int_t newfirst = (Int_t)(meanpulsetime-fExtractWinLeft);
+        const Int_t newfirst = TMath::Nint(meanpulsetime-fExtractWinLeft);
         Int_t wshigain = fExtractor->InheritsFrom("MExtractTimeAndCharge") 
           ?  ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeHiGain()
@@ -1302,8 +1304,8 @@
           ? ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeLoGain()
           : 6;
-        if (wslogain > 6)
-          wslogain = 6;
-
-        const Int_t newlast  = (Int_t)(meanpulsetime+fExtractWinRight);
+        if (wslogain > 4)
+          wslogain = 4;
+
+        const Int_t newlast  = TMath::Nint(meanpulsetime+fExtractWinRight);
 
         *fLog << all << underline 
@@ -1331,5 +1333,5 @@
             *fLog << "Try to use a different extractor (e.g. with a window size of only 4 sl.) or:" << endl;
             *fLog << "Set the limit to a lower value (callisto.rc: line 329): " << endl;
-            *fLog << "    MJPedestalY2:ExtractWinRight: 5.0           " << endl;
+            *fLog << "    MJPedestalY2:ExtractWinRight: 4.5           " << endl;
             *fLog << "(ATTENTION, you will lose late cosmics pulses!)" << endl;
             *fLog << endl;
Index: trunk/MagicSoft/Mars/msignal/calibration_weights_UV46.dat
===================================================================
--- trunk/MagicSoft/Mars/msignal/calibration_weights_UV46.dat	(revision 6870)
+++ trunk/MagicSoft/Mars/msignal/calibration_weights_UV46.dat	(revision 6870)
@@ -0,0 +1,104 @@
+# High Gain Weights: 4 10
+# (Amplitude)  (Time)
+-0.735581 -0.673266
+-0.800386 -0.47606
+-0.902801 -0.192719
+-0.945945 0.237423
+-0.851618 0.770424
+-0.598107 1.28444
+-0.290663 1.69546
+0.0967702 1.89144
+0.362204 1.98161
+0.610111 2.06506
+0.919902 2.20752
+1.12282 1.94486
+1.46305 1.70309
+1.85728 1.58904
+2.19155 1.21011
+2.37154 0.603168
+2.37187 0.000360131
+2.25639 -0.535921
+2.12495 -0.948388
+1.97328 -1.286
+1.72155 -1.70358
+1.55218 -1.75991
+1.21489 -1.86382
+0.759117 -2.09403
+0.266577 -2.03167
+-0.102906 -1.60487
+-0.284545 -1.16641
+-0.367327 -0.679947
+-0.376403 -0.3943
+-0.379568 -0.229929
+-0.218954 0.0443019
+-0.22659 0.163101
+-0.195144 0.249649
+-0.136182 0.328464
+-0.0541723 0.334035
+-0.00249719 0.207255
+0.00794832 0.102902
+0.00785676 0.0396167
+0.00459524 0.0111356
+0.00887564 0.0405
+# 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
Index: trunk/MagicSoft/Mars/msignal/cosmics_weights46.dat
===================================================================
--- trunk/MagicSoft/Mars/msignal/cosmics_weights46.dat	(revision 6870)
+++ trunk/MagicSoft/Mars/msignal/cosmics_weights46.dat	(revision 6870)
@@ -0,0 +1,104 @@
+# High Gain Weights: 4 10
+# (Amplitude)  (Time)
+-0.637443 -0.648763
+-0.707555 -0.610204
+-0.772465 -0.469694
+-0.896081 -0.305143
+-1.02783 0.00696361
+-1.03684 0.731979
+-0.73698 1.49428
+-0.23419 1.57509
+0.12767 1.83675
+0.441087 1.70526
+0.639658 1.50546
+0.806192 1.58667
+0.966865 1.41151
+1.24058 1.34506
+1.58293 1.39453
+2.02092 1.46038
+2.31508 0.8539
+2.31705 0.051831
+2.18497 -0.493294
+2.01129 -0.749924
+1.8675 -0.959329
+1.75322 -1.25026
+1.60962 -1.37231
+1.3216 -1.58832
+0.880364 -1.9924
+0.219661 -2.50675
+-0.35077 -1.96955
+-0.553454 -0.855454
+-0.491715 -0.387673
+-0.38701 -0.0297507
+-0.293549 0.092153
+-0.278646 0.194742
+-0.263716 0.25195
+-0.221238 0.323789
+-0.121941 0.381038
+0.00379863 0.393009
+0.0805122 0.201843
+0.0443888 -0.0531952
+-0.0199606 -0.175625
+-0.0809393 -0.21419
+# 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
