next up previous index
Next: GEOM310 Finding distance Up: GEANT Previous: GEOM299 The rotation

GEOM300 Finding in which volume a point is

Routine ID: GEOM300
Author(s): Submitted: 18.12.83
Origin: R.Brun, A.C.McPherson, F.BruyantRevised: 14.12.93

CALL GMEDIA (X,NUMED*)

X
( REAL) array of dimension 3 with the coordinates in the MRS;
NUMED
( INTEGER) medium number, if this is zero the point is outside the detector.

Searches the geometrical tree structure to find in which volume the point X is. The tracking medium is returned in NUMED, and the common /GCVOLU/ is updated.

GMEDIA uses the geometry data structure to conduct its search starting its search from the last volume where a point was found. If no previous search has been conducted, the first volume is used as a starting point.

If the point is not inside the current volume, GMEDIA looks in its mother and so on, until it finds a volume which contains the point. It then looks at the contents of this object and so on until the point is in a volume but in none of its contents (if any).

If this downward search terminates in a 'MANY' object, GMEDIA looks for another candidate. See [GEOM110] for a description of the `MANY' volumes tratment.

The physical geometrical tree from the first volume to the current one is stored in the common block GCVOLU (see [BASE030]) and in the structure JGPAR (see [GEOM199]).

CALL GTMEDI (X,NUMED*)

X
( REAL) array of dimension 3 with the coordinates in the MRS;
NUMED
( INTEGER) medium number, if this is zero the point is outside the detector.

This routine performs the same function than GMEDIA, but it uses the dynamical information of the particle history to speed-up the search:

CALL GINVOL (X,ISAME*)

X
( REAL) array of dimension 3 with the coordinates in the MRS;
ISAME
( INTEGER) return flag.
Checks if particle at point X has left current volume. If so, returns ISAME = 0 and prepares information useful to identify the new volume entered, otherwise, returns ISAME = 1.

GEOM310



next up previous index
Next: GEOM310 Finding distance Up: GEANT Previous: GEOM299 The rotation


Janne Saarela
Mon Apr 3 12:46:29 METDST 1995