1+ using Geant4
2+ using Geant4. SystemOfUnits
3+ using GLMakie # to force loading G4Vis extension
4+
5+ # detname = "LHCb_Upgrade_fullLHCb"
6+ detname = " cms2018"
7+
8+ # ---Create the detector geometry from a GDML file----------------------------------------------
9+ detector = G4JLDetectorGDML(" $(@__DIR__) /$(detname) .gdml" ; validate_schema= false );
10+ # ---Create the Application---------------------------------------------------------------------
11+ app = G4JLApplication(;detector = detector, # # detector defined with a GDML file
12+ physics_type = FTFP_BERT, # # what physics list to instantiate
13+ );
14+ configure(app)
15+ initialize(app) # # Initialize Geant4 kernel (including the geometry)
16+
17+ world = GetWorldVolume()
18+
19+ # ---Create the display scene-------------------------------------------------------------------
20+ set_theme!(backgroundcolor = :black)
21+ fig = Figure(size= (1280 , 720 ))
22+ sc = LScene(fig[1 ,1 ], show_axis= false )
23+ Camera3D(sc. scene, upvector= Vec3f(0 , 1 , 0 ))
24+ rotate_cam!(sc. scene, Vec3f(π, 0 , 0 ))
25+
26+ # Cut out a wedge from θ1 to θ2
27+ θ1, θ2 = 0 , π / 2 # 0° to 90° wedge removed
28+
29+ # Part 1: everything with angle > θ2
30+ n1 = Vec3f(sin(θ2), - cos(θ2), 0 )
31+ draw!(sc, world, maxlevel= 5 , clip_planes= [Makie. Plane3f(n1, 0f0 )]);
32+ # Part 2: everything with angle < θ1
33+ n2 = Vec3f(- sin(θ1), cos(θ1), 0 )
34+ draw!(sc, world, maxlevel= 5 , clip_planes= [Makie. Plane3f(n2, 0f0 )]);
35+ display(fig)
36+
37+ save(" $(@__DIR__) /$(detname) .png" , fig)
0 commit comments