Geant4 Cross Reference |
1 ############################################## 1 ################################################### 2 # Visualization of detector geometry and event 2 # Visualization of detector geometry and events 3 ############################################## 3 ################################################### 4 4 >> 5 # create empty scene >> 6 /vis/scene/create >> 7 5 # reading extended GDML Geometry from file 8 # reading extended GDML Geometry from file 6 /mydet/readFile color_extension.gdml 9 /mydet/readFile color_extension.gdml 7 /run/initialize 10 /run/initialize 8 # 11 # 9 # Open a viewer << 12 # Use this open statement to create an OpenGL view: 10 /vis/open << 13 /vis/open OGL 600x600-0+0 11 # This opens the default viewer - see examples << 14 # 12 # more comprehensive overview of options. Also << 15 # Use this open statement to create a .prim file suitable for >> 16 # viewing in DAWN: >> 17 #/vis/open DAWNFILE >> 18 # >> 19 # Use this open statement to create a .heprep file suitable for >> 20 # viewing in HepRApp: >> 21 #/vis/open HepRepFile >> 22 # >> 23 # Use this open statement to create a .wrl file suitable for >> 24 # viewing in a VRML viewer: >> 25 #/vis/open VRML2FILE 13 # 26 # 14 # Disable auto refresh and quieten vis message 27 # Disable auto refresh and quieten vis messages whilst scene and 15 # trajectories are established: 28 # trajectories are established: 16 /vis/viewer/set/autoRefresh false 29 /vis/viewer/set/autoRefresh false 17 /vis/verbose errors 30 /vis/verbose errors 18 # 31 # 19 # Draw geometry: 32 # Draw geometry: 20 /vis/drawVolume 33 /vis/drawVolume 21 # 34 # 22 # Specify view angle: 35 # Specify view angle: 23 #/vis/viewer/set/viewpointThetaPhi 90. 0. 36 #/vis/viewer/set/viewpointThetaPhi 90. 0. 24 # 37 # 25 # Specify zoom value: 38 # Specify zoom value: 26 /vis/viewer/zoom 1.5 39 /vis/viewer/zoom 1.5 27 # 40 # 28 # Specify style (surface or wireframe): 41 # Specify style (surface or wireframe): 29 #/vis/viewer/set/style wireframe 42 #/vis/viewer/set/style wireframe 30 # 43 # 31 # Draw coordinate axes: 44 # Draw coordinate axes: 32 #/vis/scene/add/axes 0 0 0 1 m 45 #/vis/scene/add/axes 0 0 0 1 m 33 # 46 # 34 # Draw smooth trajectories at end of event, sh 47 # Draw smooth trajectories at end of event, showing trajectory points 35 # as markers 2 pixels wide: 48 # as markers 2 pixels wide: 36 /vis/scene/add/trajectories smooth 49 /vis/scene/add/trajectories smooth 37 /vis/modeling/trajectories/create/drawByCharge 50 /vis/modeling/trajectories/create/drawByCharge 38 /vis/modeling/trajectories/drawByCharge-0/defa 51 /vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true 39 /vis/modeling/trajectories/drawByCharge-0/defa 52 /vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2 40 # (if too many tracks cause core dump => /trac 53 # (if too many tracks cause core dump => /tracking/storeTrajectory 0) 41 # 54 # 42 # Draw hits at end of event: 55 # Draw hits at end of event: 43 #/vis/scene/add/hits 56 #/vis/scene/add/hits 44 # 57 # 45 # To draw only gammas: 58 # To draw only gammas: 46 #/vis/filtering/trajectories/create/particleFi 59 #/vis/filtering/trajectories/create/particleFilter 47 #/vis/filtering/trajectories/particleFilter-0/ 60 #/vis/filtering/trajectories/particleFilter-0/add gamma 48 # 61 # 49 # To invert the above, drawing all particles e 62 # To invert the above, drawing all particles except gammas, 50 # keep the above two lines but also add: 63 # keep the above two lines but also add: 51 #/vis/filtering/trajectories/particleFilter-0/ 64 #/vis/filtering/trajectories/particleFilter-0/invert true 52 # 65 # 53 # Many other options are available with /vis/m 66 # Many other options are available with /vis/modeling and /vis/filtering. 54 # For example, to select colour by particle ID 67 # For example, to select colour by particle ID: 55 #/vis/modeling/trajectories/create/drawByParti 68 #/vis/modeling/trajectories/create/drawByParticleID 56 #/vis/modeling/trajectories/drawByParticleID-0 69 #/vis/modeling/trajectories/drawByParticleID-0/set e- blue 57 # 70 # 58 # To superimpose all of the events from a give 71 # To superimpose all of the events from a given run: 59 /vis/scene/endOfEventAction accumulate 72 /vis/scene/endOfEventAction accumulate 60 # 73 # 61 # Re-establish auto refreshing and verbosity: 74 # Re-establish auto refreshing and verbosity: 62 /vis/viewer/set/autoRefresh true 75 /vis/viewer/set/autoRefresh true 63 /vis/verbose warnings 76 /vis/verbose warnings 64 # 77 # 65 # For file-based drivers, use this to create a 78 # For file-based drivers, use this to create an empty detector view: 66 #/vis/viewer/flush 79 #/vis/viewer/flush 67 # 80 # 68 #hard coded position and direction for gun 81 #hard coded position and direction for gun 69 /gun/position 0 0 -0.1 mm 82 /gun/position 0 0 -0.1 mm 70 /gun/direction 1 0 0 83 /gun/direction 1 0 0 71 84 72 #if you want make a run with particle 85 #if you want make a run with particle 73 #/tracking/verbose 1 86 #/tracking/verbose 1 74 /run/beamOn 10 87 /run/beamOn 10 75 # 88 #