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

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

ajout de la doc

File size: 6.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.Touch">
12<title>
13Touchables: Uniquely Identifying a Volume
14</title>
15
16
17<!-- ******************* Section (Level#3) ****************** -->
18<sect3 id="sect.Geom.Touch.Intro">
19<title>
20Introduction to Touchables
21</title>
22
23<para>
24A <emphasis>touchable</emphasis> for a volume serves the purpose of providing
25a unique identification for a detector element. This can be useful
26for description of the geometry alternative to the one used by the
27Geant4 tracking system, such as a Sensitive Detectors based
28read-out geometry, or a parameterised geometry for fast Monte
29Carlo. In order to create a <emphasis>touchable volume</emphasis>, several
30techniques can be implemented: for example, in Geant4 touchables
31are implemented as solids associated to a transformation-matrix in
32the global reference system, or as a hierarchy of physical volumes
33up to the root of the geometrical tree.
34</para>
35
36<para>
37A touchable is a geometrical entity (volume or solid) which has
38a unique placement in a detector description. It is represented by
39an abstract base class which can be implemented in a variety of
40ways. Each way must provide the capabilities of obtaining the
41transformation and solid that is described by the touchable.
42</para>
43
44</sect3>
45
46<!-- ******************* Section (Level#3) ****************** -->
47<sect3 id="sect.Geom.Touch.WhatCan">
48<title>
49What can a Touchable do?
50</title>
51
52<para>
53All <literal>G4VTouchable</literal> implementations must respond to the
54two following "requests", where in all cases, by <literal>depth</literal> it
55is meant the number of levels <emphasis>up</emphasis> in the tree to be
56considered (the default and current one is <literal>0</literal>):
57
58<orderedlist spacing="compact">
59  <listitem><para>
60    <literal>GetTranslation(depth)</literal>
61  </para></listitem>
62  <listitem><para>
63    <literal>GetRotation(depth)</literal>
64  </para></listitem>
65</orderedlist>
66
67that return the components of the volume's transformation.
68</para>
69
70<para>
71Additional capabilities are available from implementations with
72more information. These have a default implementation that causes
73an exception.
74</para>
75
76<para>
77Several capabilities are available from touchables with physical
78volumes:
79
80<orderedlist continuation="continues" >
81  <listitem><para>
82    <literal>GetSolid(depth)</literal> gives the solid associated to the
83    touchable.
84  </para></listitem>
85  <listitem><para>
86    <literal>GetVolume(depth)</literal> gives the physical volume.
87  </para></listitem>
88  <listitem><para>
89    <literal>GetReplicaNumber(depth)</literal> or
90    <literal>GetCopyNumber(depth)</literal> which return the copy number of the
91    physical volume (replicated or not).
92  </para></listitem>
93</orderedlist>
94</para>
95
96<para>
97Touchables that store volume hierarchy (history) have the whole
98stack of parent volumes available. Thus it is possible to add a
99little more state in order to extend its functionality. We add a
100"pointer" to a level and a member function to move the level in
101this stack. Then calling the above member functions for another
102level the information for that level can be retrieved.
103</para>
104
105<para>
106The top of the history tree is, by convention, the world
107volume.
108
109<orderedlist continuation="continues" >
110  <listitem><para>
111    <literal>GetHistoryDepth()</literal> gives the depth of the history
112    tree.
113  </para></listitem>
114  <listitem><para>
115    <para>
116    <literal>MoveUpHistory(num)</literal> moves the current pointer inside
117    the touchable to point <literal>num</literal> levels up the history tree.
118    Thus, e.g., calling it with <literal>num=1</literal> will cause the internal
119    pointer to move to the mother of the current volume.
120    </para>
121    <para>
122    WARNING: this function changes the state of the touchable and can
123    cause errors in tracking if applied to Pre/Post step
124    touchables.
125    </para>
126  </para></listitem>
127</orderedlist>
128</para>
129
130<para>
131These methods are valid only for the <emphasis>touchable-history</emphasis> type,
132as specified also below.
133</para>
134
135<para>
136An update method, with different arguments is available, so that
137the information in a touchable can be updated:
138
139<orderedlist continuation="continues" >
140  <listitem><para>
141    <literal>UpdateYourself(vol, history)</literal> takes a physical volume
142    pointer and can additionally take a <literal>NavigationHistory</literal>
143    pointer.
144  </para></listitem>
145</orderedlist>
146</para>
147
148</sect3>
149
150<!-- ******************* Section (Level#3) ****************** -->
151<sect3 id="sect.Geom.Touch.History">
152<title>
153Touchable history holds stack of geometry data
154</title>
155
156<para>
157As shown in Sections
158<xref linkend="sect.Geom.LogVol" /> and <xref linkend="sect.Geom.PhysVol" />,
159a logical volume represents unpositioned detector elements, and a physical
160volume can represent multiple detector elements. On the other hand,
161touchables provide a unique identification for a detector element.
162In particular, the Geant4 transportation process and the tracking
163system exploit touchables as implemented in
164<literal>G4TouchableHistory</literal>. The touchable history is the minimal
165set of information required to specify the full genealogy of a
166given physical volume (up to the root of the geometrical tree).
167These touchable volumes are made available to the user at every
168step of the Geant4 tracking in <literal>G4VUserSteppingAction</literal>.
169</para>
170
171<para>
172To create/access a <literal>G4TouchableHistory</literal> the user must
173message <literal>G4Navigator</literal> which provides the method
174<literal>CreateTouchableHistoryHandle()</literal>:
175
176<informalexample>
177<programlisting>
178  G4TouchableHistoryHandle CreateTouchableHistoryHandle() const;
179</programlisting>
180</informalexample>
181
182this will return a handle to the touchable.
183</para>
184
185<para>
186The methods that differentiate the touchable-history from other
187touchables (since they have meaning only for this type...),
188are:
189
190<informalexample>
191<programlisting>
192  G4int GetHistoryDepth()  const;
193  G4int MoveUpHistory( G4int num_levels = 1 );
194</programlisting>
195</informalexample>
196</para>
197
198<para>
199The first method is used to find out how many levels deep in the
200geometry tree the current volume is. The second method asks the
201touchable to eliminate its deepest level.
202</para>
203
204<para>
205As mentioned above, <literal>MoveUpHistory(num)</literal> significantly
206modifies the state of a touchable.
207</para>
208
209
210</sect3>
211</sect2>
Note: See TracBrowser for help on using the repository browser.