How does G4PVParameterised actually work?

Hello to you all,

I am currently working on a master thesis about translating DICOM images into G4 geometries. I have examined the DICOM example and am trying to figure out how DicomRegularDetectorConstruction works, which implies understanding what a G4PVParameterised works.

I am asking for validation or invalidation of my way of understanding, which I could explain as follows:

By observing the code I suspect that when a DICOM image is read, all useful information consists in position of voxels and materials of these voxels. The example shows in fact that all these data are stored in a class inheriting from G4PhantomParameterisation, inheriting from G4VPVParameterisation. The ComputeDimensions(), ComputeMaterial() and ComputeTransformation() methods of this class are interesting in the sense that they require a G4int as argument in addition with a G4VPhysicalVolume. My understanding is that this G4int serves as an index for identifying a particular voxel.

By “identifying a particular voxel” I do not mean to say that we are referring to an actual Solid Logical Physical (SLP) volume but rather to dimensions, transformation and material data stored in the parameterisation as attributes.

During simulation, I therefore think that when a simulated particle asks the run manager in which volume it is standing at the time, this run manager actually interrogates the parameterisation in order to deduce the index corresponding to the voxel in which the particle is standing. When this index is retrieved, ComputeDimensions(), ComputeMaterial() and ComputeTransformation() methods use it to modify the G4VPhysicalVolume they receive as argument. From what I looked, this G4VPhysicalVolume is actually a G4PVParameterised which is valid as it inheriting from G4VReplica which inherits from G4VPhysicalVolume.

Consequently, it seems that at all time of simulation, only one voxel is physical and its properties are modified according to needs of the simulation.

Is my reasoning correct or am I missing a few important details?

Thank very much in advance for your help !

Your reasoning is right: this is a general feature of the Geant4 tracking, to avoid filling up the memory, only the copy of the volume where the track is (a G4Trouchable) is kept in memory.

Thank you for your answer. I suppose that by “copy” you mean to refer to a copy of a generic volume (the G4PVParameterised)?