A charge q with velocity v enter into a region with perpendular to magnetic field B, will move in a circular orbit.
The trajectory of the beam will spread out if the bean is deviated with a small angle $\theta$ (dca in the simulation)  or with small deviation in velocity (dv)

The angle $\theta$ = dca * (random() -0.5); // where random() give random number between 0-1
The velocity v=V+ dv* (random() -0.5);

The trjjectory for all different possible paths are shown in the following simulation.

/htdocs/ntnujava/ejsuser/2/users/ntnu/fkh/chargeinBvdc_pkg/chargeinBvdc.propertiesFull screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list