| 1 | <html>
|
|---|
| 2 | <head>
|
|---|
| 3 | <title>ADG: Geometry</title>
|
|---|
| 4 | </head>
|
|---|
| 5 |
|
|---|
| 6 | <!-- Changed by: Gabriele Cosmo, 18-Apr-2005 -->
|
|---|
| 7 | <!-- $Id: geomTouch.html,v 1.2 2006/06/09 13:55:26 gcosmo Exp $ -->
|
|---|
| 8 | <!-- $Name: $ -->
|
|---|
| 9 | <body>
|
|---|
| 10 | <table WIDTH="100%"><TR>
|
|---|
| 11 | <td>
|
|---|
| 12 | <a href="../../../../Overview/html/index.html">
|
|---|
| 13 | <IMG SRC="../../../../resources/html/IconsGIF/Overview.gif" ALT="Overview"></a>
|
|---|
| 14 | <a href="geometry.html">
|
|---|
| 15 | <IMG SRC="../../../../resources/html/IconsGIF/Contents.gif" ALT="Contents"></a>
|
|---|
| 16 | <a href="geomPhysical.html">
|
|---|
| 17 | <IMG SRC="../../../../resources/html/IconsGIF/Previous.gif" ALT="Previous"></a>
|
|---|
| 18 | <a href="geomAssembly.html">
|
|---|
| 19 | <IMG SRC="../../../../resources/html/IconsGIF/Next.gif" ALT="Next"></a>
|
|---|
| 20 | </td>
|
|---|
| 21 | <td ALIGN="Right">
|
|---|
| 22 | <font SIZE="-1" COLOR="#238E23">
|
|---|
| 23 | <b>Geant4 User's Guide</b>
|
|---|
| 24 | <br>
|
|---|
| 25 | <b>For Application Developers</b>
|
|---|
| 26 | <br>
|
|---|
| 27 | <b>Geometry</b>
|
|---|
| 28 | </font>
|
|---|
| 29 | </td>
|
|---|
| 30 | </tr></table>
|
|---|
| 31 | <br><br>
|
|---|
| 32 |
|
|---|
| 33 | <a name="4.1.5">
|
|---|
| 34 | <h2>4.1.5 Touchables: Uniquely Identifying a Volume</h2></a>
|
|---|
| 35 |
|
|---|
| 36 | <b>Introduction to Touchables</b>
|
|---|
| 37 | <p>
|
|---|
| 38 | A <i>touchable</i> for a volume serves the purpose of providing a unique identification for
|
|---|
| 39 | a detector element. This can be useful for description of the geometry
|
|---|
| 40 | alternative to the one used by the Geant4 tracking system, such as a Sensitive
|
|---|
| 41 | Detectors based read-out geometry, or a parameterised geometry for fast
|
|---|
| 42 | Monte Carlo. In order to create a <i>touchable volume</i>, several techniques can be
|
|---|
| 43 | implemented: for example, in Geant4 touchables are implemented as solids
|
|---|
| 44 | associated to a transformation-matrix in the global reference system, or as a
|
|---|
| 45 | hierarchy of physical volumes up to the root of the geometrical tree.
|
|---|
| 46 | </p>
|
|---|
| 47 |
|
|---|
| 48 | <p>
|
|---|
| 49 | A touchable is a geometrical entity (volume or solid) which has a unique
|
|---|
| 50 | placement in a detector description. It is represented by an abstract base class
|
|---|
| 51 | which can be implemented in a variety of ways. Each way must provide the
|
|---|
| 52 | capabilities of obtaining the transformation and solid that is described by
|
|---|
| 53 | the touchable.
|
|---|
| 54 | </p>
|
|---|
| 55 |
|
|---|
| 56 | <br>
|
|---|
| 57 |
|
|---|
| 58 | <b>What can a Touchable do ?</b>
|
|---|
| 59 | <p>
|
|---|
| 60 | All <tt>G4VTouchable</tt> implementations must respond to the two following
|
|---|
| 61 | "requests", where in all cases, by <tt>depth</tt> it is meant the number of
|
|---|
| 62 | levels <i>up</i> in the tree to be considered (the default and current one
|
|---|
| 63 | is <tt>0</tt>):
|
|---|
| 64 | <P>
|
|---|
| 65 | <ol>
|
|---|
| 66 | <li><tt>GetTranslation(depth)</tt></li>
|
|---|
| 67 | <li><tt>GetRotation(depth)</tt></li>
|
|---|
| 68 | </ol>
|
|---|
| 69 | that return the components of the volume's transformation.
|
|---|
| 70 | <P>
|
|---|
| 71 | Additional capabilities are available from implementations with more
|
|---|
| 72 | information. These have a default implementation that causes an exception.
|
|---|
| 73 | <P>
|
|---|
| 74 | Several capabilities are available from touchables with physical volumes:
|
|---|
| 75 | <P>
|
|---|
| 76 | <ol start=3>
|
|---|
| 77 | <li><tt>GetSolid(depth)</tt> gives the solid associated to the touchable.
|
|---|
| 78 | <li><tt>GetVolume(depth)</tt> gives the physical volume.
|
|---|
| 79 | <li><tt>GetReplicaNumber(depth)</tt> or <tt>GetCopyNumber(depth)</tt> which
|
|---|
| 80 | return the copy number of the physical volume (replicated or not).
|
|---|
| 81 | </ol>
|
|---|
| 82 | <P>
|
|---|
| 83 | Touchables that store volume hierarchy (history) have the whole stack of
|
|---|
| 84 | parent volumes available. Thus it is possible to add a little more state
|
|---|
| 85 | in order to extend its functionality. We add a "pointer" to a level and a
|
|---|
| 86 | member function to move the level in this stack. Then
|
|---|
| 87 | calling the above member functions for another level the information for
|
|---|
| 88 | that level can be retrieved.
|
|---|
| 89 | <P>
|
|---|
| 90 | The top of the history tree is, by convention, the world volume.
|
|---|
| 91 | <P>
|
|---|
| 92 | <ol start=6>
|
|---|
| 93 | <li><tt>GetHistoryDepth()</tt> gives the depth of the history tree.
|
|---|
| 94 | <li><tt>MoveUpHistory(num)</tt> moves the current pointer inside the
|
|---|
| 95 | touchable to point <tt>num</tt> levels up the history tree. Thus, e.g., calling
|
|---|
| 96 | it with <tt>num=1</tt> will cause the internal pointer to move to the mother
|
|---|
| 97 | of the current volume.<br>
|
|---|
| 98 | WARNING: this function changes the state of the touchable and can cause
|
|---|
| 99 | errors in tracking if applied to Pre/Post step touchables.
|
|---|
| 100 | </ol>
|
|---|
| 101 | These methods are valid only for the <i>touchable-history</i> type, as
|
|---|
| 102 | specified also below.
|
|---|
| 103 | <P>
|
|---|
| 104 | An update method, with different arguments is available, so
|
|---|
| 105 | that the information in a touchable can be updated:
|
|---|
| 106 | <P>
|
|---|
| 107 | <ol start=8>
|
|---|
| 108 | <li><tt>UpdateYourself(vol, history)</tt> takes a physical volume pointer
|
|---|
| 109 | and can additionally take a <tt>NavigationHistory</tt> pointer.
|
|---|
| 110 | </ol>
|
|---|
| 111 | <P>
|
|---|
| 112 |
|
|---|
| 113 | <b>Touchable history holds stack of geometry data</b>
|
|---|
| 114 | <p>
|
|---|
| 115 | As shown in Sections <a href="geomLogical.html#4.1.3">4.1.3</a> and
|
|---|
| 116 | <a href="geomPhysical.html#4.1.4">4.1.4</a>, a logical volume represents
|
|---|
| 117 | unpositioned detector elements, and a physical volume can represent multiple
|
|---|
| 118 | detector elements. On the other hand, touchables provide a unique
|
|---|
| 119 | identification for a detector element. In particular, the Geant4
|
|---|
| 120 | transportation process and the tracking system exploit touchables as
|
|---|
| 121 | implemented in <tt>G4TouchableHistory</tt>. The touchable history is the
|
|---|
| 122 | minimal set of information required to specify the full genealogy of a
|
|---|
| 123 | given physical volume (up to the root of the geometrical tree). These
|
|---|
| 124 | touchable volumes are made available to the user at every step of the Geant4
|
|---|
| 125 | tracking in <tt>G4VUserSteppingAction</tt>.
|
|---|
| 126 | </p>
|
|---|
| 127 |
|
|---|
| 128 | <p>
|
|---|
| 129 | To create/access a <tt>G4TouchableHistory</tt> the user must message
|
|---|
| 130 | <tt>G4Navigator</tt> which provides the method <tt>CreateTouchableHistoryHandle()</tt>:
|
|---|
| 131 | <PRE>
|
|---|
| 132 | G4TouchableHistoryHandle CreateTouchableHistoryHandle() const;
|
|---|
| 133 | </PRE>
|
|---|
| 134 | this will return a handle to the touchable.
|
|---|
| 135 | <p>
|
|---|
| 136 | The methods that differentiate the touchable-history from other touchables
|
|---|
| 137 | (since they have meaning only for this type...), are:
|
|---|
| 138 | <pre>
|
|---|
| 139 | G4int GetHistoryDepth() const;
|
|---|
| 140 | G4int MoveUpHistory( G4int num_levels = 1 );
|
|---|
| 141 | </pre>
|
|---|
| 142 | </p>
|
|---|
| 143 |
|
|---|
| 144 | <p>
|
|---|
| 145 | The first method is used to find out how many levels deep in the
|
|---|
| 146 | geometry tree the current volume is. The second method asks the
|
|---|
| 147 | touchable to eliminate its deepest level.
|
|---|
| 148 | </p>
|
|---|
| 149 |
|
|---|
| 150 | <p>
|
|---|
| 151 | As mentioned above, <tt>MoveUpHistory(num)</tt> significantly modifies the
|
|---|
| 152 | state of a touchable.
|
|---|
| 153 | </p>
|
|---|
| 154 |
|
|---|
| 155 | <hr><a href="../../../../Authors/html/subjectsToAuthors.html">
|
|---|
| 156 | <i>About the authors</a></i> </P>
|
|---|
| 157 |
|
|---|
| 158 | </body>
|
|---|
| 159 | </html>
|
|---|