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.

parameters which may be needed. The action requested is then performed and control returns to<br />

the beginning of the loop. This continues until the control input has been exhausted.<br />

The <strong>EGS5</strong> code itself contains, among many other subprograms, four user-callable subroutines,<br />

BLOCK SET, P<strong>EGS5</strong>, HATCH, and SHOWER. These routines call other subroutines in the <strong>EGS5</strong> code,<br />

some of which call two user-written subroutines, HOWFAR and AUSGAB, which define the geometry<br />

and output (scoring), respectively. The user communicates with <strong>EGS5</strong> by means of the subroutines<br />

described above accessing variables contained in various COMMON blocks.<br />

To use <strong>EGS5</strong>, the user must write a MAIN program and the subroutines HOWFAR and AUSGAB.<br />

Typically, MAIN performs any initialization needed for the geometry routine HOWFAR and then sets<br />

the values of COMMON block variables which specify such things as the names of the media to be<br />

used, the desired cutoff energies, the unit of distance (e.g., centimeters, radiation lengths, etc.) and<br />

so on. MAIN must also call the new initialization routine BLOCK SET, which is used primarily to<br />

initialize data which is not defined in BLOCK DATA subprograms. At this point, MAIN may call the<br />

new PEGS subroutine P<strong>EGS5</strong> to prepare material data for the simulation (this may be skipped if<br />

an existing data set is available). A call to the HATCH subroutine then “hatches” <strong>EGS5</strong> by doing<br />

some once-only integrity checks and initializations and by reading from a data set the material<br />

data prepared by P<strong>EGS5</strong> for the media requested. With the initialization completed, simulation<br />

of the shower may begin with MAIN calling subroutine SHOWER when desired. Each call to SHOWER<br />

results in the generation of a single <strong>EGS5</strong> particle history, with the arguments to SHOWER specifying<br />

the parameters (energy, position, direction, etc.) of an individual initial particle. This permits<br />

the user the freedom to use any source distribution desired. The flow of control and data when a<br />

user-written MAIN program is linked with <strong>EGS5</strong> is illustrated in Figure 2.1. Detailed information<br />

needed to write user programs is provided in the <strong>EGS5</strong> User Manual (Appendix B of this report)<br />

As a beginning introduction, however, the reader may find it useful to first study the series of short<br />

tutorials provided in Chapter 3 of this document.<br />

Both <strong>EGS5</strong> and PEGS use MeV for the unit of energy, and all <strong>EGS5</strong> variables reference the total<br />

energy (i.e., kinetic plus rest mass) associated with particles. <strong>EGS5</strong> primarily employs the CGS<br />

system of units, but PEGS scales its outputs in units of radiation lengths for subsequent (internal)<br />

use by <strong>EGS5</strong>. By default, the centimeter is the basic working unit of distance used in <strong>EGS5</strong>, but<br />

other transport distance unit may be chosen by setting the variable DUNIT before calling HATCH (see<br />

Appendix B for details).<br />

Table 2.1 defines some of the mathematical and program symbols for entities in EGS and<br />

PEGS, as well as other symbols used in this discussion. The first column gives the item number,<br />

the second column shows the mathematical symbol used for the entities, and the third column<br />

shows the FORTRAN name for the same thing in the EGS or PEGS code. A ‘P’, ‘E’, or both in<br />

column four shows whether the item is used in PEGS, EGS, or both. 4 The fifth column contains<br />

the definition, explanation, or name of the item.<br />

A number of physical, mathematical, and derived constants are used by the codes. We have<br />

4 Even though PEGS is integrated into EGS, PEGS and EGS have retained the majority of their prior distinctiveness,<br />

sharing only a handful of variables.<br />

31

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

Saved successfully!

Ooh no, something went wrong!