Detector Geometry and Media

Detector geometry in FairRoot can be defined via:

  • ASCII files (Hades Geometry interface)
  • Root files (TGeoManager Object in ROOT file)
  • implimented directly in FairDetector::ConstructGeometry()

by default the geometry and media files are searched for in the $VMCWORKDIR/geometry directory, however one can define the variable GEOMPATH, which will force the framework to look for the geometry file specified in the macro first in this dir and then in the default geometry directory.

The filenames for the geometry definition and the media definition must have the suffix .geo and must contain a special keyword for every set:

  • media (for all materials needed in Geant for the standard geometry)
  • cave
  • Magnet
  • STS
  • ...

Geometry file format

Each file consists of a list of volumes. Each volume is characterized by its name and a list of parameters. Comments (marked with // at the beginning of a line) are allowed only at the beginning or the end of a volume.

A detector may consist of several modules sitting in a keepin volume and each module consists of several daughters, grand-daughters and so on. First the keepin volume will be read and afterwards each module with all volumes inside. The general construction (keepin volumes or not, number of modules) is for each detector hardwired in the program (see chapter Implemented sets). All inner parts of a module are only defined through the input file. You are free to change the names (with some restrictions), media, shapes, dimensions, and the tree itself, e.g. by inserting volumes, without recompiling the program. The only restriction is that the program will not create a daughter before it has created its mother, thus the mother has to show up in the list before its daughters.

Important: All volumes are created in Geant with the 'ONLY' flag!

The general input for a volume (except CAVE ) looks like:

  • name of the volume
  • inout flag (only for keepin volumes and modules, not for subvolumes of a module)
  • name of the mother-volume
  • Geant shape of the volume
  • name of the medium (= material)
  • points or parameters from technical drawings (depends on the shape)
  • position (x y z) of the coordinate system, in which the points are given, in the coordinate system of the mother
  • 3x3 rotational matrix of the coordinate system listed rowwise as a vector

For explanation:

Names of volumes: For each detector the names of the keepin-volumes and the modules are hardwired in the program (see chapter Implemented sets ). The inner parts of a module have names starting with a detector specific string. Each volume to be created in Geant has a name with at least 4 characters (upper case letters). Only the first 4 characters are used in Geant. All volumes of which several copies exist have names with 5 or more characters. These additionally characters are always digits ranging from 1 to the maximum number of volumes with the same 4-character Geant name. For example Tof 1 contains 8 identical cells T01S1 ... T01S8. The volume T01S is created only once via GSVOLU(...) but positioned 8 times via GSPOS(...). The names of the sensitive volumes must have a special structure which is defined for each detector in chapter Implemented sets.

Inout flag: All keepin volumes and mothervolumes of a detector may have an inout flag. If this inout flag is 1 the volume is created otherwise not. If the flag is not given in the input file the program (next line after name of volume) the program sets it automatically to 1. By setting this flag to 0 in the input file you can prevent for example the creation of a module in a special sector. This flag is not stored in the database. When reading from database the flag is always set to 1 by the program.

Name of the mother: Each volume is positioned in a mother. The name of the mother has 4 characters ( in upper case letters) plus eventually a 5th character if several copies of the mother exist. This 5th character has to be always 1. (In Geant only 4 characters are used, but 5 characters are necessary to find the mother in Oracle.)

Geant Shape: Each volume has a shape (4 characters in upper case letters). The shapes yet implemented in the program are BOX , PGON, PCON, TRAP, TRD1, TUBE, TUBS, CONE, CONS, SPHE, ELTU.

Medium: Each volume is filled with a medium given by the name of the medium. This medium must be defined in the medium file.

Points: Each volume has parameters describing the dimensions. The number of these parameters and their meaning depend on the shape of the volume. This is explained in chapter Shapes.

Coordinate system: Each volume has a coordinate system in which the parameters are given. Its position and orientation relative to the coordinate system of the mother volume is described by a translation vector T and a 3x3 rotation matrix R according to the equation x=R*x'+T where x is the vector in the coordinate system of the mother, and x' the vector in the coordinate system of the daughter. The matrix R is listed rowwise as a vector with 9 components. Each shape has its own intrinsic orientation which is defined similar to the Geant definition except for TRAP and TRD1 (see chapter Shapes). Important: The rotation matrix should be given with a precision of 10**-6. Otherwise you would get a lot of warnings from Geant that the coordinate system is not orthogonal. As long as all volumes in a module are not rotated you may use the coordinate system of the module as the base coordinate system in which all points are given. More information about the coordinate transformations you can find in the document Hades Geometry and Database of Michael Dahlinger.

Important: Volumes of which several copies exist have a special input structure: For the first volume all information above is read. The input for the other copies looks like:

  • name of the volume
  • inout flag if is the volume is a keepin volume or a module (may be missing)
  • name of the mother
  • translation vector of the coordinate transformation
  • rotation matrix of the coordinate transformation

The other information is not necessary because it has to be identical.

Shapes

A variable number of 'points' (one in each line of the input file), each having a maximum of 3 values, can be stored in the program. Apart from the shapes with 8 corners (BOX , TRAP, TRD1) the parameter are at least very similar to the ones in Geant. Except for a TRAP and a TRD1 the intrinsic coordinate systems are defined as in Geant.

BOX
This shapes has 8 corners described by the x, y, z coordinates.

TRAP
This shapes has 8 corners described by the x, y, z coordinates. The corners are counted clockwise starting at the lower left corner of the bottom plane. The intrinsic coordinate system of a TRAP is different from the one in Geant. The y-axis points from the smaller side in x-direction to the larger one. A TRAP not rotated in a Box has the same intrinsic coordinate system as the BOX. In Geant the y- and x-axis point in the opposite directions.

TRD1
This shapes has 8 corners described by the x, y, z coordinates. The intrinsic coordinate system of a TRD1 is the same as for a TRAP. That's different from the definition in Geant.

PGON
This shape has a variable number of 'points'.

  • point 0: NZ number of planes perpendicular to the z-axis where the section is given
  • point 1: azimuthal angle PHI1 at which the volume begins
    opening angle DPHI of the volume
    number NPDV of sides of the cross section between the phi limits
  • point 2ff:
    • z coordinate Z of the section
    • inner radius RMIN at position z
    • outer radius RMAX at position z

PCON

This shape has a variable number of 'points'.

  • point 0: NZ number of planes perpendicular to the z-axis where the section is given
  • point 1: azimuthal angle PHI1 at which the volume begins
    opening angle DPHI of the volume
  • point 2ff:
    • z coordinate Z of the section
    • inner radius RMIN at position z
    • outer radius RMAX at position z

SPHE
This shape has 3 'points' with 2 parameters each.

  • Point 0: inner radius RMIN of the shell
    outer radius RMAX of the shell
  • point1: starting polar angle THE1 of the shell
    ending polar angle THE2 of the shell
  • point 2: starting azimuthal angle PHI1 of the shell
    ending azimuthal angle PHI2 of the shell

TUBE
This shape has 3 'points'.

  • point 0: x, y, z coordinate of the center of the circle at the beginning of the tube
  • point 1: inner radius RMIN of the tube
    outer radius RMAX of the tube
  • point 2: x, y, z coordinate of the center of the circle at the end of the tube

TUBS

This shape has 4 'points'.

  • point 0: x, y, z coordinate of the center of the circle at the beginning of the tubs
  • point 1: inner radius RMIN of the tubs
    outer radius RMAX of the tubs
  • point 2: x, y, z coordinate of the center of the circle at the end of the tubs
  • point 3: starting angle PHI1 of the segment
    ending angle PHI2 of the segment

CONE

This shape has 4 'points'.

  • point 0: x, y, z coordinate of the center of the circle at the beginning of the cone
  • point 1: inner radius RMN1 at the beginning of the cone
    outer radius RMX1at the beginning of the cone
  • point 2: x, y, z coordinate of the center of the circle at the end of the cone
  • point 3: inner radius RMN2 at the end of the cone
    outer radius RMX2 at the end of the cone

CONS

This shape has 5 'points'.

  • Point 0: x, y, z coordinate of the center of the circle at the beginning of the cons
  • point 1: inner radius RMN1 at the beginning of the cons
    outer radius RMX1 at the beginning of the cons
  • point 2: x, y, z coordinate of the center of the circle at the end of the cons
  • point 3: inner radius RMN2 at the end of the cons
    outer radius RMX2 at the end of the cons
  • point 4: starting angle PHI1 of the segment
    ending angle PHI2 of the segment

ELTU

This shape has 3 'points'.

  • point 0: x, y, z coordinate of the center of the ellipsoid at the beginning of the eltu
  • point 1: semi-axis P1 along x
    semi-axis P2 along y
  • point 2: x, y, z coordinate of the center of the ellipsoid at the end of the eltu

Warning: A TUBE, TUBS, CONE, ELTU can not be rotated by different x- and y-values of the starting and ending circles. They have to be identical. A rotation can only be described by a rotation matrix.

TORUS

This shape has 5 'points'. (not available in native Geant3!!)

  • point 0: R - axial radius
  • point 1: Rmin - inner radius
  • point 2: Rmax - outer radius
  • point 3: Phi1 - starting phi
  • point 4: Dphi - phi extent

Media file

Each medium is characterized by a name. The names of the materials and the media are identical. Together with the name all parameters must be given which are needed for the Geant routines GSMATE, GSMIXT, GSTMED and GSCKOV.
There are no predefined materials!

The following parameters are needed:

  • int ncomp - number of components in the material (ncomp= 1 for a basic material and <1 or >1 for a mixture
    If ncomp > 0 the array wm contains the proportion by weight of each material in the mixture.
    If ncomp < 0 the array wm contains the proportion by number of atoms of each kind.
    For more detailed information see NLMAT in Geant3 routine GSMIXT
  • float aw[ncomp] - atomic weights A for the components
  • float an[ncomp] - atomic numbers Z for the components
  • float dens - density DENS in g cm(**-3)
  • float wm[ncomp] - weights WMAT of each component in a mixture (only for a mixture)
  • int sensflag - sensitivity flag ISVOL
  • int fldflag - fieldflag IFIELD
  • float fld - maximum field value FIELDM in kilogauss
  • float epsil - boundary crossing precision EPSIL
  • int npckov - number of values used to define the optical properties of the medium.
    The variable npckov is 0 for all media except some special media used for the Rich where the tracking of the Cerenkov photons is necessary. These media have additinal parameters
    • float ppckov[npckov] - photon momentum in eV
    • float absco[npckov] - absorption length in case of dielectric and of absorption probabilities in case of a metal
    • float effic[npckov] - detection efficiency
    • float rindex[npckov] - refraction index for a dielectric, rindex[0]=0 for a metal
      Remark: In the present program version a mixture may contain a maximum of 5 components. If this is not sufficient one has to change MAXCOMP in hgeomedium.h.

The following parameters are normally not read. The default values are -1 and the real values are automatically calculated by Geant. If you want to set these values by yourself, you must type the keyword AUTONULL in your media file. After this keyword all media must contain these additional 4 parameters before the Cerenkov (int npckov).

  • float madfld - maximum angular deviation TMAXFD due to field
  • float maxstep - maximum step permitted STEMAX
  • float maxde - maximum fractional energy loss DEEMAX
  • float minstep - minimum value for step STMIN

Comments can be placed before a medium in a new line starting with //

Example for a basic material

ALUMINIUM 1 26.98 13 2.7
0 0 0 0.0001
0
corresponds to :
name ncomp aw an dens
sensflag fldflag fld epsil
npckov


Example for a mixture where the content of each material in the mixture is given as proportion by weight

air 3 14.01 16. 39.95. 7. 8. 18. 1.205e-3 .755 .231 .014
0 1 3. .001
0
corresponds to:
name ncomp aw(1) aw(2) aw(3) an(1) an(2) an(3) dens wm(1) wm(2) wm(3)
sensflag fldflag fld epsil
npckov


Example for a mixture where the content of each material in the mixture is given as number of atoms of each kind

C4F10 -2 12.01 19. 6. 9. 7.35485e-3 4. 10.
0 1 3. .001
0
corresponds to:
name ncomp aw(1) aw(2) an(1) an(2) dens wm(1) wm(2)
sensflag fldflag fld epsil
npckov

AUTONULL

RICHPad -2 12.01 1.00797 6. 1. 0.717e-3 1 4
1 1 3. .001
20 0.5 0.001 .00001
3
5.636 40000 1.0 1.0
7.750 2280 1.0 1.0
9.540 0.0 1.0 1.0
corresponds to
name ncomp aw(1) aw(2) an(1) an(2) dens wm(1) wm(2)
sensflag fldflag fld epsil
madlfd maxstep maxde minstep
npckov
ppckov[0] absco[0] effic[0] rindex[0]
ppckov[1] absco[1] effic[1] rindex[1]
ppckov[2] absco[2] effic[2] rindex[2]