source: trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/Detector/material.xml @ 905

Last change on this file since 905 was 904, checked in by garnier, 16 years ago

ajout de la doc

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