SLAC 265 Appendix 2
EGS4 User Manual


About this document

This document is an HTML version of SLAC-265 Appendix 2 written by


                      Walter R. Nelson

              Stanford Linear Accelerator Center

                     Stanford University

                  Stanford, CA 94305, U.S.A.





                       Hideo Hirayama

      National Laboratory for High Energy Physics (KEK)

           Oho-machi, Tsukuba-gun, Ibaraki, Japan





                     David W. O. Rogers

             National Research Council of Canada

                   Ottawa K1A 0R6, Canada





                     31 December 1985


A2. EGS4 USER MANUAL

A2.1 Introduction


A2.2 General Description of Implementation

As described in Chapter 2 of SLAC-265 ("The EGS4 Code System"), the EGS code itself consists of two User-Callable subroutines, HATCH and SHOWER, which in turn call the other subroutines in the EGS code, some of which call two User- Written subroutines, HOWFAR and AUSGAB. This is best illus- trated with the aid of Fig. A2.2.1.

To use EGS the user must write a "User Code." This consists of a MAIN program and the subroutines HOWFAR and AUSGAB, the latter two determining the geometry and output (scoring), respectively. Additional auxiliary subprograms might be included in the User Code to facilitate matters. The user can communicate with EGS by means of various COMMON variables. Usually MAIN will perform any initialization needed for the geometry routine, HOWFAR, and sets the values of certain EGS COMMON variables which specify such things as names of the media to be used, the desired cutoff energies, and the distance unit to be used (e.g., inches, centimeters, radiation lengths, etc.). MAIN then calls the HATCH subroutine which "hatches EGS" by doing necessary once-only initialization and by reading material data for the media from a data set that had been previously created by PEGS. This initialization completed, MAIN may then call SHOWER when desired. Each call to SHOWER results in a gener- ation of one history (often referred to as a "case"). The arguments to SHOWER specify the parameters of the incident particle initiating the cascade.

In addition, macro definitions can be included in MAIN in order to control or over-ride various functions in EGS as well as in the User-Written codes.




     +---------+                      +-------------+

     |  User   |                      | Information |

     | Control |                      |  Extracted  |       U

     |  Data   |                      | From Shower |       S

     +---------+                      +-------------+       E

         ***                                 *              R

         ***                                ***

         ***                               *****            C

        *****                               ***             O

         ***                                ***             D

          *                                 ***             E

     +---------+          +--------+     +--------+

     |  MAIN   |          | HOWFAR |     | AUSGAB |<----- + +---------+ +--------+ +--------+ | | | A A A A | | | | | | | | | | | +-----------+ | |="====" |="=====" |="============" |="==========" |="|=" |="=======" |="=" | | | | | | | | | | +--------+ | | | V V | | | | | +-------+ +--------+ +--------+ +--------+ | | HATCH | | SHOWER |--->| ELECTR |   +->| PHOTON |--> + |

 +-------+  +--------+    +--------+   |  +--------+    | |

     *           |         |           |                | | E

    ***          +-------> | --------> +                | | G

   *****                +--+                            | | S

    ***                 |   +-------+        +-------+  | |

    ***                 +-->| MSCAT |     +--| COMPT |<-+ | C *** | +-------+ | +-------+ | | O *** | +--| PAIR |<-+ | D *** | +-------+ | +-------+ | | E *** +-->| ANNIH |--+  |             | |

+---------+             |   +-------+  |  |  +-------+  | |

|  Media  |             +-->| BHABHA|--+  |  | PHOTO |<-+ | | Data | | +-------+ | | +-------+ | | (PEGS) | +-->| MOLLER|--+  |      |        |

+---------+             |   +-------+  |  |      |        |

                        +-->| BREMS |--+  |      +------> +

+---------+             |   +-------+  |  |               |

|  BLOCK  |             |              V  V               |

|  DATA   |             |            +------+             |

