source: trunk/documents/UserDoc/UsersGuides/ForApplicationDeveloper/html/Detector/material.html @ 1287

Last change on this file since 1287 was 1208, checked in by garnier, 15 years ago

CVS update

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