+-------------+ +----------## | Geant 3.15 | GEANT User's Guide | GEOM001 ## +-------------+ +----------##
Author(s) : F.Bruyant Submitted: 01.10.84 Origin : R. Brun, F.Bruyant, A.McPherson Revised: 13.05.92
The geometry package has two main functions:
The present section reviews the concepts of the geometry package and explains how the geometrical information should be provided by the user. It is important to point out that, once the geometry has been defined, the tracking of particles through the different volumes proceeds without any intervention from the user [TRAK].
The connection between the geometry and tracking packages is established by the subroutines GMEDIA/GTMEDI, GNEXT and GINVOL which answer respectively the questions:
The routines GTMEDI, GTNEXT are used in a dynamic context, at tracking time, when the a priori knowledge of the track direction can be used to save time.
Experimental setups, as complex as the LEP
As long as it is not `positioned' in a given reference frame, a VOLUME is an entity which has no spatial relation with the other volumes. By convention, a unique initial volume has to be defined which should contain all the other volumes. The reference frame intrinsic to this volume is considered to be the master reference frame.
A VOLUME can be declared to have contents and become a mother volume. The contents are either predefined volumes which are explicitly positioned inside the mother, or new volumes which are implicitly defined by a division mechanism applied to the mother. Positioning a volume with given shape and dimensions inside a mother volume is obtained by specifying its translation and rotation with respect to the mother reference frame. The user should make sure that no volume extends beyond the boundaries of its mother. When a volume is positioned, the user gives it a NUMBER. Multiple copies of the same volume can be positioned inside the same or different mothers with different copy numbers, and the contents of the positioned volume are reproduced implicitly in all copies. Divisions are performed along the three axes of the mother volume. The definition of the axes (X, Y, Z or R ,phi, Z or R, theta, phi) depends on the shape. For certain xy shapes it is not possible to divide along one of the axis. The mother volume can be partially or totally divided. The division process generates a number of `cells', which are considered as new volumes often with the same shape of the mother. The cell dimensions are computed according to the number of divisions or the step size. A cell, as any other volume, can again be divided along its axes, or have other volumes positioned into it. Volumes positioned within a cell are reproduced implicitly in all cells. These operations permit to define a physical tree with several levels. The material and properties of the contents replace the ones of the mother within the space region they occupy. A VOLUME is therefore defined not only by its intrinsic characteristics but also by those of its descendants, namely its contents, the contents of its contents, etc.
The user may define volumes which have no relation with the real objects. It is sometimes convenient to make use of such volumes, to artificially delimit regions with simple shapes. As a consequence, it may happen that volumes partially overlap each other. (A volume positioned inside a mother is obviously not regarded as overlapping the mother). It is possible in GEANT to handle partially overlapping volumes, but there are some implications that the user should be aware of. A flag `ONLY/MANY' is assigned to each copy of a given volume at the moment this is positioned. The `MANY' option indicates that a point found to be in this volume could also be in other volumes which are not direct descendants of it. If one of the overlapping volumes is declared as `ONLY' the geometry subroutines will give priority to this volume, and if a point is found in this volume the search stops. If a point is inside several `MANY' volumes and outside all `ONLY' ones, priority will be given to the volume found at the deepest level, or to the first found, if there are many valid `MANY' candidates at the same level. In order to avoid ambiguities, two overlapping `MANY' volumes should in general have the same default tracking medium.
An example of a 4 level physical tree with embedded volumes and the corresponding geometrical configuration are shown below:
where A and B are BOXes, C a TRAPezoid, and D and E TUBEs. Notice that the same physical configuration could be described as well though a 3 level tree if D were defined as a hollow TUBE, with inner radius non zero and E directly positioned into B. The package accepts a maximum of 15 levels, which should be enough to represent even the fine details of a complex setup.Figure: MonteCarlo in High Energy Physics
In practice, the physical tree is not represented as such in the data part of the program. Instead, a logical tree structure is defined, the JVOLUM data structure, which describes the arrangement of volumes in a compact and recurrent way. Each generic volume appears once, and once only, and carries the information relevant to the volume itself and to its contents, if any, by reference to the generic volumes corresponding to those contents. In the situation where division or multiple copies occur, there is no longer a one-to-one correspondence between a given volume in the logical tree and a unique region in space. Information has to be kept at tracking time to identify which division cell or which copy was considered at each depth level along the path through the physical tree. This information is stored by the subroutine GMEDIA/GTMEDI, for the current point of the current track, in the common /GCVOLU/. It contains the current level number NLEVEL and, for each level, starting from the first initial reference volume, the identification of the corresponding volume, e.g.: NAME, NUMBER, `ONLY/MANY' flag, translation and rotation with respect to the master reference frame. The number of SHAPE parameters and pointers to the vector describing the actual values of those parameters, for all levels, are stored in the data part and in the link part, of the mother bank IGPAR, respectively.
The rules of the game being established, it is easy to introduce the set of subroutines which ensure the functionality of the package.
The user can define a volume through a call to the subroutine:
The user can position a volume through a call to either one of the following subroutines:
The user can divide a volume through a call to either one of the following subroutines:
When a track enters a volume with contents, the search time to identify whether the current point is in the mother or in any of the contents is very short when the contents are division cells (straightforward computation along the relevant axis). When the contents have been positioned, the search time can be quite large. In order to save time the user can make use of either of the two following facilities:
Pseudo cell 1 2 3 4 5 6 7The coordinate selected for the pseudo division can be any of X, Y, Z, R y, R, phi or theta;. For a given volume the call to x GSORD has to come after all its first level contents have been positioned.
For any volume specified by the description of the path one has to follow through the physical volume tree in order to reach it (namely by the lists of NAMES and NUMBERs at all levels from the top, down to the given volume), the common/GCVOLU/ (and the structure JGPAR can be properly filled) by the user, through a call to the subroutine GLVOLU.