|(Default)|             +----------> | UPHI |-----------> +

+---------+                          +------+





       Fig. A2.2.1  Flow Control with User Using EGS



In summary, the user communicates with EGS by means of:


     1.)  Subroutines HATCH  --- to establish media data



                      SHOWER --- to initiate the cascade



                      HOWFAR --- to specify the geometry



                      AUSGAB --- to score and output the



                                 results



     2.)  COMMON blocks --- by changing values of variables



     3.)  Macro definitions --- re-definition of pre-defined

                                features.

To reiterate, we shall refer to the MAIN/HOWFAR/AUSGAB combination (plus auxiliary subprograms and macros) as the User Code. The following sections discuss these things in greater detail.


A2.3 The COMMON Blocks

Listed here are the names of the COMMON blocks relevant to the user (and relevant variables contained in them) with a brief description of their functions. Their useage will be discussed in more detail in subsequent sections. The easiest way to declare any of the COMMON blocks is with the COMIN macro. For example, COMIN/STACK,BOUNDS/ will automatically expand to the correct COMMON/STACK/ and COMMON/BOUNDS/ forms [Note: An asterisk (*) in the left column indicates a change from EGS3].


                       Table A2.3.1



-----------------------------------------------------------------

  COMMON BLOCK  VARIABLE              FUNCTION

