The puzzle about example B1

In example B1, the Volume for tallying deposit energy is constrained using PreStepPoint,
this include the case below:

but for the right example on the figure, the step is not in the volume.

Please fill out the following information to help in answering your question, and also see tips for posting code snippets

_Geant4 Version:_11.1.1
_Operating System:_Ubuntu 20.04
_Compiler/Version:_GCC 9.4.0

In Example B1, the stepping action checks if the prestep point is in the volume being scored: examples/basic/B1/src/ · master · geant4 / geant4 · GitLab. On the RHS of the figure, the PreStepPoint is in “Other Volume”, so won’t be considered for scoring.

but when tallying deposited energy in a volume, the PreStepPoint and PostStepPoint should all be constrained in the volume?
if only the PreStepPoint is constrained in the volume, it include this case the PreStepPoint is on the volume boundary and the PostStepPoint in the other volume, the deposited energy is tallied.
is it right?

No, it’s the other way around. In the LHS of you nice figure, that step was limited by G4Transportation. The PreStepPoint will be associated with “The Scoring Volume” (specifically, the Touchable will point to “The Scoring Volume”), while the PostStepPoint will be associated with “Other Volume” – the PostStepPoint is exactly on the boundary between the two, and this is how G4 deals with it.

For the next step, the preceding PostStepPoint is copied to become the new PreStepPoint, so it will also be associated with “Other Volume,” along with the new PostStepPoint.

@mkelsey , thanks, now i know the PreStepPoint on the right in the figure is below the other volume!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.