Geant4 Materials
Table of Contents
Elements
Geant4 describes all matter in terms of elements and materials. At the lowest level, you define chemical elements, then combine them into materials that are used in your geometry. Understanding this hierarchy is essential because every logical volume in your detector must be associated with a material, and that material is internally made from one or more elements.
In Geant4, an element represents a chemical element in the periodic table, such as hydrogen, oxygen, or silicon. An element is characterized by its name, symbol, atomic number $Z$, and atomic mass. Once defined, elements can be reused in many different materials.
The standard Geant4 way to define an element in C++ uses the G4Element class. There are two common constructors: one that uses the atomic mass directly, and one that constructs an element from its isotopes. For most detector simulations, the simpler form that takes an average atomic mass is sufficient.
A typical element definition looks like this:
auto elSi = new G4Element("Silicon", "Si", 14, 28.0855 * g/mole);
Here, "Silicon" is a descriptive name, "Si" is the chemical symbol, 14 is the atomic number $Z$, and 28.0855 * g/mole is the molar mass. The unit g/mole comes from the Geant4 units system and ensures that the mass is interpreted correctly.
It is important to understand that defining an element does not yet create anything in the detector. It only provides a building block that will be used when defining materials. Also, elements are not associated with any particular density or state of matter. Those properties belong to materials, not to elements. The same element, for example oxygen, can appear in many materials with different densities and phases such as water, air, or biological tissue.
Sometimes it is useful to define elements through isotopes if you need an exact isotopic composition. This is done with G4Isotope and a different G4Element constructor, but detailed isotope handling is usually not needed in basic detector simulations and is covered elsewhere in more advanced material.
Geant4 also provides a large set of predefined elements through the NIST material manager, which can construct elements and materials with recommended values. However, even if you use the NIST database for most things, you should still understand what an element represents, because it helps you reason about the composition of the materials in your model.
Materials
A Geant4 material represents a macroscopic substance, such as liquid water, air, lead, or silicon. Materials are the quantities that you directly assign to logical volumes. They determine how particles interact in different parts of your geometry, which physical processes occur, and how much energy is deposited.
Each material is defined primarily by three things: its name, its density, and its composition in terms of elements or other materials. Optionally, you can also specify its physical state (solid, liquid, gas), its temperature, and its pressure.
The basic C++ class for materials is G4Material. One commonly used constructor creates a material with a given density, a number of components, and then you add each component with a specified fraction by mass or by number of atoms. For example, a very simple water material, defined from hydrogen and oxygen with the correct stoichiometric ratio, may be written as:
auto elH = new G4Element("Hydrogen", "H", 1., 1.008 * g/mole);
auto elO = new G4Element("Oxygen", "O", 8., 16.00 * g/mole);
auto water = new G4Material("Water", 1.0 * g/cm3, 2);
water->AddElement(elH, 2);
water->AddElement(elO, 1);
In this example, the material is named "Water", has a density of 1.0 * g/cm3, and is composed of two elements. The 2 in the constructor indicates that there will be two components, and the numbers in AddElement refer to the number of atoms of each element in the chemical formula.
Material composition can also be given by mass fraction instead of atom count. In that case, AddElement is called with a G4double representing the fraction by mass. For mixtures of several materials, you can also build a new material from existing materials by mass fraction, which is convenient when approximating complex composites.
Once defined, a G4Material object can be passed to G4LogicalVolume and will be used by Geant4 to determine cross sections, stopping powers, and all other relevant physics parameters. The name you give the material is only for your own reference and for output messages, but choosing clear and descriptive names makes debugging and validation much easier.
Geant4 also includes a comprehensive NIST material database, provided through G4NistManager. This manager can create commonly used materials such as "G4_AIR", "G4_WATER", "G4_Si", and many others, with realistic densities and compositions:
auto nist = G4NistManager::Instance();
auto air = nist->FindOrBuildMaterial("G4_AIR");
Using NIST materials avoids mistakes in composition and ensures consistency with reference data. However, when you need a special material that is not available in the database, or you want to study the effect of changing composition, you can always define your own materials explicitly with G4Material.
The physical state, temperature, and pressure of a material matter for some physics processes, especially in gases and cryogenic systems. You can set these properties either in the constructor or by dedicated methods. For many solid materials at room temperature, using the default settings is sufficient. If you simulate unusual conditions, check carefully that the material definition correctly represents your experimental setup.
Finally, remember that every logical volume must have exactly one material. Trying to use a null pointer as a material, or forgetting to set one, will lead to run-time errors. Make sure that all materials are defined before they are used in your detector construction code, typically inside the Construct() method of your detector class or in helper functions called from there.
Density
Density is a key property of every Geant4 material, and it appears explicitly in almost every G4Material definition. Physically, the density tells Geant4 how much matter per unit volume is present, which directly influences how likely particles are to interact and how much energy they lose while traversing the material.
In the most common material constructor, the density is given as the first numeric parameter, together with an explicit unit from the Geant4 units system. For example:
auto lead = new G4Material("Lead", 11.34 * g/cm3, 1);
lead->AddElement(elPb, 1);
Here, 11.34 * g/cm3 specifies the density of lead. Geant4 units require that you always multiply a raw number by the appropriate unit constant. Using 11.34 alone, without g/cm3, would lead to a meaningless value, because Geant4 internally works in a consistent set of base units and expects you to express physical quantities in those units.
In every G4Material definition, always specify the density with the correct unit such as g/cm3 or mg/cm3. A wrong density or missing unit will produce completely incorrect interaction probabilities and energy deposition, even if the composition is otherwise correct.
Density also determines the mean free path of particles in matter. Roughly speaking, the higher the density, the shorter the average distance between interactions. If you double the density of a given material, you approximately halve the mean free path for many processes. This is why air at standard pressure is much less effective at stopping radiation than a dense solid like lead or tungsten.
If your material is a mixture or compound, you usually specify only a single density for the final material. Geant4 then uses this density together with the elemental or material fractions to compute the necessary macroscopic cross sections. For example, in the water definition above, the density of 1.0 * g/cm3 represents liquid water at standard conditions. If you want to simulate ice or high pressure water, you should adjust the density accordingly, or use a suitable NIST material that already includes the correct value.
In some special cases, such as gases, you might want to construct materials using the number density instead of the mass density. Geant4 provides constructors that take temperature and pressure and compute the density internally using the ideal gas law. This is useful when you know the gas pressure and temperature more precisely than its mass density. For simple solid detectors, you will most often use fixed density values from handbooks or from the NIST database.
It is good practice to keep all density values together with clear comments and references to their sources, such as data sheets or literature. Consistent and well documented density values are important when you validate your simulation against measurements or analytical calculations.
Views: 9
KAHIBARO