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

Add the egs_gammaspec app #910

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open

Add the egs_gammaspec app #910

wants to merge 9 commits into from

Conversation

rtownson
Copy link
Collaborator

@rtownson rtownson commented Aug 11, 2022

Add an application for calculating gamma spectrometry related quantities, like detector efficiency and coincidence summing corrections. It outputs spectra both with coincidence summing effects included (e.g. a realistic or "non-perfect" detector), and without summing effects (a "perfect" detector). Total efficiency and full energy peak efficiency are also calculated for each case.

The egs_radionuclide_source was changed slightly to allow for the calculations - it now returns the number of decays from getNextParticle, instead of the number of source particles. This does not change the normalization when using the source, but apps specially designed to use current_case and last_case for the radionuclide source may be affected. This will only affect users who have written their own applications, not any of the applications distributed with EGSnrc.

The application specific inputs are:

:start scoring options:

    :start output spectrum:
        scoring regions = crystal_no_dead_label # The region numbers or region label(s) denoting the sensitive regions

        minimum spectrum energy  = 0.0 # Optional, MeV, default=0, minimum energy in output spectrum
        maximum spectrum energy = 0.4 # Optional, MeV, defaults=maximum in source, maximum energy in output spectrum
        number of bins  = 2000 # Optional, default=1000, number of bins in output spectrum

        # Example: these are peaks of interest for Ba-133, in MeV
        # Optional, coincidence summing corrections will be calculated for each of these
        gamma analysis energies = .0309 .035 .0531 .0796 .0810 .1606 .2232 .2764 .3028 .356 .3838

        # Optional, yes or no, default=yes, get the analysis energies automatically, using all of the gamma energies from the radionuclide decay scheme. They will be combined with the manually entered 'gamma analysis energies', so make sure they don't overlap. Only works for egs_radionuclide_source.
        automatic analysis energies = no

        # Optional, MeV, default=1e-6, the minimum energy from a single shower that can be detected in the sensitive regions
        minimum detectable energy = 1e-6
    :stop output spectrum:

:stop scoring options:

@rtownson rtownson added this to the Release 2023 milestone Aug 11, 2022
@rtownson rtownson self-assigned this Aug 11, 2022
@rtownson rtownson marked this pull request as ready for review November 9, 2023 16:41
@rtownson rtownson requested a review from a team as a code owner November 9, 2023 16:41
Copy link
Contributor

@blakewalters blakewalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiles, runs and seems to produce the desired output, @rtownson! Just a couple of questions: 1) Would it be useful to have an option to output these efficiencies to a file? and 2) Does this branch need to be rebased on develop before merging?

@rtownson
Copy link
Collaborator Author

I think since the list of efficiencies is usually just a few numbers, it's OK to have it just be in the .egslog file, similar to the dose reported for egs_chamber.

Wouldn't be a bad idea to do a more recent rebase before merging.

rtownson and others added 9 commits September 4, 2024 15:14
Add an application for calculating gamma spectrometry related
quantities, like detector efficiency and coincidence summing
corrections. The egs_radionuclide_source was changed slightly to allow
for the calculations - it now returns the number of decays from
getNextParticle, instead of the number of source particles. This does
not change the normalization when using the source, but apps specially
designed to use current_case and last_case for the radionuclide source
may be affected.
Change the radionuclide spectrum so that it is no longer part of
egs_spectra.cpp. Instead, it is in egs_radionuclide_source, because it
is not compatible with any other source. Also, add virtual functions to
the base source class to be able to extract information from the
radionuclide source without needing to do a static cast. These functions
were also added to the source collection and transformed source classes.
Add the feature for egs_gammaspec to get the gamma analysis energies
automatically from the radionuclide decay scheme, if one is used. Also
fix the normalization of the efficiency calculations.
Change the output spectra from egs_gammaspec to report the energy at the
middle of each energy bin, instead of the lower edge of the bin.
Fix a bug where some ensdf files from the nndc caused a segmentation
fault for egs_radionuclide source. This was due to comment lines
following gamma records in the file. The code did not check to see if a
normalization record existed before trying to use it, and this has been
fixed.
Fix a bug in egs_ensdf that resulted in the x-rays and auger electrons
in the ensdf file for Zn-65 not being used. This has no impact if the
relaxations are set to the default of using EADL data.
@rtownson
Copy link
Collaborator Author

rtownson commented Sep 4, 2024

There are quite a few people using this branch - it would be nice to review & merge it into the 2024 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants