Warning, /geant4/examples/extended/geometry/transforms/README.md is written in an unsupported language. File is not indexed.
0001 \page Exampletransforms Example transforms
0002
0003 This example illustrates various ways to place a volume.
0004
0005 There are two G4PVPlacement constructors. One uses a direct rotation matrix,
0006 via G4Transform3D class. The other uses an inverse rotation matrix.
0007 The rotation matrices themselves, direct or inverse, can be explicitely computed
0008 by users, or built with various G4 build-in transformations methods,
0009 like axial rotations.
0010
0011 ## Geometry construction
0012
0013 Two G4Trd volumes (daughters) are placed within a G4Tubs (mother), in such a way
0014 that their z_axis are in the mother xy plane.
0015 To see the picture, run the example in interactive mode.
0016
0017 The various ways of placement are implemented in the DetectorConstruction class
0018 in the following private functions:
0019
0020 - DetectorConstruction::PlaceWithDirectMatrix() \n
0021 This method is using G4PVPlacement with G4Transform3D, which is constructed from a rotation matrix (G4RotationMatrix) and a translation vector (G4ThreeVector). The rotation and translation in this case represent the active transformation: the solid itself is moved by rotating and translating it to bring it into the system of coordinates of the mother volume.\n
0022 The rotation matrix is defined via the daughter frame axes with respect to the mother frame.\n\n
0023
0024 - DetectorConstruction::PlaceWithInverseMatrix() \n
0025 This method is using G4PVPlacement with a rotation matrix (G4RotationMatrix) and a translation vector (G4ThreeVector). The rotation Matrix represents the rotation of the reference frame of the considered volume relatively to its mother volume’s reference frame. The translation Vector represents the translation of the current volume in the reference frame of its mother volume. \n
0026 If compared to the previous construct, the transformation in this case is generated by specifying the same translation with respect to its mother volume and the inverse of the rotation matrix. \n
0027 The rotation matrix is defined again via the daughter frame axes with respect to the mother frame. \n\n
0028
0029 - DetectorConstruction::PlaceWithAxialRotations() \n
0030 This method is using G4PVPlacement with G4Transform3D again, but in difference from
0031 PlaceWithDirectMatrix(), the rotation matrix is defined via rotate[X,Y,Z]() member functions of G4RotationMatrix. \n\n
0032
0033 - DetectorConstruction::PlaceWithEulerAngles() \n
0034 This method is using G4PVPlacement with G4Transform3D again, but with the rotation matrix is defined via Euler angles. \n\n
0035
0036 - DetectorConstruction::PlaceWithReflections() \n
0037 In this method, in addition to two positions defined via "PlaceWithAxialRotations" method, two more positions including reflection symmetry are defined.
0038 When reflections are present in geometry, the placements have to be applied
0039 via G4ReflectionFactory::Place() method, where a G4Transform3D with reflection
0040 can be used.
0041
0042 These functions are then called from the DetectorConstruction::Construct() function.
0043 All methods define exactly same geometry except for the placement
0044 with reflection where trapezoids are placed with their symmetry axis
0045 in parallel with z-axis in order to make easier to check reflection
0046 visually.
0047
0048 The method of placement can be selected interactively via the command
0049 (see DetectorMessenger and transforms.in):
0050 ```
0051 /placement/setMethod method
0052 where method = WithDirectMatrix, WithInverseMatrix, WithAxialRotations,
0053 WithEulerAngles, WithReflections
0054 ```
0055
0056 ## Physics list
0057
0058 PhysicsList.cc defines only geantino and transportation process.
0059
0060 ## Primary generator
0061
0062 Default kinematic is a geantino, at coordinate origin.
0063 Can be changed with particleGun commands.
0064
0065 ## Physics
0066
0067 No physics; only transportation.
0068
0069 ## Visualisation
0070
0071 In interactive mode, visualization manager is set in the main().
0072 Initialisation of the drawing is done via the commands
0073 `/vis/..`` in the macro vis.mac.
0074
0075 ## How to start ?
0076
0077 - Execute transforms in 'interactive mode' with visualization
0078 ```
0079 % ./transforms
0080 ....
0081 Idle> ---> type your commands. For instance:
0082 Idle> /placement/setMethod WithInverseMatrix
0083 Idle> /control/execute vis.mac
0084 Idle> /tracking/verbose 1
0085 Idle> /run/beamOn 1
0086 Idle> exit
0087 ```
0088 or, simply
0089 ```
0090 Idle> /control/execute rotations.mac
0091 Idle> /control/execute reflections.mac
0092 ```
0093
0094 - Execute transforms in 'batch' mode from macro files
0095 ```
0096 % transforms transforms.in
0097 ```
0098