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

Support scoring of optical photons by Geant4 host sensitive detectors #1397

Open
drbenmorgan opened this issue Sep 9, 2024 · 0 comments
Open
Assignees
Labels
enhancement New feature or request user Hits and track diagnostics

Comments

@drbenmorgan
Copy link
Contributor

drbenmorgan commented Sep 9, 2024

Related to/broken out of #1351 on the general support for optical boundary processes.

Geant4's G4OpBoundaryProcess class provides a capability for user code to use the Sensitive Detector mechanism to score optical photons that are totally absorbed on a given optical surface. Celeritas should support this capability too, and a first implementation could be to follow what was done with EM scoring by sending G4Steps of absorbed photons back to the host and passing them to the appropriate user-defined sensitive detectors on the host. It's assumed here that diagnostic like information like number of steps, process counts, etc will be handled internally by Celeritas.

The basic algorithm used in Geant4 is within G4OpBoundaryProcess::PostStepDoIt with the key parts being (omitting quite a bit of detail!):

  • It will call G4OpBoundaryProcess::DoAbsorption when the photon is going to be absorbed on the surface.
    • This checks if the photon will be "detected" given the quantum efficiency of the surface.
    • If "detected" it sets the photon's status flag to G4OpBoundaryProcessStatus::Detection, and marks the track as fStopAndKill.
  • Right at the end of PostStepDoIt, if the photon's status is G4OpBoundaryProcessStatus::Detection, then G4OpBoundaryProcess::InvokeSD is called with the photon's G4Step
    • This adds the photon energy to the step's local energy deposition, then
    • Determines if the post step point has a Sensitive Detector (i.e. the Logical Volume of the post step point), calling its Hit member function if so.

That's pretty straightforward/obvious, but with some things to note (which we've also discussed today):

  1. That the SD invocation isn't part of Geant4's main loop looks to be due to the SD being located by the post step point rather than the pre step point used for volumetric scoring (see https://gitlab.cern.ch/geant4/geant4/-/blob/geant4-11.2-release/source/tracking/src/G4SteppingManager.cc?ref_type=heads#L251), but should be checked.
  2. It's not completely clear where the post step point is following a photon being Detectioned(!). We want to check this as it will impact how/where we look for attached sensitive detectors.
    • I'll put together a minimal G4 app to confirm what happens here.
    • In StepGatherExecutor.h, StepPoint::pre is used. This might be made configurable.

This'll probably also need some follow up with experiments to see how they've implemented optical photon scoring. It's also demonstrated in Geant4 through the stepping action invoking the SD itself, e.g.: https://gitlab.cern.ch/geant4/geant4/-/blob/geant4-11.2-release/examples/extended/optical/LXe/src/LXeSteppingAction.cc?ref_type=heads#L198

@drbenmorgan drbenmorgan added enhancement New feature or request user Hits and track diagnostics labels Sep 9, 2024
@drbenmorgan drbenmorgan self-assigned this Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request user Hits and track diagnostics
Projects
None yet
Development

No branches or pull requests

1 participant