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> |
---|
13 | Touchables: Uniquely Identifying a Volume |
---|
14 | </title> |
---|
15 | |
---|
16 | |
---|
17 | <!-- ******************* Section (Level#3) ****************** --> |
---|
18 | <sect3 id="sect.Geom.Touch.Intro"> |
---|
19 | <title> |
---|
20 | Introduction to Touchables |
---|
21 | </title> |
---|
22 | |
---|
23 | <para> |
---|
24 | A <emphasis>touchable</emphasis> for a volume serves the purpose of providing |
---|
25 | a unique identification for a detector element. This can be useful |
---|
26 | for description of the geometry alternative to the one used by the |
---|
27 | Geant4 tracking system, such as a Sensitive Detectors based |
---|
28 | read-out geometry, or a parameterised geometry for fast Monte |
---|
29 | Carlo. In order to create a <emphasis>touchable volume</emphasis>, several |
---|
30 | techniques can be implemented: for example, in Geant4 touchables |
---|
31 | are implemented as solids associated to a transformation-matrix in |
---|
32 | the global reference system, or as a hierarchy of physical volumes |
---|
33 | up to the root of the geometrical tree. |
---|
34 | </para> |
---|
35 | |
---|
36 | <para> |
---|
37 | A touchable is a geometrical entity (volume or solid) which has |
---|
38 | a unique placement in a detector description. It is represented by |
---|
39 | an abstract base class which can be implemented in a variety of |
---|
40 | ways. Each way must provide the capabilities of obtaining the |
---|
41 | transformation 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> |
---|
49 | What can a Touchable do? |
---|
50 | </title> |
---|
51 | |
---|
52 | <para> |
---|
53 | All <literal>G4VTouchable</literal> implementations must respond to the |
---|
54 | two following "requests", where in all cases, by <literal>depth</literal> it |
---|
55 | is meant the number of levels <emphasis>up</emphasis> in the tree to be |
---|
56 | considered (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 | |
---|
67 | that return the components of the volume's transformation. |
---|
68 | </para> |
---|
69 | |
---|
70 | <para> |
---|
71 | Additional capabilities are available from implementations with |
---|
72 | more information. These have a default implementation that causes |
---|
73 | an exception. |
---|
74 | </para> |
---|
75 | |
---|
76 | <para> |
---|
77 | Several capabilities are available from touchables with physical |
---|
78 | volumes: |
---|
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> |
---|
97 | Touchables that store volume hierarchy (history) have the whole |
---|
98 | stack of parent volumes available. Thus it is possible to add a |
---|
99 | little 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 |
---|
101 | this stack. Then calling the above member functions for another |
---|
102 | level the information for that level can be retrieved. |
---|
103 | </para> |
---|
104 | |
---|
105 | <para> |
---|
106 | The top of the history tree is, by convention, the world |
---|
107 | volume. |
---|
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> |
---|
131 | These methods are valid only for the <emphasis>touchable-history</emphasis> type, |
---|
132 | as specified also below. |
---|
133 | </para> |
---|
134 | |
---|
135 | <para> |
---|
136 | An update method, with different arguments is available, so that |
---|
137 | the 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> |
---|
153 | Touchable history holds stack of geometry data |
---|
154 | </title> |
---|
155 | |
---|
156 | <para> |
---|
157 | As shown in Sections |
---|
158 | <xref linkend="sect.Geom.LogVol" /> and <xref linkend="sect.Geom.PhysVol" />, |
---|
159 | a logical volume represents unpositioned detector elements, and a physical |
---|
160 | volume can represent multiple detector elements. On the other hand, |
---|
161 | touchables provide a unique identification for a detector element. |
---|
162 | In particular, the Geant4 transportation process and the tracking |
---|
163 | system exploit touchables as implemented in |
---|
164 | <literal>G4TouchableHistory</literal>. The touchable history is the minimal |
---|
165 | set of information required to specify the full genealogy of a |
---|
166 | given physical volume (up to the root of the geometrical tree). |
---|
167 | These touchable volumes are made available to the user at every |
---|
168 | step of the Geant4 tracking in <literal>G4VUserSteppingAction</literal>. |
---|
169 | </para> |
---|
170 | |
---|
171 | <para> |
---|
172 | To create/access a <literal>G4TouchableHistory</literal> the user must |
---|
173 | message <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 | |
---|
182 | this will return a handle to the touchable. |
---|
183 | </para> |
---|
184 | |
---|
185 | <para> |
---|
186 | The methods that differentiate the touchable-history from other |
---|
187 | touchables (since they have meaning only for this type...), |
---|
188 | are: |
---|
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> |
---|
199 | The first method is used to find out how many levels deep in the |
---|
200 | geometry tree the current volume is. The second method asks the |
---|
201 | touchable to eliminate its deepest level. |
---|
202 | </para> |
---|
203 | |
---|
204 | <para> |
---|
205 | As mentioned above, <literal>MoveUpHistory(num)</literal> significantly |
---|
206 | modifies the state of a touchable. |
---|
207 | </para> |
---|
208 | |
---|
209 | |
---|
210 | </sect3> |
---|
211 | </sect2> |
---|