How the material of several bodies in a parallel world is defined

I encountered a problem with the definition of materials when defining the parallel world. According to the manual, if I define the material in the parallel world and set the layered mass geometry, then the material in the parallel world will override the material in the mass world.

The problem I am having is that I need to define a geometry in the parallel world and set the material for this geometry. Also the materials of the objects in the mass world cannot be affected by the materials defined in the parallel world. I would like to know what I should do.

I am not sure if I understand you correctly. Is the problem that the material definition (not the volume/placement) overrides the previous material definition, or is the problem that placed volumes in the parallel world change the “currently active material” for certain coordinates?

Naive suggestions:

  • use different names for the materials in the parallel world
  • subtract the volumes of the main world from parallel world volumes to make them non-overlapping

Yes yes, my concern now is that the materials I have defined in the parallel world will have an effect on the materials in the mass world. I have built a model using the DICOM example and then defined a geometry in the parallel world. This geometry uses PTFE as the material.

My concern is that the material in the parallel world will overwrite the material in the mass world. I define a sphere in the mass world to define the material as air. Define a box in the parallel world defining the material as water, and place this box at the parallel world origin. So will the material at the origin of the mass world be changed?

According to the advice you gave, isn’t it true that material overwriting doesn’t happen as long as the material names are different in the two worlds. Am I understanding this correctly?

Thank you for your reply.

  • Volumes in a parallel world may have materials. Such materials overwrite the materials defined in the mass geometry if the "layered mass geometry" switch of the G4ParallelWorldProcess constructor is set.

Again, depends on what you mean… Re-defining a material with identical name in both worlds does not throw an error. If I were to have e.g. a PTFE material in both worlds (with different properties!), I would use two different names, just to be sure… Probable it is not an issue at all, because

/material/g4/printMaterial <name>

will then just list both variants without complaining when there is two definitions of in both worlds…

Thanks for the advice you gave, I understand the problem now. Thanks.