12.07.2015 Views

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Getting Started with <strong>Geant4</strong>- Running a Simple Example# Save the commands below as a macro file, say,# "vis2.mac", and execute it as follows:## % $(G4BINDIR)/exampleN03# Idle> /control/execute vis1.mac################################################################################################### Store particle trajectories <strong>for</strong> visualization/tracking/storeTrajectory 1############################################################################################################## Visualization with the OGLSX (OpenGL Stored X) driver######################################################### Invoke the OGLSX driver# Create a scene handler and a viewer <strong>for</strong> the OGLSX driver/vis/open OGLSX# Create an empty scene and add detector components to it/vis/drawVolume# Add trajectories to the current scene# Note: This command is not necessary in, e.g.,# examples/novice/N03, since the C++ method DrawTrajectory()# is described in the event action.#/vis/scene/add/trajectories# Set viewing parameters/vis/viewer/reset/vis/viewer/set/viewpointThetaPhi 10 20# Visualize one it./run/beamOn 1########################################################### Visualization with the DAWNFILE driver########################################################### Invoke the DAWNFILE driver# Create a scene handler and a viewer <strong>for</strong> the DAWNFILE driver/vis/open DAWNFILE# Create an empty scene and add detector components to it/vis/drawVolume# Add trajectories to the current scene# Note: This command is not necessary in exampleN03,# since the C++ method DrawTrajectory() is# described in the event action.#/vis/scene/add/trajectories# Visualize plural events (bird's eye view)# drawing style: wireframe# viewpoint : (theta,phi) = (45*deg, 45*deg)# zoom factor: 1.5 x (full screen size)/vis/viewer/reset/vis/viewer/set/style wireframe/vis/viewer/set/viewpointThetaPhi 45 45/vis/viewer/zoom 1.5/run/beamOn 2# Set the drawing style to "surface"# Candidates: wireframe, surface/vis/viewer/set/style surface# Visualize plural events (bird's eye view) again# with another drawing style (surface)/run/beamOn 2################### END of vis2.mac ###################2.10.6. For More In<strong>for</strong>mation on <strong>Geant4</strong> VisualizationSee the Chapter 8 "Visualization" part of this user guide.32

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!