I have been trying to find this particular information, but nothing seems to be clear:
I have a geometry that was created with ROOT via the TGeoManager class and saved in a .root format. I would like to know if it is possible to use that geometry directly (.root) in Geant4? Or do I need to convert it to GDML beforehand?
I found the Virtual Monte Carlo class in ROOT as an interface to Geant4, but it looks like the latest versions of ROOT do not contain that class anymore.
I agree with Jason’s answer - using GDML as the transfer format is the simplest answer, and should suffice for nearly all setups / applications.
The implementations of GDML in Root and Geant4 are well aligned, so I would expect that you will obtain the same setup in Geant4 as what you expect from ROOT.
In addition, I believe that this is the way in which tools such as DD4HEP use to export geometries created in Root to Geant4. So you would be treading a well worn path.
It’s really not a problem in my code. It’s just that ROOT stores the geometry in a nice format (.root), where you can see the full tree of objects and such. But it’s really just a matter of changing my code from gGeoManager->Export(geom.root); to gGeoManager->Export(geom.gdml);, and I can later store the gdml file inside a ROOT file.