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
Associated with these active functionals are other operations; namely,
Note: Those interested in preparing data sets for EGS4 can go directly to Section A3.3
* This manual is kept up-to-date on the EGS account at SLAC and is distributed along with other files on the EGS4 distribution tape.
** A. J. Cook, "Mortran3 User's Guide", SLAC Computation Research Group Technical Memorandum CGTM-209 (1983) [see also APPENDIX 4: "EGS4 Users Guide to Mortran3"].
The PEGS code contains over 4200 Mortran source lines which are the source for a MAIN program, BLOCK DATA subpro- gram, 12 subroutines, and 83 functions. Despite the large number of subprograms, PEGS has a simple structure. Fig. A3.2.1 shows a flowchart of the MAIN program of PEGS. After the once-only initializations an option loop is entered. Each time through the option loop, an option is read (option names are four characters and are read as 4A1), numeric con- trol parameters are read (using NAMELIST/INP/), and then the option name is looked up in the option table. If not found, the job is aborted. If found, the appropriate code is exec- uted and return is passed to the beginning of the option loop. Normal exit from the loop is by selection of the STOP option, or detection of an End of File condition on the con- trol input file. The details for the use of the options are contained in Section A3.3.
Fig. A3.2.2 shows the subprogram relationships of PEGS. Boxed items are subprograms, and labels for option names (i.e., :CALL:) are used to show which subprograms correspond to which options. It can be seen that the physical routines are accessed directly for the PWLF option. For utility options (TEST, PLTN, PLTI, HPLT, and CALL) the physical routines are referenced using the function FI---the so-called "function multiplexer". Function FI has five arguments. The first argument (I) tells which physical function to invoke, and the other four arguments (X1, X2, X3, X4) are used as needed as arguments for the called function. FI then returns the value returned by the called function.
This method of implementing options that are functionals was selected to avoid the necessity of having a separate call to the associated utility routines for each physical function on which it might be desired to operate. It was also desired to be able to refer to the particular function symbolically, both at compile time and at run-time, and to know the number of arguments to each function. In order to have these conveniences and also allow easy insertion or deletion of functions to the list of functions accessible to FI, a Mortran macro ($FUNCTIONS) was written which takes a list of names of functions (each of which is immediately pre- ceded by the number of arguments it has) and generates other macros containing the desired information. In particular,
+------+ | PEGS | +------+ | | +-------------+ initialize | +------x| OPTION LOOP |x-----+ +--------------+ +-------------+ A | | | | | | V V | +------------------------+ +-----------------+ | | Compute Physical & | | Read Option | | | Mathematical Constants | | Name (4A1) | | +------------------------+ | & | | | | Read Control | | | | Parameters | | V | (NAMELIST/INP/) | | +------------------------+ +-----------------+ | | Read Pair Production & | | | | Photo Cross Sections | | | | from File PHPRDAT | | | +------------------------+ | | | | V | +------+ Yes +--------------+ | | Stop |x------------ | End of File? | | +------+ +--------------+ | | | | No | | | V | +-----------------------+ +---------------+ | | Illegal Option---Stop |x----- | Select Option | | +-----------------------+ +---------------+ | | | | | V | +x---------------------------------------- + | | | V | * * * * * * * 1 * * 2 * * * * * * * Fig. A3.2.1 Flowchart of the MAIN Program of PEGS (continued)
* * * * * * * 1 * * 2 * * * * * * * | A | | | +-----------------------+ | +--x:ELEM: | Set Up Element Medium | -------------------x | | +-----------------------+ | | +-----------------------+ | +--x:MIXT: | Set Up Mixture Medium | -------------------x | | +-----------------------+ | | +------------------------+ | +--x:COMP: | Set Up Compound Medium | ------------------x | | +------------------------+ | | +------------------------+ | +--x:ENER: | Set Energy Cutoffs and | ------------------x | | | Compute Thresholds | | | +------------------------+ | | +---------------------+ | +--x:PLTN: | Plot Named Function | ---------------------x | | +---------------------+ | | +-----------------------+ | +--x:PLTI: | Plot Indexed Function | -------------------x | | +-----------------------+ | | +-----------------------+ | +--x:HPLT: | Histogram Theoretical | -------------------x | | | vs Sampled Spectrum | | | +-----------------------+ | | +-------------------------+ | +--x:CALL: | Evaluate Named Function | -----------------x | | +-------------------------+ | | +-----------------------------+ | +--x:TEST: | Plot Functions To Be Fitted | -------------x | | +-----------------------------+ | | +----------------------+ | +--x:PWLF: | Piecewise Linear Fit | --------------------x | | +----------------------+ | | +------------------------+ | +--x:DECK: | Punch Deck of Material | ------------------x + | | Dependent Data | | +------------------------+ | +------+ +--x:STOP: | Stop | +------+ Fig. A3.2.1 Flowchart of the MAIN Program of PEGS
+------------+ +------+ | BLOCK DATA | | MAIN | +------------+ +------+ | | + --- + -- + ----- + ----- + ----- + ----- + ---- + ---- + | | | | | | | | | | :PWLF: :DECK: :TEST: :HPLT: :CALL: :ENER: | | | | :PLTN: | | | | | +---+ :PLTI: +-----+ | | | | |LAY| | |HPLT1| | | | | +---+ | +-----+ | | | | +----+ | | +------+ | +---+----+ |PLOT| | | |PMDCON| | | | +----+ | | +------+ | +-----+ +-----+ | | | | |EBIND| |PWLF1| +-----x | x--- + | +-----+ +-----+ | :ELEM: | | :MIXT: +----+ | :COMP: |QFIT| * | +----+ * * + ----- + ----- + | * 3 * | | | | * * +---+ +------+ +------+ | * |MIX| |SPINIT| |DIFFER| | +---+ +------+ +------+ | | | + -- + -- + --------------- + | | | +-----+ +-----+ +-----+ |EFUNS| |GFUNS| |RFUNS| +-----+ +-----+ +-----+ | | | +-----+----+-----+--+---+---+ | +------+ +-----+ | | | | | | +---|PHOTTE| |AINTP| +------+ | +------+ | +------+ | | +------+ +-----+ |SPTOTP| | |ANIHTM| | |BHABTM| | | +------+ +------+ | +------+ | +------+ | +---|COMPTM| | | | | +------+ +------+ | +------+ | +------+ | | +------+ |SPTOTE|-+ |AMOLTM|-+ |BREMTM|-+ +---|PAIRTU| +------+ +------+ +------+ | +------+ | +------+ +---|COHETM| +------+ Fig. A3.2.2 Subprogram Relationships of PEGS (continued)
* * * * 3 * * * * | | | | + ---------------------- + | FI | | "Function Multiplexer" | + ---------------------- + | | | + ------------------------------------- + | | | ALIN APRIM COMPFM PAIRTE | | ALINI BHABDM COMPRM PAIRTM | | BHABFM COMPTM PAIRTR | | ADFMOL BHABRM CRATIO PAIRTU | | ADIMOL BHABTM EBIND PAIRTZ | | ADDMOL BREMDR EBR1 PBR1 | | ALOG BREMFR EDEDX PBR2 | | EXP BREMDZ ESIG PDEDX | | AREC BRMSDZ FCOULC PHOTTZ | | ALKE BREMFZ GBR1 PHOTTE | | ALKEI BRMSFZ GBR2 PSIG | | AMOLDM BREMRR GMFP SPIONE | | AMOLFM BREMRM PAIRDR SPIONP | | AMOLRM BREMRZ PAIRFR SPTOTE | | AMOLTM BREMTM PAIRDZ SPTOTP | | ANIHDM BREMTR PAIRFZ TMXB | | ANIHFM BRMSRM PAIRRM TMXS | | ANIHRM BRMSRZ PAIRRR TMXDE2 | | ANIHTM BRMSTM PAIRRZ XSIF | | COHETM | | COHETZ | | COMPDM | + ------------------------------------- + Fig. A3.2.2 Subprogram Relationships of PEGS (continued from previous page)
The following macros are defined:
$NFUNS - Gives the number of functions.
$FLIST$DATA(FNAME) - Generates a data statement init- alizing the array FNAME(6,$NFUNS) so that FNAME(i,j) has the ith character of the name of the jth function.
$FLIST$NARGS - Gives a list of the number of arguments for each function, which is used to initialize the run- time array NFARG($NFUNS).
$FLIST$FNUMS - Gives a list of numbers from 1 to $NFUNS, which is used to generate the computed GO TO in FI.
$FLIST$FCALLS - Generates the function calls in FI with the proper number of arguments for each function taken from the list X1, X2, X3, X4.
$FN(function name) - Gives the function index of the specified function.
$NA(function name) - Gives the number of arguments for the specified function.
It should also be noted that there are relationships between the functions shown in Fig. A3.2.2 that are not indicated there. We show the most complicated of these in Figs. A3.2.3a,b (Bremsstrahlung Related Functions) and in Figs. A3.2.4a,b (Pair Production Related Functions). One reason for the complexity of these is that the higher level forms of the cross sections must be obtained by numerical integration of the more differential forms.
+------+ |BREMTM| +------+ | V +------+ |BREMRM| +------+ | V +------+ +------+ initialize +------+ | QD |x------------- |BREMRZ|-------------x |BREMDZ| +------+ +------+ BREMFZ +------+ | | V | +------+ | |DCADRE| | +------+ | | | V V +------+ +------+ +------+ |BREMFZ|-------------x |BRMSFZ|x------------- |BRMSDZ| +------+ +------+ +------+ A A | | | | +------+ +---------------+ | +--x|APRIM | | | | +------+ +------+ +------+ initialize | | |DCADRE| +----|BRMSRZ|---------------x + | +------+ +------+ | +------+ BRMSFZ +--x| XSIF | A | A | +------+ | | | | +------+ | +------+ | +------+ | QD |x--+ |BRMSRM| +--x|FCOULC| +------+ +------+ +------+ A | | +------+ +------+ +------+ |SPTOTE|-----------x |BRMSTM|x----------- |SPTOTP| +------+ +------+ +------+ | | | | V V +------+ +------+ +------+ |SPIONE|-----------x |SPIONB|x----------- |SPIONP| +------+ +------+ +------+ Fig. A3.2.3a Bremsstrahlung Related Functions---Most Accurate Form (Used to Produce the Total Cross Sections and Stopping Power).
+------+ |BREMTR| +------+ | | V +------+ |BREMRR| +------+ | | initialize V + x---------+--------x + | BREMFR | | | V V +------+ +------+ |BREMDR| | QD | +------+ +------+ | | | | | V | +------+ | |DCADRE| | +------+ | | | | | | | +------+ | + ----x |BREMFR| x---- + +------+ Fig. A3.2.3b Bremsstrahlung Related Functions---With Run-Time Approximations (For Comparison with Sampled Spectra).
+------+ |PAIRTU| +------+ | | + x------------------- + + -------------------x + | | V V +------+ +------+ |PAIRTM| |PAIRTE| +------+ +------+ | | V V +------+ +------+ |PAIRRM| |PAIRTZ| +------+ +------+ | | V V +------+ initialize +------+ |PAIRRZ|-------------x + |AINTP | +------+ PAIRFZ | +------+ | | | | | | | | V V +------+ +------+ +------+ | QD | |PAIRDZ|-----+----x | XSIF | +------+ +------+ | +------+ | | | | | | +------+ | | +----x |FCOULC| V V +------+ +------+ +------+ |DCADRE|----------x |PAIRFZ| +------+ +------+ Fig. A3.2.4a Pair Production Related Functions---Most Accurate Form (Used to Produce the Total Cross Sections and Stopping Power).
+------+ |PAIRTR| +------+ | | V +------+ |PAIRRR| +------+ | | initialize V + x-------- + -------x + | PAIRFR | | | V V +------+ +------+ |PAIRDR| | QD | +------+ +------+ | | | | | V | +------+ | |DCADRE| | +------+ | | | | | | | +------+ | + ----x |PAIRFR| x---- + +------+ Fig. A3.2.4b Pair Production Related Functions---With Run-Time Approximations (For Comparison with Sampled Spectra).
Table A3.2.2 lists the FUNCTIONS used in PEGS along with their mathematical symbols, definitions, and locations in this report for a fuller discussion. The names of most of the functions have been chosen in a rather mnemonic way. The first three or four letters suggest the process being con- sidered. The last letter designates the form of the cross section (Z for element, M for mixture, and R for "run-time" mixture). The next to last letter describes either the part- icular form of the cross section (such as D for differential, T for total or R for range-integrated), or it indicates that only the secondary energy is to vary, with other data being passed through a common. The letter F is used in such cases and the data in common is initialized using the corresponding function that has a next to last letter of D. If the function word begins with an I through N (i.e., the FORTRAN integer convention) the word is prefixed with the letter A. A few examples are given below:
AMOLDM is the differential Moller cross section for a mixture of elements.
BREMDR is the differential bremsstrahlung cross section for a "run-time" mixture of elements.
BREMRM is the bremsstrahlung cross section, integrated over some energy range, for a mixture of elements.
BRMSTM is the soft bremsstrahlung total cross section for a mixture of elements.
PAIRRR is the pair production cross section, integrated over some energy range, for a "run-time" mixture of elements.
PAIRTZ is the total cross section for pair production for an element.
This method of naming is not strictly adhered to, however. For example, SPIONE is the ionization stopping power for an electron, PBR1 and PBR2 are positron branching ratios, and GMFP is the gamma-ray mean free path.
Table A3.2.1 SUBROUTINES Used In PEGS ----------------------------------------------------------------- NAME DESCRIPTION PAGES ----------------------------------------------------------------- DIFFER Determines the various parameters A3.2-4, needed for bremsstrahlung and pair A3.3-11 production energy sampling. EFUNS Subprogram to compute electron A3.2-4 functions to be fit in a way that avoids repetition. GFUNS Subprogram to compute photon A3.2-4 functions to be fit in a way that avoids repetition. HPLT1 Creates line printer plot comparisons A3.2-4, of EGS-sampled data (UCTESTSR User A3.3-20,21 Code) and theoretical functions of PEGS. LAY Subprogram to produce a deck of A3.2-4, material dependent data (for sub- A3.3-17 sequent use by EGS). MIX Computes Z-dependent paramaters A3.2-4, that reside in COMMON/MOLVAR/. A3.3-11 MOLIER Computes material independent A3.2-4 multiple scattering data (for EGS2 only). PLOT Subprogram to plot a given function A3.2-4 (referenced by number). PMDCON Determines the physical, mathematical, A3.2-4 and derived constants in a very mnemonic way. PWLF1 Subprogram to piecewise linearly fit A3.2-4,19, up to 10 functions simultaneously on A3.3-14 an interval (XL,XU). RFUNS Subprogram to compute Rayleigh A3.2-4 scattering functions to be fit in a way that avoids repetition. SPINIT Initializes stopping power functions A3.2-4, for a particular medium. A3.3-11 AFFACT Atomic form factor (squared) for an element or mixture of elements. AINTP Linear or log interpolation function. A3.2-4,9 ALKE Log of kinetic energy (ALOG(E-RM)), A3.2-5, used as a cumulative distribution A3.3-20 function for fits and plots. ALKEI Inverse of ALKE (=EXP(X)+RM). A3.2-5 ALIN Linear cumulative distribution func- A3.2-5, tion for plots (ALIN(X)=X). A3.3-20 ALINI Inverse of ALIN (=same as ALIN). A3.2-5 Used as inverse cumulative distri- bution function in plots. ADFMOL Approximate cumulative distribution A3.2-5, function for Moller and Bhabha cross A3.3-20 sections (ADFMOL(E)=-1/(E-RM)). ADIMOL Inverse of ADFMOL. A3.2-5 ADDMOL Derivative of ADFMOL. A3.2-5 AMOLDM Moller differential cross section for A3.2-5,11,14 a mixture of elements. AMOLFM "One argument" form of AMOLDM. A3.2-5 AMOLRM Moller cross section, integrated over A3.2-5 some energy range, for a mixture of elements. AMOLTM Moller total cross section for a A3.2-4,5 mixture of elements. ANIHDM Annihilation differential cross A3.2-5 section for a mixture of elements. ANIHFM "One argument" form of ANIHDM. A3.2-5 ANIHRM Annihilation cross section, integrated A3.2-5 over some energy range, for a mixture of elements. ANIHTM Annihilation total cross section for A3.2-4,5 a mixture of elements. APRIM Empirical correction factor in A3.2-5,7 bremsstrahlung cross section. AREC Reciprocal function (=derivative of A3.2-5 ALOG(X)). Used as probability density function in log plots (AREC(X)=1/X). BHABDM Bhabha differential cross section for A3.2-5 a mixture of elements. BHABFM "One argument" form of BHABDM. A3.2-5 BHABRM Bhabha cross section, integrated over A3.2-5 some energy range, for a mixture of elements. BHABTM Bhabha total cross section for a A3.2-4,5 mixture of elements. BREMDR Bremsstrahlung differential cross A3.2,5,8,11 section for a "run-time" mixture of elements. BREMFR "One argument" form of BREMDR. A3.2-5,8 BREMDZ Bremsstrahlung differential cross A3.2-5,7 section for an element. BREMFZ "One argument" form of BREMDZ. A3.2-5,7 BREMRM Bremsstrahlung cross section, inte- A3.2-5,7,11 grated over some energy range, for a mixture of elements. BREMRR Bremsstrahlung cross section, inte- A3.2-5,8 grated over some energy range, for a "run-time" mixture of elements. BREMRZ Bremsstrahlung cross section, inte- A3.2-5,7 grated over some energy range, for an element. BREMTM Bremsstrahlung total cross section A3.2-4,5,7 for a mixture of elements. BREMTR Bremsstrahlung total cross section A3.2-5,8 for a "run-time" mixture of elements. BRMSDZ Soft bremsstrahlung differential A3.2-5,7 cross section for an element. BRMSFZ "One argument" form of BRMSDZ. A3.2-5,7 BRMSRM Soft bremsstrahlung cross section, A3.2-5,7 integrated over some energy range, for a mixture of elements. BRMSRZ Soft bremsstrahlung cross section A3.2-5,7, integrated over some energy range, A3.3-19,20 for an element. BRMSTM Soft bremsstrahlung total cross A3.2-5,7,11 section for a mixture of elements. COHERTM Coherent (Rayleigh) total cross A3.2-4,5 section for a mixture of elements. COHETZ Coherent (Rayleigh) total cross A3.2-5 section for an element. COMPDM Compton differential cross section A3.2-5 for a mixture of elements. COMPFM "One argument" form for COMPDM. A3.2-5 COMPRM Compton cross section, integrated over A3.2-5 some energy range, for a mixture of elements. COMPTM Compton total cross section for a A3.2-4,5 mixture of elements. CRATIO Coherent (Rayleigh) cross section ratio A3.2-5 DCADRE Quadrature routine to integrate A3.2-7-10,19 f(x) between a and b using cautious Romberg extrapolation. EBIND Function to get an average photo- A3.2-4,5 electric binding energy. EBR1 Function to determine the electron(-) A3.2-5 branching ratio (Brem/Total). EDEDX Evaluates SPTOTE with cutoff energies A3.2-5 of AE and AP. ESIG Determines the total electron(-) A3.2-5 interaction cross section (prob- ability per radiation length). FCOULC Coulomb correction term in pair A3.2-5,7,9 production and bremsstrahlung cross sections. FI Function multiplexer. A3.2-1,5,6 GBR1 Function to determine the gamma-ray A3.2-5 branching ratio (Pair/Total). GBR2 Function to determine the gamma-ray A3.2-5 branching ratio ((Pair+Compton)/Total). GMFP Function to determine the gamma-ray A3.2-5,11, mean free path. A3.3-18,19 IFUNT Given PEGS function name, it looks it up name in table and returns the function index. Used by options that specify functions by name. PAIRDR Pair production differential cross A3.2-5,10,18 section for a "run-time" mixture of elements. PAIRDZ Pair production differential cross A3.2-5,9,18 section for an element. PAIRFR "One argument" form of PAIRDR. A3.2-5,10 PAIRFZ "One argument" form of PAIRDZ. A3.2-5,10 PAIRRM Pair production cross section, inte- A3.2-5,9 grated over some energy range, for a mixture of elements. PAIRRR Pair production cross section, inte- A3.2-5,10,11 grated over some energy range, for a "run-time" mixture of elements. PAIRRZ Pair production cross section, inte- A3.2-5,9 grated over some energy range, for an element. PAIRTE "Empirical" total pair production A3.2-5,9 production cross section for a mixture (=SUM(PZ(I)*PAIRTZ(Z(I))). PAIRTM Pair production total cross section A3.2-5,9 for a mixture of elements, obtained by numerical integration of differ- ential cross section. PAIRTR Pair production total cross section A3.2-5,10 for a "run-time" mixture of elements. PAIRTU Pair production total cross section A3.2-4,5,9 actually "used". Same as PAIRTE for primary energy less than 50 MeV; otherwise, same as PAIRTM. PAIRTZ Computes contribution to empirical A3.2-5,9,11 pair production total cross section for an element assuming one atom per molecule. It is obtained by log-linear interpolation of Israel-Storm data. PBR1 Function to determine the positron A3.2-5,11 branching ratio (Brem/Total). PBR2 Function to determine the positron A3.2-5,11 branching ratio ((Brem+Bhabha)/Total). PDEDX Evaluates SPTOTP with cutoff energies A3.2-5 of AE and AP. PHOTTE Determines the proper mix of PHOTTZ's A3.2-4,5 for a mixture. PHOTTZ Determines the interpolated total A3.2-5 photoelectric cross section from tabulated data. PSIG Determines the total positron A3.2-5 interaction cross section (prob- ability per radiation length). QD Driver function for DCADRE, the A3.2-7-10 numerical integration routine. QFIT Utility logical function for the A3.2-4, piecewise linear fit subroutine, PWLF1. A3.3-14,15 It returns .TRUE. if a given parti- tion gives a good fit. SPIONB Does the work for SPIONE and SPIONP. A3.2-7 One argument tells whether to compute stopping power for electron or positron. SPIONE Calculates the stopping power due to A3.2-5,7 ionization for electrons(-). SPIONP Calculates the stopping power due to A3.2-5,7 ionization for positrons. SPTOTE Calculates the total stopping power A3.2-4,5,7 (ionization plus soft bremsstrahlung) for electrons(-) for specified cutoffs. SPTOTP Calculates the total stopping power A3.2-4,5,7,19 (ionization plus soft bremsstrahlung) for positrons for specified cutoffs. TMXB Determines the maximum total step A3.2-5 length consistent with Bethe's criterion. TMXS Determines the minimum of TMXB and A3.2-5 10 radiation lengths. TMXDE2 Included for possible future modifi- A3.2-5 cation purposes (=TMXB/(E**2*BETA**4)). It might be easier to fit this quantity than to fit TMXB and then apply the the denominator in EGS at run-time. XSIF Function to account for bremsstrahlung A3.2-5,7,9 and pair production in the field of the atomic electrons. ZTBL Given the atomic symbol for an element, it returns the atomic number.
Fig. A3.3.1 illustrates the logical relationship between options of PEGS. For example, in order to be able to use the PLTN option, one of the material specification options (ELEM, MIXT, COMP) must have already been processed. The PWLF option requires that both the ENER option and one of the material specification options precede it. To use the DECK option, it is sufficient to have validly invoked the PWLF option. The STOP and MIMS options are seen to be independent of the others.
In the following sections, for each option we will give its function, parameters which control it, the format of cards needed to invoke it, and an explanation of the routines (if any) that are used to implement it. The cards for a given option are named with the first part of their name being the option name, and the last part the card number. For example, MIXT2 is the name of the second card needed for the MIXT option. The information is summarized in Table A3.3.1. It should be noted that IBM and CDC require different formats for NAMELIST data. Also, the single card referred to as being read by NAMELIST may in fact be several cards, provided that the proper convention for continuing NAMELIST cards is followed. Once the first card (indicating the option) has been read in, however, the second card (i.e., NAMELIST/INP/) must follow (see examples at the end of Section A3.3.2). We will use the IBM form of NAMELIST in our examples.
The purpose of the ELEMent, MIXTure, and COMPound options is to specify the material used by the PEGS functions. The parameters needed to specify a material are its density (RHO), the number of different kinds of atoms (NE), and, for each different kind of atom, its atomic number (Z(I)), its atomic weight (WA(I)), and its proportion either by number (PZ(I)) for a compound or by weight (RHOZ(I)) for a mixture. PEGS has tables for the atomic symbol (ASYMT(1:100)) and the atomic weight (WATBL(1:100)) for elements I=1 through I=100, so the type of atom is specified by giving its atomic symbol (ASYM(I)). PEGS also has a table of the densities of the elements (RHOTBL(1:100)). Rayleigh (coherent) scattering data will be appended to the normal output data if the IRAYL flag is set to 1 in NAMELIST/INP/.
+------+ +------+ +------+ +------+ |:ELEM:| |:MIXT:| |:COMP:| |:ENER:| +------+ +------+ +------+ +------+ | | | | | | | | | | | | | V | | | | | + ------x OR x-------- + | | | V | +---------------------------x AND ----+ | | | | | V | | + -------+----+----+------- + | | | | | | | | | | | | | | V V V V | | +------+ +------+ +------+ +------+ +------+ | | |:PLTN:| |:PLTI:| |:HPLT:| |:CALL:| |:TEST:|x---+ | +------+ +------+ +------+ +------+ +------+ | | V +------+ |:PWLF:| +------+ +------+ |:MIMS:| | +------+ | V +------+ +------+ |:STOP:| |:DECK:| +------+ +------+ Fig. A3.3.1 Logical Relationship Between the Options of PEGS
Table A3.3.1 PEGS Control Cards ----------------------------------------------------------------- CARD FORMAT VARIABLES READ COMMENTS ----------------------------------------------------------------- ELEM1 (4A1) OPT(1:4) 'ELEM'. Means "select mat- erial that is an element." ELEM2 NAMELIST/INP/ RHO Optional. If given, this over-rides the PEGS default density (g/cm**3) for the element. WA(1) Optional. Atomic weight of element. If given, this over-rides the PEGS default. IRAYL Optional. Set to unity to included Rayleigh output. IUNRST Optional. Set to unity for unrestricted collision stop- ping power. ISSB Optional. Set to unity to use own density effect param- eters (see text below). ELEM3 (24A1, MEDIUM(1:24) Identifier assigned to data 6X,24A1) set to be produced. IDSTRN(1:24) Optional. Identifer of medium name under which desired Sternheimer-Seltzer- Berger coeffcients are given in PEGS. If not specified, the identifier in MEDIUM(1:24) is used. ELEM4 (24(A2,1X)) ASYM(1) Atomic symbol for element. ----------------------------------------------------------------- COMP1 (4A1) OPT(1:4) 'COMP'. Means "select mat- erial that is a compound." COMP2 NAMELIST/INP/ NE Number of elements in compound. RHO Density (g/cm**3) of compound (at NTP for gases). (PZ(I),I=1,NE) Relative numbers of atoms in compound. GASP Optional. Defines state of compound: zero (default) for solid or liquid, otherwise value gives gas pressure (atm). (WA(I),I=1,NE) Optional. May be used to over-ride default atomic weights (e.g., to allow for special isotopes). IRAYL Same as for ELEM2. IUNRST Same as for ELEM2. ISSB Same as for ELEM2. COMP3 (24A1, MEDIUM,IDSTRN Same as for ELEM3. 6X,24A1) COMP4 (24(A2, (ASYM(I),I=1,NE) Atomic symbols for the atoms 1X)) in the compound. Duplicates are allowed if several iso- topes of the same element are present, or may be required for diatomic molecules (e.g. nitrogen gas). ----------------------------------------------------------------- MIXT1 (4A1) OPT(1:4) 'MIXT'. Means "select mat- erial that is a mixture." MIXT2 NAMELIST/INP/ NE Number of elements in mixture. RHO Density (g/cm**3) of mixture (at NTP for gases). (RHOZ(I),I=1,NE) Relative amount of atom in mixture (by weight). GASP Optional. Defines state of mixture: zero (default) for solid or liquid, otherwise value gives gas pressure (atm). (WA(I),I=1,NE) Optional. May be used to over-ride default atomic weights. IRAYL Optional. Set to unity to included Rayleigh output. IUNRST Same as for ELEM2. ISSB Same as for ELEM2. MIXT3 (24A1, MEDIUM,IDSTRN Same as for ELEM3. 6X,24A1) MIXT4 (24(A2, (ASYM(I),I=1,NE) Same as for COMP4. 1X)) ----------------------------------------------------------------- ENER1 (4A1) OPT(1:4) 'ENER'. Means "select energy limits." ENER2 NAMELIST/INP/ AE Lower cutoff energy (total) for charged particle trans- port (MeV). UE Upper limit energy (total) for charged particle trans- port (MeV). AP Lower cutoff energy for photon transport (MeV). UP Upper limit energy for photon transport (MeV).
Note: If the user supplies negative values for the energy limits above, the absolute values given will be interpreted as in units of the electron rest mass energy. Thus, AE=-1 is equivalent to AE=0.511 MeV.
PWLF1 (4A1) OPT(1:4) 'PWLF'. Means "select piecewise linear fit." PWLF2 NAMELIST/INP/ Note: The following PWLF par- meters (see Section A3.3.4) are optional and may be over-ridden by the user. The default values (in BLOCK DATA) are indicated below. EPE/0.01/ Electron EP parameter. EPG/0.01/ Gamma EP parameter. ZTHRE(1:8)/8*0./ Electron ZTHR parameter. ZTHRG(1:3)/0.,.1,0./ Gamma ZTHR parameter. ZEPE(1:8)/8*0./ Electron ZEP parameter. ZEPG(1:3)/0.,.01,0./ Gamma ZEP parameter. NIPE/20/ Electron NIP parameter. NIPG/20/ Gamma NIP parameter. NALE/$MXEKE/ Electron NIMX parameter. NALG/$MXGE/ Gamma NIMX parameter. ----------------------------------------------------------------- DECK1 (4A1) OPT(1:4) 'DECK'. Means "punch fit data and other useful par- ameters." DECK2 NAMELIST/INP/ No parameters. MIMS1 (4A1) OPT(1:4) 'MIMS'. Means "Calculate Material Independent Multi- ple Scattering Data" (for EGS2 only). MIMS2 NAMELIST/INP/ MIMS is controlled by macro settings and by data in BLOCK DATA that is not accessible to the NAMELIST. ----------------------------------------------------------------- TEST1 (4A1) OPT(1:4) 'TEST'. Means "Plot the fitted functions." TEST2 NAMELIST/INP/ NPTS Optional. Number of points to plot per function (Default=50). ----------------------------------------------------------------- CALL1 (4A1) OPT(1:4) 'CALL'. Means "Call the designated function and print value." CALL2 NAMELIST/INP/ XP(1:4) Values for up to four argu- ments of the function. CALL3 (6A1) NAME(1:6) Name of function to be evaluated. ----------------------------------------------------------------- PLTI1 (4A1) OPT(1:4) 'PLTI'. Means "Plot func- tion given its index and the index of the distribution function." PLTI2 NAMELIST/INP/ IFUN The index of the function to be plotted. XP(1:4) Values for the static arguments (parameters). IV Variable telling which argu- ment is to be varied (e.g., IV=2 means plot function vs. its second argument). VLO Lower limit for argument being varied. VHI Upper limit for argument being varied. NPTS Number of points to plot. IDF Index of distribution func- tion used to select indepen- dent variable. ----------------------------------------------------------------- PLTN1 (4A1) OPT(1:4) 'PLTN'. Means "Plot the named function." PLTN2 NAMELIST/INP/ XP(1:4),IV, Same as PLTI2. VLO,VHI,NPTS, IDF,MP PLTN3 (2(6A1)) NAME(1:6) Name (6 characters) of function to be plotted. IDFNAM(1:6) Name of distribution function to be used. HPLT1 (4A1) OPT(1:4) 'HPLT'. Means "Plot histo- gram to compare the sampled spectrum with the range- integrated and the differ- ential theoretical values." HPLT2 NAMELIST/INP/ EI Test particle total energy (MeV). ISUB Variable telling which function is being tested: 1=PAIR 2=COMPT 3=BREMS 4=MOLLER 5=BHABHA 6=ANNIH 7=MSCAT (not implemented). HPLT3 (' TEST DATA FOR ROUTINE=',12A1,',#SAMPLES=', I10,',NBINS=',I5) NAMESB(1:12) Name of subroutine tested. NTIMES Number of samples. NBINS Number of histogram bins. HPLT4 (' IQI=',I2,',RNLO,RNHI=',2F12.8,',IRNFLG=',I2) IQI Charge of test particle. RNLO,RNHI Lower and upper limits to random number preceding call to test function. IRNFLG Non-zero means to "apply above limits to preceding random number to test for correlation." Zero value means "don't do this." HPLT5...etc. (9I8) NH(1:NBINS) Sampled data (from User Code UCTESTSR).The ELEMent option is used if the material in question has only one type of atom. In this case PEGS knows that NE=1, has the density in a table, sets PZ(1)=1, and deduces Z(1) and WA(1) from ASYM(1). Thus the atomic symbol (ASYM(1)) is the only information that the user need supply. Before each option, RHO and the WA(I) are saved and then cleared so that it can be determined whether these have been set by the user. If so, they over-ride the table values in PEGS. This allows the different atoms to be non-standard isotopes and/or allows the overall density to be adjusted to the experimental state. For options other than ELEM, MIXT, or COMP, RHO and WA(I) are restored after reading the NAMELIST.
The COMPound option is used when there is more than one different kind of atom and it is desired to give the proportions by relative number of atoms (PZ(I)). The only required data is NE, ASYM(I), and PZ(I) (for I=1,NE). Optionally, any of the WA(I) can be over-ridden.
The MIXTure option is similar to the COMPound option except that the relative atomic proportions are given by weight (RHOZ(I)) rather than by number.
When the PZ(I) values have been specified, PEGS obtains the RHOZ(I) using RHOZ(I)=PZ(I)*WA(I); otherwise, the PZ(I) are obtained from PZ(I)=RHOZ(I)/WA(I). The absolute norm- alization of the PZ(I) and RHOZ(I) values is not important because of the way the quantities are used. For example, the macroscopic cross sections contain factors like
PZ(I)/SUM(PZ(I)*WA(I))
where the denominator is the "molecular weight".
In addition to physically specifying the material being used, a name for it must be supplied (MEDIUM(1:24)) for ident- ification purposes. This name is included in the output deck when the DECK option is selected. The name can be different for any two data sets that are created, even though the same material has been used. For example, one might produce PEGS output using a particular material but different energy limits (or fit tolerances, density effect parameters, etc.), with separate identification names for each (e.g., FE1, FE2, etc.).
The quantity IDSTRN(1:24) is used to identify the Sternheimer-Seltzer-Berger density effect parameters that are tabulated in BLOCK DATA (see Table 2.13.2 of SLAC-265 for com- plete list of identifer names). If IDSTRN(1) is blank, then IDSTRN is given the same value as MEDIUM. If this name is not identifiable with any of those in BLOCK DATA, the Sternheimer density effect scheme is replaced with a general formula by Sternheimer and Peierls. Although not recommended, setting IUNRST to unity causes the unrestricted collision stopping power to be used (instead of the sum of the restricted and radiative stopping powers). An option is available to allow users to supply their own values for the various parameters used to calculate the density effect correction (see Section 2.13 of SLAC-265 for a discussion). To initiate this option, all six parameters (AFACT, SK, X0, X1, CBAR, and IEV)) must be read in the NAMELIST input in ELEM, MIXT, or COMP, and ISSB must be set to non-zero as a flag. Note that if one only wants to override IEV, one must still input all six parameters (see Table 2.13.2 of SLAC-265).
After reading the input data for these options, subroutine MIX is called in order to compute the Z-related parameters that reside in COMMON/MOLVAR/, subroutine SPINIT is called to initialize the stopping power routines for this material, and subroutine DIFFER is called to compute run-time parameters for the pair production and bremsstrahlung sampling routines. The reader might find the comments in subroutine MIX useful.
The following are examples of sets of data cards that can be used with the ELEM, MIXT, and COMP options:
Note: The NAMELIST data (i.e., &INP...&END) starts in column 2.
----------------------------------------------------------------- A. Material - Element is Iron with defaults taken. ----------------------------------------------------------------- Column Card 123456789112345678921234567893123456789412345678..etc. ELEM1 ELEM ELEM2 &INP &END ELEM3 IRON FE ELEM4 FE ----------------------------------------------------------------- B. Material - Element is Helium-3 with the density and atomic weight over-ridden by user. ----------------------------------------------------------------- Column Card 123456789112345678921234567893123456789412345678..etc. ELEM1 ELEM ELEM2 &INP RHO=1.E-2,WA(1)=3 &END ELEM3 HELIUM-3 HE ELEM4 HE ----------------------------------------------------------------- C. Material - Compound is sodium iodide with IDSTRN(1:24) defaulting to MEDIUM(1:24). ----------------------------------------------------------------- Column Card 123456789112345678921234567893123456789412345678..etc. COMP1 COMP COMP2 &INP NE=2,RHO=3.667,PZ(1)=1,PZ(2)=1 &END COMP3 NAI COMP4 NA I ----------------------------------------------------------------- D. Material - Compound is polystyrene scintillator (e.g., PILOT-B or NE-102A) with data taken from: "Particle Properties Data Booklet, April 1982" (Physics Letters 111B, April 1982). Sternheimer-Peierls default. ----------------------------------------------------------------- Column Card 123456789112345678921234567893123456789412345678..etc. COMP1 COMP COMP2 &INP NE=2,RHO=1.032,PZ(1)=1,PZ(2)=1.1 &END COMP3 POLYSTYRENE SCINTILLATOR COMP4 C H ----------------------------------------------------------------- E. Material - Mixture is lead glass, consisting of five specified elements (and 1 per cent of the trace elements unspecified). Sternheimer-Peierls default. ----------------------------------------------------------------- Column Card 123456789112345678921234567893123456789412345678..etc. MIXT1 MIXT MIXT2 &INP NE=5,RHO=3.61,RHOZ=41.8,21.0,29.0,5.0,2.2 &END MIXT3 LEAD GLASS MIXT4 PB SI O K NA ----------------------------------------------------------------- F. Material - Mixture is U-235, U-238, and carbon (not a real material). Sternheimer-Peierls default. ----------------------------------------------------------------- Column Card 123456789112345678921234567893123456789412345678..etc. MIXT1 MIXT MIXT2 &INP NE=3,RHO=16,WA=235,238,RHOZ=50,30,10 &END MIXT3 JUNK MIXT4 U U C
The ENERgy option is used to define the electron and photon energy intervals over which it is desired to transport particles, and hence, over which fits to total cross sections and branching ratios must be made. The electron energy interval is (AE,UE) and the photon interval is (AP,UP). If any of these is entered negative, it is multiplied by -RM=-0.511 MeV; that is, the absolute magnitude is assumed to be the energy in units of the electron rest mass energy. The quantities TE=AE-RM, TET2=2*TE, and TEM=TE/RM, as well as the bremsstrahlung and Moller thresholds (RM+AP and AE+TM, respectively), are then computed and printed out.
The following are examples of sets of data cards that can be used with the ENER option:
Note: The NAMELIST data (i.e., &INP...&END) starts in column 2.
----------------------------------------------------------------- A. Electron and photon cutoff energies are 1.5 MeV and 10 keV, respectively. The upper energy limit for both is set at 100 GeV. (Note: All energies are in MeV and are total energies). ----------------------------------------------------------------- Column Card 123456789112345678921234567893123456789412345678..etc. ENER1 ENER ENER2 &INP AE=1.5,UE=100000.,AP=0.01,UP=100000. &END ----------------------------------------------------------------- B. Same as above, except AE=3*RM. ----------------------------------------------------------------- Column Card 123456789112345678921234567893123456789412345678..etc. ENER1 ENER ENER2 &INP AE=-3,UE=100000.,AP=0.01,UP=100000. &END
The PieceWise Linear Fit option performs a simultaneous piecewise linear (vs. ln(E-RM)) fit of eight electron func- tions over the energy interval (AE,UE) and a simultaneous piecewise linear (vs. ln E) fit of three or four photon func- tions over the energy interval (AP,UP). Each simultaneous fit over several functions is accomplished by a single call to subroutine PWLF1---once for the electrons and once for the photons.
By simultaneous fit we mean that the same energy sub- intervals are used for all of the functions of a set. Alter- nately, we could describe it as fitting a vector function. The PWLF1 subroutine is an executive routine that calls the function QFIT. Function QFIT, which does most of the work, tries to perform a fit to the vector function by doing a linear fit with a given number of subintervals. It returns the value .TRUE. if the fit satisfies all tolerances and .FALSE. otherwise. Subroutine PWLF1 starts out doubling the number of subintervals until a successful fit is found. Additional calls to QFIT are then made to determine the minimum number of subintervals needed to give a good fit. Sometimes, because of discontinuities in the functions being fitted, a fit satisfying the specified tolerances cannot be obtained within the constraints of the number of subintervals allowed by the array sizes of EGS. When this happens, PEGS prints out the warning message (for example):
NUMBER OF ALLOCATED INTERVALS(= 150) WAS INSUFFICIENT TO GET MAXIMUM RELATIVE ERROR LESS THAN 0.01Even in this case a fit is produced which is sufficient most of the time.
Let NFUN be the number of components to the vector func- tion F(IFUN,E(J)) (where IFUN=1,NFUN), and let E(J) be a sequence of points (J=1,NI) covering the interval being fitted. The number of points (NI) is about ten times the number of fit intervals (NINT) in order that the fit will be well tested in the interiors of the intervals. If FEXACT(IFUN,J) and FFIT(IFUN,J) are the exact and fitted values of the IFUN-th component at E(J), then the logical function QFIT may be given as follows:
LOGICAL FUNCTION QFIT(NINT); COMMON.......etc. QFIT=.TRUE.; REM=0.0; "RELATIVE ERROR MAXIMUM" NI=10*NINT; DO J=1,NI [ DO IFUN=1,NFUN [ AER=ABS(FEXACT(IFUN,J)-FFIT(IFUN,J)); AF=ABS(FEXACT(IFUN,J)); IF(AF.GE.ZTHR(IFUN))[IF(AF.NE.0.0) REM=AMAX1(REM,AER/AF);] ELSE [IF(AER.GT.ZEP(IFUN)) QFIT=.FALSE.;] ] ] QFIT=QFIT.AND.REM.LE.EP; RETURN; END;
Thus we see that EP is the largest allowed relative error for those points where the absolute computed value is above ZTHR(IFUN), and ZEP(IFUN) is the largest allowed absolute error for those points where the absolute computed value is less than ZTHR(IFUN).
Other features of the QFIT routine include provisions for aligning a subinterval boundary at a specified point in the overall interval (in case the fitted function has a discontin- uous slope such as at the pair production or Moller thres- holds), and computation of fit parameters in bins flanking the main interval to guard against truncation errors in sub- interval index computations.
The net result of the fit is to obtain cofficients AX, BX, AF(IFUN,J), and BF(IFUN,J) such that
FVALUE(E)=AF(IFUN,INTERV)*XFUN(E) + BF(IFUN,INTERV)
is the value of the IFUN-th function, and where
INTERV=INT(AX*XFUN(E) + BX).
XFUN is called the distribution function and is ln(E-RM) for electrons and ln(E) for photons.
The coding of EGS and its original $EVALUATE macros are designed to allow a "mapped PWLF" in which we have AX, BX, AF(IFUN,J), BF(IFUN,J), and M(I), such that when
I=INT(AX*XFUN(E)+BX)
and
J=M(I),
then
FVALUE(E)=AF(IFUN,J)*XFUN(E) + BF(IFUN,J)
for the IFUN-th function. This kind of fit has the advantage that it could get a better fit with a smaller amount of stored data. However, this fitting scheme has never been imple- mented in PEGS. With the present scheme more data than necessary is used in describing the functions at the higher energies where they vary quite smoothly.
The following is an example of the data cards that can be used with the PWLF option:
Column Card 123456789112345678921234567893123456789412345678..etc. PWLF1 PWLF PWLF2 &INP &END
The DECK option, with the aid of subroutine LAY, prints and punches the data needed to specify the current material, the energy intervals specified, various computed molecular parameters (e.g., the radiation length), the run-time parameters for pair production and bremsstrahlung, and the fit data produced by the PWLF option. In other words, DECK prints and punches anything that might be of use to EGS in simulating showers, or to the user in analysis routines. The macros ECHOREAD and ECHOWRITE have been written to give nicely captioned print-outs of data (read or written) and to eliminate the need for creating separate write statements to echo the values.
Subroutines LAY (in PEGS) and HATCH (in EGS) are a matched pair in that HATCH reads what LAY writes (PEGS "lays" and EGS "hatches"). Thus, if the users would like to get more information at EGS run-time, they need only modify LAY and HATCH accordingly.
DECK should be invoked when either ELEM, MIXT, or COMP and ENER and PWLF have been run for the current material and before any of these have been executed for the next material (see Fig. 3.3.1).
The following is an example of the data cards that can be used with the DECK option:
Column Card 123456789112345678921234567893123456789412345678..etc. DECK1 DECK DECK2 &INP &END
The MIMS option produces a data set for EGS (Version 2 only) that contains Material Independent Multiple Scattering data. A stand alone program, EGSCMS (EGS Continuous Multiple Scattering), performs an analogous function for EGS3/EGS4, except that the data is held in a BLOCK DATA subprogram in the EGS code itself rather than in an external data set.
In the sense that these data sets are produced already, the MIMS option and EGSCMS code are now dispensible. However, as documentation for the origin of the present data, they are valuable and they will be maintained with the EGS Code System. (Note: EGSCMS was originally written in Mortran2 and will remain that way since it is not expected to be used again).
The TEST option is used as an easy way to obtain plots of all the functions (not the fits) that the PWLF option fits. These plots are valuable in getting a feel for the magnitudes and variations of the functions to be fitted.
The following is an example of the data cards that can be used with the TEST option:
Column Card 123456789112345678921234567893123456789412345678..etc. TEST1 TEST TEST2 &INP NPTS=50 &END
The CALL option is used whenever one desires to have PEGS evaluate a particular function and print out the results.
The following is an example of the data cards that can be used with the CALL option in order to test for discontinuities in GMFP (Gamma Mean Free Path) near 50 MeV. (Note: In this example we have included the (necessary) ELEM option cards for Lead).
Column Card 123456789112345678921234567893123456789412345678..etc. ELEM1 ELEM ELEM2 &INP &END ELEM3 PB ELEM4 PB CALL1 CALL CALL2 &INP XP(1)=49.99 &END CALL3 GMFP CALL1 CALL CALL2 &INP XP(1)=50.01 &END CALL3 GMFP
The resulting output from PEGS is:
OPT=CALL FUNCTION CALL: 1.95522 = GMFP OF 49.9900 OPT=CALL FUNCTION CALL: 1.97485 = GMFP OF 50.0100Note: This calculation was done on the IBM-3081 computer.
The PLTI and PLTN options may be used to obtain printer--- and with some work, possibly graphic---plots of any of the functions in the PEGS function table. The PLTI option is rather primitive in that the functions involved must be specified by number, so we shall instead concentrate on the PLTN option in which the functions are specified by name.
Consider the function BRMSRZ(Z,E,K1,K2) which is the soft bremsstrahlung cross section (for an electron of total energy energy E and element Z) integrated over the photon energy range (K1,K2). Suppose we would like to see a plot of BRMSRZ(2,E,0.0,1.5) for values of E from 5 to 100 MeV. Also assume we want the data points evenly spaced in ln(E). Then (see Table 3.3.1) the function name is 'BRMSRZ', the distribution function name is IDNAM='ALOG', the static arguments are
XP(1)=2., XP(3)=0.0, XP(4)=1.5, the independent variable is the second argument (i.e., IV=2), and its limits are VLO=5.0 and VHI=100.0. If we want 100 points on the plot we let NPTS=100.
The cards necessary to accomplish this plot are:
Column Card 123456789112345678921234567893123456789412345678..etc. PLTN1 PLTN PLTN2 &INP XP(1)=2.,XP(3)=0.0,XP(4)=1.5,IV=2,VLO=5., VHI=100.,NPTS=100 &END PLTN3 BRMSRZALOG
Distribution functions that are available are indicated below:
----------------------------------------------------------------- IDFNAM Purpose ----------------------------------------------------------------- 'ALIN' Linear plot. 'ALOG' Natural log plot. 'ALKE' Natural log of electron kinetic energy plot. 'ADFMOL' Approximation to Moller and Bhabha distributions (i.e., 1/K.E. distribution).
The Histogram PLoT option is designed to be used in conjunction with UCTESTSR (User Code to TEST Sampling Routine), which is provided on the EGS4 distribution tape . (Note: UCTESTSR was simply referred to as TESTSR in the the EGS3 User Manual (see Section 2.6 of SLAC-210)).
The basic idea is that a probability density function, PDF(X) (see Section 2.2 of SLAC-265), is to be sampled by EGS (note: PDF(X) will have other static arguments which we ignore for this discussion). Let CDF(X) be the cumulative distribution function associated with PDF(X).
If PDF(X) drops sharply with increasing X, we will not get many samples in the bins with large X unless we make the bins themselves larger in such regions. We accomplish this by finding another p.d.f.and c.d.f., PDG(X) and CDG(X), respectively, such that PDG(X) approximates PDF(X). If we want N bins, we then pick the X(I) such that
CDG(X(I+1))-CDG(X(I))=(CDG(X(N+1))-CDG(X(I)))/N.
For all I, this implies that
X(I)=CDGI((CDG(X(N+1))-CDG(X(1)))*I/(N+1) + CDG(X(1)))
where CDGI is the inverse function of CDG. Thus, if PDG(X) is a reasonable approximation, the histogram bins at large X should have the same order of magnitude of counts as those at lower X. The function CDG(X) is called the "distribution function" in the context of the HPLT option. CDG(X), CDGI(X), and PDG(X) are used by the UCTESTSR and HPLT1 programs. If we let SPDF(X) and SCDF(X) be the "sampled" data, and PDF(X) and CDF(X) be the theoretical data, then the routine HPLT1 can be summarized by the pseudo-code:
DO I=1,N [ PLOT((SCDF(X(I+1))-SCDF(X(I)))/(CDG(X(I+1))-CDG(X(I)))); PLOT((CDF(X(I+1))-CDF(X(I)))/(CDG(X(I+1))-CDG(X(I)))); DO....X(I) at 10 points in the interval (X(I),X(I+1)) [ PLOT(d(SCDF)/d(CDG)=PDF(X)/PDG(X));] ] RETURN; END;Thus the theoretical and sampled distributions can be compared and problems with the sampling routine (or the random number generator, for example) can be detected.
All of the control cards for the HPLT option are punched directly by UCTESTSR. The reader should refer to the listing for UCTESTSR and comments therein for a better understanding of the HPLT option (see also Chapter 6 of SLAC-210).
In the previous sections we have seen the various uses for PEGS. We summarize by giving the option sequences most generally used.
----------------------------------------------------------------- A. Minimal material data set creation (for use by EGS). ----------------------------------------------------------------- 1. ELEM (or MIXT, or COMP) 2. ENER 3. PWLF 4. DECK ----------------------------------------------------------------- B. Same as A. with default plots of all the functions that the PWLF option fits. ----------------------------------------------------------------- 1. ELEM (or MIXT, or COMP) 2. ENER 3. TEST 4. PWLF 5. DECK ----------------------------------------------------------------- C. Comparison of theoretical and sampled distributions by means of the HPLT option. ----------------------------------------------------------------- 1. ELEM (or MIXT, or COMP) Note: Data cards should agree with those used with the UCTESTSR run. 2. HPLT Note: Output data from UCTESTSR run. ----------------------------------------------------------------- D. Selective plotting of various functions. ----------------------------------------------------------------- 1. ELEM (or MIXT, or COMP) - for material 1 2. PLTN - for function 1 3. PLTN - for function 2,....etc. 4. ELEM (or MIXT, or COMP) - for material 2,....etc. 5. PLTN - for function 1 6. PLTN - for function 2,....etc.
last updated 10/04/01