22.05.2014 Views

CERN Program Library Long Writeup W5013 - CERNLIB ...

CERN Program Library Long Writeup W5013 - CERNLIB ...

CERN Program Library Long Writeup W5013 - CERNLIB ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Geant 3.16 GEANT User’s Guide CONS001<br />

Origin : Submitted: 01.10.84<br />

Revision : Revised: 17.12.93<br />

Documentation : F.Bruyant<br />

Introduction to the section CONS<br />

1 Introduction<br />

The setup where the particles are transported is represented by a structure of geometrical volumes. Each<br />

volume is filled with matter (which can have the properties of the vacuum in case of it contains no matter).<br />

The matter composing the volumes is described via two sets of attributes. The first set is relative to the<br />

nature of the material composing the volume, and contains information such as the atomic number, the<br />

atomic weight, the density and so on (see the description of the routine GSMATE in this section for more<br />

information).<br />

The second set of attributes is relevant to the process of particle transport and they define a so-called tracking<br />

medium. These are parameters such as the material composing the volume, the magnetic field, the required<br />

tracking precision, the maximum energy that can be lost in one step and so on (see the description of the<br />

routine GSTMED in this section for more information).<br />

Each tracking medium refers to a material via a material number which is assigned by the user. Different<br />

tracking media can, with some limitation, refer to the same material.<br />

Each volume is filled by a tracking medium identified by a medium number. Different volumes may have<br />

the same medium number (see [GEOM]).<br />

The transport of particles through a setup ([TRAK]) requires access to data which describe:<br />

• the geometry of the setup;<br />

• the material and tracking medium parameters;<br />

• the particle properties.<br />

The section [CONS] contains the routines for the storage and retrieval of information related to materials,<br />

tracking media and the particles.<br />

Important note: many entities in GEANT are user-defined via a subroutine call. One of the arguments of this<br />

subroutine is a integer number which identifies the entity. Examples are materials, tracking media, particles<br />

and so on. It can be tempting, for booking purposes, to use very large numbers. For instance, in a large<br />

detector, the number of all the materials in the hadronic calorimeter could be 1001 ≤ I ≤ 2000. Evenif<br />

these conventions are very handy, they can introduce a performance penalty.<br />

For reasons of speed, the number provided by the user is used directly as the number of the link in the<br />

ZEBRA data structure indicating where to store the pointer to the bank containing the information on the<br />

entity. ZEBRA pointers are contiguous. Defining an object with a user number of 1000 forces ZEBRA to allow<br />

space for 1000 links. This entails a loss of space (999 words), but much worse than that, induces ZEBRA to<br />

believe that there are in fact 999 more banks. At every operation which causes a relocation of banks, ZEBRA<br />

will check all the possible links, which can be very time consuming.<br />

So values of user-defined entities must be kept as small as possible and contiguous. In large applications<br />

one could write a routine which returns the next free number to be allocated, which can then be stored in a<br />

variable and always referenced symbolically, freeing the user from the need to define ranges. As an example<br />

we give here a function performing this operation for the material number:<br />

45 CONS001 – 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!