Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions basic/B2/B2aVis.jl
Original file line number Diff line number Diff line change
@@ -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)