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

Sample scintillation photons individually #1376

Merged
merged 10 commits into from
Aug 20, 2024

Conversation

sethrj
Copy link
Member

@sethrj sethrj commented Aug 19, 2024

This updates the scintillation photon generator to create a single photon at a time by sampling from material yields instead of splitting the selected photons among them. It also fixes an error in the sampling (which assumed that component index for a material was the same as the component ID).

It keeps us from losing "stratified sampling" of the original implementation but it no longer unfairly rounds.

I refactored some of the data structures and builders to make this happen, and to reduce the amount of work I've removed the unused scintillate-by-particle construction code (which @stognini added and I believe @whokion mildly objected to because it may not be needed). The data structures and related import code are still there; we can either remove those at some future point or re-add the by-particle construction and implement sampling by particle.

@sethrj sethrj added physics Particles, processes, and stepping algorithms minor Minor internal changes or fixes labels Aug 19, 2024
@sethrj sethrj requested review from amandalund and stognini August 19, 2024 20:14
Copy link
Member

@stognini stognini left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Copy link
Contributor

@amandalund amandalund left a comment

Choose a reason for hiding this comment

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

This looks great @sethrj, thanks!

src/celeritas/optical/ScintillationData.hh Outdated Show resolved Hide resolved
@sethrj sethrj enabled auto-merge (squash) August 20, 2024 15:40
@sethrj sethrj merged commit 00c84c5 into celeritas-project:develop Aug 20, 2024
29 checks passed
@sethrj sethrj deleted the scintillation-generator branch August 20, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Minor internal changes or fixes physics Particles, processes, and stepping algorithms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants