Extract energy deposit in volumes constracted by G4PVReplica

I have constructed 10 volumes using G4PVReplica, I want to extract the energy deposit in each volume.
is there some ideas to achieve this?
thank you


Refer to example B5, it’s a good place to start.

You’ll want to make sure that the logical volume of your replicated geometry is designated as a sensitive detector within detector construction.

Within the sensitive detector file, you’ll have access to each step, and thus the energy deposition at each step, along with information regarding the unique physical volume where the energy deposition occurred. From the “step” access the presteppoint, then gettouchable, then getvolume, then copy ID. The copy ID will be unique for each replicated physical volume. From there just keep track of the energy deposited in each unique copy ID.

Let me know if that makes sense. Feel free to reach out if you have other questions.

Happy coding!


Thanks, B5 is very useful for that