+-------------+ +----------## | Geant 3.16 | GEANT User's Guide | DRAW001 ## +-------------+ +----------##
Author(s) : P.Zanarini, S.Giani Submitted: 07.03.92 Origin : R.Brun, P.Zanarini Revised: 11.12.92
The drawing package has been designed mainly to visualise:
The set of routines in the drawing package allows the visualization of the volumes of the detector. These routines can be called from the user program or interactively via the command interface. The output can be directed onto the screen or to a file. The graphics of GEANT is based on the HIGZ [bib-HIGZ] package. HIGZ is a high-level interface between the user program (in this case GEANT), ZEBRA and a basic graphics library. At the moment of writing, HIGZ can use various flavours of the GKS [bib-gks2d], [bib-gks3d], [bib-GKS1] graphics system or the X11 [bib-X11] system. A version based on the PHIGS [bib-phigs] system is now being developed at CERN.
The graphics capabilities of GEANT have been greatly enhanced in the last few revisions of the program. It is now possible to display volumes with hidden lines removed from the drawing. This improves the understanding of complicated objects. It is also possible to cut the displayed volumes with various shapes (boxes, cones, tubes and spheres) in order to visualise the internals of a detector element. The surfaces of the volumes drawn can be filled with colour, either solid or shaded according to a scan-line based lighting algorithm. A more sophisticated surface rendering algorithm is now being developed but it will be available only in the next version of the program.
Almost all drawing commands can be executed either by calling a routine from the user application or by issuing a command when running GEANT with the standard interactive interface. Several interactive tools (ZOOM, LENS) have been developed to analyse in detail the various parts of the detectors. The interactive MOVE facility allows the rotation, translation and zooming in real time for simple components of the detectors. Some of these commands are only available in the interactive interface. These are described briefly in [DRAW500] and more extensively in the [XINT] section.
Various graphical options can be set via the GSATT and GDOPT routines.
Every detector component can be visualised either in orthonormal projection or in perspective (routines GDRAW and GDRVOL). Sections of the volumes and of their descendents can be visualised as well (routines GDRAWX and GDRAWC).
The hierarchical relations of the various volumes which compose the detector can be visualised via the GDTREE routine. In the interactive interface the user can select one of the volumes which are nodes of the tree with the mouse, and display the characteristics of the volume and walk up and down the logical tree.
Tracks and hits can be drawn either alone or superimposed on the detector (routines GDCHIT, GDHITS, GDAHIT, GDXYZ). It is also possible to draw the tracks while tracking is performed via the routine GDCXYZ.
The drawing may be done with hidden-line removal and with shading effects according to the value of the options HIDE and SHAD (see next section).
Drawing complicated detectors can be a lengthy process even on a fast machine. In particular, when graphics options like hidden line removal or surface shading are requested and many volumes are involved, the complete drawing can take several minutes on the most powerful workstations. To alleviate this problem drawings can be stored in memory in so called view banks. The routines involved are GDOPEN, GDCLOS, GDSHOW and GDELET, and the corresponding interactive commands (DOPEN, DCLOSE, DSHOW, DELETE). These banks can then be redisplayed quickly. They can also be written on disk and read back.
Attributes like colour (GDCOL) and line width (GDLW) can be globally set for all 2D drawings (i.e. text, vectors, man, etc.); such attributes do not affect the volume attributes that can be set by the GSATT routine with COLO or LWID option.
The user can control some drawing options (GDOPT), by selecting, for instance, to have either parallel or perspective projection, either Y-Z or R-Z projection, etc.
The geometrical dimensions of an existing volume can be changed via the routine GEDITV.
Various service routines allow the drawing of the profile of a human figure, the axis, the scale of the dimension of the drawing and so on. These are described in [DRAW400].
In GEANT 3.16 a new shading algorithm has been introduced which is 10 to 100 times faster than the algorithm which was implemented in GEANT 3.15. In the new algorithm the search for the visible portions of all the faces of every volume is performed in the following steps:
The resulting picture can be saved into GEANT view banks or HIGZ picture files.
The best way to initialise the drawing package is to call the HPLOT initialisation routine HPLINT. This will work independently of the basic graphic package used. The reader should consult the HPLOT documentation for more information on this routine. The drawing package is initialized by:
The main drawing routines are:
Routines that show how the detector has been modelled are:
Routines that perform control operations on view banks are:
Routines that allow the visualization of the detector with hidden line removal are:
Other routines are: