Index: trunk/Mars/msimcamera/MSimGeomCam.cc
===================================================================
--- trunk/Mars/msimcamera/MSimGeomCam.cc	(revision 19662)
+++ trunk/Mars/msimcamera/MSimGeomCam.cc	(revision 19663)
@@ -184,15 +184,30 @@
     // We add an additional sample at the end to support a possible shift
     // of the start time of the first event by 0 to 1 sample.
-    const Int_t   ns   = fHeader->GetNumSamplesHiGain()+1;
-
+    const Float_t  win  = (fHeader->GetNumSamplesHiGain()+1)/freq;
+
+    // First and last photon in event (in nano-seconds)
     const Float_t first = cnt>0 ? fEvt->GetTimeFirst() :  0;
-    const Float_t last  = cnt>0 ? fEvt->GetTimeLast()  : ns*freq;
+    const Float_t last  = cnt>0 ? fEvt->GetTimeLast()  : win;
 
     // Length (ns), Pulse position (Units ns)
     const Float_t pp   = fPulsePos ? fPulsePos->GetVal() : 0;
-    const Float_t pw   = fPulse    ? fPulse->GetWidth()  : 0;
+    const Float_t pw   = fPulse    ? fPulse->GetWidth()/freq : 0;
+
+    // If the trigger is ssupposed to be at position (pp),
+    // then we have to start our sampling pp before
+    // the first photon (first-pp). To have the tail
+    // of a possible previous pulse at the beginning
+    // of the window properly samples, we have to start
+    // sampling (pw) nanoseconds earlier,
+    // thus at: first-pw-pp
+    //
+    // The last possible readout window starts pp before
+    // the last photon and lasts for a width corresponding
+    // to the number of samples (win). The last pulse
+    // that should be reaosnable added to the readout
+    // window is the one which comes at the end.
 
     fStat->SetTimeMedDev(fEvt->GetTimeMedianDev());
-    fStat->SetTime(first-pp-pw, last-pp+pw + ns*freq);
+    fStat->SetTime(first-pp-pw, last-pp + win);
     fStat->SetLength(last-first);
     fStat->SetMaxIndex(fGeom->GetNumPixels()-1);
