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

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

Add Geant4 Documentation at 8.12.2008

File size: 7.1 KB
Line 
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>5.5.  Cuts per Region</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="ch05s04.html" title="5.4.  Production Threshold versus Tracking Cut"><link rel="next" href="ch05s06.html" title="5.6.  Physics Table"><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.5. 
9Cuts per Region
10</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch05s04.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="ch05s06.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.CutReg"></a>5.5. 
13Cuts per Region
14</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.CutReg.Gene"></a>5.5.1. 
15General Concepts
16</h3></div></div></div><p>
17Beginning with Geant4 version 5.1, the concept of a region has been
18defined for use in geometrical descriptions. Details about regions
19and how to use them are available in
20<a href="ch04.html#sect.Geom.LogVol.SubReg" title="4.1.3.1. 
21Sub-detector Regions
22">Section 4.1.3.1</a>.
23As an example, suppose a user defines three regions, corresponding to
24the tracking volume, the calorimeter and the bulk structure of a
25detector. For performance reasons, the user may not be interested
26in the detailed development of electromagnetic showers in the
27insensitive bulk structure, but wishes to maintain the best
28possible accuracy in the tracking region. In such a use case,
29Geant4 allows the user to set different production thresholds
30("cuts") for each geometrical region. This ability, referred to as
31"cuts per region", is also a new feature provided by the Geant4 5.1
32release. The general concepts of production thresholds were
33presented in the <a href="ch05s04.html" title="5.4. 
34Production Threshold versus Tracking Cut
35">Section 5.4</a>.
36</p><p>
37Please note that this new feature is intended only for users
38who
39
40</p><div class="orderedlist"><ol type="1" compact><li><p>
41    are simulating the most complex geometries, such as an LHC
42    detector, and
43  </p></li><li><p>
44    are experienced in simulating electromagnetic showers in
45    matter.
46  </p></li></ol></div><p>
47</p><p>
48We strongly recommend that results generated with this new feature
49be compared with results using the same geometry and uniform
50production thresholds. Setting completely different cut values for
51individual regions may break the coherent and comprehensive
52accuracy of the simulation. Therefore cut values should be
53carefully optimized, based on a comparison with results obtained
54using uniform cuts.
55</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.CutReg.DefReg"></a>5.5.2. 
56Default Region
57</h3></div></div></div><p>
58The world volume is treated as a region by default. A
59<span class="emphasis"><em>G4Region</em></span> object is automatically assigned to the world
60volume and is referred to as the "default region". The production
61cuts for this region are the defaults which are defined in the
62<span class="emphasis"><em>UserPhysicsList</em></span>. Unless the user defines different cut
63values for other regions, the cuts in the default region will be
64used for the entire geometry.
65</p><p>
66Please note that the default region and its default production
67cuts are created and set automatically by <span class="emphasis"><em>G4RunManager</em></span>.
68The user is <span class="bold"><strong>not</strong></span> allowed to set a region to
69the world volume, <span class="bold"><strong>nor</strong></span> to assign other
70production cuts to the default region.
71</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.CutReg.Assig"></a>5.5.3. 
72Assigning Production Cuts to a Region
73</h3></div></div></div><p>
74In the <code class="literal">SetCuts()</code> method of the user's physics list, the
75user must first define the default cuts. Then a
76<span class="emphasis"><em>G4ProductionCuts</em></span> object must be created and initialized with
77the cut value desired for a given region. This object must in turn
78be assigned to the region object, which can be accessed by name
79from the <span class="emphasis"><em>G4RegionStore</em></span>. An example <code class="literal">SetCuts()</code> 
80code follows.
81
82</p><div class="example"><a name="programlist_CutReg_1"></a><p class="title"><b>Example 5.12. 
83<code class="literal">Setting production cuts to a region</code>
84</b></p><div class="example-contents"><pre class="programlisting">
85void MyPhysicsList::SetCuts()
86{
87  // default production thresholds for the world volume
88  SetCutsWithDefault();
89
90  // Production thresholds for detector regions
91  G4Region* region;
92  G4String regName;
93  G4ProductionCuts* cuts;
94
95  regName = "tracker";
96  region = G4RegionStore::GetInstance()-&gt;GetRegion(regName);
97  cuts = new G4ProductionCuts;
98  cuts-&gt;SetProductionCut(0.01*mm); // same cuts for gamma, e- and e+
99  region-&gt;SetProductionCuts(cuts);
100
101  regName = "calorimeter";
102  region = G4RegionStore::GetInstance()-&gt;GetRegion(regName);
103  cuts = new G4ProductionCuts;
104  cuts-&gt;SetProductionCut(0.01*mm,G4ProductionCuts::GetIndex("gamma"));
105  cuts-&gt;SetProductionCut(0.1*mm,G4ProductionCuts::GetIndex("e-"));
106  cuts-&gt;SetProductionCut(0.1*mm,G4ProductionCuts::GetIndex("e+"));
107  region-&gt;SetProductionCuts(cuts);
108}
109</pre></div></div><p><br class="example-break">
110</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch05s04.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="ch05s06.html"><img src="AllResources/IconsGIF/next.gif" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">5.4. 
111Production Threshold versus Tracking Cut
112 </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.6. 
113Physics Table
114</td></tr></table></div></body></html>
Note: See TracBrowser for help on using the repository browser.