Adapt Sam's https://github.com/DUNE/larnd-sim/pull/153
Adapt Sam's DUNE/larnd-sim#153