Visualisation¶
Geant4 built-in visualisation features¶
Geant4 itself offer a very extensive set of visualisation features, which automatically produce graphics output based on user defined criteria, filtering, etc.
This is available for the visualisation of both - geometry model - event trajectories
Users may choose to selectively draw part of the geometry model, or to colour the solids based on criteria such as density, etc. For trajectories, Geant4 built-in filters include selection based on touched volumes, colouring based on charge, primary energy, or other properties.
These extensive features have been introduced in Geant4 after the GRAS visualisation utilities had been introduced, so the Geant4 and GRAS capabilities are partially overlapping. However, there are a few features such as global event selection (i.e. not just for single trajectories) triggered by event properties such as event dose, that offer additional ease of use to the users. These are described here below.
We encourage the GRAS users to read the related Geant4 documentation on Visualization.
Geometry visualisation¶
GRAS offers utilities to interactively modify some visualisation attributes of the volumes in the geometry model, through the UI script Command:
/gras/vis/util/setVolumeProperty.
The properties that the user can modify are colour, visibility, forcewireframe, forcesolid, linewidth.
The user can assign the new property to one or more volumes at a time, selecting the volumes by (logical) name, by physical_name or by material.
Script example:
/gras/vis/util/addColour grey 0.5 0.5 0.5
/gras/vis/util/addColour red 1 0 0
/gras/vis/util/setVolumeProperty colour red name Detector
/gras/vis/util/setVolumeProperty colour red physical_name Absorber
/gras/vis/util/setVolumeProperty colour grey material Aluminium
/gras/vis/util/setVolumeProperty visibility false name World
Event visualisation¶
The user can decides whether to display of not the trajectories of the particles for an event based on user defined criteria. The UI Command:sets the criterion for the drawing of the events. If the “trigger” mode is selected, the event is only displayed in case at least one analysis module has triggered the visualisation during the event. For more details on the analysis triggering mechanism, see Section 3.6.
/gras/event/drawEvents [all | none | trigger]
The trigger
option also needs the Geant4 option
/vis/drawOnlyToBeKeptEvents true
. In this case, the events are only
shown if at least one analysis module has “triggered” the visualisation
(e.g. the event contribution to TID/TNID is >0). The UI Command
setVisTrigger
is available for each analysis module to set/unset
this option.
Script example:
/gras/analysis/module_type/module_name/setVisTrigger true
/gras/event/drawEvents trigger
/vis/drawOnlyToBeKeptEvents
Trajectory visualisation¶
In case the event is drawn, the Command:sets the criterion for the drawing of individual trajectories in the event. Only a simple filter based on the particle charge is implemented.
Script example:
/gras/event/drawTracks [all | charged | neutral]
GRAS/trunk/r2242