How to get and use the coordinate (x, y, z) of a volume randomly distributed

Hello everyone,

Consider that a number of volumes (such as spheres that, have their own daughter volumes) are defined/distributed randomly (and without overlapping) in the mother/world volume of the geometry setup. The ionizing radiation source (for example, monoenergetic electrons) must be distributed within one of those volumes (or one of their compartments). To this, the position (the x, y, and z Cartesian coordinates) of the origin of that certain volume is needed (Note that this procedure must be done before running the simulation program. Although, getting the position after the run (as an output) and using it for another simulation could be a good solution, too).

Is this possible? Is there any function in Geant4 to give each coordinate separately?

With kind regards.