Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Towards being able to generate multigroup photon/neutron libraries for shielding purposes, with the eventual goal of random ray adjoints for dose in shielding contexts, I have implemented a filter on secondary particle energies. The first step is to be able to generate the multigroup photon source vector from a neutron flux vector for a given MGXS material. This can be done by tallying secondary particle energies generated during a collision.
To implement this, I added a counter on the secondaries created in a collision. Analog estimation can then be used to bin the secondary particle energies. Naturally, to ensure that secondary photons from photons are not captured, this requires specifying the primary and secondary particle type on the energy filter.
I want to check this by comparing the photon source from an n/p simulation, and using it as the source in a plain photon spectrum to check they match up.
Here is an example of using this feature to find the secondary photon specrum emitted by 2 MeV source neutrons in U238. There are about 20 photons generated per source neutron.
Which gave me this result:

For now this is just a first pass to open up the implementation to feedback. I plan to add a regression test and further validation of the idea soon.
Checklist