I would like to implement a complex detector geometry in ALLPIX Squared using the passive volumes in GDML format of GeometryBuilderGeant4 module. Until now, I have directly coded them in the module.
The geometry consists in a sandwhich of several layers. For simplicity, I attach you the files corresponding to a geometry with just 3 passive volumes in the WorldBox (from sensor to outside):
Front plate → Purple volume
Titane collimator → Yellow volume
Copper container → Brown volume
NB: In attached figures, the sensor is in blue, bonding is in orange and the support is in green
NB: To use files, please remove the “.txt” termination of “materials.xml.txt” and “dialeil-LEAPS.gdml.txt” files. These terminations have added to upload files in this topic.
If I implement in the GDML file just the first two layers, the two layers are shown by viewer:
after playing more with it I believe that this must be an issue with your GDML file somehow. When I swap the fcont and col volumes, I see the (previously missing) colPhys, but at the position of the fcont, so with a gap to the plate.
I have also tried wrapping them in an assembly volume
very interesting issue. If I remove the line you’re pointing at, our examples start to fail, as we’re placing volumes outside their mother volume. You defined a rather large world volume in your gdml, maybe the volumes still fit into the mother volume, and that’s why it doesn’t fail in your case. This is just a hypothesis for the moment, as I didn’t have the time to test your case.
Meaning: I think for us this is the solution yet, but we’ll keep investigating. If for now it works for you, of course go ahead with the fix, there shouldn’t be much harm in it.
We do need to remove the volumes from their GDML world, so your option does not generally work
However, when removing we were changing the indices of the remaining daughters and at the end were simply reading the wrong volumes - I’m even surprised Geant4 didn’t crash or throw us an exception.