Index: trunk/MagicSoft/Mars/melectronics/MAvalanchePhotoDiode.cc
===================================================================
--- trunk/MagicSoft/Mars/melectronics/MAvalanchePhotoDiode.cc	(revision 9518)
+++ trunk/MagicSoft/Mars/melectronics/MAvalanchePhotoDiode.cc	(revision 9565)
@@ -123,10 +123,13 @@
     //            return 0;
 
+    // Number of the x/y cell in the one dimensional array
     // const Int_t cell = fHist.GetBin(x, y);
     const Int_t cell = x + (fHist.GetNbinsX()+2)*y;
 
-    // This is the fastes way to access the bin-contents in fArray
+    // Getting a reference to the float is the fastes way to
+    // access the bin-contents in fArray
     Float_t &cont = fHist.GetArray()[cell];
 
+    // Calculate the time since the last breakdown
     // const Double_t dt = t-fHist.GetBinContent(x, y)-fDeadTime; //
     const Float_t dt = t-cont-fDeadTime;
@@ -136,7 +139,13 @@
         return 0;
 
-    // Signal height (in units of one photon) produced after dead time
-    const Float_t weight = fRecoveryTime<=0 ? 1 : 1.-exp(-dt/fRecoveryTime);
-
+    // The signal height (in units of one photon) produced after dead time
+    // depends on the recovery of the cell - described by an exponential.
+    const Float_t weight = fRecoveryTime<=0 ? 1. : 1-TMath::Exp(-dt/fRecoveryTime);
+
+    // The probability that the cell emits a photon causing crosstalk
+    // scales as the signal height.
+    const Float_t prob = weight*fCrosstalkProb;
+
+    // Set the contents to the time of the last breakdown (now)
     cont = t; // fHist.SetBinContent(x, y, t)
 
@@ -161,14 +170,15 @@
      */
 
+
     //for (int i=0; i<1; i++)
     while (1)
     {
         const Double_t rndm = gRandom->Rndm();
-        if (rndm>=fCrosstalkProb)
+        if (rndm>=prob/*fCrosstalkProb*/)
             break;
 
-        // We can re-use the random number becuase it is uniformely
+        // We can re-use the random number because it is uniformely
         // distributed. This saves cpu power
-        const Int_t dir = TMath::FloorNint(4*rndm/fCrosstalkProb);
+        const Int_t dir = TMath::FloorNint(4*rndm/prob/*fCrosstalkProb*/);
 
         // Get a random neighbor which is hit.
