source: trunk/Documentation/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ch05s06.html@ 901

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

Add Geant4 Documentation at 8.12.2008

File size: 7.8 KB
Line 
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>5.6.  Physics Table</title><link rel="stylesheet" href="../xml/XSLCustomizationLayer/G4HTMLStylesheet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.71.1"><link rel="start" href="index.html" title="Geant4 User's Guide for Application Developers"><link rel="up" href="ch05.html" title="Chapter 5.  Tracking and Physics"><link rel="prev" href="ch05s05.html" title="5.5.  Cuts per Region"><link rel="next" href="ch05s07.html" title="5.7.  User Limits"><script language="JavaScript">
2function remote_win(fName)
3{
4 var url = "AllResources/Detector/geometry.src/" + fName;
5 RemoteWin=window.open(url,"","resizable=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,copyhistory=0,width=520,height=520")
6 RemoteWin.creator=self
7}
8</script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5.6. 
9Physics Table
10</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch05s05.html"><img src="AllResources/IconsGIF/prev.gif" alt="Prev"></a> </td><th width="60%" align="center">Chapter 5. 
11Tracking and Physics
12</th><td width="20%" align="right"> <a accesskey="n" href="ch05s07.html"><img src="AllResources/IconsGIF/next.gif" alt="Next"></a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect.PhysTab"></a>5.6. 
13Physics Table
14</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.PhysTab.Gene"></a>5.6.1. 
15General Concepts
16</h3></div></div></div><p>
17In Geant4, physics processes use many tables of cross sections,
18energy losses and other physics values. Before the execution of an
19event loop, the <code class="literal">BuildPhysicsTable()</code> method of
20<span class="emphasis"><em>G4VProcess</em></span> is invoked for all processes and
21cross section tables are prepared. "Standard" electromagnetic
22processes calculate cross section and/or energy loss values for
23each material and for each production cut value assigned to each
24material. A change in production cut values therefore require these
25cross sections to be re-calculated. Cross sections for hadronic
26processes do not depend on the production cut.
27</p><p>
28The <span class="emphasis"><em>G4PhysicsTable</em></span> class is used to handle cross section
29tables. <span class="emphasis"><em>G4PhysicsTable</em></span> is a collection of instances of
30<span class="emphasis"><em>G4PhysicsVector</em></span> (and derived classes), each of which has
31cross section values for a particle within a given energy range
32traveling in a material.
33</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.PhysTab.MateCoup"></a>5.6.2. 
34Material-Cuts Couple
35</h3></div></div></div><p>
36Users can assign different production cuts to different regions
37(see <a href="ch05s05.html" title="5.5. 
38Cuts per Region
39">Section 5.5</a>).
40This means that if the same material is used in regions with different
41cut values, the processes need to prepare several different cross
42sections for that material.
43</p><p>
44The <span class="emphasis"><em>G4ProductionCutsTable</em></span> has
45<span class="emphasis"><em>G4MaterialCutsCouple</em></span>
46objects, each of which consists of a material paired with a cut
47value. These <span class="emphasis"><em>G4MaterialCutsCouple</em></span>s are numbered with an
48index which is the same as the index of a <span class="emphasis"><em>G4PhysicsVector</em></span>
49for the corresponding <span class="emphasis"><em>G4MaterialCutsCouple</em></span>in the
50<span class="emphasis"><em>G4PhysicsTable</em></span>. The list of
51<span class="emphasis"><em>MaterialCutsCouple</em></span>s used
52in the current geometry setup is updated before starting the event
53loop in each run.
54</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.PhysTab.Fio"></a>5.6.3. 
55File I/O for the Physics Table
56</h3></div></div></div><p>
57Calculated physics tables for "Standard" electromagnetic processes
58can be stored in files. The user may thus eliminate the time
59required for the calculation of physics tables by retrieving them
60from the files.
61</p><p>
62Using the built-in user command "<span class="bold"><strong>storePhysicsTable</strong></span>"
63(see <a href="ch07.html#sect.BuiltinCom" title="7.1. 
64Built-in Commands
65">Section 7.1</a>),
66stores physics tables in files. Information on materials and
67cuts defined in the current geometry setup are stored together with
68physics tables because calculated values in the physics tables
69depend on <span class="emphasis"><em>MaterialCutsCouple</em></span>. Note that physics tables are
70calculated before the event loop, not in the initialization phase.
71So, at least one event must be executed before using the
72"<span class="bold"><strong>storePhysicsTable</strong></span>" command.
73</p><p>
74Calculated physics tables can be retrieved from files by using
75the "<span class="bold"><strong>retrievePhysicsTable</strong></span>" command. Materials
76and cuts from files are compared with those defined in the current geometry
77setup, and only physics vectors corresponding to the
78<span class="emphasis"><em>MaterialCutsCouple</em></span>s used in the current setup are restored.
79Note that nothing happens just after the
80"<span class="bold"><strong>retrievePhysicsTable</strong></span>" command is issued.
81Restoration of physics tables will be executed in parallel with the calculation
82of physics tables.
83</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.PhysTab.Build"></a>5.6.4. 
84Building the Physics Table
85</h3></div></div></div><p>
86In the <code class="literal">G4RunManagerKernel::RunInitialization()</code> method,
87after the list of <span class="emphasis"><em>MaterialCutsCouple</em></span>s is updated, the
88<code class="literal">G4VUserPhysicsList::BuildPhysicsTable()</code> method is invoked
89to build physics tables for all processes.
90</p><p>
91Initially, the <code class="literal">G4VProcess::PreparePhysicsTable()</code> method
92is invoked. Each process creates <span class="emphasis"><em>G4PhysicsTable</em></span> objects as
93necessary. It then checks whether the <span class="emphasis"><em>MaterialCutsCouple</em></span>s
94have been modified after a run to determine if the corresponding
95physics vectors can be used in the next run or need to be
96re-calculated.
97</p><p>
98Next, the <code class="literal">G4VProcess::RetrievePhysicsTable()</code> method is
99invoked if the <code class="literal">G4VUserPhysicsList::fRetrievePhysicsTable</code>
100flag is asserted. After checking materials and cuts in files,
101physics vectors corresponding to the <span class="emphasis"><em>MaterialCutsCouple</em></span>s
102used in the current setup are restored.
103</p><p>
104Finally, the <code class="literal">G4VProcess::BuildPhysicsTable()</code> method is
105invoked and only physics vectors which need to be re-calculated are
106built.
107</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch05s05.html"><img src="AllResources/IconsGIF/prev.gif" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="ch05.html"><img src="AllResources/IconsGIF/up.gif" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="ch05s07.html"><img src="AllResources/IconsGIF/next.gif" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">5.5. 
108Cuts per Region
109 </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="AllResources/IconsGIF/home.gif" alt="Home"></a></td><td width="40%" align="right" valign="top"> 5.7. 
110User Limits
111</td></tr></table></div></body></html>
Note: See TracBrowser for help on using the repository browser.