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