Skip to content

Conversation

@mvicenzi
Copy link
Member

This PR includes a small change in the setting of the GDMLParser::Write() call to clean-up the volume names in the GDML files by setting storeReferences=false. This is needed for FPFDisplay and possibly every other use of the GDML files (e.g: ACTS?).

From the GDML documention of GDMLParser::Write():

There exists also an optional third parameter, which is a Boolean value set by default to
TRUE. This parameter tells how you would like the names of volumes (as well as of
solids, materials and all entities) to be formatted in your output GDML file:

true (default) – The names will be concatenated with their logical address in
hexadecimal format. This is to avoid name duplication in the GDML output; in fact
Geant4 allows different volumes (as well as materials and solids) with the same name.
When you will read the GDML output file back into Geant4 the address part will be
stripped off and you will have the original names. This is almost always safe.

false – The names will NOT be concatenated with anything. So the names in the output
file will correspond exactly to the ones you have in Geant4. This is the prettiest format
although you have to be REALLY sure that you don’t have name duplication inside
Geant4, otherwise this will generate a GDML output with duplicated names, which will be
unreadable by any parser of course.

@mvicenzi mvicenzi self-assigned this May 15, 2025
@mvicenzi mvicenzi added the enhancement New feature or request label May 15, 2025
Copy link
Contributor

@WenjieWu-Sci WenjieWu-Sci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's nice to know.

@WenjieWu-Sci WenjieWu-Sci merged commit 31875f2 into main May 16, 2025
@mvicenzi mvicenzi mentioned this pull request Jun 12, 2025
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants