Skip to content

Commit

Permalink
fix: Relative path of MuonChamber.gdml independend of working direc…
Browse files Browse the repository at this point in the history
…tory (#2152)

Now the script finds `MuonChamber.gdml` even when `mockupbuilder.py` is
run from outside its folder.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Andreas Stefl <stefl.andreas@gmail.com>
  • Loading branch information
3 people committed May 26, 2023
1 parent f8d0446 commit 2c02d29
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Examples/Python/python/acts/examples/mockupbuilder.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import acts
import acts.examples.geant4 as actsG4

Expand All @@ -18,8 +20,10 @@
mockupChamberConfigOuter.SensitiveNames = ["Outer_Skin"]
mockupChamberConfigOuter.PassiveNames = ["xx"]

mockupConfig.gdmlPath = (
"../../../../Detectors/MuonSpectrometerMockupDetector/MuonChamber.gdml"
dirOfThisScript = os.path.dirname(__file__)
mockupConfig.gdmlPath = os.path.join(
dirOfThisScript,
"../../../../Detectors/MuonSpectrometerMockupDetector/MuonChamber.gdml",
)
mockupConfig.NumberOfSectors = 8

Expand Down

0 comments on commit 2c02d29

Please sign in to comment.