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

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

ajout de la doc

File size: 7.7 KB
Line 
1<!-- ******************************************************** -->
2<!--                                                          -->
3<!--  [History]                                               -->
4<!--    Converted to DocBook: Katsuya Amako, Aug-2006         -->
5<!--    Changed by: Gabriele Cosmo, 18-Apr-2005               -->
6<!--                                                          -->
7<!-- ******************************************************** -->
8
9
10<!-- ******************* Section (Level#2) ****************** -->
11<sect2 id="sect.Geom.LogVol">
12<title>
13Logical Volumes
14</title>
15
16<para>
17The Logical Volume manages the information associated with
18detector elements represented by a given Solid and Material,
19independently from its physical position in the detector.
20</para>
21
22<para>
23A Logical Volume knows which physical volumes are contained
24within it. It is uniquely defined to be their mother volume. A
25Logical Volume thus represents a hierarchy of unpositioned volumes
26whose positions relative to one another are well defined. By
27creating Physical Volumes, which are placed instances of a Logical
28Volume, this hierarchy or tree can be repeated.
29</para>
30
31<para>
32A Logical Volume also manages the information relative to the
33Visualization attributes (<xref linkend="sect.VisAtt" />) and
34user-defined parameters related to tracking, electro-magnetic field
35or cuts (through the <literal>G4UserLimits</literal> interface).
36</para>
37
38<para>
39By default, tracking optimization of the geometry (voxelization)
40is applied to the volume hierarchy identified by a logical volume.
41It is possible to change the default behavior by choosing not to
42apply geometry optimization for a given logical volume. This
43feature does not apply to the case where the associated physical
44volume is a parameterised volume; in this case, optimization is
45always applied.
46
47<informalexample>
48<programlisting>
49    G4LogicalVolume( G4VSolid*             pSolid,
50                     G4Material*           pMaterial,
51                     const G4String&amp;       Name,
52                     G4FieldManager*       pFieldMgr=0,
53                     G4VSensitiveDetector* pSDetector=0,
54                     G4UserLimits*         pULimits=0,
55                     G4bool                Optimise=true )
56</programlisting>
57</informalexample>
58</para>
59
60<para>
61Through the logical volume it is also possible to <emphasis>tune</emphasis> the
62granularity of the optimisation algorithm to be applied to the sub-tree of
63volumes represented. This is possible using the methods:
64
65<informalexample>
66<programlisting>
67    G4double GetSmartless() const
68    void SetSmartless(G4double s)
69</programlisting>
70</informalexample>
71
72The default <emphasis>smartless</emphasis> value is <emphasis>2</emphasis>
73and controls the average number of slices per contained volume which are used
74in the optimisation. The smaller the value, the less fine grained optimisation
75grid is generated; this will translate in a possible reduction of memory
76consumed for the optimisation of that portion of geometry at the price of
77a slight CPU time increase at tracking time. Manual tuning of the
78optimisation is in general not required, since the optimal granularity level
79is computed automatically and adapted to the specific geometry setup; however,
80in some cases (like geometry portions with 'dense' concentration of volumes
81distributed in a non-uniform way), it may be necessary to adopt manual tuning
82for helping the optimisation process in dealing with the most critical areas.
83By setting the verbosity to <emphasis>2</emphasis> through the following UI
84run-time command:
85<informalexample>
86<programlisting>
87    /run/verbose 2
88</programlisting>
89</informalexample>
90a statistics of the memory consumed for the allocated optimisation nodes
91will be displayed volume by volume, allowing to easily identify the critical
92areas which may eventually require manual intervention.
93</para>
94
95<para>
96The logical volume provides a way to estimate the <emphasis>mass</emphasis> of
97a tree of volumes defining a detector or sub-detector. This can be
98achieved by calling the method:
99
100<informalexample>
101<programlisting>
102    G4double GetMass(G4bool forced=false)
103</programlisting>
104</informalexample>
105</para>
106
107<para>
108The mass of the logical volume tree is computed from the estimated
109geometrical volume of each solid and material associated with the
110logical volume and its daughters. Note that this computation may
111require a considerable amount of time, depending on the complexity
112of the geometry tree. The returned value is cached by default and
113can be used for successive calls, unless recomputation is forced by
114providing <literal>true</literal> for the boolean argument
115<literal>forced</literal> in input.
116Computation should be forced if the geometry setup has
117changed after the previous call.
118</para>
119
120<para>
121Finally, the Logical Volume manages the information relative to
122the Envelopes hierarchy required for fast Monte Carlo
123parameterisations (<xref linkend="sect.PhysProc.Param" />).
124</para>
125
126
127<!-- ******************* Section (Level#3) ****************** -->
128<sect3 id="sect.Geom.LogVol.SubReg">
129<title>
130Sub-detector Regions
131</title>
132
133<para>
134In complex geometry setups, such as those found in large detectors
135in particle physics experiments, it is useful to think of specific
136Logical Volumes as representing parts (sub-detectors) of the entire
137detector setup which perform specific functions. In such setups,
138the processing speed of a real simulation can be increased by
139assigning specific production <emphasis>cuts</emphasis> to each of these detector
140parts. This allows a more detailed simulation to occur only in
141those regions where it is required.
142</para>
143
144<para>
145The concept of detector <emphasis>Region</emphasis> was introduced to address
146this need. Once the final geometry setup of the detector has been
147defined, a region can be specified by constructing it with:
148
149<informalexample>
150<programlisting>
151    G4Region( const G4String&amp; rName )
152</programlisting>
153</informalexample>
154
155where:
156
157<informaltable>
158<tgroup cols="2">
159  <tbody>
160  <row>
161    <entry>
162      <literal>rName</literal>
163    </entry>
164    <entry>
165      String identifier for the detector region
166    </entry>
167  </row>
168  </tbody>
169</tgroup>
170</informaltable>
171</para>
172
173<para>
174A <literal>G4Region</literal> must then be assigned to a logical volume,
175in order to make it a <emphasis>Root Logical Volume</emphasis>:
176
177<informalexample>
178<programlisting>
179    G4Region* emCalorimeter = new G4Region("EM-Calorimeter");
180    emCalorimeter-&gt;AddRootLogicalVolume(emCalorimeter);
181</programlisting>
182</informalexample>
183</para>
184
185<para>
186A root logical volume is the first volume at the top of the
187hierarchy to which a given region is assigned. Once the region is
188assigned to the root logical volume, the information is
189automatically propagated to the volume tree, so that each daughter
190volume shares the same region. Propagation on a tree branch will be
191interrupted if an already existing root logical volume is
192encountered.
193</para>
194
195<para>
196A specific <emphasis>Production Cut</emphasis> can be assigned to the region,
197by defining and assigning to it a <literal>G4ProductionCut</literal>
198object
199
200<informalexample>
201<programlisting>
202    emCalorimeter-&gt;SetProductionCuts(emCalCuts);
203</programlisting>
204</informalexample>
205</para>
206
207<para>
208<xref linkend="sect.ProThres.Set" /> describes how to define a
209production cut. The same region can be assigned to more than one
210root logical volume, and root logical volumes can be removed from
211an existing region. A logical volume can have only
212<emphasis>one</emphasis> region assigned to it. Regions will
213be automatically registered in a store which will take care of
214destroying them at the end of the job. A default region with a
215default production cut is automatically created and assigned to the
216world volume.
217</para>
218
219
220</sect3>
221</sect2>
Note: See TracBrowser for help on using the repository browser.