Summing detector scattered gamma particle energies

Hello, I am working on a project for my professor and I have been given the task to (when a gamma particle is detected in a scintillation detector) also check the two detectors on either side of it for potential scattering and sum the energies that are deposited in them. Currently I am using an
if(vol == detector)
energy += GetTotalEnergyDeposit();
approach to get this energy, but I am unsure what the best approach to do this task would be. Also, would this be best done in the SteppingAction file, or along side my other gating and data acquisition functions in Analysis? Any advice would be GREATLY appreciated!