source: trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/GettingStarted/materialDef.xml@ 1222

Last change on this file since 1222 was 904, checked in by garnier, 17 years ago

ajout de la doc

File size: 6.2 KB
Line 
1<!-- ******************************************************** -->
2<!-- -->
3<!-- [History] -->
4<!-- Changed by: Katsuya Amako, 4-Aug-1998 -->
5<!-- Changed by: Dennis Wright, 28-Nov-2001 -->
6<!-- Proof read by: Joe Chuma, 15-Jun-1999 -->
7<!-- Converted to DocBook: Katsuya Amako, Aug-2006 -->
8<!-- -->
9<!-- ******************************************************** -->
10
11
12<!-- ******************* Section (Level#1) ****************** -->
13<sect1 id="sect.HowToSpecMate">
14<title>
15How to Specify Materials in the Detector
16</title>
17
18<!-- ******************* Section (Level#2) ****************** -->
19<sect2 id="sect.HowToSpecMate.GeneCons">
20<title>
21General Considerations
22</title>
23
24<para>
25In nature, general materials (chemical compounds, mixtures) are
26made of elements, and elements are made of isotopes. Therefore,
27these are the three main classes designed in Geant4. Each of these
28classes has a table as a static data member, which is for keeping
29track of the instances created of the respective classes.
30</para>
31
32<para>
33The <emphasis>G4Element</emphasis> class describes the properties of the
34atoms:
35<itemizedlist spacing="compact">
36 <listitem><para>
37 atomic number,
38 </para></listitem>
39 <listitem><para>
40 number of nucleons,
41 </para></listitem>
42 <listitem><para>
43 atomic mass,
44 </para></listitem>
45 <listitem><para>
46 shell energy,
47 </para></listitem>
48 <listitem><para>
49 as well as quantities such as cross sections per atom, etc.
50 </para></listitem>
51</itemizedlist>
52</para>
53
54<para>
55The <emphasis>G4Material</emphasis> class describes the macroscopic properties
56of matter:
57<itemizedlist spacing="compact">
58 <listitem><para>
59 density,
60 </para></listitem>
61 <listitem><para>
62 state,
63 </para></listitem>
64 <listitem><para>
65 temperature,
66 </para></listitem>
67 <listitem><para>
68 pressure,
69 </para></listitem>
70 <listitem><para>
71 as well as macroscopic quantities like radiation length, mean
72 free path, dE/dx, etc.
73 </para></listitem>
74</itemizedlist>
75</para>
76
77<para>
78The <emphasis>G4Material</emphasis> class is the one which is visible to the
79rest of the toolkit, and is used by the tracking, the geometry, and
80the physics. It contains all the information relative to the
81eventual elements and isotopes of which it is made, at the same
82time hiding the implementation details.
83</para>
84
85</sect2>
86
87<!-- ******************* Section (Level#2) ****************** -->
88<sect2 id="sect.HowToSpecMate.DefSimpleMate">
89<title>
90Define a Simple Material
91</title>
92
93<para>
94In the example below, liquid argon is created, by specifying its
95name, density, mass per mole, and atomic number.
96<example id="programlist_HowToSpecMate_1">
97<title>
98Creating liquid argon.
99</title>
100<programlisting>
101 G4double density = 1.390*g/cm3;
102 G4double a = 39.95*g/mole;
103 G4Material* lAr = new G4Material(name="liquidArgon", z=18., a, density);
104</programlisting>
105</example>
106</para>
107
108<para>
109The pointer to the material, <emphasis>lAr</emphasis>, will be used to specify
110the matter of which a given logical volume is made:
111<informalexample>
112<programlisting>
113 G4LogicalVolume* myLbox = new G4LogicalVolume(aBox,lAr,"Lbox",0,0,0);
114</programlisting>
115</informalexample>
116</para>
117
118</sect2>
119
120<!-- ******************* Section (Level#2) ****************** -->
121<sect2 id="sect.HowToSpecMate.DefineMolecule">
122<title>
123Define a Molecule
124</title>
125
126<para>
127In the example below, the water, <emphasis>H2O</emphasis>, is built from its
128components, by specifying the number of atoms in the molecule.
129<example id="programlist_HowToSpecMate_2">
130<title>
131Creating water by defining its molecular components.
132</title>
133<programlisting>
134 a = 1.01*g/mole;
135 G4Element* elH = new G4Element(name="Hydrogen",symbol="H" , z= 1., a);
136
137 a = 16.00*g/mole;
138 G4Element* elO = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
139
140 density = 1.000*g/cm3;
141 G4Material* H2O = new G4Material(name="Water",density,ncomponents=2);
142 H2O-&gt;AddElement(elH, natoms=2);
143 H2O-&gt;AddElement(elO, natoms=1);
144</programlisting>
145</example>
146</para>
147
148</sect2>
149
150<!-- ******************* Section (Level#2) ****************** -->
151<sect2 id="sect.HowToSpecMate.DefMixtureByFractionalMass">
152<title>
153Define a Mixture by Fractional Mass
154</title>
155
156<para>
157In the example below, air is built from nitrogen and oxygen, by
158giving the fractional mass of each component.
159
160<example id="programlist_HowToSpecMate_3">
161<title>
162Creating air by defining the fractional mass of its components.
163</title>
164<programlisting>
165 a = 14.01*g/mole;
166 G4Element* elN = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
167
168 a = 16.00*g/mole;
169 G4Element* elO = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
170
171 density = 1.290*mg/cm3;
172 G4Material* Air = new G4Material(name="Air ",density,ncomponents=2);
173 Air-&gt;AddElement(elN, fractionmass=70*perCent);
174 Air-&gt;AddElement(elO, fractionmass=30*perCent);
175</programlisting>
176</example>
177</para>
178
179</sect2>
180
181
182<!-- ******************* Section (Level#2) ****************** -->
183<sect2 id="sect.HowToSpecMate.DefMateFromDatabase">
184<title>
185Define a Material from the Geant4 Material Database
186</title>
187
188<para>
189In the example below, air and water are accessed via the Geant4
190material database.
191<example id="programlist_HowToSpecMate_4">
192<title>
193Defining air and water from the internal Geant4 database.
194</title>
195<programlisting>
196 G4NistManager* man = G4NistManager::Instance();
197
198 G4Material* H2O = man-&gt;FindOrBuildMaterial("G4_WATER");
199 G4Material* Air = man-&gt;FindOrBuildMaterial("G4_AIR");
200</programlisting>
201</example>
202</para>
203
204</sect2>
205
206<!-- ******************* Section (Level#2) ****************** -->
207<sect2 id="sect.HowToSpecMate.PrintMateInfo">
208<title>
209Print Material Information
210</title>
211
212<para>
213<example id="programlist_HowToSpecMate_5">
214<title>
215Printing information about materials.
216</title>
217<programlisting>
218 G4cout &lt;&lt; H2O; \\ print a given material
219 G4cout &lt;&lt; *(G4Material::GetMaterialTable()); \\ print the list of materials
220</programlisting>
221</example>
222
223In <literal>examples/novice/N03/N03DetectorConstruction.cc</literal>, you
224will find examples of all possible ways to build a material.
225</para>
226
227
228</sect2>
229</sect1>
Note: See TracBrowser for help on using the repository browser.