Geant4 D4-Optimisation
Geant4 D4-Optimisation
http://cern.ch/geant4
PART IV
Visibility, visibility of daughter volumes Color, line style, line width Force flag to wire-frame or solid-style mode
For parameterised volumes, attributes can be dynamically assigned to the logical volume Lifetime of visualization attributes must be at least as long as the objects theyre assigned to
G4Trajectory class has a Draw() method. Blue : positive Green : neutral Red : negative You can implement alternatives by yourself
4
Implemented in JAVA, GGE is a graphical geometry editor compliant to Geant4. It allows to:
Graphically visualize the detector geometry using a Geant4 supported visualization system, e.g. DAWN Store persistently the detector description Generate the C++ code according to the Geant4 specifications As part of the MOMO Java environment suite
geant4/environments/MOMO/MOMO.jar
5
As simple ASCII text structure Graphical through GUI (combined with GAG) As XML exportable format As an additional graphics driver
PART IV
Smart voxels
Subdivisions (slices) containing same volumes are gathered into one Subdivisions containing many volumes are refined
applying a virtual division again using a second Cartesian axis the third axis can be used for a further refinement, in case
Some geometry topologies may require special tuning for ideal and efficient optimisation
for example: a dense nucleus of volumes included in very large mother volume
from
G4LogicalVolume
/run/verbose
Pointers -------50 4
greater than
10
The computed voxel structure can be visualized with the final detector geometry Helper class G4DrawVoxels Visualize voxels given a logical volume
G4DrawVoxels::DrawVoxels(const G4LogicalVolume*)
useful for debugging purposes Can also be done through a visualization command at run-time:
/vis/scene/add/logicalVolume <logical-volume-name> [<depth>] Detector Description: Visualization, optimisation & debugging - Geant4 Course 11
Detector regions may be excluded from optimisation (ex. for debug purposes)
Optional argument in constructor of through provided set methods
SetOptimisation/IsToOptimise()
G4LogicalVolume
or
PART IV
Debugging tools
protruding
overlapping
An overlapping volume is a contained volume which actually protrudes from its mother volume
Volumes are also often positioned in a same volume with the intent of not provoking intersections between themselves. When volumes in a common mother actually intersect themselves are defined as overlapping
Geant4 does not allow for malformed geometries The problem of detecting overlaps between volumes is bounded by the complexity of the solid models description Utilities are provided for detecting wrong positioning
Graphical tools Kernel run-time commands
Detector Description: Visualization, optimisation & debugging - Geant4 Course 14
A number of points (1000 by default) are randomly sampled on the surface of the volume being created Each of these points are examined if outside of the mother volume, or if inside of already existing other volumes in the same mother volume NOTE: this check may requires lots of CPU time
DAVID is a graphical debugging tool for detecting potential intersections of volumes Accuracy of the graphical representation can be tuned to the exact geometrical description.
physical-volume surfaces are automatically decomposed into 3D polygons intersections of the generated polygons are parsed. If a polygon intersects with another one, the physical volumes associated to these polygons are highlighted in color (red is the default).
DAVID can be downloaded from the Web as external tool for Geant4
http://geant4.kek.jp/GEANT4/vis/DAWN/About_DAVID.html
16
Built-in run-time commands to activate verification tests for the user geometry. Tests can be applied recursively to all depth levels (may require CPU time!): [recursion_flag] geometry/test/run [recursion_flag] or
geometry/test/grid_test [recursion_flag] to start verification of geometry for overlapping regions based on a standard grid setup geometry/test/cylinder_test [recursion_flag] shoots lines according to a cylindrical pattern geometry/test/line_test [recursion_flag] to shoot a line along a specified direction and position geometry/test/position and geometry/test/direction to specify position & direction for the line_test
Example layout:
GeomTest: no daughter volume extending outside mother detected. GeomTest Error: Overlapping daughter volumes The volumes Tracker[0] and Overlap[0], both daughters of volume World[0], appear to overlap at the following points in global coordinates: length (cm) ----- start position (cm) ----- ----- end position 240 -240 -145.5 -145.5 0 -145.5 Which in the mother coordinate system are: length (cm) ----- start position (cm) ----- ----- end position . . . Which in the coordinate system of Tracker[0] are: length (cm) ----- start position (cm) ----- ----- end position . . . Which in the coordinate system of Overlap[0] are: length (cm) ----- start position (cm) ----- ----- end position . . .
(cm) -----
(cm) -----
18
Provided as extended example Can be combined with a graphical environment and GUI ex. Qt library Integrated in the CMS Iguana Framework
19
20