Geometry boundaries affect location of energy deposition
Energy deposition unnaturally decreases towards the end of a volume in the general direction of the primary and is greater in the next volume. The expected outcome is not a level, but smooth energy deposition histogram.
examples/processes/1_em/ copper example
Large shower in segmented collimator that's sensitive.
Comments (3)
-
reporter -
reporter Changing the hard coded Z position in histograms instead of S (ok for linear example - broken for a lattice with any bends) results in the same bug being present but to a lesser degree.
.
Printing out the difference between S and global Z (in this linear case should be 0) shows ~95% 0 difference and then occasionally + - 25mm (exactly) difference.
-
reporter - changed status to resolved
Resolved with commit 47c416e.
Reimplemented the energy deposition coordinate calculation in BDSEnergyCounterSD. Removed complicated s position lookup by using new BDSPhysicalVolumeInfoRegistry instead that looks up unique placement volumes and gets the s position from that.
Also, used the end position of the step as the point of energy deposition. Previously, it was the average of the pre and post step points. This produces a smooth energy deposition curve irrespective of how the geometry is divided.
- Log in to comment
BDSEventAction.cc was changed to use the global Z position instead of S to ascertain whether it's a problem with determination of the s coordinate or the energy counter hits being produced from the step / track information. No difference -> coordinate problem, not s problem.
Changing BDSEnergyCounterSD to use the post step point instead of the pre step point provides a smoother output, which means the geometry boundaries don't affect it. The attached graph shows S as the x axis but it's actually global Z (hard coded for test).
It is really ambiguous in Geant4 documentation as to which point you should use in your code to record the output. In most of their examples, they seem to use the pre step point, but this does not provide smooth output.
If we assume a relatively smooth energy deposition curve is actually being produced (sensible -> large number of secondaries with 0.7mm range cuts default), the correct analysis / recording should also produce a smooth output irrespective of the geometry divisions.
This seems to have fixed the energy hits.