Skip to content

Conversation

@amandalund
Copy link
Contributor

There isn't any need to have separate distribution buffers and generator actions for scintillation and Cherenkov photon generation. This adds a GeneratorType field to the distribution struct and removes the templating on GeneratorType from the action. We still have separate offload actions for the two processes, but those will now write to the same buffer and the generation will be done in a single kernel launch. This should simplify the integration with Geant4 a bit.

@amandalund amandalund requested a review from sethrj October 10, 2025 21:48
@amandalund amandalund added physics Particles, processes, and stepping algorithms minor Refactoring or minor internal changes/fixes labels Oct 10, 2025
@codecov
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 85.41667% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.97%. Comparing base (7c6f299) to head (6f9b289).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
test/celeritas/optical/OpticalCollector.test.cc 77.27% 8 Missing and 2 partials ⚠️
src/celeritas/optical/gen/GeneratorAction.cc 89.65% 3 Missing ⚠️
src/corecel/io/Repr.hh 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2034   +/-   ##
========================================
  Coverage    86.96%   86.97%           
========================================
  Files         1690     1690           
  Lines        76082    76077    -5     
  Branches      4198     4198           
========================================
- Hits         66166    66165    -1     
+ Misses        8393     8390    -3     
+ Partials      1523     1522    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

github-actions bot commented Oct 11, 2025

Test summary

 4 953 files   7 896 suites   16m 34s ⏱️
 2 042 tests  2 018 ✅ 24 💤 0 ❌
28 010 runs  27 911 ✅ 99 💤 0 ❌

Results for commit 6f9b289.

♻️ This comment has been updated with latest results.

Copy link
Member

@sethrj sethrj left a comment

Choose a reason for hiding this comment

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

Although this simplifies the built-in use case, it removes the generalization that would allow us to add primaries or other customizable distributions (e.g. uniform isotropic with gaussian energy). How soon do we need those cases? Is the plan to build them into new branches, or to add a new generalization, or to just duplicate+modify the generator code?

@amandalund
Copy link
Contributor Author

We do support optical primary generation with (eventually, since they're currently hardcoded) customizable distributions since #1858. The GeneratorBase class extracts most of the common code, but the logic for the primary generation is different enough from the scintillation/Cherenkov generation that we already have separate actions for the two.

@amandalund amandalund merged commit d3ce169 into celeritas-project:develop Oct 19, 2025
80 of 83 checks passed
@amandalund amandalund deleted the single-generator branch October 19, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Refactoring or minor internal changes/fixes physics Particles, processes, and stepping algorithms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants