Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7831)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7832)
@@ -18,4 +18,25 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2006/08/02 Thomas Bretz
+
+   * mhist/MHCamEvent.cc:
+     - removed some obsolete includes
+
+   * msignal/MExtractTimeAndCharge.cc:
+     - reformatted position of a parenthesis
+
+   * msignal/MExtractTimeAndChargeDigitalFilter.cc:
+     - changed default lo-gain offset to new value 1.05 which was
+       determined plotting arrival time vs. signal height.
+     - added fHiGainFirst to time (as it is in the spline extractor)
+
+   * msignal/MSignalCam.cc:
+     - after extesive tests using the arrival time vs signal height
+       histograms, new threshold levels (independent of the pixel size)
+       have been determined for the pulse positions
+       (50phe for pulse, hi-gain and 320phe for lo-gain)
+
+
 
  2006/08/01 Thomas Bretz
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 7831)
+++ trunk/MagicSoft/Mars/NEWS	(revision 7832)
@@ -37,8 +37,14 @@
 
    - callisto: Implemented two new tabs, the pulse position of pulses
-     not saturating the hi-gain (and above 15phe) and the pulse-position
+     not saturating the hi-gain (and above 50phe) and the pulse-position
      saturating the hi-gain (means the pulse position of signal extracted
-     from the lo-gain) This can be used to check (and/or correct) the
-     hi-/lo-gain offset.
+     from the lo-gain and above 320phe) This can be used to check (and/or
+     correct) the hi-/lo-gain offset.
+
+   - callisto: After extensive tests a new threshold level for determination
+     of the pulse position has been found at 50phe. This is due to the
+     fact that for lower pulses the arrival time changes its average
+     behaviour dramatically. It tends to the average of the extraction
+     range and starts sticking to non-floating point numbers (5, 6, 7, ...)
 
    - star: changed the fit for the ffective on time such that initial
Index: trunk/MagicSoft/Mars/mhist/MHCamEvent.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCamEvent.cc	(revision 7831)
+++ trunk/MagicSoft/Mars/mhist/MHCamEvent.cc	(revision 7832)
@@ -54,7 +54,4 @@
 #include "MHCamEvent.h"
 
-#include <TCanvas.h>
-#include <TPaveStats.h>
-
 #include "MLog.h"
 #include "MLogManip.h"
Index: trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.cc	(revision 7831)
+++ trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.cc	(revision 7832)
@@ -226,5 +226,5 @@
 
           if ( fLoGainFirst <= fLoGainLast-fWindowSizeLoGain)
-            {
+          {
               const Bool_t logainabflag = (higainabflag + pixel.GetNumHiGainSamples()) & 0x1;
               FindTimeAndChargeLoGain(pixel.GetLoGainSamples()+fLoGainFirst,
Index: trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc	(revision 7831)
+++ trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc	(revision 7832)
@@ -88,5 +88,5 @@
 const Int_t  MExtractTimeAndChargeDigitalFilter::fgSignalStartBinHiGain    =  4;
 const Int_t  MExtractTimeAndChargeDigitalFilter::fgSignalStartBinLoGain    =  4;
-const Float_t MExtractTimeAndChargeDigitalFilter::fgOffsetLoGain           =  1.7; // 5 ns
+const Float_t MExtractTimeAndChargeDigitalFilter::fgOffsetLoGain           =  1.05;
 const Float_t MExtractTimeAndChargeDigitalFilter::fgLoGainStartShift       = -1.8;
 
@@ -113,6 +113,6 @@
     SetSignalStartBin();
 
-    SetOffsetLoGain(fgOffsetLoGain);
-    SetLoGainStartShift(fgLoGainStartShift);
+    SetOffsetLoGain(fgOffsetLoGain);          // Order between both
+    SetLoGainStartShift(fgLoGainStartShift);  // is important
 }
 
@@ -480,5 +480,7 @@
 
   // here, the first high-gain slice is already included in the fTimeShiftHiGain
-  time = fTimeShiftHiGain + max_p - Float_t(t_iter)/fBinningResolutionHiGain;
+//  time = fTimeShiftHiGain + max_p - Float_t(t_iter)/fBinningResolutionHiGain;
+  time = max_p + fTimeShiftHiGain + (Float_t)fHiGainFirst /* this shifts the time to the start of the rising edge */
+      - ((Float_t)t_iter)/fBinningResolutionHiGain;
 
   const Float_t timefineadjust = time_sum/sum;
Index: trunk/MagicSoft/Mars/msignal/MSignalCam.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MSignalCam.cc	(revision 7831)
+++ trunk/MagicSoft/Mars/msignal/MSignalCam.cc	(revision 7832)
@@ -643,9 +643,9 @@
         break;
 
-    case 7: // pulse position above 15phe
+    case 7: // pulse position above 50phe
         // The number of photons is not scaled with the ratio because
         // otherwise to many large pixels survive (maybe because the
         // fluctuations scale different than expected)
-        if (pix->IsPixelUnmapped() || pix->GetNumPhotons()*ratio<15)
+        if (pix->IsPixelUnmapped() || pix->GetNumPhotons()<50)
             return kFALSE;
         val = pix->GetArrivalTime();
@@ -657,5 +657,6 @@
 
     case 10: // lo gain time
-        if (pix->IsPixelUnmapped() || !pix->IsLoGainUsed())
+        if (pix->IsPixelUnmapped() || !pix->IsLoGainUsed() ||
+            pix->GetNumPhotons()<320)
             return kFALSE;
         val = pix->GetArrivalTime();
@@ -667,5 +668,5 @@
         // fluctuations scale different than expected)
         if (pix->IsPixelUnmapped() || pix->IsLoGainUsed() ||
-            pix->GetNumPhotons()*ratio<15)
+            pix->GetNumPhotons()<50)
             return kFALSE;
         val = pix->GetArrivalTime();
