EGS4 Bug Alert
PRESTA density scaling

Status of Bug

This bug has NOT been corrected in the latest unix
(Jan 2, 1997 version 3) distribution of the EGS4 code.

Blake Walters (NRC), Dave Rogers (NRC) and Charlie Ma (Stanford University) encountered a potentially serious bug in PRESTA which affects calculations using the density scaling macro (used e.g. in CT phantom calculations with DOSXYZ). Essentially, multiple scattering related quantities are not scaled properly with RHOF, the ratio of the actual mass density to the default material density. This leads to a wrong calculation of the path-length-correction (PLC) causing in some extreme cases negative USTEP's (the bug showed up when Blake and Charlie tried to model lung as air with a density of 0.2-0.3 g/cm**3, i.e. RHOF=200-300).

It is difficult (time consuming) to estimate the error in general in more "normal" situations (RHOF=0.8-1.2) as in addition to the approximations used to derive PRESTA's PLC also various power series expansions of logarithms have been employed in the coding of the algorithm. The table at the end of this mail give some examples. The patch of the bug is very simple. It is sufficient to make the following replacements in the presta.macros file:




In the macro $BOUNDARY-CROSSING-ALGORITHM

             ============================

replace

         USTMIN=(OMEGMN/BLCC(MEDIUM))*EKE*(EIE+RM)/EIE**2;

with

         USTMIN=(OMEGMN/BLCC(MEDIUM)/RHOF)*EKE*(EIE+RM)/EIE**2;



In the macro $SET-MS-PLC-PARAMETERS(#)

             =========================

replace

         AMSPLC=BLCC(MEDIUM)/BMSPLC;

with

         AMSPLC=RHOF*BLCC(MEDIUM)/BMSPLC;

and

         OMEGA0=AMSPLC*{P1}*RHOF;

with

         OMEGA0=AMSPLC*{P1};



Fortunately, no changes are necessary in the quite lengthy

formulas.



The following table gives some examples of PLC's calculated

with the wrong density scaling and compared to the correct PLC.

PLC is defined as



                   USTEP = TUSTEP*(1-PLC).



So, if PLC > 1 USTEP is negative and if PLC < 0, USTEP > TUSTEP.

The calculations are for water (BLCC=7502, XCC=0.814).



RHOF = 200, E=4.5 MeV

=====================



TUSTEP/RHOF (cm)       B        wrong PLC         correct PLC

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

0.24623232E-05   2.0238943      5.3442426         0.23597506E-04

0.46449441E-05   3.0737443      3.0273671         0.70733477E-04

0.94857214E-05   4.0535579      1.0195229         0.16167645E-03

0.20970785E-04   5.0722480      0.2465808         0.36815650E-03

0.46361663E-04   6.0556016      0.46358950E-01    0.81978837E-03

0.16497946E-03   7.5554671     -0.88938419E-03    0.29241699E-02

0.31121846E-03   8.2714767     -0.19862058E-03    0.55146483E-02

0.15210867E-02   10.049789      0.14439936E-01    0.26693009E-01



RHOF = 1.2, E=1 MeV

===================



TUSTEP/RHOF (cm)       B        wrong PLC         correct PLC

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

0.27742854E-03   1.2514294     -0.95947807E-05    0.79724814E-04

0.67028857E-03   3.0260816      0.61462866E-03    0.67189545E-03

0.13980436E-02   4.0378828      0.15264377E-02    0.15781850E-02

0.67908997E-02   6.0334730      0.78060790E-02    0.79495925E-02

0.36831997E-01   8.0130301      0.42675540E-01    0.42676818E-01



  Iwan Kawrakow, PhD

  Ionizing Radiation Standards

  Institute for National Measurement Standards

  National Research Council of Canada

  Ottawa, K1A 0R6

  Tel.   (613) 993 2197

  fax    (613) 952 9865

Questions regarding the aforementioned bug should be directed to Iwan Kawrakow (iwan@irs.phy.nrc.ca)


return to main EGS web page
Webmasters

last updated 09/28/01