12.07.2015 Views

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Detector Definition and Responsehave a starting angle of 20 degrees (as <strong>for</strong> the mother) and a phi extension of 30 degrees. They are rotatedaround the Z axis by 60 and 30 degrees, so that the first copy will extend from 80 to 110 and the last from170 to 200 degrees.• divPconeZN is a division of the same polycone along its Z axis. As the mother polycone has two sections, itwill be divided in two one-section polycones, the first one extending from -1 to -0.25 meters, the second from-0.25 to 1 meters. Although specified, the offset will not be used.4.1.5. Touchables: Uniquely Identifying a Volume4.1.5.1. Introduction to TouchablesA touchable <strong>for</strong> a volume serves the purpose of providing a unique identification <strong>for</strong> a detector element. This canbe useful <strong>for</strong> description of the geometry alternative to the one used by the <strong>Geant4</strong> tracking system, such as aSensitive Detectors based read-out geometry, or a parameterised geometry <strong>for</strong> fast Monte Carlo. In order to createa touchable volume, several techniques can be implemented: <strong>for</strong> example, in <strong>Geant4</strong> touchables are implementedas solids associated to a trans<strong>for</strong>mation-matrix in the global reference system, or as a hierarchy of physical volumesup to the root of the geometrical tree.A touchable is a geometrical entity (volume or solid) which has a unique placement in a detector description. It isrepresented by an abstract base class which can be implemented in a variety of ways. Each way must provide thecapabilities of obtaining the trans<strong>for</strong>mation and solid that is described by the touchable.4.1.5.2. What can a Touchable do?All G4VTouchable implementations must respond to the two following "requests", where in all cases, by depthit is meant the number of levels up in the tree to be considered (the default and current one is 0):1. GetTranslation(depth)2. GetRotation(depth)that return the components of the volume's trans<strong>for</strong>mation.Additional capabilities are available from implementations with more in<strong>for</strong>mation. These have a default implementationthat causes an exception.Several capabilities are available from touchables with physical volumes:3. GetSolid(depth) gives the solid associated to the touchable.4. GetVolume(depth) gives the physical volume.5. GetReplicaNumber(depth) or GetCopyNumber(depth) which return the copy number of the physicalvolume (replicated or not).Touchables that store volume hierarchy (history) have the whole stack of parent volumes available. Thus it ispossible to add a little more state in order to extend its functionality. We add a "pointer" to a level and a memberfunction to move the level in this stack. Then calling the above member functions <strong>for</strong> another level the in<strong>for</strong>mation<strong>for</strong> that level can be retrieved.The top of the history tree is, by convention, the world volume.6. GetHistoryDepth() gives the depth of the history tree.7. MoveUpHistory(num) moves the current pointer inside the touchable to point num levels up the historytree. Thus, e.g., calling it with num=1 will cause the internal pointer to move to the mother of the currentvolume.WARNING: this function changes the state of the touchable and can cause errors in tracking if applied to Pre/Post step touchables.94

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!