You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enable calling of UserSteppingAction and PostUserTrackingAction (apt-sim#356)
If the UserSteppingAction is required, we need to copy back every GPU
step back to the G4 workers.
This required to change the kernels, as we need to be able to record
every step independent of edep or sensitive detector.
Since copying back every step can lead to a very large amount of steps,
this would quickly fill the buffer. Then, if the buffer gets too full
before the Geant4 workers take care of their hits, the GPUStep
Management Thread would start copying out the GPUSteps, as implemented
in apt-sim#350. However, this copying is too slow, if every Step is recorded
and leads to the GPU running out of HitSlots.
Previously, the Geant4 workers would only take care of the GPU Steps
after their transport has finished. However, this may be too late and
the buffer may be too full, leading to copying. Therefore, the Geant4
workers must be able to process some of the steps already earlier. This
is now done in the `AdePTTrackingManager`: Before a new track is
processed, the `GPUStepProcessing` is called. This way, the GPU step
buffer can be kept under control. To enable this, the processing of the
GPUSteps is now encapsulated in a single function, that can be called
from the `AdePTTrackingManager`.
In the same manner, the PostUserTrackingAction is called. For this, the
RecordHit also writes if it is the LastStep of a track.
Note that it is straightforward to calso call the PreUserTrackingAction.
This requires a StepCounter, which is availale in the B field update
branch, so I will add it *after* the B field branch is merged.
Both can be enabled via:
```
/adept/CallUserSteppingAction true
/adept/CallPostUserTrackingAction true
```
Since this PR touches the kernels, below the physics validation at high
statistics, which is as good as it should be:
<img width="586" alt="Screenshot 2025-03-09 at 07 30 15"
src="https://github.com/user-attachments/assets/8027a386-2680-4b22-9c4f-8da91a693ea3"
/>
0 commit comments