Import GDML to ROOT::TGeo

Are there any good example to show how I can generate GDML file?
I found that its possible to import Geant4 geometry to ROOT TGeoManager::Import(“test.gdml”);
But, I do not have any good example for achieving it…
Best regards,

It’s not built into Geant4. Your DetectorConstruction class would need to call the code necessary to write out a GDML file after the geometry is built, and you probably want a UI command to control that (to specify an output filename, for example).

See examples/extended/persistency/gdml/G02, and the read_gdml.mac and write_gdml.mac files there.

Thanks for the comment,
I found the files you gave, and it seems there
exist sufficient information that I need.
I’ll check it!
best regards.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.