Index: trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc	(revision 6685)
+++ trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc	(revision 6686)
@@ -356,6 +356,10 @@
       while (p < end)
 	{
-	  if (*p++ > max)
-	    maxpos = p-start-1;
+	  if (*p > max)
+	    {
+	      max = *p;
+	      maxpos = p-start-1;
+	    }
+	  p++;
 	}
 
@@ -366,7 +370,13 @@
       while (p < end)
 	{
-	  if (*p++ > max)
-	    maxpos = p-start+pixel.GetNumHiGainSamples() - 1;
+	  if (*p > max)
+	    {
+	      max = *p;
+	      maxpos = p-start+pixel.GetNumHiGainSamples() - 1;
+	    }
+	  p++;
 	}
+
+      *fLog << err << (Int_t)max <<  "  " << maxpos << endl;
 
       if ((Int_t)max < fLowerSignalLimit)
@@ -376,4 +386,6 @@
       histhi.FillHist(time);
         
+      *fLog << inf << time << endl;
+
       const Int_t aidx   = (*fGeom)[i].GetAidx();
       const Int_t sector = (*fGeom)[i].GetSector();
