Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
DisplayAs = "0b91fe84-8a4c-11e9-3e1d-67c38462b6d6"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
FHist = "68837c9b-b678-4cd5-9925-8a54edc8f695"
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
Geant4 = "559df036-b7a0-42fd-85df-7d5dd9d70f44"
Geant4_jll = "872b6946-528a-5ac7-9145-d37eec569368"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
Expand Down
37 changes: 37 additions & 0 deletions docs/src/examples/DetectorDisplay.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Geant4
using Geant4.SystemOfUnits
using GLMakie # to force loading G4Vis extension

#detname = "LHCb_Upgrade_fullLHCb"
detname = "cms2018"

#---Create the detector geometry from a GDML file----------------------------------------------
detector = G4JLDetectorGDML("$(@__DIR__)/$(detname).gdml"; validate_schema=false);
#---Create the Application---------------------------------------------------------------------
app = G4JLApplication(;detector = detector, ## detector defined with a GDML file
physics_type = FTFP_BERT, ## what physics list to instantiate
);
configure(app)
initialize(app) ## Initialize Geant4 kernel (including the geometry)

world = GetWorldVolume()

#---Create the display scene-------------------------------------------------------------------
set_theme!(backgroundcolor = :black)
fig = Figure(size=(1280, 720))
sc = LScene(fig[1,1], show_axis=false)
Camera3D(sc.scene, upvector=Vec3f(0, 1, 0))
rotate_cam!(sc.scene, Vec3f(π, 0, 0))

# Cut out a wedge from θ1 to θ2
θ1, θ2 = 0, π / 2 # 0° to 90° wedge removed

# Part 1: everything with angle > θ2
n1 = Vec3f(sin(θ2), -cos(θ2), 0)
draw!(sc, world, maxlevel=5, clip_planes=[Makie.Plane3f(n1, 0f0)]);
# Part 2: everything with angle < θ1
n2 = Vec3f(-sin(θ1), cos(θ1), 0)
draw!(sc, world, maxlevel=5, clip_planes=[Makie.Plane3f(n2, 0f0)]);
display(fig)

save("$(@__DIR__)/$(detname).png", fig)
366,528 changes: 366,528 additions & 0 deletions docs/src/examples/LHCb_Upgrade_fullLHCb.gdml

Large diffs are not rendered by default.

Binary file added docs/src/examples/LHCb_Upgrade_fullLHCb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading