-
Notifications
You must be signed in to change notification settings - Fork 50
Closed
Description
I am working at ORNL doing Julia (1.11) Geant4 simulations for minimizing PEN enclosure thickness. I keep encountering a recurring error where I am unable to perform more than one Geant4 simulation in a single Julia session. If I were to run my code, which includes two sources and a simulation for each, line by line, it would break down when I perform the second Geant4 simulation with a UndefRefError. This has been recurring and I have not been able to find a solution to it. Please find attached below a minimal working example.
using Geant4
using SolidStateDetectors
using Unitful
source_1 = MonoenergeticSource(
"e-",
3.5u"MeV",
CartesianPoint(0.065, 0., 0.05),
CartesianVector(-1,0,0),
10u"°" )
source_2 = MonoenergeticSource(
"e-",
2.25u"MeV",
CartesianPoint(0.085, 0., 0.15),
CartesianVector(-2,0,0),
15u"°" )
T = Float32
sim = Simulation{T}(SSD_examples[:InvertedCoaxInCryostat])
app = G4JLApplication(sim, source_1, verbose = false)
events = run_geant4_simulation(app, 1000)
sim_2 = Simulation{T}(SSD_examples[:InvertedCoaxInCryostat])
app_2 = G4JLApplication(sim_2, source_2, verbose = false)
events_2 = run_geant4_simulation(app_2, 1000)CC @theHenks
Metadata
Metadata
Assignees
Labels
No labels