Implementation of unusual Geant4 shapes as Passive volumes

Dear developpers,

I have a question on future developments of the module GeometryBuilderGeant4.

In my simulation project, I have to implement a collimator with holes of unusual shapes: a central hexagonal one surrounded by trapezoidal holes.

These two hole geometries can be modeled in Geant4 by the object G4Trap. I attach you the lines:

    // Solid & logic of one hole.
    solidColHole = new G4Trap("colhole",
			      colhthick, 0.0*deg,
			      0.0*deg, colholehwid,
			      colholehlen2, colholehlen,
			      0.0*deg, colholehwid,
    			      colholehlen2, colholehlen,

I have implemented as hard code this geometry in the module GeometryBuilderGeant4:

But I was wondering if you have considered this shape as PassiveVolume in future versions of this module. Or the definition of passive volumes by a GDML input file.

Many thanks in advance for your answer.

Best regards,


Hi @iguaz ,

as this is quite unusual, we did not consider such a shape yet.
However, indeed last week we merged a new feature which enables loading GDML files. It’s available in the current master branch and will be part of our next feature release, which will most probably be released in February.

You can find a corresponding example here:


Dear @pschutze,

Thanks for your reply.

I will definitively test the GDML feature. It could possible simplify my work.