These are some particle physics snippets of code for personal reference. For proper explanation check the pages.
Simulation of a particle entering a material. A C++ calculation of the stopping power of any material (and air). It also calculates the range of the particle.
An approximation of PI with random numbers.
A High Energy Ring was designed with Win-AGILE, a tool created by P. J. Bryant for the simulation of simple lattices.
See description of the snippets in the dedicated webpage: http://ppsnippets.tk.