Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate G4VG for use of in-memory conversion of Geant4->VecGeom geometries #340

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

drbenmorgan
Copy link
Member

@drbenmorgan drbenmorgan commented Jan 31, 2025

This supersedes #289 to integrate the now standalone celeritas-project/G4VG library into AdePT for in-memory geometry conversions without an intermediate GDML file. The as-submitted implementation is:

  • G4VG is pulled in via CMake's FetchContent mechanism to build it as part of AdePT.
  • It is linked in to the AdePT integration library
  • AdePTGeant4Integration::CreateVecGeomWorld(G4VPhysicalVolume const *physvol) is implemented to use G4VG to do the in-memory conversion.
  • AdePTTrackingManager::InitializeAdePT() is updated to use that function if AdePTConfiguration::fVecGeomGDML is empty.
  • An extra test of example1 is provided that is identical to the existing test, except for not setting AdePTConfiguration::fVecGeomGDML.
    • I've confirmed locally that this results in the in memory conversion being called, but there's no reproducibility check against the GDML-using version.

I'm marking as draft as there's a final merge to do upstream in G4VG to get a proper commit to use, however, I wanted to start things off to get some initial CI checks done and for initial comments. That's done, so fully ready for review!

Provide new CreateVecGeomWorld static function taking a Geant4 physical
volume, using G4VG to convert this in-memory using G4VG.

Update AdePTTrackingManager to use this function if the GDML file
entry in the configuration is empty, otherwise falling back to the
VGDML convertor.
Reproduce example1's large stack test, leaving the AdePTTrackingManager
GDML file configuration empty so that G4VG conversion is used.

At present this is a pure check on a successful run with no
reproducibility check between GDML/G4VG outputs.
Use of find_package with G4VG seems to encounter a few issues.
Whilst those are resolved, just use FetchContent to get and use
G4VG.
@drbenmorgan drbenmorgan added the in_geometry Category: In geometry label Jan 31, 2025
@phsft-bot
Copy link

Can one of the admins verify this patch?

@drbenmorgan drbenmorgan marked this pull request as ready for review January 31, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in_geometry Category: In geometry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants