Skip to content

Offload optical photons from Geant4 to optical track#2135

Draft
Rashika-Gupta wants to merge 29 commits intoceleritas-project:developfrom
Rashika-Gupta:optical-steps
Draft

Offload optical photons from Geant4 to optical track#2135
Rashika-Gupta wants to merge 29 commits intoceleritas-project:developfrom
Rashika-Gupta:optical-steps

Conversation

@Rashika-Gupta
Copy link
Member

@Rashika-Gupta Rashika-Gupta commented Dec 1, 2025

This PR introduces optical track offloading from Geant4 to Celeritas #2103

  • LocalOpticalOffload is renamed to LocalOpticalGenOffload to distinguish generator-based optical offloading from track-based offloading.
  • TrackOffloadInterface generalizes the tracking manager to support both EM and optical track offload implementations.
  • LocalOpticalTrackOffload classes provide a dedicated pathway for buffering and transporting (in the follow up PR) optical photon tracks.

@Rashika-Gupta Rashika-Gupta added enhancement New feature or request physics Particles, processes, and stepping algorithms external Dependencies and framework-oriented features labels Dec 1, 2025
@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

❌ Patch coverage is 11.38211% with 109 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.45%. Comparing base (62c3034) to head (e6272d0).

Files with missing lines Patch % Lines
src/accel/LocalOpticalTrackOffload.cc 0.00% 75 Missing ⚠️
src/accel/detail/IntegrationSingleton.cc 39.13% 12 Missing and 2 partials ⚠️
src/celeritas/setup/Problem.cc 8.33% 11 Missing ⚠️
src/accel/LocalOpticalTrackOffload.hh 0.00% 8 Missing ⚠️
src/accel/TrackOffloadInterface.hh 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2135      +/-   ##
===========================================
- Coverage    83.68%   83.45%   -0.24%     
===========================================
  Files         1257     1260       +3     
  Lines        42470    42588     +118     
  Branches     13287    13330      +43     
===========================================
- Hits         35542    35541       -1     
- Misses        4597     4704     +107     
- Partials      2331     2343      +12     
Files with missing lines Coverage Δ
src/accel/LocalTransporter.hh 95.00% <ø> (ø)
src/accel/SetupOptions.hh 90.62% <100.00%> (+0.30%) ⬆️
src/accel/SharedParams.cc 81.75% <ø> (ø)
src/accel/TrackingManager.cc 100.00% <ø> (ø)
src/accel/TrackingManager.hh 100.00% <100.00%> (ø)
src/accel/TrackingManagerConstructor.cc 97.77% <100.00%> (+0.05%) ⬆️
src/accel/detail/IntegrationSingleton.hh 80.00% <ø> (ø)
src/celeritas/inp/Events.hh 61.53% <ø> (ø)
src/accel/TrackOffloadInterface.hh 0.00% <0.00%> (ø)
src/accel/LocalOpticalTrackOffload.hh 0.00% <0.00%> (ø)
... and 3 more

... and 13 files with indirect coverage changes

🚀 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 Dec 1, 2025

Test summary

 5 831 files   9 354 suites   7m 40s ⏱️
 1 711 tests  1 702 ✅   9 💤 0 ❌
30 218 runs  30 077 ✅ 141 💤 0 ❌

Results for commit 7498929.

♻️ This comment has been updated with latest results.

@Rashika-Gupta Rashika-Gupta marked this pull request as ready for review December 19, 2025 20:14
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.

Nice! Just a couple of comments. Swing by my office if you have any questions.

"cacheVariables": {
"CELERITAS_VecGeom_SURFACE": {"type": "BOOL", "value": "OFF"}
}
},
Copy link
Member

Choose a reason for hiding this comment

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

I think this may have been unintentional?

{
return std::make_unique<LSOOTrackingAction>();
}
};
Copy link
Member

Choose a reason for hiding this comment

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

Can you also override EndOfRunAction (see LarSphereOptical::EndOfRunAction in TrackingManagerIntegration) to check that optical tracks were run?

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.

Looks like there are still a couple TODOs before this is actually offloading tracks. :)

CELER_EXPECT(g4track.GetDefinition()->GetParticleName() == "opticalphoton");

// TODO : Populate optical::TrackInitializer from Geant4 Track
TrackData init;
Copy link
Contributor

Choose a reason for hiding this comment

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

Still need to populate the track initializer here.


// TODO insert buffered track into
// optical CoreState and execute optical transport.
// state_->insert_primaries(make_span(buffer_));
Copy link
Contributor

Choose a reason for hiding this comment

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

And still need to offload the buffered tracks here.

@Rashika-Gupta Rashika-Gupta requested a review from a team as a code owner January 25, 2026 16:30
@sethrj
Copy link
Member

sethrj commented Jan 25, 2026

@Rashika-Gupta I think something went terribly wrong with your rebase. Monday morning let's go through your git history and try to figure out what happened and fix it. In the meantime, I'm force-pushing what I think was intended based on the branch history. If this was my fault for telling you to git pull --rebase on Friday, I apologize!!

@sethrj sethrj marked this pull request as draft January 26, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request external Dependencies and framework-oriented features physics Particles, processes, and stepping algorithms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants