Next: laser, Previous: line, Up: Physical elements
matdef
To define a material the matdef
keyword must be used.
If the material is composed by a single element, it can be defined using the following syntax: 1
<material> : matdef, Z=<int>, A=<double>, density=<double>,
T=<double>, P=<double>, state=<char*>;
Attributes
Z
- atomic number
A
- mass number [g/mol]
density
- density in [g/cm^3]
T
- temperature in [K] (default set to 300)
P
- pressure [atm] (default set to 1)
state
- “solid”, “liquid” or “gas” (default set to “solid”)
Example:
iron : matdef, Z=26, A=55.845, density=7.87
If the material is made up by several components, first of all each of them must be specified with the atom
keyword:
2
<element> : atom, Z=<int>, A=<double>, symbol=<char*>;
Attributes:
Z
- atomic number
A
- mass number [g/mol]
symbol
- atom symbol
Then the compound material can be specified in two manners:
1) If the number of atoms of each component in material unit is known, the following syntax can be used: 3
<material> : matdef, density=<double>, T=<double>, P=<double>, state=<char*>, components=<[list<char*>]>, componentsWeights=<{list<int>}>;
Attributes
density
- density in [g/cm^3]
T
- temperature in [K] (default set to 300)
P
- pressure in [atm] (default set to 1)
state
- “solid”, “liquid” or “gas” (default set to “solid”)components
- list of symbols for material components
componentsWeights
- number of atoms of each component in material unit, in order
Example:
niobium : atom, symbol="Nb", z=41, a=92.906;
titanium : atom, symbol="Ti", z=22, a=47.867;
NbTi : matdef, density=5.6, temperature=4.0, ["Nb","Ti"], {1,1}
2) On the other hand, if the mass fraction of each component is known, the following syntax can be used: 4
<material> : matdef, density=<double>, T=<double>, P=<double>, state=<char*>, components=<[list<char*>]>, componentsFractions=<{list<double>}>;
Attributes
density
- density in [g/cm^3]
T
- temperature in [K] (default set to 300)
P
- pressure in [atm] (default set to 1)
state
- “solid”, “liquid” or “gas” (default set to “solid”)components
- list of symbols for material components
componentsFractions
- mass fraction of each component in material unit, in order
Example:
samarium : atom, symbol="Sm", z= 62, a=150.4;
cobalt : atom, symbol="Co", z= 27, a=58.93;
SmCo : matdef, density=8.4, temperature=300.0, ["Sm","Co"], {0.338,0.662}
The second syntax can be used also to define materials which are composed by other materials (and not by atoms).
Nb: Square brackets are required for the list of element symbols, curly brackets for the list of weights or fractions.
[1] In this case, in src/BDSDetectorConstruction.cc
the BDSMaterials::AddMaterial(name, Z, A, density)
method is called, which in turns (src/BDSMaterials.cc
) invokes the Geant4 G4Material
constructor: G4Material(name, Z, A, density);
[2] In this case, in src/BDSDetectorConstruction.cc
the BDSMaterials::AddElement(name, symbol, Z, A)
method is called, which in turns (src/BDSMaterials.cc
) invokes the Geant4 G4Element
constructor: G4Element(name, symbol, Z, A);
[3] In this case, in src/BDSDetectorConstruction.cc
the
BDSMaterials::AddMaterial(name, density, state, temp, pressure, list<char*> itsComponents, list<G4int> itsComponentsWeights)
method is called, which in turns (src/BDSMaterials.cc
) invokes the Geant4 G4Material constructor:
G4Material(name, density, (G4int)itsComponents.size(), state, temp, pressure). Then each component is added with a call to the
G4Material::AddElement(G4string , G4int ) method.
[4] In this case, in src/BDSDetectorConstruction.cc
the
BDSMaterials::AddMaterial(name, density, state, temp, pressure, list<char*> itsComponents, list<G4double> itsComponentsFractions)
method is called, which in turns (src/BDSMaterials.cc
) invokes the Geant4 G4Material constructor:
G4Material(name, density, (G4int)itsComponents.size(), state, temp, pressure). Then each component is added with a call to the
G4Material::AddElement(G4string , G4double ) method.