| 1 | <!-- ******************************************************** -->
|
|---|
| 2 | <!-- -->
|
|---|
| 3 | <!-- [History] -->
|
|---|
| 4 | <!-- Converted to DocBook: Katsuya Amako, Aug-2006 -->
|
|---|
| 5 | <!-- Changed by: Katsuya Amako, 14-Jul-1998 -->
|
|---|
| 6 | <!-- Proof read by: Joe Chuma, 29-Jun-1999 -->
|
|---|
| 7 | <!-- -->
|
|---|
| 8 | <!-- ******************************************************** -->
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 | <!-- ******************* Section (Level#1) ****************** -->
|
|---|
| 12 | <sect1 id="sect.Mate">
|
|---|
| 13 | <title>
|
|---|
| 14 | Material
|
|---|
| 15 | </title>
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 | <!-- ******************* Section (Level#2) ****************** -->
|
|---|
| 19 | <sect2 id="sect.Mate.GenCons">
|
|---|
| 20 | <title>
|
|---|
| 21 | General considerations
|
|---|
| 22 | </title>
|
|---|
| 23 |
|
|---|
| 24 | <para>
|
|---|
| 25 | In nature, materials (chemical compounds, mixtures) are made of
|
|---|
| 26 | elements, and elements are made of isotopes. Geant4 has three main
|
|---|
| 27 | classes designed to reflect this organization. Each of these
|
|---|
| 28 | classes has a table, which is a static data member, used to keep
|
|---|
| 29 | track of the instances of the respective classes created.
|
|---|
| 30 |
|
|---|
| 31 | <variablelist><title></title>
|
|---|
| 32 | <varlistentry>
|
|---|
| 33 | <term>
|
|---|
| 34 | <emphasis>G4Isotope</emphasis>
|
|---|
| 35 | </term>
|
|---|
| 36 | <listitem><para>
|
|---|
| 37 | This class describes the properties of atoms: atomic number,
|
|---|
| 38 | number of nucleons, mass per mole, etc.
|
|---|
| 39 | </para></listitem>
|
|---|
| 40 | </varlistentry>
|
|---|
| 41 | <varlistentry>
|
|---|
| 42 | <term>
|
|---|
| 43 | <emphasis>G4Element</emphasis>
|
|---|
| 44 | </term>
|
|---|
| 45 | <listitem><para>
|
|---|
| 46 | This class describes the properties of elements: effective
|
|---|
| 47 | atomic number, effective number of nucleons, effective mass per
|
|---|
| 48 | mole, number of isotopes, shell energy, and quantities like cross
|
|---|
| 49 | section per atom, etc.
|
|---|
| 50 | </para></listitem>
|
|---|
| 51 | </varlistentry>
|
|---|
| 52 | <varlistentry>
|
|---|
| 53 | <term>
|
|---|
| 54 | <emphasis>G4Material</emphasis>
|
|---|
| 55 | </term>
|
|---|
| 56 | <listitem><para>
|
|---|
| 57 | This class describes the macroscopic properties of matter:
|
|---|
| 58 | density, state, temperature, pressure, and macroscopic quantities
|
|---|
| 59 | like radiation length, mean free path, dE/dx, etc.
|
|---|
| 60 | </para></listitem>
|
|---|
| 61 | </varlistentry>
|
|---|
| 62 | </variablelist>
|
|---|
| 63 | </para>
|
|---|
| 64 |
|
|---|
| 65 | <para>
|
|---|
| 66 | Only the <emphasis>G4Material</emphasis> class is visible to the rest of the
|
|---|
| 67 | toolkit and used by the tracking, the geometry and the physics. It
|
|---|
| 68 | contains all the information relevant to its constituent elements
|
|---|
| 69 | and isotopes, while at the same time hiding their implementation
|
|---|
| 70 | details.
|
|---|
| 71 | </para>
|
|---|
| 72 |
|
|---|
| 73 | </sect2>
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 | <!-- ******************* Section (Level#2) ****************** -->
|
|---|
| 77 | <sect2 id="sect.Mate.Intro">
|
|---|
| 78 | <title>
|
|---|
| 79 | Introduction to the Classes
|
|---|
| 80 | </title>
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 | <!-- ******************* Section (Level#3) ****************** -->
|
|---|
| 84 | <sect3 id="sect.Mate.Intro.Iso">
|
|---|
| 85 | <title>
|
|---|
| 86 | G4Isotope
|
|---|
| 87 | </title>
|
|---|
| 88 |
|
|---|
| 89 | <para>
|
|---|
| 90 | A <emphasis>G4Isotope</emphasis> object has a name, atomic number, number of
|
|---|
| 91 | nucleons, mass per mole, and an index in the table. The constructor
|
|---|
| 92 | automatically stores "this" isotope in the isotopes table, which
|
|---|
| 93 | will assign it an index number.
|
|---|
| 94 | </para>
|
|---|
| 95 |
|
|---|
| 96 | </sect3>
|
|---|
| 97 |
|
|---|
| 98 | <!-- ******************* Section (Level#3) ****************** -->
|
|---|
| 99 | <sect3 id="sect.Mate.Intro.Ele">
|
|---|
| 100 | <title>
|
|---|
| 101 | G4Element
|
|---|
| 102 | </title>
|
|---|
| 103 |
|
|---|
| 104 | <para>
|
|---|
| 105 | A <emphasis>G4Element</emphasis> object has a name, symbol, effective atomic
|
|---|
| 106 | number, effective number of nucleons, effective mass of a mole, an
|
|---|
| 107 | index in the elements table, the number of isotopes, a vector of
|
|---|
| 108 | pointers to such isotopes, and a vector of relative abundances
|
|---|
| 109 | referring to such isotopes (where relative abundance means the
|
|---|
| 110 | number of atoms per volume). In addition, the class has methods to
|
|---|
| 111 | add, one by one, the isotopes which are to form the element.
|
|---|
| 112 | </para>
|
|---|
| 113 |
|
|---|
| 114 | <para>
|
|---|
| 115 | A <emphasis>G4Element</emphasis> object can be constructed by directly
|
|---|
| 116 | providing the effective atomic number, effective number of
|
|---|
| 117 | nucleons, and effective mass of a mole, if the user explicitly
|
|---|
| 118 | wants to do so. Alternatively, a <emphasis>G4Element</emphasis> object can be
|
|---|
| 119 | constructed by declaring the number of isotopes of which it will be
|
|---|
| 120 | composed. The constructor will "new" a vector of pointers to
|
|---|
| 121 | <emphasis>G4Isotopes</emphasis> and a vector of doubles to store their relative
|
|---|
| 122 | abundances. Finally, the method to add an isotope must be invoked
|
|---|
| 123 | for each of the desired (pre-existing) isotope objects, providing
|
|---|
| 124 | their addresses and relative abundances. At the last isotope entry,
|
|---|
| 125 | the system will automatically compute the effective atomic number,
|
|---|
| 126 | effective number of nucleons and effective mass of a mole, and will
|
|---|
| 127 | store "this" element in the elements table.
|
|---|
| 128 | </para>
|
|---|
| 129 |
|
|---|
| 130 | <para>
|
|---|
| 131 | A few quantities, with physical meaning or not, which are
|
|---|
| 132 | constant in a given element, are computed and stored here as
|
|---|
| 133 | "derived data members".
|
|---|
| 134 | </para>
|
|---|
| 135 |
|
|---|
| 136 | <para>
|
|---|
| 137 | Using the internal Geant4 database, a <emphasis>G4Element</emphasis> can be accessed
|
|---|
| 138 | by atomic number or by atomic symbol ("Al", "Fe", "Pb"...). In that
|
|---|
| 139 | case <emphasis>G4Element</emphasis> will be found from the list of existing elements or
|
|---|
| 140 | will be constructed using data from the Geant4 database, which is
|
|---|
| 141 | derived from the
|
|---|
| 142 | <ulink url="http://physics.nist.gov/PhysRefData/Compositions/index.html">NIST database
|
|---|
| 143 | of elements and isotope compositions</ulink>.
|
|---|
| 144 | Thus, the natural isotope composition can be built by default.
|
|---|
| 145 | The same element
|
|---|
| 146 | can be created as using the NIST database with the
|
|---|
| 147 | natural composition of isotopes
|
|---|
| 148 | and from scratch in user code with user defined isotope composition.
|
|---|
| 149 | </para>
|
|---|
| 150 |
|
|---|
| 151 | </sect3>
|
|---|
| 152 |
|
|---|
| 153 | <!-- ******************* Section (Level#3) ****************** -->
|
|---|
| 154 | <sect3 id="sect.Mate.Intro.Mate">
|
|---|
| 155 | <title>
|
|---|
| 156 | G4Material
|
|---|
| 157 | </title>
|
|---|
| 158 |
|
|---|
| 159 | <para>
|
|---|
| 160 | A <emphasis>G4Material</emphasis> object has a name, density, physical state,
|
|---|
| 161 | temperature and pressure (by default the standard conditions), the
|
|---|
| 162 | number of elements and a vector of pointers to such elements, a
|
|---|
| 163 | vector of the fraction of mass for each element, a vector of the
|
|---|
| 164 | atoms (or molecules) numbers of each element, and an index in the
|
|---|
| 165 | materials table. In addition, the class has methods to add, one by
|
|---|
| 166 | one, the elements which will comprise the material.
|
|---|
| 167 | </para>
|
|---|
| 168 |
|
|---|
| 169 | <para>
|
|---|
| 170 | A <emphasis>G4Material</emphasis> object can be constructed by directly
|
|---|
| 171 | providing the resulting effective numbers, if the user explicitly
|
|---|
| 172 | wants to do so (an underlying element will be created with these
|
|---|
| 173 | numbers). Alternatively, a <emphasis>G4Material</emphasis> object can be
|
|---|
| 174 | constructed by declaring the number of elements of which it will be
|
|---|
| 175 | composed. The constructor will "new" a vector of pointers to
|
|---|
| 176 | <emphasis>G4Element</emphasis> and a vector of doubles to store their fraction of
|
|---|
| 177 | mass. Finally, the method to add an element must be invoked for
|
|---|
| 178 | each of the desired (pre-existing) element objects, providing their
|
|---|
| 179 | addresses and mass fractions. At the last element entry, the system
|
|---|
| 180 | will automatically compute the vector of the number of atoms of
|
|---|
| 181 | each element per volume, the total number of electrons per volume,
|
|---|
| 182 | and will store "this" material in the materials table. In the same
|
|---|
| 183 | way, a material can be constructed as a mixture of other materials
|
|---|
| 184 | and elements.
|
|---|
| 185 | </para>
|
|---|
| 186 |
|
|---|
| 187 | <para>
|
|---|
| 188 | It should be noted that if the user provides the number of atoms
|
|---|
| 189 | (or molecules) for each element comprising the chemical compound,
|
|---|
| 190 | the system automatically computes the mass fraction. A few
|
|---|
| 191 | quantities, with physical meaning or not, which are constant in a
|
|---|
| 192 | given material, are computed and stored here as "derived data
|
|---|
| 193 | members".
|
|---|
| 194 | </para>
|
|---|
| 195 |
|
|---|
| 196 | <para>
|
|---|
| 197 | Some materials are included in the internal Geant4 database,
|
|---|
| 198 | which were derived from the
|
|---|
| 199 | <ulink url="http://physics.nist.gov/PhysRefData/Star/Text/method.html">NIST database
|
|---|
| 200 | of material properties</ulink>.
|
|---|
| 201 | Additionally a number of materials friquently used in HEP is
|
|---|
| 202 | included in the database. Materials are interrogated or constructed
|
|---|
| 203 | by their <emphasis>names</emphasis> (<xref linkend="sect.G4MatrDb" />).
|
|---|
| 204 | There are UI commands for the material category, which provide
|
|---|
| 205 | an interactive access to the database. If material is created
|
|---|
| 206 | using the NIST database by it will
|
|---|
| 207 | consist by default of elements with the natural composition of isotopes.
|
|---|
| 208 | </para>
|
|---|
| 209 |
|
|---|
| 210 | </sect3>
|
|---|
| 211 |
|
|---|
| 212 | <!-- ******************* Section (Level#3) ****************** -->
|
|---|
| 213 | <sect3 id="sect.Mate.Intro.Fin">
|
|---|
| 214 | <title>
|
|---|
| 215 | Final Considerations
|
|---|
| 216 | </title>
|
|---|
| 217 |
|
|---|
| 218 | <para>
|
|---|
| 219 | The classes will automatically decide
|
|---|
| 220 | if the total of the mass fractions is correct, and perform the
|
|---|
| 221 | necessary checks. The main reason why a fixed index is kept as a
|
|---|
| 222 | data member is that many cross section and energy tables will be
|
|---|
| 223 | built in the physics processes "by rows of materials (or elements,
|
|---|
| 224 | or even isotopes)". The tracking gives the physics process the
|
|---|
| 225 | address of a material object (the material of the current volume).
|
|---|
| 226 | If the material has an index according to which the cross section
|
|---|
| 227 | table has been built, then direct access is available when a number
|
|---|
| 228 | in such a table must be accessed. We get directly to the correct
|
|---|
| 229 | row, and the energy of the particle will tell us the column.
|
|---|
| 230 | Without such an index, every access to the cross section or energy
|
|---|
| 231 | tables would imply a search to get to the correct material's row.
|
|---|
| 232 | More details will be given in the section on processes.
|
|---|
| 233 | </para>
|
|---|
| 234 |
|
|---|
| 235 | <para>
|
|---|
| 236 | Isotopes, elements and materials must be instantiated dynamically
|
|---|
| 237 | in the user application; they are automatically registered in
|
|---|
| 238 | internal stores and the system takes care to free the memory
|
|---|
| 239 | allocated at the end of the job.
|
|---|
| 240 | </para>
|
|---|
| 241 |
|
|---|
| 242 | </sect3>
|
|---|
| 243 | </sect2>
|
|---|
| 244 |
|
|---|
| 245 |
|
|---|
| 246 | <!-- ******************* Section (Level#2) ****************** -->
|
|---|
| 247 | <sect2 id="sect.Mate.Recep">
|
|---|
| 248 | <title>
|
|---|
| 249 | Recipes for Building Elements and Materials
|
|---|
| 250 | </title>
|
|---|
| 251 |
|
|---|
| 252 | <para>
|
|---|
| 253 | <xref linkend="programlist_Mate_1" /> illustrates the different ways to define
|
|---|
| 254 | materials.
|
|---|
| 255 | </para>
|
|---|
| 256 |
|
|---|
| 257 | <example id="programlist_Mate_1">
|
|---|
| 258 | <title>
|
|---|
| 259 | A program which illustrates the different ways to define materials.
|
|---|
| 260 | </title>
|
|---|
| 261 |
|
|---|
| 262 | <programlisting>
|
|---|
| 263 | #include "G4Isotope.hh"
|
|---|
| 264 | #include "G4Element.hh"
|
|---|
| 265 | #include "G4Material.hh"
|
|---|
| 266 | #include "G4UnitsTable.hh"
|
|---|
| 267 |
|
|---|
| 268 | int main() {
|
|---|
| 269 | G4String name, symbol; // a=mass of a mole;
|
|---|
| 270 | G4double a, z, density; // z=mean number of protons;
|
|---|
| 271 | G4int iz, n; // iz=nb of protons in an isotope;
|
|---|
| 272 | // n=nb of nucleons in an isotope;
|
|---|
| 273 | G4int ncomponents, natoms;
|
|---|
| 274 | G4double abundance, fractionmass;
|
|---|
| 275 | G4double temperature, pressure;
|
|---|
| 276 |
|
|---|
| 277 | G4UnitDefinition::BuildUnitsTable();
|
|---|
| 278 |
|
|---|
| 279 | // define Elements
|
|---|
| 280 | a = 1.01*g/mole;
|
|---|
| 281 | G4Element* elH = new G4Element(name="Hydrogen",symbol="H" , z= 1., a);
|
|---|
| 282 |
|
|---|
| 283 | a = 12.01*g/mole;
|
|---|
| 284 | G4Element* elC = new G4Element(name="Carbon" ,symbol="C" , z= 6., a);
|
|---|
| 285 |
|
|---|
| 286 | a = 14.01*g/mole;
|
|---|
| 287 | G4Element* elN = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
|
|---|
| 288 |
|
|---|
| 289 | a = 16.00*g/mole;
|
|---|
| 290 | G4Element* elO = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
|
|---|
| 291 |
|
|---|
| 292 | a = 28.09*g/mole;
|
|---|
| 293 | G4Element* elSi = new G4Element(name="Silicon", symbol="Si", z=14., a);
|
|---|
| 294 |
|
|---|
| 295 | a = 55.85*g/mole;
|
|---|
| 296 | G4Element* elFe = new G4Element(name="Iron" ,symbol="Fe", z=26., a);
|
|---|
| 297 |
|
|---|
| 298 | a = 183.84*g/mole;
|
|---|
| 299 | G4Element* elW = new G4Element(name="Tungsten" ,symbol="W", z=74., a);
|
|---|
| 300 |
|
|---|
| 301 | a = 207.20*g/mole;
|
|---|
| 302 | G4Element* elPb = new G4Element(name="Lead" ,symbol="Pb", z=82., a);
|
|---|
| 303 |
|
|---|
| 304 | // define an Element from isotopes, by relative abundance
|
|---|
| 305 | G4Isotope* U5 = new G4Isotope(name="U235", iz=92, n=235, a=235.01*g/mole);
|
|---|
| 306 | G4Isotope* U8 = new G4Isotope(name="U238", iz=92, n=238, a=238.03*g/mole);
|
|---|
| 307 |
|
|---|
| 308 | G4Element* elU = new G4Element(name="enriched Uranium", symbol="U", ncomponents=2);
|
|---|
| 309 | elU->AddIsotope(U5, abundance= 90.*perCent);
|
|---|
| 310 | elU->AddIsotope(U8, abundance= 10.*perCent);
|
|---|
| 311 |
|
|---|
| 312 | cout << *(G4Isotope::GetIsotopeTable()) << endl;
|
|---|
| 313 | cout << *(G4Element::GetElementTable()) << endl;
|
|---|
| 314 | </programlisting>
|
|---|
| 315 | </example>
|
|---|
| 316 | <informalexample>
|
|---|
| 317 | <programlisting>
|
|---|
| 318 | // define simple materials
|
|---|
| 319 | density = 2.700*g/cm3;
|
|---|
| 320 | a = 26.98*g/mole;
|
|---|
| 321 | G4Material* Al = new G4Material(name="Aluminum", z=13., a, density);
|
|---|
| 322 |
|
|---|
| 323 | density = 1.390*g/cm3;
|
|---|
| 324 | a = 39.95*g/mole;
|
|---|
| 325 | vG4Material* lAr = new G4Material(name="liquidArgon", z=18., a, density);
|
|---|
| 326 |
|
|---|
| 327 | density = 8.960*g/cm3;
|
|---|
| 328 | a = 63.55*g/mole;
|
|---|
| 329 | G4Material* Cu = new G4Material(name="Copper" , z=29., a, density);
|
|---|
| 330 |
|
|---|
| 331 | // define a material from elements. case 1: chemical molecule
|
|---|
| 332 | density = 1.000*g/cm3;
|
|---|
| 333 | G4Material* H2O = new G4Material(name="Water", density, ncomponents=2);
|
|---|
| 334 | H2O->AddElement(elH, natoms=2);
|
|---|
| 335 | H2O->AddElement(elO, natoms=1);
|
|---|
| 336 |
|
|---|
| 337 | density = 1.032*g/cm3;
|
|---|
| 338 | G4Material* Sci = new G4Material(name="Scintillator", density, ncomponents=2);
|
|---|
| 339 | Sci->AddElement(elC, natoms=9);
|
|---|
| 340 | Sci->AddElement(elH, natoms=10);
|
|---|
| 341 |
|
|---|
| 342 | density = 2.200*g/cm3;
|
|---|
| 343 | G4Material* SiO2 = new G4Material(name="quartz", density, ncomponents=2);
|
|---|
| 344 | SiO2->AddElement(elSi, natoms=1);
|
|---|
| 345 | SiO2->AddElement(elO , natoms=2);
|
|---|
| 346 |
|
|---|
| 347 | density = 8.280*g/cm3;
|
|---|
| 348 | G4Material* PbWO4= new G4Material(name="PbWO4", density, ncomponents=3);
|
|---|
| 349 | PbWO4->AddElement(elO , natoms=4);
|
|---|
| 350 | PbWO4->AddElement(elW , natoms=1);
|
|---|
| 351 | PbWO4->AddElement(elPb, natoms=1);
|
|---|
| 352 |
|
|---|
| 353 | // define a material from elements. case 2: mixture by fractional mass
|
|---|
| 354 | density = 1.290*mg/cm3;
|
|---|
| 355 | G4Material* Air = new G4Material(name="Air " , density, ncomponents=2);
|
|---|
| 356 | Air->AddElement(elN, fractionmass=0.7);
|
|---|
| 357 | Air->AddElement(elO, fractionmass=0.3);
|
|---|
| 358 |
|
|---|
| 359 | // define a material from elements and/or others materials (mixture of mixtures)
|
|---|
| 360 | density = 0.200*g/cm3;
|
|---|
| 361 | G4Material* Aerog = new G4Material(name="Aerogel", density, ncomponents=3);
|
|---|
| 362 | Aerog->AddMaterial(SiO2, fractionmass=62.5*perCent);
|
|---|
| 363 | Aerog->AddMaterial(H2O , fractionmass=37.4*perCent);
|
|---|
| 364 | Aerog->AddElement (elC , fractionmass= 0.1*perCent);
|
|---|
| 365 | </programlisting>
|
|---|
| 366 | </informalexample>
|
|---|
| 367 | <informalexample>
|
|---|
| 368 | <programlisting>
|
|---|
| 369 | // examples of gas in non STP conditions
|
|---|
| 370 | density = 27.*mg/cm3;
|
|---|
| 371 | pressure = 50.*atmosphere;
|
|---|
| 372 | temperature = 325.*kelvin;
|
|---|
| 373 | G4Material* CO2 = new G4Material(name="Carbonic gas", density, ncomponents=2,
|
|---|
| 374 | kStateGas,temperature,pressure);
|
|---|
| 375 | CO2->AddElement(elC, natoms=1);
|
|---|
| 376 | CO2->AddElement(elO, natoms=2);
|
|---|
| 377 |
|
|---|
| 378 | density = 0.3*mg/cm3;
|
|---|
| 379 | pressure = 2.*atmosphere;
|
|---|
| 380 | temperature = 500.*kelvin;
|
|---|
| 381 | G4Material* steam = new G4Material(name="Water steam ", density, ncomponents=1,
|
|---|
| 382 | kStateGas,temperature,pressure);
|
|---|
| 383 | steam->AddMaterial(H2O, fractionmass=1.);
|
|---|
| 384 |
|
|---|
| 385 | // What about vacuum ? Vacuum is an ordinary gas with very low density
|
|---|
| 386 | density = universe_mean_density; //from PhysicalConstants.h
|
|---|
| 387 | pressure = 1.e-19*pascal;
|
|---|
| 388 | temperature = 0.1*kelvin;
|
|---|
| 389 | new G4Material(name="Galactic", z=1., a=1.01*g/mole, density,
|
|---|
| 390 | kStateGas,temperature,pressure);
|
|---|
| 391 |
|
|---|
| 392 | density = 1.e-5*g/cm3;
|
|---|
| 393 | pressure = 2.e-2*bar;
|
|---|
| 394 | temperature = STP_Temperature; //from PhysicalConstants.h
|
|---|
| 395 | G4Material* beam = new G4Material(name="Beam ", density, ncomponents=1,
|
|---|
| 396 | kStateGas,temperature,pressure);
|
|---|
| 397 | beam->AddMaterial(Air, fractionmass=1.);
|
|---|
| 398 |
|
|---|
| 399 | // print the table of materials
|
|---|
| 400 | G4cout << *(G4Material::GetMaterialTable()) << endl;
|
|---|
| 401 |
|
|---|
| 402 | return EXIT_SUCCESS;
|
|---|
| 403 | }
|
|---|
| 404 | </programlisting>
|
|---|
| 405 | </informalexample>
|
|---|
| 406 | <para>
|
|---|
| 407 | As can be seen in the later examples, a material has a state:
|
|---|
| 408 | solid (the default), liquid, or gas. The constructor checks the
|
|---|
| 409 | density and automatically sets the state to gas below a given
|
|---|
| 410 | threshold (10 mg/cm3).
|
|---|
| 411 | </para>
|
|---|
| 412 |
|
|---|
| 413 | <para>
|
|---|
| 414 | In the case of a gas, one may specify the temperature and
|
|---|
| 415 | pressure. The defaults are STP conditions defined in
|
|---|
| 416 | <literal>PhysicalConstants.hh</literal>.
|
|---|
| 417 | </para>
|
|---|
| 418 |
|
|---|
| 419 | <para>
|
|---|
| 420 | An element must have the number of nucleons >= number of
|
|---|
| 421 | protons >= 1.
|
|---|
| 422 | </para>
|
|---|
| 423 |
|
|---|
| 424 | <para>
|
|---|
| 425 | A material must have non-zero values of density, temperature and
|
|---|
| 426 | pressure.
|
|---|
| 427 | </para>
|
|---|
| 428 |
|
|---|
| 429 | <para>
|
|---|
| 430 | Materials can also be defined using the internal Geant4
|
|---|
| 431 | database. <xref linkend="programlist_Mate_2" /> illustrates
|
|---|
| 432 | how to do this for the same materials used in
|
|---|
| 433 | <xref linkend="programlist_Mate_1" />.
|
|---|
| 434 | There are also UI commands which allow the database to be accessed.
|
|---|
| 435 | <emphasis>The list of currently avalable material names</emphasis>
|
|---|
| 436 | (<xref linkend="sect.G4MatrDb" />) is extended permanetly.
|
|---|
| 437 | </para>
|
|---|
| 438 |
|
|---|
| 439 | <example id="programlist_Mate_2">
|
|---|
| 440 | <title>
|
|---|
| 441 | A program which shows how to define materials from the internal database.
|
|---|
| 442 | </title>
|
|---|
| 443 |
|
|---|
| 444 | <programlisting>
|
|---|
| 445 | #include "globals.hh"
|
|---|
| 446 | #include "G4Material.hh"
|
|---|
| 447 | #include "G4NistManager.hh"
|
|---|
| 448 |
|
|---|
| 449 | int main() {
|
|---|
| 450 | G4NistManager* man = G4NistManager::Instance();
|
|---|
| 451 | man->SetVerbose(1);
|
|---|
| 452 |
|
|---|
| 453 | // define elements
|
|---|
| 454 | G4Element* C = man->FindOrBuildElement("C");
|
|---|
| 455 | G4Element* Pb = man->FindOrBuildMaterial("Pb");
|
|---|
| 456 |
|
|---|
| 457 | // define pure NIST materials
|
|---|
| 458 | G4Material* Al = man->FindOrBuildMaterial("G4_Al");
|
|---|
| 459 | G4Material* Cu = man->FindOrBuildMaterial("G4_Cu");
|
|---|
| 460 |
|
|---|
| 461 | // define NIST materials
|
|---|
| 462 | G4Material* H2O = man->FindOrBuildMaterial("G4_WATER");
|
|---|
| 463 | G4Material* Sci = man->FindOrBuildMaterial("G4_PLASTIC_SC_VINYLTOLUENE");
|
|---|
| 464 | G4Material* SiO2 = man->FindOrBuildMaterial("G4_SILICON_DIOXIDE");
|
|---|
| 465 | G4Material* Air = man->FindOrBuildMaterial("G4_AIR");
|
|---|
| 466 |
|
|---|
| 467 | // HEP materials
|
|---|
| 468 | G4Material* PbWO4 = man->FindOrBuildMaterial("G4_PbWO4");
|
|---|
| 469 | G4Material* lAr = man->FindOrBuildMaterial("G4_lAr");
|
|---|
| 470 | G4Material* vac = man->FindOrBuildMaterial("G4_Galactic");
|
|---|
| 471 |
|
|---|
| 472 | // define gas material at non STP conditions (T = 120K, P=0.5atm)
|
|---|
| 473 | G4Material* coldAr = man->ConstructNewGasdMaterial("ColdAr","G4_Ar",120.*kelvin,0.5*atmosphere);
|
|---|
| 474 |
|
|---|
| 475 | // print the table of materials
|
|---|
| 476 | G4cout << *(G4Material::GetMaterialTable()) << endl;
|
|---|
| 477 |
|
|---|
| 478 | return EXIT_SUCCESS;
|
|---|
| 479 | }
|
|---|
| 480 | </programlisting>
|
|---|
| 481 | </example>
|
|---|
| 482 |
|
|---|
| 483 | </sect2>
|
|---|
| 484 |
|
|---|
| 485 |
|
|---|
| 486 | <!-- ******************* Section (Level#2) ****************** -->
|
|---|
| 487 | <sect2 id="sect.Mate.Tables">
|
|---|
| 488 | <title>
|
|---|
| 489 | The Tables
|
|---|
| 490 | </title>
|
|---|
| 491 |
|
|---|
| 492 | <!-- ******************* Section (Level#3) ****************** -->
|
|---|
| 493 | <sect3 id="sect.Mate.Tables.PrintCons">
|
|---|
| 494 | <title>
|
|---|
| 495 | Print a constituent
|
|---|
| 496 | </title>
|
|---|
| 497 |
|
|---|
| 498 | <para>
|
|---|
| 499 | The following shows how to print a constituent:
|
|---|
| 500 |
|
|---|
| 501 | <informalexample>
|
|---|
| 502 | <programlisting>
|
|---|
| 503 | G4cout << elU << endl;
|
|---|
| 504 | G4cout << Air << endl;
|
|---|
| 505 | </programlisting>
|
|---|
| 506 | </informalexample>
|
|---|
| 507 | </para>
|
|---|
| 508 |
|
|---|
| 509 | </sect3>
|
|---|
| 510 |
|
|---|
| 511 | <!-- ******************* Section (Level#3) ****************** -->
|
|---|
| 512 | <sect3 id="sect.Mate.Tables.PrintTab">
|
|---|
| 513 | <title>
|
|---|
| 514 | Print the table of materials
|
|---|
| 515 | </title>
|
|---|
| 516 |
|
|---|
| 517 | <para>
|
|---|
| 518 | The following shows how to print the table of materials:
|
|---|
| 519 |
|
|---|
| 520 | <informalexample>
|
|---|
| 521 | <programlisting>
|
|---|
| 522 | G4cout << *(G4Material::GetMaterialTable()) << endl;
|
|---|
| 523 | </programlisting>
|
|---|
| 524 | </informalexample>
|
|---|
| 525 | </para>
|
|---|
| 526 |
|
|---|
| 527 |
|
|---|
| 528 | </sect3>
|
|---|
| 529 | </sect2>
|
|---|
| 530 | </sect1>
|
|---|