#
# Macro file for A01app
#
# For initialization of graphics.
# See geant4/source/visualization/README.built_in_commands.
#
# Create a scene handler and viewer for a specific graphics system
# Edit the next line(s) to choose another graphic system
# /vis/open is a compound command equivalent to:
#   /vis/sceneHandler/create
#   /vis/viewer/create
#
/vis/open OGL
#
# Create a scene.  One could use /vis/drawVolume, which is equivalent to:
#   /vis/scene/create
#   /vis/scene/add/volume
#   /vis/sceneHandler/attach
# but we want more, so...
#   
# Create empty scene
#
/vis/scene/create
#
# Add volume to scene ("world" is default)
#
/vis/scene/add/volume
#
# Add trajectories to scene
#
/vis/scene/add/trajectories
#
# Add hits to scene
#
/vis/scene/add/hits
#
# If you wish to accumulate trajectories or hits...
#
/vis/scene/endOfEventAction accumulate
#
# Attach scene to scene handler.
#
/vis/sceneHandler/attach
#
# Set view parameters
#
/vis/viewer/set/lightsThetaPhi 90. 0.
/vis/viewer/set/viewpointThetaPhi 150. 90.
#
# Draw detector (with refresh, the detector is "drawn" but on some systems,
# those requiring and update action, it is not visible until update or flush).
#
/vis/viewer/refresh
#
# Do runs
#
/tracking/storeTrajectory 1
#
/run/beamOn 10
/vis/viewer/flush
#
/mydet/armAngle 60. deg
/mydet/fieldValue 2. tesla
/vis/viewer/refresh
/run/beamOn 10
/vis/viewer/flush
#
/mydet/armAngle 30. deg
/mydet/momentum 2. GeV
/mydet/sigmaMomentum 0. 
/mydet/sigmaAngle 0.
/vis/viewer/refresh
/vis/scene/endOfEventAction refresh
/run/beamOn 10
/vis/viewer/flush
#
/vis/scene/create
/vis/scene/add/volume
/vis/scene/add/trajectories
/vis/sceneHandler/attach
/vis/viewer/clear
/vis/viewer/reset
/vis/viewer/set/lightsThetaPhi 90. 0.
/vis/viewer/set/viewpointThetaPhi 150. 90.
/vis/viewer/refresh
/mydet/sigmaAngle 2. deg
/vis/viewer/refresh
/run/beamOn 10
/vis/viewer/flush
#
