The above described example illustrates an embodiment of the invention in which the dose distributions fS(x) and gS(x) are calculated using a parameter such as step and grid size (small step size on a coarse grid for gS as in FIG. 19.2, small step size on a fine grid for fS as FIG. 19.3) or cross section (complex cross section of FIG. 21.2) with the same relatively small number of particles and th