Index: /branches/MarsResidualTimeSpread/msimcamera/MSimCamera.cc
===================================================================
--- /branches/MarsResidualTimeSpread/msimcamera/MSimCamera.cc	(revision 18019)
+++ /branches/MarsResidualTimeSpread/msimcamera/MSimCamera.cc	(revision 18020)
@@ -180,4 +180,10 @@
     }
  */
+    fResidualTimeSpread = (MParameterD*)pList->FindObject("ResidualTimeSpread");
+    if (!fResidualTimeSpread)
+    {
+        *fLog << err << "ResidualTimeSpread [MParameterD] not found... aborting." << endl;
+        return kFALSE;
+    }
 
     // Create it here to make sure that MGeomApply will set the correct size
@@ -305,7 +311,18 @@
     fCamera->SetValidRange(TMath::FloorNint(pr), TMath::CeilNint(nlen+pl));
 
+    Double_t timeoffset[npix];
+
+
     // Add electronic noise to empty channels
     for (UInt_t i=0; i<npix; i++)
     {
+
+        // Get the ResidualTimeSpread Parameter
+        const Double_t residualTimeSpread = fResidualTimeSpread->GetVal();
+
+        // Jens Buss on residual time spread:
+        // randomly draw an additional time offset to be added to the arrivaltime 
+        // from a gaussian normal distribution with a given standard deviation 
+        timeoffset[i] = gRandom->Gaus(0.0, residualTimeSpread);
         const MPedestalPix &pix = (*fElectronicNoise)[i];
 
@@ -405,4 +422,5 @@
     //--------------------------------------------------------------------------
 
+    
     // Simulate pulses
     for (Int_t i=0; i<num; i++)
@@ -419,4 +437,8 @@
         // column to hold the offsets in ns.
         t = t + freq*fFixTimeOffsetsBetweenPixelsInNs->fM[idx][0];
+
+        // Jens Buss on residual time spread:
+        // add random time offset to the arrivaltimes
+        t = t + timeoffset[idx];
 
         // FIXME: Time jitter?
