

Hello Ning Li,
Try setting a global maxStep parameter and progressively reducing it. The default is 100 mm, which may be too coarse for your detector spacing. According to the G4beamline manual: "The maximum physics step permitted to be taken. Note this is a limit on the physics step; integrating the equations of motion will take multiple 'integration steps' within this. Can be overridden in each element."
If adjusting maxStep doesn't resolve the issue, you might systematically vary other geometric and physics parameters (e.g., detector length) to see whether any changes cause the anomaly to disappear. This could provide additional insight into the underlying problem.
Debugging directly with the G4beamline source code might also reveal where the particle tracking or energy deposition calculation diverges between versions.
Cheers,
Eremey
Dear Ereme,
Thank you for your previous suggestion regarding adjusting the maxStep parameter. I have followed your advice and conducted further systematic tests, but the issue persists. Below is a summary of my findings:
Adjusting the maxStep parameter:
In version 3.08, I progressively reduced maxStep from its default value to 0.001 mm. However, the particle penetration behavior remained unchanged—particles continued to pass through all 200 detectors.
When maxStep was further reduced to 0.0001 mm, no particles reached the detectors, which is inconsistent with expectations.
In contrast, version 3.06 correctly simulated energy deposition with the default maxStep value, with particles penetrating only up to the 73rd detector (consistent with the theoretical range of 73 μm).
Cross-version environment testing:
I installed both version 3.06 and 3.08 source codes on Ubuntu and ran simulations using g4blmpi 48 filename.g4bl. The results matched those observed on Windows 11.
Database cross-referencing:
To rule out potential discrepancies due to database differences, I conducted a systematic test using both the default and swapped database configurations. The swap was implemented by renaming the database directories/files to make each version load the other's data:
First, each version was run with its own corresponding Geant4Data database.
Then, a cross-test was performed: by renaming the data directories, version 3.08 was forced to use the database from version 3.06, and vice versa.
In all cases, version 3.08 consistently failed to simulate the correct energy deposition, while version 3.06 performed as expected across both configurations. This indicates that the observed issue is unlikely to be caused by database discrepancies,
Based on these results, the issue appears unrelated to the maxStep parameter and may instead stem from underlying differences in particle tracking or energy deposition calculations between the two versions. I am prepared to conduct more in-depth debugging of the source codes for both versions. If you have any further insights or suggestions—such as other critical parameters or physical models that may have changed between versions—I would greatly appreciate your input.
Please let me know if you need me to provide test scripts, detailed output logs, or specific code snippets for further analysis. I look forward to your reply.
Best regards,
Ning Li