-----------------------------------------------------------------

    BOUNDS        ECUT     Array of regions' charged particle

                           cutoff energies in MeV.



                  PCUT     Array of regions' photon cutoff

                           energies in MeV.



                  VACDST   Distance to transport in vacuum

                           (default=1.E8).



    EPCONT        EDEP     Energy deposited in MeV (Double

                           Precision).



                  TSTEP    Distance to next interaction (cm)



                  TUSTEP   Total (curved) step length

                           requested.



                  USTEP    User (straight line) step length

                           requested and granted.



                  TVSTEP   Actual total (curved) step length

                           to be transported.



                  VSTEP    Actual (straight line) step

                           length to be transported.



                  IDISC    User discard request flag (to be set

                           in HOWFAR).  IDISC .GT. 0 means user re-

                           quests immediate discard, IDISC .LT. 0

                           means user requests discard after com-

                           pletion of transport, and IDISC=0 (de-

                           fault) means no user discard requested.



                  IROLD    Index of previous region.



                  IRNEW    Index of new region.



      *           RHOF     Value of density correction (default=1)



                  EOLD     Charged particle (total) energy

                           at beginning of step in MeV.



                  ENEW     Charged particle (total) energy

                           at end of step in MeV.



      *           BETA2    Beta squared for present particle.

                           (Note: BETA is no longer included).



                  IAUSFL   Array of flags for turning on

                           various calls to AUSGAB.



                  EKE      Kinetic energy of charged

                           particle in MeV.



    EPCONT        ELKE     Natural logarithm of EKE.



                  GLE      Natural logarithm of photon energy.



                  TSCAT    See Eq. 2.14.82 in SLAC-265.



    MEDIA         NMED     Number of media being used

                           (default=1).



                  MEDIA    Array containing names of media

                           (default is NaI).



      *           IRAYLM   Array of flags for turning on (=1)

                           coherent (Rayleigh) scattering in

                           various media.  Set in HATCH based

                           on values of IRAYLR.



                  RLC      Array containing radiation

                           lengths of the media in cm.



                  RLDU     Array containing radiation

                           lengths of the media in distance

                           units established by DUNIT.



                  RHO      Array containing density of the

                           media in g/cm**3.



    MISC          MED      Array containing medium index for

                           each region.



                  DUNIT    The distance unit to be used.

                           DUNIT=1 (default) establishes all

                           distances in cm; whereas,

                           DUNIT=2.54 establishes all

                           distances in inches.



                  KMPI     FORTRAN unit number (default=12)

                           from which to read material data.



                  KMPO     FORTRAN unit number (default=8) on

                           which to "echo" material data (e.g.,

                           printed output, "dummy" output, etc.).



                  RHOR     Array containing the density for each

                           region (g/cm**3).  If this is differ-

                           ent than the default density for the

                           medium for that region, the cross

                           sections and stopping powers (with

                           the exception of the density effect)

                           are scaled appropriately.



      *           NOSCAT   Number of times multiple scattering

                           has been bypassed in subroutine MSCAT

                           (initialized to 0 in BLOCK DATA).



      *           IRAYLR   Array of flags for turning on (=1)

                           coherent (Rayleigh) scattering in

                           various regions (default=0).



    RANDOM        IXX      Random number generator seed

                           (default=123456789).



    STACK            Note: This COMMON block contains the

                           information about the particles

                           currently in the shower.  All

                           of the following variables are

                           arrays except NP.



                  E        Total energy in MeV (Double

                           Precision).



                  X,Y,Z    Position of particle in units

                           established by DUNIT.



                  U,V,W    Direction cosines of particle (not

                           necessarily normalized---see

                           Section A2.4.1c).



                  DNEAR    A lower bound of distance from

                           (X,Y,Z) to nearest surface of

                           current region.



    STACK         WT       Statistical weight of current particle

                           (default=1.0).  To be used in conjunc-

                           tion with variance reduction tech-

                           niques as determined by user.



                  IQ       Integer charge of particle

                           (+1,0,-1).



                  IR       Index of particle's current region.



                  NP       The stack pointer (i.e., the

                           particle currently being pointed

                           to).  Also, the number of particles

                           on the stack.



    THRESH        RMT2     Twice the electron rest mass

                           energy in MeV.



                  RMSQ     Electron rest mass energy squared

                           in MeV-squared.



                  AP       Array containing PEGS lower photon

                           cutoff energy for each medium in

                           MeV.



                  UP       Array containing PEGS upper photon

                           cutoff energy for each medium in

                           MeV.



                  AE       Array containing PEGS lower charged

                           particle cutoff energy for each

                           medium in MeV.



                  UE       Array containing PEGS upper charged

                           particle cutoff energy for each

                           medium in MeV.



                  TE       Same as AE except kinetic energy

                           rather than total energy.



                  THMOLL   Array containing the Moller thresh-

                           hold energy (THMOLL=AE+TE) for

                           each medium in MeV.



    UPHIOT        THETA    Collision scattering angle (polar).



                  SINTHE   Sine of THETA.



                  COSTHE   Cosine of THETA.



                  SINPHI   Sine of PHI (the azimuthal

                           scattering angle of the collision).



                  COSPHI   Cosine of PHI.



                  PI       Pi.



                  TWOPI    Twice pi.



    USEFUL        MEDIUM   Index of current medium.  If

                           vacuum, then MEDIUM=0.



                  MEDOLD   Index of previous medium.



                  RM       Electron rest mass energy in MeV.



                  PRM      "Precision" electron rest mass

                           energy in MeV (Double Precision).



                  PRMT2    Twice PRM (Double Precision).



      *           IBLOBE   Flag indicating if photon is below

                           binding energy (EBINDA) after a

                           photoelectric interaction (yes=1).


A2.4 The Sequence of Operations

The sequence of operations needed for the correct operation of EGS is shown below along with sections in this chapter for additional details.


     Step 1. User-Over-Ride-Of-EGS-Macros (A2.4.1).

     Step 2. Pre-HATCH-Call-Initialization (A2.4.2).

     Step 3. HATCH-Call (A2.4.3).

     Step 4. Initialization-For-HOWFAR (A2.4.4).

     Step 5. Initialization-For-AUSGAB (A2.4.5).

     Step 6. Determination-Of-Incident-Particle-Parameters

             (A2.4.6).

     Step 7. SHOWER-Call (A2.4.7).

     Step 8. Output-Of-Results (A2.4.8).

