28.11.2014 Views

THE EGS5 CODE SYSTEM

THE EGS5 CODE SYSTEM

THE EGS5 CODE SYSTEM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

where<br />

α ′ 1 =<br />

α ′ 2 =<br />

k 0<br />

′<br />

k 0 ′ + 1 , f 1 ′′ (E ′ ) = 2E ′ , E ′ ∈ (0, 1) (2.186)<br />

1<br />

k 0 ′ + 1 , f 2 ′′ (E ′ ) = 1, E ′ ∈ (0, 1) . (2.187)<br />

Both of these sub-distributions are easily sampled.<br />

To compute the rejection function it is necessary to get sin 2 θ. Let<br />

t =<br />

m(1 − E)<br />

˘k 0 E<br />

. (2.188)<br />

Then using Equation 2.172, we have<br />

cos θ = (˘k 0 + m)˘k − ˘k 0 m<br />

˘k 0˘k<br />

= 1 + mE − m<br />

˘k 0 E<br />

= 1 − t . (2.189)<br />

Thus<br />

sin 2 θ = 1 − cos 2 θ = (1 − cos θ)(1 + cos θ) = t(2 − t) . (2.190)<br />

When the value of E is accepted, then sin θ and cos θ are obtained via<br />

sin θ =<br />

√<br />

sin 2 θ (2.191)<br />

cos θ = 1 − t . (2.192)<br />

The sampling procedure is as follows:<br />

1. Compute the parameters depending on ˘k 0 , but not E: k ′ 0 , E 0, α 1 , and α 2 .<br />

2. Sample E in the following way: If α 1 ≥ (α 1 + α 2 )ζ 1 , use E = E 0 e α 1ζ 2<br />

. Otherwise, use<br />

E = E 0 + (1 − E 0 )E ′ , where E ′ is determined from<br />

E ′ = max (ζ 3 , ζ 4 ) if k ′ 0 ≥ (k ′ 0 + 1)ζ 2<br />

or from<br />

E ′ = ζ 3 otherwise.<br />

3. Calculate t and the rejection function g(E). If ζ 4 (or ζ 5 ) < g(E), reject and return to Step 2.<br />

After determining the secondary energies, Equation 2.167 is used to obtain the scattering angles<br />

and UPHI is called to select random azimuth and to set up the secondary particles in the usual way.<br />

Note again that a more detailed treatment of Compton scattering is provided in section 2.18.<br />

65

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

Saved successfully!

Ooh no, something went wrong!