diff --git a/basic/B2/B2aVis.jl b/basic/B2/B2aVis.jl index 8457f5a..33957a2 100644 --- a/basic/B2/B2aVis.jl +++ b/basic/B2/B2aVis.jl @@ -1,31 +1,35 @@ +import Pkg +Pkg.activate(joinpath(@__DIR__, "..", "..")) +Pkg.instantiate() + using Geant4 using Geant4.SystemOfUnits using GLMakie # to force loading G4Vis extension include(joinpath(@__DIR__, "B2aDetector.jl")) -particlegun = G4JLGunGenerator(particle = "proton", - energy = 3GeV, - direction = G4ThreeVector(0,0,1), - position = G4ThreeVector(0,0,-2940.0)); +particlegun = G4JLGunGenerator(particle="proton", + energy=3GeV, + direction=G4ThreeVector(0, 0, 1), + position=G4ThreeVector(0, 0, -2940.0)); evtdisplay = G4JLEventDisplay(joinpath(@__DIR__, "B2aVisSettings.jl")); -app = G4JLApplication(;detector = B2aDetector(nChambers=5), ## detector with parameters - generator = particlegun, ## primary particle generator - physics_type = FTFP_BERT, ## what physics list to instantiate - evtdisplay = evtdisplay, ## detector and event visualization - ); +app = G4JLApplication(; detector=B2aDetector(nChambers=5), ## detector with parameters + generator=particlegun, ## primary particle generator + physics_type=FTFP_BERT, ## what physics list to instantiate + evtdisplay=evtdisplay, ## detector and event visualization +); # wait_for_key(prompt) = (print(stdout, prompt); read(stdin, 1); nothing) configure(app) initialize(app) -beamOn(app,0) ## Needed to really initialize +beamOn(app, 0) ## Needed to really initialize display(evtdisplay.figure) -beamOn(app,1) +beamOn(app, 1) display(evtdisplay.figure) -beamOn(app,1) +beamOn(app, 1) display(evtdisplay.figure)