How to check Overlaps seen by Geant4 in Gauss (and overlaps in general)

Introduction

The overlap checking using GEANT4 is realized in the Gauss environment by using the interactive visualization of Geant4. As the default Gauss environment does not include neither the GEANT4 UI nor its visualization it is necessary to set it up. The twiki page How to visualize the geometry seen by Geant4 in Gauss describe how to set up Gauss togheter with the GEANT4 UI and visualization environment and how to use the various graphical options from GEANT4 that are available in Gauss. All commands below requires you to have set the environment.

A short description of LHCb tools to check the geometry directly with DetDesc is given at the end.

Overlap checking using CAD systems

The method consists in using CAD (Computer-Aided Design) systems that provide powerful clash detection algorithms (1). In order to have that you have to have started Gauss with the command UI and have the promt

GeomClosed >

GEANT4 provides some commands to activate verification tests of user-defined geometry, as for example :

geometry/test/grid_test [recursion_flag]

This test is based on standard lines grid setup. The default set of the recursion flag is "false", what means that the check is limited to the first depth level of the geometry tree (otherwise it visits recursively the whole geometry tree).

On the console, you will have messages telling you where overlaps have been detected :

GeomTest Error: Overlapping daughter volumes
The volumes /dd/Structure/LHCb/MagnetRegion/PipeInMagnet#pvUX852#pvUX852Cone03[1038] and
/dd/Structure/LHCb/MagnetRegion/PipeInMagnet#pvUX852#pvUX852Vacuum01[1048],
both daughters of volume Universe[0],appear to overlap at the following points in global coordinates:
length (cm)    ---------- start position (cm) -----------   ----------- end position (cm) ------------
0.00165029          -4.00178             0           400         -4.00013             0           400
0.00165029           4.00013             0           400          4.00178             0           400
0.00165029                 0      -4.00178           400                0      -4.00013           400
0.00165029                 0       4.00013           400                0       4.00178           400

Other types of verification tests based on cylindrical or linear pattern can be found in the G4 User Guide(1). However, be aware that by using this method, certain errors will be missed unless a line is supplied in precisely the correct path.

DAVID intersection debugger:

DAVID (2) can automatically detect the overlaps between the volumes defined in GEANT4 and converts them to a graphical representation. This graphical representation require an input files as generated with DAWN graphical driver as described at How to visualize the geometry seen by Geant4 in Gauss. The results can be visualized with the same driver as described later. Physical-volume surfaces are decomposed into 3D polygons, and intersections of the generated polynoms are investigated. If a polynom intersects with another, physical volumes which these polygons belong to are visualized in red.

To start DAVID, enter the following command in the current directory (job file) :

> david g4_00.prim

(where g4_00.prim is the DAWNFILE previously produced) and you will see on the console messages like these :

===========================================
DAVID
version 1.34a
October 6, 1999
Satoshi Tanaka  and  Kunihiro Hashimoto
Fukui University
===========================================
Reading file: g4_00.prim
Data reading completed

*** 10330 primitives **
Investigating intersections of surfaces
***
0%
**** 0%
**** 1%
**** 1%
**** 1%
**** 2%
**** 2%

Eventually, you obtain the picture of the geometry with the overlaps highlighted in red :

DAVID_LHCb
LHCb complete geometry for theta=90 and phi=180 with overlaps highlighted in red using the DAVID intersection debugger.

DAVID outputs two files, the g4david.log and the g4david.prim files.

The g4david.log contains detailed information of the intersections :

#--------------------------------------------------------------------
# This is g4david.log generated by DAVID (version 1.34a).
# This file describes detaild information on intersections.
#--------------------------------------------------------------------
# Investigated file: g4_01.prim
#--------------------------------------------------------------------
!!! INTERSECTED VOLUMES !!!
/dd/Geometry/BeforeMagnetRegion/Velo/lvVelo#pvVeloLeft#pvLeftRFBox#RFSBx2a.1100: Box: line 43370
/dd/Geometry/BeforeMagnetRegion/Velo/lvVelo#pvVeloRight#pvRightRFBox#RFSBx2b.1206: Box: line 87025

The g4david.prim file contains the description of the 3D scene with intersected shapes highlighted. The geometry can be re-visualized by the command :

david g4david.prim

NB david cannot manage overlaps involving polyhedral volumes, it can only deal with simple volumes, e.g. tubs, cons, box, etc.

Geometry checking using tools in the LHCb software

Tools to check overlaps are available in the Det/DetDescChecks package, which you can getpack to your User_release_area (3). You can also copy the latest version of Det/SQLDDDB from $LHCBRELEASES/DBASE, where you can implement any geometry or alignment changes that you wish to check (4).

There are three options files available in the package, which you can execute in the standard way:

gaudirun.py theOptions.opts

  • CheckOverlap.opts - This is the fastest way to check for overlaps. Uncomment the volume that you wish to check. See Vanya's talk at T-Rec on 2007-12-17
  • DetDescChecks.opts - This is an older (and slower) implementation of a checking algorithm. The options also contain an algorithm to determine the material budget up to a given plane
  • LoadDDDB.opts - Loads the whole geometry tree, useful to detect inconsistencies in the database

References

(1) How to check for overlaps in the Geometry section of the Geant4 User Guide

(2) DAVID web page

(3) Working with CMT install areas

(4) LHCb Conditions Database How-To

-- GeraldineConti and GloriaCorti - 17 Sep 2007 -- Last modified on 12 Oct 2007

Topic attachments
I Attachment History Action Size Date Who Comment
GIFgif DAVID_LHCb.gif r1 manage 2.4 K 2007-10-09 - 19:40 GloriaCorti david_lhcb
Edit | Attach | Watch | Print version | History: r13 < r12 < r11 < r10 < r9 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r13 - 2013-05-20 - GloriaCorti
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LHCb/FAQ All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback