Geometry boundaries affect location of energy deposition

Issue #52 resolved
Laurie Nevay created an issue

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.

Screen Shot 2015-07-15 at 09.29.59.png

Comments (3)

  1. Laurie Nevay reporter

    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).

    Screen Shot 2015-07-14 at 23.59.20.png

    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.

  2. Laurie Nevay 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.

    Screen Shot 2015-07-15 at 09.42.40.png.

    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.

  3. Laurie Nevay reporter

    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.

    Screen Shot 2015-07-22 at 15.33.27.png

  4. Log in to comment