-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature renormalized photoelectric cross sections and ICRU90 recommended values for key data #322
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work Ernesto! We should make obvious note somewhere of all the changes to default parameters.
are relaxed via emission of fluorescent X-Rays,\ | ||
Auger and Koster-Cronig electrons.\ | ||
Make sure to turn this option on for low energy\ | ||
applications.\ | ||
|
||
Selecting On or EADl is equivalent. A full atomic relaxation cascade\ | ||
is simmulated using EADL transition probabilities. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in simulated
applications. | ||
|
||
Selecting On or EADl is equivalent. A full atomic relaxation cascade\ | ||
is simmulated using EADL transition probabilities. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo
HEN_HOUSE/src/egs_utilities.mortran
Outdated
of the current simlation. This is due to the fact that energies | ||
below 1 keV are taken from the relaxation database only for | ||
elements requested in the input when EPDL is used. This is not | ||
and issue when using XCOM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: and
should be an
HEN_HOUSE/src/get_inputs.mortran
Outdated
@@ -1690,6 +1713,28 @@ write(i_errors,*) | |||
' ******************** end input transport parameter *********************** '; | |||
write(i_errors,*); | |||
|
|||
"Check if EADL relaxation requested. Note that original relaxation" | |||
"algorithm using <M> and <N> is only turned ON for all regions." | |||
"Moved passed the $TURN-ON/OFF-IN-REGIONS statement to catch the" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: passed
should be past
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a bunch @rtownson for reviewing! Somehow I thought you had made the corrections. Will fix them right away! Updating the documentation is the next step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, Ernesto!
@mainegra , do you want to fix the noted typos? You can add a commit at the end; or else if you prefer you can use |
Thanks @blakewalters for reviewing! |
Done! |
@mainegra can you
|
4668d13
to
72f6e9b
Compare
Rebased on tip of |
Now that you've rebased you can remove the commented out block Fred referenced. I also see another instance in
|
Oh, I forgot to commit the merge conflict resolution. |
a5aa2b1
to
7e4ba64
Compare
Updated commit history (reorder, reword, edit, squash, etc.), adjusted contributors in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable relax_initiator_q
was used on this branch, but in the mean time it had been deleted on the develop branch.
Add photoelectric (PE) cross sections by Sabbatucci and Salvat based on Dirac–Hartree–Fock–Slater (DHFS) calculations, with a normalization screening correction defined as the ratio of electron densities obtained with DHFS and multi-configuration Dirac-Fock (MCDF) methods. These cross sections are expected to closely reproduce MCDF cross sections. The data base is a 1-byte record length binary file with total and shell-wise photoelectric cross sections. The data is arranged sequentially so as to allow direct access to any given element: NZ fpos(1)...fpos(NZ) NE(1),Nshell(1) E(1,1) SigTot Sig(K) Sig(L1)...Sig(Nshell(1)) ... E(1,NE(1)) SigTot Sig(K) Sig(L1)...Sig(Nshell(1)) ... E(NZ,1) SigTot Sig(K) Sig(L1)...Sig(Nshell(1)) ... E(NZ,NE(1)) SigTot Sig(K) Sig(L1)...Sig(Nshell(1)) ...
- Turn on the use of renormalized photoelectric (PE) cross sections by setting the photon cross sections key to either 'mcdf-xcom' or 'mcdf-epdl': a) Sets variable mcdf_pe_xsections to true. b) Sets photon cross section data base to xcom or epdl, respectively. c) If relaxation is requested, only EADL relaxation is allowed and shell-wise cross sections are used to sample the interacting shell. d) Subroutine egs_shellwise_photo() is called from PHOTO. MCDF stands for "multi-configuration Dirac-Fock" because the normalization screening correction used by Sabbatucci and Salvat brings their DHFS cross sections closer to MCDF results. - If mcdf_pe_xsections is true: a) egs_read_shellwise_pe reads in MCDF shell-wise PE cross sections by Sabbatucci and Salvat only for the elements in the problem, sorted by increasing Z value. b) egs_read_shellwise_pe adjusts cross sections to the EGSnrc binding energies via an energy scale shift. c) egs_read_shellwise_pe normalizes elemental shell cross sections to the total cross section of an element preparing a log(E) log(sigma(E,Z,shell)/sigma(E,Z,total)) table for interpolation when sampling the interacting shell. d) egsi_get_shell_data prepares a database of medium PE cross sections for sampling the interaction using the same energy grid as the cross sections for the other interactions, and normalizes elemental PE cross sections to the medium PE cross section for sampling the element with which the photon interacts, maintaining Sabbatucci and Salvat's energy grid. pe_elem_prob(j,k,medium) = log(pz*sigma(E,Z)/sigma(E,medium)) - egs_shellwise_photo is the new photoelectric routine: a) Determines the energy interval using binary search to preserve structure near edges (one search per element). b) Samples the interacting element by looping through the medium's elements, starting with the highest Z element using pre-calculated pe_elem_prob(j,k,medium) in egsi_get_shell_data. c) The interacting shell is sampled using normalized shell-wise cross sections pe_xsection(j,i,l) for shells with binding energy above a minimum energy, set currently to 1 keV. d) In the case of no atomic relaxations, a photoelectron is simply generated. - Replace macro $EADL_RELAX with integer variable eadl_relax. Acceptable values are: Off -> no atomic relaxation, just generate photoelectron On or eadl -> Use detailed relaxation with EADL transition prob. simple -> Use original relaxation algorithm with <M> and <N> - Move $RELAX-CUTOFF to egsnrc.macros; currently set to 1 keV. $RELAX-CUTOFF defines the lowest energy for which to simulate the photoelectric interaction and create initial vacancies. Note that relaxation transitions can produce sub-threshold particles and vacancies. - Set minimum binding energy requiring relaxation data to $RELAX-CUTOFF rather than the minimum of AE or AP. - In egs_eadl_relax: initial vacancies below L3 are only allowed if using MCDF shell-wise PE cross sections. Note that in this case COMPT and PHOTO will create such vacancies, but not the electron impact ionization (EII) routine eii_sample. This should be expanded when implementing the EII cross sections from Bote and Salvat.
Add an option to select a detailed EADL relaxation and photoelectric (PE) interaction using renormalized cross sections via the variables eadl_relax and mcdf_pe_xsections respectively. The key value pair is: Photon cross section = mcdf-xcom # or mcdf-epdl Note that the only cross sections taken from either the xcom or epdl series are Rayleigh, pair and triplet cross sections. When renormalized PE cross sections are used, only EADL relaxation is allowed, with a warning issued when changing from simple to detailed relaxation. Turning OFF relaxation is also possible.
Force the simulation of atomic relaxations for all interactions with atomic electrons. Before, this was enforced automatically for electron impact ionization (EII) and bound Compton scattering, but not for the photoelectric effect. For consistency, atomic relaxations should be enabled (or disabled) for all atomic interactions.
Use the C++ string copy function instead of strcpy. The latter adds a terminating null character to the character array which interferes with contiguous character arrays in COMMON blocks or C data structures, such as the_media->pxsec and the_media->eiixsec.
Incoherent scattering by atomic electrons is ON by default, hence coherent (Rayleigh) scattering should also be ON by default, for a physically consistent photon scatter model. If atomic relaxations are important, then electron impact ionization should also be turned ON. Currently EII is OFF by default. In cases where scattering by atomic electrons has a negligible effect, such as in MV beam calculations, one can turn OFF coherent scattering and use Klein-Nishina for incoherent scattering. For an ion chamber dose calculation at the reference depth in a water phantom, the time penalty of turning ON photon interactions with atomic electrons is about 6% for a Co-60 beam and 4% for a 6 MV beam.
DOSXYZnrc overrides some of the egsnrc.macros defaults. It explicitly turns OFF Compton binding corrections and atomic relaxations. For consistency, coherent (Rayleigh) scattering is now also turned OFF by default since it doesn't make sense physically to have incoherent scattering off a free electron while including coherent scattering off atomic electrons.
Rename the binary search function in DOSXYZnrc to avoid conflict with the new binary search function in egs_utilities.mortran (needed by the new photoelectric routine). The function name is changed from ibsearch to ibsearch4, reflecting the fact that it takes a real*4 array. Remove the binary search function ibsearch from the EDKnrc application source code. This function is now defined in egs_utilities.mortran, and in fact it is not even used in EDKnrc.
Add newline characters in the message warning the user that the relaxation model is changed to the full EADL algorithm (triggered when the user selects the renormalized photoelectric cross sections but the default relaxation algorithm).
Add gui options to use renormalized photoelectric (PE) cross sections and to select between EADL and the original relaxation algorithm. Also set Rayleigh scattering ON by default. Update help text accordingly.
ICRU Report 90 recommends that density-effect corrections for graphite be calculated for a mean excitation energy I = 81 eV and the crystalline density rho = 2.265 g/cm3. Using the Fortran version of the ESTAR program two files are created, for graphite bulk mass densities of 1.7 g/cm3 and 2.0 g/cm3 (both files contain the same density-effect correction data, calculated for 2.265 g/cm3).
Add a density-effect correction file for water, for a mean excitation energy I = 78 eV, following the recommendation of ICRU Report 90. The data is obtained from the Fortran version of the ESTAR program.
Move the default eadl_relax block below the call to the macro $TURN-ON/OFF-IN-REGIONS which sets the default for atomic relaxations. Otherwise there is a mismatch between eadl_relax and iedgfl. This problem was revealed when testing dosxyznrc.mortran, which overrides egsnrc.macros defaults.
Monte Carlo (MC) transport parameters allowing inputs beyond ON or OFF by region must shift the output_strings array index by 2 to get the proper output when the default values are used, i.e., no input is provided.
Inform the user about the requirement to turn on bound Compton when selecting EADL relaxation, since binding energies below 1 keV are taken from the incoh.data file.
08cd89b
to
82e6611
Compare
Just squashed the EDKnrc update for |
This is a major PR introducing several important features:
$EADL_RELAX
which is now deprecated.To use the features in this PR before they are merged with the
develop
branch users can get the branchfeature-shellwise-pe-xsections
and create a user configuration for it. See bottom of this PR for more details on this.To use the re-normalized cross sections one will have to set the input key
Photon cross sections
in theMC transport parameter
input block to one of the following values:These options allow the use of the re-normalized PE cross sections while using the rest of the photon cross sections from either the XCOM or EPDL libraries. Note above that EADL relaxation is turned ON by using the values
On
orEADL
. If the input issimple
, then the original relaxation implementation is used. However, whenmcdf-xcom
ormcdf-epdl
is used, nosimple
atomic relaxation is allowed.The re-normalized cross sections are available for all atomic sub-shells up to N7 for elements from Z=1 to Z=99 for energies from the ionization threshold up to 1 GeV. However only sub-shells above 1 keV are included in EGSnrc. Taking advantage of the availability of sub-shell PE cross sections a new routine is implemented that allows sampling the photoelectric interaction from all energetically possible sub-shells. Since an adaptive energy grid is used near absorption edges, to ensure accurate interpolation, a binary search algorithm is used in the new photoelectric routine to find the energy interval the photon energy falls in. However, the total PE cross section used for sampling the interaction uses the same equidistant grid as the rest of the photon cross sections for fast interpolation. The time penalty of the new algorithm is about 6% for a BEAMnrc simulation of a 30 kV x-ray tube. However for an
egs_fac
simulation of HVL attenuation measurements with a free-air chamber (FAC) for 4 attenuation filters including the BEAMnrc x-ray tube simulation no time difference is observed. This can be attributed to the fact that more very low-energy particles are produced in the BEAMnrc simulation that don't make it to the FAC.To create material data for graphite or water according to ICRU90 recommendations one will have to make use of the following density correction files:
The easiest way is to take advantage of the pegsless option which generates the data on-the-fly by adding the following input block to the input file:
One can of course create a pegs4 data file for these media making sure to use the proper density correction files.
Several checks have been made to ensure that the implementation produces correct values. The graph below shows the ratio of air mass-energy absorption coefficients calculated with the EGSnrc app
g.mortran
either with the original XCOM PE cross sections or with the re-normalized cross sections of Sabbatucci and Salvat to the Penelope values taken from the ICRU90 report. The first shows similar differences as reported in ICRU90 report while the second demonstrates excellent agreement between both codes except at 3.263 keV (Ar K shell binding energy in Penelope) because of the small differences in binding energies between the codes (EGSnrc uses the XCOM value of 3.2029 keV).To make use of these features one can clone the git repository for EGSnrc and then all branches are available to the user. To switch to the branch
feature-shellwise-pe-xsections
one needs to executegit checkout feature-shellwise-pe-xsections
on the command line in the folder containing the git repository. Once on that branch the user can create a configuration either for Linux or Windows.
Alternatively to using git, one can download this branch directly as a zip archive and then configure it as a separate install using one of the methods mentioned in the previous paragraph. Go to the EGSnrc github page of this branch and download it by clicking the green button on the right
Clone or download
and click on theDownload ZIP
link.Details to take into consideration when using this branch and dosxyznrc:
$EGS_HOME
remains untouched.dosxyznrc.mortran
is not updated, hence its compilation will fail during the execution ofEGSnrc-configure-linux
as this file was modified for this branch.dosxyznrc.mortran
from $HEN_HOUSE/user_codes/dosxyznrc/$EGS_CONFIG
in .bashrc to point to the new configuration and start a new shell console.