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