ECE532 Biomedical Optics
©1998
Steven L. Jacques, Scott A. Prahl
Oregon Graduate Institute
to next page

Chapter 4
Course
Home

Time-resolved Monte Carlo:

Check if photon is still ALIVE

Finally, the program checks to see if the current total photon pathlength exceeds the maximum pathlength under consideration: L >= Lmax. If so, then the photon should be terminated. The photon_status is set to DEAD (= 0). Consequently, the HOP/DROP_SPIN_CHECK DO-WHILE loop will terminate and the next photon will be launched. If all photons have been launched, i_photon = Nphotons, then the RUN DO-WHILE loop also terminates. The program is ready to create an output file for the data.

/**** CHECK if photon ALIVE 
*****/
if (L >= Lmax)
   photon_status = DEAD;

} /* end HOP/DROP_SPIN_CHECK loop */
while (photon_status == ALIVE);

  /* If photon dead, then launch new photon. */
} /* end RUN */
while (i_photon < Nphotons);

to next page | Chapter 4 | Course | Home