28.11.2014 Views

THE EGS5 CODE SYSTEM

THE EGS5 CODE SYSTEM

THE EGS5 CODE SYSTEM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

At small path lengths t, a very large number of coefficients g l may be required to ensure<br />

convergence of the Legendre series given in Equation 2.362. The default value of the number of<br />

coefficients is set in ELASTINO to 1000, which should yield convergence for reasonably short paths<br />

in most cases. Note that since the time to compute a single distribution function depends on the<br />

square of the number of coefficients, and, typically, a very large number of distributions must be<br />

computed (the distribution function space is three dimensional, depending on material, energy, and<br />

path length, for both positrons and electrons), the total time to compute a full set of distribution<br />

functions for some problems can be very long. To speed the computation, ELASTINO works from<br />

low energy and short paths to higher energies and longer paths, re-setting at each new step the<br />

number of terms to be computed based on the number required at the previous step. Even so,<br />

computation times can be extremely long, even when error tolerances have been set fairly high,<br />

and users should be mindful of this whenever invoking the use of this distribution.<br />

Traditionally, sampling from GS distributions has been either prohibitively expensive (requiring<br />

computation of the slowly converging series) or overly approximate (using very large pre-computed<br />

data tables with limited accuracy). We have developed here new fitting and sampling techniques<br />

that overcome these drawbacks, using a scaling model that have been known for some time [27].<br />

First, the change of variables of Equation 2.363 is performed, and a reduced angle now called<br />

χ = (1 − cos(Θ))/2 is defined. The full range of angles (0 ≤ Θ ≤ π, or 0 ≤ χ ≤ 1) is then broken<br />

into 128 intervals of equal probability, with the 128 th interval further broken down into 32 subintervals<br />

of equal spacing. Because the distribution is so heavily forward peaked, in most cases the<br />

last 32 sub-intervals cover the entire range from approximately π/2 to π, which is why this region<br />

is treated specially. In each of the 287 intervals or sub-intervals, the distribution is parameterized<br />

as<br />

α<br />

f(χ) =<br />

(χ + η) 2 [1 + β(χ − χ −)(χ + − χ)] (2.365)<br />

where α, β and η are parameters of the fit (which can be determined analytically if it is assumed<br />

that the distribution function conforms the shape given above over each given interval) and χ − and<br />

χ + are the endpoints of the interval.<br />

Using the large number of angle bins which we do, this parameterization models the exact form<br />

of the distribution to a very high degree of accuracy, and, in addition, it can be sampled very<br />

quickly. As the 128 bins are equally probable, initial angle intervals can be determined trivially.<br />

When the last (128 th ) interval is selected, a linear table search is used to determine which of the 32<br />

equally spaced sub-intervals to use. This table search is usually very fast because the first several<br />

of the 32 sub-intervals typically cover 90% of the probable angles in the final interval. Once the<br />

correct bin is chosen, the distribution can be sampled quickly. We begin by inverting the first term<br />

of Equation 2.365 to produce a value of χ from<br />

χ = ηζ + χ −(χ + + η)/(χ + − χ − )<br />

, (2.366)<br />

(χ + + η)/(χ + − χ − ) − ζ<br />

and we then use 1 + β(χ − χ − )(χ + − χ) as a rejection function. Rejection efficiencies on the order<br />

of 95% are typical. Energy and pathlength interpolation is done by randomly selecting either the<br />

upper or lower bounding grid point in the tabulated mesh.<br />

95

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!