Skip to content
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

Photonuclear attenuation magnified with cross section enhancement #956

Closed
ftessier opened this issue Feb 3, 2023 · 6 comments
Closed

Photonuclear attenuation magnified with cross section enhancement #956

ftessier opened this issue Feb 3, 2023 · 6 comments
Assignees
Milestone

Comments

@ftessier
Copy link
Member

ftessier commented Feb 3, 2023

Description

  • The photonuclear cross section is magnified when the cross section enhancement (xcse) variance reduction technique is turned on, biasing calculated quantities.

Expected behavior

  • xcse is a true variance reduction technique, hence it should not alter calculated quantities.

Impact

  • The bug arises when xcse is used while Photonuclear attenuation = On, and scales with the enhancement factor.
  • The most severe bias occurs when the relative photonuclear cross section is largest, as shown further down.
  • It affects the following EGSnrc applications: cavrznrc, cavsphnrc, dosrznrc, and egs_chamber.
  • It was introduced when photonuclear attenuation was added to EGSnrc, around 2012.

Root cause

  • There are no ausgab calls for BeforePhotoNuc (PHOTONUCAUSB) nor AfterPhotoNuc (PHOTONUCAUSA) events in application that implement cross section enhancement. When xcse is turned, the total photon cross section is increased by the enhancement factor. However, there is no compensation for this biasing in the ausgab routine, for the photonuclear interaction (only).

Examples

  • The dose to the air cavity of a Farmer ionization chamber surrounded by a tungsten buildup cap is decreased by about 2% for a bremsstralung beam emitted by 15 MeV electrons striking an aluminum target, and an xcse factor of 32 inside the tungsten cap. The discrepancy scales with the xcse factor. This is how this bug was initially revealed.

  • A more contrived example, although by no means far-fetched, is the dose to an air cavity inside a spherical shell of PMMA, 1 cm thick, irradiated by a uniform monoenergectic beam of 23 MeV photons, as depicted below. When xcse is turned on (enhancement of 1024), the dose is reduced by ~40% (input file for egs_chamber):

    xcse factor Dose per incident fluence
    cs enhancement = 0 9.6485e-12 +/- 0.09%
    cs enhancement = 1 1024 5.5757e-12 +/- 0.33%

    image

    Relative photonuclear cross section for a few common materials, for reference:

photonuc-small

@ftessier ftessier added this to the Release 2023 milestone Feb 3, 2023
@ftessier ftessier self-assigned this Feb 3, 2023
@ftessier ftessier changed the title Magnification of photonuclear attenuation when using cross section enhancement Magnification of photonuclear attenuation with cross section enhancement Feb 3, 2023
@ftessier ftessier changed the title Magnification of photonuclear attenuation with cross section enhancement Photonuclear attenuation magnified with cross section enhancement Feb 3, 2023
ftessier added a commit that referenced this issue Feb 6, 2023
Add ausgab calls before and after a photonuclear interactions, in order
to handle cross section enhancement (xcse) correctly. Without these
calls, there is no compensation for the enhanced cross section, hence
the photonuclear cross section is effectively increased.

Also, update a couple loops that print out the ausgab flags (IAUSFL)
values, to include the photonuclear attenuation input value.
@ftessier
Copy link
Member Author

ftessier commented Feb 7, 2023

beamnrc is also affected.

@mainegra
Copy link
Contributor

mainegra commented Feb 7, 2023

Wow @ftessier ! This is quite an effect! Good catch and great detective work!

@ojalaj
Copy link

ojalaj commented Feb 9, 2023

@ftessier Dumb question: To my knowledge xcse feature is not used/available in beamnrc/cavrznrc/cavsphnrc/dosrznrc so how it can affect their results? Or with those applications, do you mean BCSE or any such feature? Is dosxyznrc affected? And if e.g. with beamnrc BCSE is not used, there is no problem even if Photonuclear attenuation = On?

@ftessier
Copy link
Member Author

ftessier commented Feb 9, 2023

Hi @ojalaj! Support for xcse was added in beamnrc in 2005, but the option is not available in the gui (but it can be added in the input file), as far as I can tell. So by and large there is no issue if you have not entered CSE IN CMS in the input file. It is turned off by default. There is no issue with bcse. The dosxyznrc application is not affected. See #958 to see what files are affected and how.

@ojalaj
Copy link

ojalaj commented Feb 9, 2023

Thanks @ftessier for confirmation (& sorry for dumb questions)!

@ftessier
Copy link
Member Author

ftessier commented Feb 9, 2023

No dumb question. It is very useful when users ask questions, especially regarding any code modification. Thanks!

ftessier added a commit that referenced this issue Feb 15, 2023
Add ausgab calls before and after a photonuclear interaction, in order
to handle cross section enhancement (xcse) correctly. Without these
calls, there is no compensation for the enhanced cross section, hence
the photonuclear cross section is effectively increased by the xcse
factor.

Also add the photonuclear event trapping in Fano calculations, for
consistency. However, the Fano calculation fails when photonuclear
attenuation is turned on anyway, because the photon is discarded
without depositing its energy.

Also update a couple loops that print out the ausgab flags (IAUSFL)
values, to include the photonuclear attenuation option value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants