From 045c2c47b3609c618a5ab1ffa0651bebceb79553 Mon Sep 17 00:00:00 2001 From: Oliver Lantwin Date: Tue, 3 Feb 2026 14:29:29 +0100 Subject: [PATCH 1/3] feat(sim): add --dump-g4-config option to dump Geant4 VMC configuration Prints material/cuts couples table and region info after initialisation. Enable in CI for diagnostics. --- .github/workflows/build-run.yml | 2 +- macro/run_simScript.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-run.yml b/.github/workflows/build-run.yml index 3e7a5f5b5b..dd7d98d6e1 100644 --- a/.github/workflows/build-run.yml +++ b/.github/workflows/build-run.yml @@ -84,7 +84,7 @@ jobs: run: | source /cvmfs/ship.cern.ch/$version/setUp.sh eval $(alienv load FairShip/latest) - python $FAIRSHIP/macro/run_simScript.py --test --debug 2 --${{ matrix.vessel_option }} --SND --SND_design=${{ matrix.SND_option }} --shieldName ${{ matrix.muon_shield }} --target-yaml=$FAIRSHIP/geometry/target_config_${{ matrix.target }}.yaml --EvtGenDecayer --tag ci-test + python $FAIRSHIP/macro/run_simScript.py --test --debug 2 --${{ matrix.vessel_option }} --SND --SND_design=${{ matrix.SND_option }} --shieldName ${{ matrix.muon_shield }} --target-yaml=$FAIRSHIP/geometry/target_config_${{ matrix.target }}.yaml --EvtGenDecayer --dump-g4-config --tag ci-test - name: Overlap check run: | diff --git a/macro/run_simScript.py b/macro/run_simScript.py index 6025dc0e4d..f4ceb8d322 100755 --- a/macro/run_simScript.py +++ b/macro/run_simScript.py @@ -143,6 +143,7 @@ parser.add_argument("--debug", help="Control FairLogger verbosity: 0=info (default), 1=+debug, 2=+debug1, 3=+debug2", default=0, type=int, choices=range(0,4)) parser.add_argument("--print-fields", help="Print VMC fields and weights information", action="store_true") parser.add_argument("--check-overlaps", help="Perform geometry overlap checking", action="store_true") +parser.add_argument("--dump-g4-config", help="Dump Geant4 VMC configuration after initialisation", action="store_true") parser.add_argument("--field_map", default=None, help="Specify spectrometer field map.") parser.add_argument("--z-offset", dest="z_offset", help="z-offset for the FixedTargetGenerator [mm]", default=-84., type=float) parser.add_argument( @@ -532,6 +533,12 @@ gMC = ROOT.TVirtualMC.GetMC() fStack = gMC.GetStack() +if options.dump_g4_config: + gMC.ProcessGeantCommand("/mcVerbose/composedPhysicsList 2") + gMC.ProcessGeantCommand("/mcVerbose/regionsManager 3") + print(f"Stack type: {type(fStack).__name__}") + print(f"Stack StoreSecondaries: {fStack.GetStoreSecondaries()}") + # -----J/psi external decayer configuration handled in g4config.in------------------------------------ # VMC command /mcPhysics/setExtDecayerSelection J/psi forces external decayer usage EnergyCut = 10. * u.MeV if options.mudis else 100. * u.MeV From 3d216b4f69120cc77d2a0196c8810be377733b88 Mon Sep 17 00:00:00 2001 From: Oliver Lantwin Date: Tue, 3 Feb 2026 15:23:36 +0100 Subject: [PATCH 2/3] fixup! feat(sim): add --dump-g4-config option to dump Geant4 VMC configuration --- macro/run_simScript.py | 1 - 1 file changed, 1 deletion(-) diff --git a/macro/run_simScript.py b/macro/run_simScript.py index f4ceb8d322..cae990ccb1 100755 --- a/macro/run_simScript.py +++ b/macro/run_simScript.py @@ -537,7 +537,6 @@ gMC.ProcessGeantCommand("/mcVerbose/composedPhysicsList 2") gMC.ProcessGeantCommand("/mcVerbose/regionsManager 3") print(f"Stack type: {type(fStack).__name__}") - print(f"Stack StoreSecondaries: {fStack.GetStoreSecondaries()}") # -----J/psi external decayer configuration handled in g4config.in------------------------------------ # VMC command /mcPhysics/setExtDecayerSelection J/psi forces external decayer usage From 54544c481c53086ace0ebe148f8e220e2046f83c Mon Sep 17 00:00:00 2001 From: Oliver Lantwin Date: Tue, 3 Feb 2026 17:44:02 +0100 Subject: [PATCH 3/3] fixup! feat(sim): add --dump-g4-config option to dump Geant4 VMC configuration --- macro/run_simScript.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/macro/run_simScript.py b/macro/run_simScript.py index cae990ccb1..9f4a883c63 100755 --- a/macro/run_simScript.py +++ b/macro/run_simScript.py @@ -534,8 +534,7 @@ fStack = gMC.GetStack() if options.dump_g4_config: - gMC.ProcessGeantCommand("/mcVerbose/composedPhysicsList 2") - gMC.ProcessGeantCommand("/mcVerbose/regionsManager 3") + gMC.ProcessGeantCommand("/run/dumpCouples") print(f"Stack type: {type(fStack).__name__}") # -----J/psi external decayer configuration handled in g4config.in------------------------------------