The following are restrictions on the order of these operations:

  1. Step 1 must precede use of EGS macros by user.
  2. Step 2 must precede Step 3.
  3. Steps 3 through 6 must precede Step 7.
  4. Step 5 may be repeated as often as desired, depending on whether information on single showers or many showers is desired (e.g., for shower fluctuation or conversion efficiency calculations).
  5. At least one Step 7 must precede the first Step 8.

Details for the above steps are given in the following sub-sections.

A2.4.1 User-Over-Ride-Of-EGS-Macros (Step 1)

EGS macros which the user might want to over-ride include the following:

Array Dimensions


           $MXMED   Maximum number of media (default=10).

           $MXREG   Maximum number of regions (default=2000).

For example, to extend the number of media to 25, include the statement

             REPLACE {$MXMED} WITH {25}

in the User Code.

Pseudo-Random Number Generation

Whenever EGS (or the User Code) requires a float- ing point random number uniform in the interval (0,1) in a variable, say RNUMBR, the following statement type is included:

             $RANDOMSET RNUMBR;

For efficiency purposes, EGS currently uses an "in-line" simulation of the SLAC system routine called RAN6. If the user desires to use some other random number generator (e.g., RAN10), this can be most easily accomplished by including the override macro

             REPLACE {$RANDOMSET#;} WITH {{P1}=RAN10(0);}

in the User Code at Step 1 (prior to any corres- ponding pattern). Note, however, that not using an in-line random number generator slows EGS down significantly. Of course, the user must make sure that the random number generator is properly initialized. As an example, suppose we wish to "seed" the random number generator in the User Code by the statement

             IXX=987654321;

which could be included at any step prior to Step 7. To properly initialize, however, the associated COMMON block, RANDOM, would have to be included in the declaration section of the User Code. This is best done with the statement

             COMIN/RANDOM/;
If no initialization is provided, EGS automatic- ally seeds with IXX=123456789 in BLOCK DATA (default). SLAC users should note that RAN6 must be re-seeded (with an odd integer number) for any new run of the same problem in order to avoid getting identical statistical results.

Sines and Cosines

To increase calculational speed, sines and cosines are not determined by function (e.g., SINTHE= SIN(THETA)) in EGS. Instead, the sine is looked- up in a sine-table and the cosine is determined from the sine. However, it is quite easy to revert back to the standard method (such as was done in EGS1) by means of the macros


             REPLACE {$EVALUATE#USING SIN(#);}

               WITH {{P1}=SIN({P2});}

             REPLACE {$SET INTERVAL#,SINC;} WITH {;}

which are thereby included at Step 1 of the User Code. [The reader is referred to the Mortran3 User's Guide as an aid in understanding the macros].

It should be pointed out that due to the precision involved in the table look-up method, the direction cosines can become slightly unnormalized.

Depending on the problem at hand, this can lead to incorrect results---such as when two direction cosines are simultaneously involved in an angular sort of particles. The problem can generally be remedied by renormalizing the direction cosines prior to using them.

Charged Particle Transport

The pattern $CHARGED-TRANSPORT has been included in subroutine ELECTR in order to allow transport of the charged particles by other means than used in this version. For example,

             REPLACE {$CHARGED-TRANSPORT;} WITH {CALL MYTRAN;}

could be included in Step 1 of the User Code, and an appropriate subroutine MYTRAN would need to be provided by the user.

Another pattern that has been included in ELECTR is $TMXS-OVER-RIDE, which is there in case the user wants to impose an additional constraint on the electron transport step size. It can be used, for example, to revert back to the method used in EGS1 in which step sizes were taken discretely (rather than randomly as is done in subsequent EGS versions). To do this one uses the macro


             REPLACE {$TMXS-OVER-RIDE;}

               WITH {;IF(E(NP).GT.5.0) [TMXS=0.01*RLDU(MEDIUM);]

                    ELSE [TMXS=0.001*RLDU(MEDIUM);]}

Note: Always prefix an additional semicolon to IF- statements that begin replacement strings.

The macro


             REPLACE {$TMXS-OVER-RIDE;}

               WITH {TP=1.335E-3*EKE**2*RLDU(MEDIUM);

                    TMXS=AMIN1(TMXS,TP);}

can be used to limit path length corrections (see Chapter 2 of SLAC-265) to values less than 15 per cent (whether or not this is important depends on the problem being solved). On the other hand, to remove the path length correction entirely (as in EGS1 and EGS2), one can use the macro-pair


             REPLACE {$SET-USTEP;} WITH {USTEP=TUSTEP;}

             REPLACE {$SET-TVSTEP;} WITH {TVSTEP=VSTEP;}

Finally, the macro


             REPLACE {$TMXS-OVER-RIDE;}

               WITH {TP=200.0*TEFF0(MEDIUM); TMXS=AMIN1(TMXS,TP);}

limits the step size essentially in the manner done in EGS2, and we use this as the default macro for EGS3, and now for EGS4, for reasons discussed and demon- strated at the end of Section 3.5 of SLAC-210. For low energy problems, other step size algorithms should be used (see end of Section 2.14 of SLAC-265).

A2.4.2 Pre-HATCH-Call-Initialization (Step 2)

This step consists of setting EGS COMMON variables that are used by HATCH in its initialization operations. All of these variables are initialized to some reasonable value in the BLOCK DATA subprogram. Therefore, if different values are desired they should be set with executable code (as opposed to another BLOCK DATA). Concurrently, the various COMMON blocks (i.e., BOUNDS, MEDIA, MISC) will have to be included in the declaration section of the MAIN program of the User Code. These variables are:

NMED --- This must be initialized to the number of media to be used in the shower generation (default=1).

MEDIA --- This array contains the names of the media required and is dimensioned MEDIA(24,$MXMED), where $MXMED is an EGS macro that is currently defined to be 10 (default), and whose value is the maximum number of media for which array space has been allocated (see Section A2.4.1a above). The media names are stored in MEDIA in alphameric field specification A1 to ensure transportability. Each medium name is 24 characters long. For the convenience of users compiling with EGS' macros, there is a macro to generate A1 strings. For example,


            $S'STRING' expands to 'S','T','R','I','N','G'.

One way of implementing this in the User Code is demonstrated in the next example, which is for three media: lead, steel, and air at NTP.

A temporary array is declared and initialized in MAIN by


              $TYPE TEMP(24,3)/$S'PB',        22*' ',

                               $S'STEEL',     19*' ',

                               $S'AIR AT NTP',14*' '/;

Note: $TYPE is recognized as a macro template and gets expanded to CHARACTER*4 for FORTRAN 77 and to INTEGER for FORTRAN IV.

Then at Step 2 one puts


            NMED=3;     "NUMBER OF MEDIA USED"

            DO J=1,NMED [DO I=1,24 [MEDIA(I,J)=TEMP(I,J);]]

MED --- This array, which is dimensioned MED($MXREG), contains the medium indices for each region (default values are 1 for all $MXREG). A medium index of zero means a region is filled with a vacuum. For instance, if we consider the three media example above along with vacuum to define four regions, we might have


            MED(1)=3;  "FIRST REGION IS AIR AT NTP"

            MED(2)=1;  "SECOND REGION IS LEAD"

            MED(3)=0;  "THIRD REGION IS VACUUM"

            MED(4)=2;  "FOURTH REGION IS STEEL"

in Step 2 of the User Code.

ECUT and PCUT --- These arrays contain the cutoff energies (in MeV) for charged particles and photons, respectively, for each region. They are dimen- sioned ECUT($MXREG) and PCUT($MXREG) and are given temporary (default) values of 0.0 in BLOCK DATA. At the time that data for each medium are gen- erated in the preprocessing code (PEGS), two para- meters (AE and AP) are set to the lowest energies at which it will be desired to transport electrons and photons. When the EGS subroutine HATCH is called, these AE and AP values are read in and HATCH upgrades the values of ECUT and PCUT such that the maximum of the current (ECUT,AE) (and (PCUT,AP)) is chosen. Therefore, by assigning values of ECUT and PCUT prior to the HATCH call, the user can raise (but not lower) the cutoff energies in this manner. For instance, consider the four region example from above. The statement

            DO I=1,3 [ECUT(I)=10.0; PCUT(I)=100.0;]

when put in Step 2 of the User Code results in charged particle histories being terminated at 10.0 MeV (total energy) and photon histories being terminated at 100.0 MeV in the first three regions only. In the fourth region the respective cutoffs are set by AE and AP as established by PEGS. Of course COMMON/BOUNDS/ will have to be declared in the routine that calls HATCH in order to pass ECUT and PCUT to HATCH. Combined with COMMON/MEDIA/ and COMMON/MISC/, the macro declara- tion might look like


               COMIN/BOUNDS,MEDIA,MISC/;

IRAYLR --- The elements of this array (dimensioned IRAYLR($MXREG) and passed in COMMON/MISC/), are to be set to 1 prior to calling HATCH if coherent (Rayleigh) scattering is to be done in a particular region. Execution is terminated if Rayleigh data is not included in the PEGS data, however.

DUNIT --- This parameter determines the unit of distance to be used in the shower simulation (the default is cm if DUNIT=1.0). On input to HATCH, this parameter will be interpreted as follows:

  1. DUNIT > 0 means that DUNIT is the length of the distance unit expressed in centi- meters. For example, setting DUNIT=2.54 would mean that the distance unit would be one inch.
  2. DUNIT <0 means that the absolute value of DUNIT will be interpreted as a medium index. The distance unit used will then be the radiation length for this medium, and on exit from HATCH, DUNIT will be equal to the radiation length of that medium in centimeters. The obvious use of this feature is for the case of only one medium with DUNIT="-1." Then the shower is expressed entirely in radiation lengths of the first medium.

The distance unit used by PEGS is the radiation length. After HATCH interprets DUNIT, it scales all distance- type data from PEGS in the proper way, so that all subsequent operations in EGS will be correctly performed with all distances in units of DUNIT (default value: 1.0 cm).

A2.4.3 HATCH-Call (Step 3)

This step is very simple---HATCH has no arguments, so all one has to do is:

  CALL HATCH;

The following is a typical output message when DUNIT has not been changed (and Rayleigh data is included in the file):


  RAYLEIGH DATA AVAILABLE FOR MEDIUM  1 BUT OPTION NOT REQUESTED.

  EGS SUCCESSFULLY 'HATCHED' FOR ONE MEDIUM.

However, if the user has set DUNIT=2.54 prior to calling HATCH, the message will look like the following (two media, no Rayleigh data):


  DUNIT REQUESTED&USED ARE:   2.54000E+00   2.54000E+00(CM.)

  EGS SUCCESSFULLY 'HATCHED' FOR     2 MEDIA.

Failure to "hatch", on the other hand, will result in the message:


  END OF FILE ON UNIT 12



  PROGRAM STOPPED IN HATCH BECAUSE THE

  FOLLOWING NAMES WERE NOT RECOGNIZED:



                  (list of names)

followed by a STOP in HATCH. [Note: one cannot ask for the same medium twice].

A2.4.4 Initialization-For-HOWFAR (Step 4)

As stated previously, HOWFAR is the routine that deter- mines the geometry of the regions. Although initialization for items that are taken up in HOWFAR can be done at any step prior to calling SHOWER (Step 7), Step 4 allows a space in MAIN to consider if such initialization need be performed. For example, if regions are defined by semi-infinite planes, data defining each plane (e.g., coordinates and unit normal vectors) can be established here. The data may be referred to in HOWFAR or by user-written subprograms called by HOWFAR. It may be that some of the dimensions of the regions are determined at run-time, or the geometry may be so complex that it is desirable to use executable code to generate tables for use by HOWFAR. In such cases, initialization for HOWFAR will probably consist of filling up some user-written COMMON blocks for HOWFAR.

A2.4.5 Initialization-For-AUSGAB (Step 5)

This step is similar to Step 4 above in that it provides a specified location in the MAIN code where quantities used in AUSGAB can be initialized. For example, suppose that we wished to create an array, ESUM, to keep track of the total energy deposited in each of the regions. We could declare


  COMMON/TOTALS/ESUM($MXREG);

in both the MAIN code and in AUSGAB, and we could add


  DO I=1,$MXREG [ESUM(I)=0.0;]

to the MAIN code (at Step 5). Then the statement


  ESUM(IR(NP))=ESUM(IR(NP)) + EDEP;

in AUSGAB could keep a running total of the energy deposited in each region under consideration (Note: the EGS utility subroutines, ECNSV1 and NTALLY, have been developed to facilitate keeping track of where the energy is deposited and how many events are scored, respectively).

This would be a good time to point out that EDEP is a double precision variable---established as such via a macro. Therefore, one might wish to establish ESUM as double pre- cision as well (in both MAIN and AUSGAB). We have experienced situations whereby energy balancing could not be attained due to round-off error difficulties. This was particularly evident for large shower-history problems involving the addition of small energy values to large numbers in various regions. As a result of this experience, certain key energy variables in the EGS code have been defined as double precision. Users may take advantage of this at their discretion.

A2.4.6 Determination-Of-Incident-Particle-Parameters (Step 6)

This step is really self-explanatory---particularly when looked at in conjunction with Step 7 below. A specfic exam- ple of such coding might be useful and is given as follows:


  IQI=-1;  "INCIDENT PARTICLE IS AN ELECTRON"

  EI=1000.0;  "TOTAL ENERGY (MEV)"

  XI=0.0; YI=0.0; ZI=0.0;  "PARTICLE COORDINATES"

  UI=0.0; VI=0.0; WI=1.0;  "DIRECTION COSINES"

  IRI=2;  "REGION NUMBER 2 IS THE INCIDENT REGION"

  WTI=1.0;  "WEIGHT FACTOR IN IMPORTANCE SAMPLING"

  IXX=987654321;  "RANDOM NUMBER GENERATOR SEED"

  NCASES=10;  "NUMBER OF HISTORIES TO RUN"

A2.4.7 SHOWER-Call (Step 7)

The calling sequence for SHOWER is:


  CALL SHOWER(IQI,EI,XI,YI,ZI,UI,VI,WI,IRI,WTI);

The types of the arguments are given by their starting letter in accordance with standard FORTRAN convention. These arguments specify the charge, total energy, position, direction, region index, and statistical weight of the incident particle, and are used to fill the corresponding stack variables (see COMMON/STACK/ in Section A2.3). Section A2.4.6 above might be of some aid in understanding the parameter list. The subroutine may be called repeatedly by means of statements like


  DO I=1,NCASES [CALL SHOWER(IQI,EI,XI,....,etc.);]   .

The statistical weight, WTI, is generally taken as unity unless variance reduction techniques are employed by the user. It should noted, however, that if IQI is assigned the value of 2, subroutine SHOWER recognizes this as a pi-zero meson decay event, and two photons are added to the stack with energies and direction cosines appropriately obtained by sampling.

A2.4.8 Output-Of-Results (Step 8)

This step has been added for completeness and is self-explanatory.


A2.5 Specifications for HOWFAR


A2.6 Specifications for AUSGAB


A2.7 UCSAMPL4 --- An Example of a "Complete" EGS4 User Code


return to main EGS web page
Webmasters

last updated 10/04/01