Energy accumulation between runs

Hello!! How to accumulate the deposited energy of all the executions in a single output file? I have a voxelized water phantom and I want to obtain the energy deposited by multiple particles in each voxel. The problem is that every time the /run/beamoOn command is executed, the energy deposit is reset, so I only get the energy deposited by the last particle fired and not the total energy deposited by all the particles, which is what I want.

My input file:

The question is: how can I get the total energy deposited by all the particles in each voxel in a .txt file? How can I keep the file open between executions?