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 ExampleExample 2.25. The prerunN03.mac macro.# Macro file <strong>for</strong> the initialization phase of "exampleN03.cc"## Sets some default verbose flags# and initializes the graphics.#/control/verbose 2/control/saveHistory/run/verbose 2#/run/particle/dumpCutValues## Create empty scene ("world" is default)/vis/scene/create## Add volume to scene/vis/scene/add/volume## Create a scene handler <strong>for</strong> a specific graphics system# Edit the next line(s) to choose another graphic system##/vis/sceneHandler/create DAWNFILE/vis/sceneHandler/create OGLIX## Create a viewer/vis/viewer/create## Draw scene/vis/scene/notifyHandlers## <strong>for</strong> drawing the tracks# if too many tracks cause core dump => storeTrajectory 0/tracking/storeTrajectory 1#/vis/scene/include/trajectoriesAlso, this example demonstrates that you can read and execute a macro interactively:Idle> /control/execute mySubMacro.mac2.10. How to Visualize the Detector and Events2.10.1. IntroductionThis section briefly explains how to per<strong>for</strong>m <strong>Geant4</strong> Visualization. The description here is based on the sampleprogram examples/novice/N03. More details are given in Chapter 8 "Visualization". Example macro filescan be found in examples/novice/N03/visTutor/exN03VisX.mac.2.10.2. Visualization DriversThe <strong>Geant4</strong> visualization system was developed in response to a diverse set of requirements:1. Quick response to study geometries, trajectories and hits2. High-quality output <strong>for</strong> publications3. Flexible camera control to debug complex geometries4. Tools to show volume overlap errors in detector geometries5. Interactive picking to get more in<strong>for</strong>mation on visualized objectsNo one graphics system is ideal <strong>for</strong> all of these requirements, and many of the large software frameworks intowhich <strong>Geant4</strong> has been incorporated already have their own visualization systems, so <strong>Geant4</strong> visualization wasdesigned around an abstract interface that supports a diverse family of graphics systems. Some of these graphicssystems use a graphics library compiled with <strong>Geant4</strong>, such as OpenGL, Qt or OpenInventor, while others involvea separate application, such as HepRApp or DAWN.You need not use all visualization drivers. You can select those suitable to your purposes. In the following, <strong>for</strong> simplicity,we assume that the <strong>Geant4</strong> libraries are built (installed) with the "OpenGL-Xlib driver" and the "DAWN-FILE driver" incorporated.28

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

Saved successfully!

Ooh no, something went wrong!