Geant4 Cross Reference |
1 ############################################## 1 ####################################################################### 2 # MACRO FILE NAME: exN03Vis12.mac 2 # MACRO FILE NAME: exN03Vis12.mac # 3 # 3 # # 4 # AUTHOR(S): John Allison 4 # AUTHOR(S): John Allison # 5 # 5 # # 6 # DATE: 16th August 2006 6 # DATE: 16th August 2006 # 7 # 7 # # 8 # CONTENTS: A basic macro for demonstrating t 8 # CONTENTS: A basic macro for demonstrating time slicing # 9 # 9 # # 10 # USAGE: 10 # USAGE: # 11 # cp -pr <install-dir>/geant4/examples/bas 11 # cp -pr <install-dir>/geant4/examples/basic/B4/macros/visTutor . # 12 # <place-of-binary>/exampleB4a -m visTutor 12 # <place-of-binary>/exampleB4a -m visTutor/exN03Vis12.mac # 13 # 13 # # 14 # REQUIRED PLATFORMS & SOFTWARES: Mac/Unix wi 14 # REQUIRED PLATFORMS & SOFTWARES: Mac/Unix with X-Windows, OpenGL # 15 # 15 # # 16 ############################################## 16 ####################################################################### 17 17 18 /control/verbose 2 18 /control/verbose 2 19 /vis/verbose confirmations 19 /vis/verbose confirmations 20 /run/initialize 20 /run/initialize 21 21 22 /vis/open OGL 600x600-0+0 22 /vis/open OGL 600x600-0+0 23 /vis/drawVolume 23 /vis/drawVolume 24 24 25 # Disable auto refresh and quieten vis message 25 # Disable auto refresh and quieten vis messages whilst scene and 26 # trajectories are established: 26 # trajectories are established: 27 /vis/viewer/set/autoRefresh false 27 /vis/viewer/set/autoRefresh false 28 /vis/verbose errors 28 /vis/verbose errors 29 29 30 /vis/viewer/set/viewpointThetaPhi 90. 180. 30 /vis/viewer/set/viewpointThetaPhi 90. 180. 31 /vis/scene/add/eventID 31 /vis/scene/add/eventID 32 /vis/scene/add/trajectories rich 32 /vis/scene/add/trajectories rich 33 33 34 # Set up drawByCharge with time slicing 34 # Set up drawByCharge with time slicing 35 /vis/modeling/trajectories/create/drawByCharge 35 /vis/modeling/trajectories/create/drawByCharge TimeSliceByCharge 36 /vis/modeling/trajectories/TimeSliceByCharge/d 36 /vis/modeling/trajectories/TimeSliceByCharge/default/setDrawStepPts true 37 /vis/modeling/trajectories/TimeSliceByCharge/d 37 /vis/modeling/trajectories/TimeSliceByCharge/default/setStepPtsSize 5 38 /vis/modeling/trajectories/TimeSliceByCharge/d 38 /vis/modeling/trajectories/TimeSliceByCharge/default/setDrawAuxPts true 39 /vis/modeling/trajectories/TimeSliceByCharge/d 39 /vis/modeling/trajectories/TimeSliceByCharge/default/setAuxPtsSize 5 40 /vis/modeling/trajectories/TimeSliceByCharge/d 40 /vis/modeling/trajectories/TimeSliceByCharge/default/setTimeSliceInterval 0.001 ns 41 /vis/modeling/trajectories/list 41 /vis/modeling/trajectories/list 42 #//globalField/setValue 5 0 0 tesla 42 #//globalField/setValue 5 0 0 tesla 43 #/vis/scene/add/trajectories rich smooth 43 #/vis/scene/add/trajectories rich smooth 44 44 45 # Re-establish auto refreshing and verbosity: 45 # Re-establish auto refreshing and verbosity: 46 /vis/viewer/set/autoRefresh true 46 /vis/viewer/set/autoRefresh true 47 /vis/verbose warnings 47 /vis/verbose warnings 48 48 49 # Draw event 49 # Draw event 50 /gun/particle e- 50 /gun/particle e- 51 /gun/energy 50 MeV 51 /gun/energy 50 MeV 52 /run/beamOn 52 /run/beamOn 53 53 54 # Configure OpenGL for display-by-time 54 # Configure OpenGL for display-by-time 55 /vis/viewer/set/timeWindow/fadeFactor 1 55 /vis/viewer/set/timeWindow/fadeFactor 1 56 /vis/viewer/set/timeWindow/displayHeadTime tru 56 /vis/viewer/set/timeWindow/displayHeadTime true 57 /control/alias timeRange 0.1 57 /control/alias timeRange 0.1 58 58 59 # Display time slices 59 # Display time slices 60 /vis/verbose warnings 60 /vis/verbose warnings 61 /control/verbose 0 61 /control/verbose 0 62 /control/loop visTutor/exN03Vis12.loop startTi 62 /control/loop visTutor/exN03Vis12.loop startTime -{timeRange} 0.7 0.001 63 /control/shell sleep 5 63 /control/shell sleep 5 64 /control/verbose 2 64 /control/verbose 2 65 /vis/verbose confirmations 65 /vis/verbose confirmations 66 66 67 # Another event 67 # Another event 68 /run/beamOn 68 /run/beamOn 69 69 70 # Display time slices 70 # Display time slices 71 /vis/verbose warnings 71 /vis/verbose warnings 72 /control/verbose 0 72 /control/verbose 0 73 /control/loop visTutor/exN03Vis12.loop startTi 73 /control/loop visTutor/exN03Vis12.loop startTime -{timeRange} 0.7 0.001 74 /control/shell sleep 5 74 /control/shell sleep 5 75 /control/verbose 2 75 /control/verbose 2 76 /vis/verbose confirmations 76 /vis/verbose confirmations 77 77 78 # Disable auto refresh and quieten vis message 78 # Disable auto refresh and quieten vis messages whilst scene and 79 # trajectories are established: 79 # trajectories are established: 80 /vis/viewer/set/autoRefresh false 80 /vis/viewer/set/autoRefresh false 81 /vis/verbose errors 81 /vis/verbose errors 82 82 83 # Set up drawByParticleID with time slicing 83 # Set up drawByParticleID with time slicing 84 /vis/modeling/trajectories/create/drawByPartic 84 /vis/modeling/trajectories/create/drawByParticleID TimeSliceByParticleID 85 /vis/modeling/trajectories/TimeSliceByParticle 85 /vis/modeling/trajectories/TimeSliceByParticleID/set e- red 86 /vis/modeling/trajectories/TimeSliceByParticle 86 /vis/modeling/trajectories/TimeSliceByParticleID/set e+ blue 87 /vis/modeling/trajectories/TimeSliceByParticle 87 /vis/modeling/trajectories/TimeSliceByParticleID/set pi- cyan 88 /vis/modeling/trajectories/TimeSliceByParticle 88 /vis/modeling/trajectories/TimeSliceByParticleID/set pi+ magenta 89 #/vis/modeling/trajectories/TimeSliceByParticl 89 #/vis/modeling/trajectories/TimeSliceByParticleID/default/setDrawStepPts true 90 /vis/modeling/trajectories/TimeSliceByParticle 90 /vis/modeling/trajectories/TimeSliceByParticleID/default/setStepPtsSize 5 91 #/vis/modeling/trajectories/TimeSliceByParticl 91 #/vis/modeling/trajectories/TimeSliceByParticleID/default/setDrawAuxPts true 92 /vis/modeling/trajectories/TimeSliceByParticle 92 /vis/modeling/trajectories/TimeSliceByParticleID/default/setAuxPtsSize 5 93 /vis/modeling/trajectories/TimeSliceByParticle 93 /vis/modeling/trajectories/TimeSliceByParticleID/default/setTimeSliceInterval 0.001 ns 94 /vis/modeling/trajectories/list 94 /vis/modeling/trajectories/list 95 95 96 # Remove gammas 96 # Remove gammas 97 /vis/filtering/trajectories/create/particleFil 97 /vis/filtering/trajectories/create/particleFilter TimeSliceFilter 98 /vis/filtering/trajectories/TimeSliceFilter/ad 98 /vis/filtering/trajectories/TimeSliceFilter/add gamma 99 /vis/filtering/trajectories/TimeSliceFilter/in 99 /vis/filtering/trajectories/TimeSliceFilter/invert true 100 100 101 # Re-establish auto refreshing and verbosity: 101 # Re-establish auto refreshing and verbosity: 102 /vis/viewer/set/autoRefresh true 102 /vis/viewer/set/autoRefresh true 103 /vis/verbose warnings 103 /vis/verbose warnings 104 104 105 /gun/energy 1 GeV 105 /gun/energy 1 GeV 106 /run/beamOn 106 /run/beamOn 107 107 108 /control/alias timeRange 0.1 108 /control/alias timeRange 0.1 109 /vis/viewer/set/timeWindow/displayHeadTime tru 109 /vis/viewer/set/timeWindow/displayHeadTime true 110 /vis/viewer/set/timeWindow/displayLightFront t 110 /vis/viewer/set/timeWindow/displayLightFront true 0 0 -90 mm 111 /vis/verbose warnings 111 /vis/verbose warnings 112 /control/verbose 0 112 /control/verbose 0 113 /control/loop visTutor/exN03Vis12.loop startTi 113 /control/loop visTutor/exN03Vis12.loop startTime -{timeRange} 0.7 0.001 114 /control/shell sleep 5 114 /control/shell sleep 5 115 /control/verbose 2 115 /control/verbose 2 116 /vis/verbose confirmations 116 /vis/verbose confirmations 117 /vis/viewer/set/timeWindow/displayLightFront f 117 /vis/viewer/set/timeWindow/displayLightFront false 118 /vis/viewer/set/timeWindow/displayHeadTime fal 118 /vis/viewer/set/timeWindow/displayHeadTime false 119 119 120 # Disable auto refresh and quieten vis message 120 # Disable auto refresh and quieten vis messages whilst scene and 121 # trajectories are established: 121 # trajectories are established: 122 /vis/viewer/set/autoRefresh false 122 /vis/viewer/set/autoRefresh false 123 /vis/verbose errors 123 /vis/verbose errors 124 124 125 # To see pi -> mu -> e decay. 125 # To see pi -> mu -> e decay. 126 /gun/particle pi+ 126 /gun/particle pi+ 127 /vis/filtering/trajectories/TimeSliceFilter/ad 127 /vis/filtering/trajectories/TimeSliceFilter/add anti_nu_mu 128 /vis/filtering/trajectories/TimeSliceFilter/ad 128 /vis/filtering/trajectories/TimeSliceFilter/add nu_mu 129 /vis/filtering/trajectories/TimeSliceFilter/ad 129 /vis/filtering/trajectories/TimeSliceFilter/add anti_nu_e 130 /vis/filtering/trajectories/TimeSliceFilter/ad 130 /vis/filtering/trajectories/TimeSliceFilter/add nu_e 131 # Accumulate several events for effect 131 # Accumulate several events for effect 132 /vis/scene/endOfEventAction accumulate 132 /vis/scene/endOfEventAction accumulate 133 /gun/energy 100 MeV 133 /gun/energy 100 MeV 134 #/vis/viewer/set/globalLineWidthScale 2 134 #/vis/viewer/set/globalLineWidthScale 2 135 135 136 # Re-establish auto refreshing and verbosity: 136 # Re-establish auto refreshing and verbosity: 137 /vis/viewer/set/autoRefresh true 137 /vis/viewer/set/autoRefresh true 138 /vis/verbose warnings 138 /vis/verbose warnings 139 139 140 /run/beamOn 5 140 /run/beamOn 5 141 141 142 /control/alias timeRange 1000 142 /control/alias timeRange 1000 143 /vis/viewer/set/timeWindow/displayHeadTime tru 143 /vis/viewer/set/timeWindow/displayHeadTime true 144 /vis/verbose warnings 144 /vis/verbose warnings 145 /control/verbose 0 145 /control/verbose 0 146 /control/loop visTutor/exN03Vis12.loop startTi 146 /control/loop visTutor/exN03Vis12.loop startTime -{timeRange} 3000 5 147 /control/shell sleep 5 147 /control/shell sleep 5 148 /control/verbose 2 148 /control/verbose 2 149 /vis/verbose confirmations 149 /vis/verbose confirmations