Import Geant4 11.0.0 source tree
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
|
||||
///\file "geometry/.README.txt"
|
||||
///\brief Examples geometry README page
|
||||
|
||||
/*! \page Examples_geometry Category "geometry"
|
||||
|
||||
This directory includes examples for the geometry setup.
|
||||
|
||||
\link Exampletransforms Transforms \endlink
|
||||
|
||||
This extended example demonstrates various ways of definition of
|
||||
3D transformations for placing volumes.
|
||||
|
||||
\link ExamplevecGeomNavigation vecGeomNavigation \endlink
|
||||
|
||||
This example demonstrates integration of the navigation elements of
|
||||
[VecGeom](https://gitlab.cern.ch/VecGeom/VecGeom), to investigate the
|
||||
performance benefits.
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
Geometry tools
|
||||
--------------
|
||||
|
||||
This directory includes examples for the geometry setup.
|
||||
|
||||
Transforms
|
||||
----------
|
||||
This extended example demonstrates various ways of definition of
|
||||
3D transformations for placing volumes.
|
||||
|
||||
vecGeomNavigation
|
||||
-----------------
|
||||
|
||||
This example demonstrates integration of the navigation elements of
|
||||
[VecGeom](https://gitlab.cern.ch/VecGeom/VecGeom), to investigate the
|
||||
performance benefits.
|
||||
@@ -0,0 +1,104 @@
|
||||
|
||||
///\file "geometry/transforms/.README.txt"
|
||||
///\brief Extended example Transforms README page
|
||||
|
||||
/*! \page Exampletransforms Example transforms
|
||||
|
||||
This example illustrates various ways to place a volume.
|
||||
|
||||
There are two G4PVPlacement constructors. One uses a direct rotation matrix,
|
||||
via G4Transform3D class. The other uses an inverse rotation matrix.
|
||||
The rotation matrices themselves, direct or inverse, can be explicitely computed
|
||||
by users, or built with various G4 build-in transformations methods,
|
||||
like axial rotations.
|
||||
|
||||
\section Transforms_s1 Geometry construction
|
||||
|
||||
Two G4Trd volumes (daughters) are placed within a G4Tubs (mother), in such a way
|
||||
that their z_axis are in the mother xy plane.
|
||||
To see the picture, run the example in interactive mode.
|
||||
|
||||
The various ways of placement are implemented in the DetectorConstruction class
|
||||
in the following private functions:
|
||||
|
||||
- \link DetectorConstruction::PlaceWithDirectMatrix() PlaceWithDirectMatrix() \endlink \n
|
||||
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
|
||||
The rotation matrix is defined via the daughter frame axes with respect to the mother frame.\n\n
|
||||
|
||||
- \link DetectorConstruction::PlaceWithInverseMatrix() PlaceWithInverseMatrix() \endlink \n
|
||||
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
|
||||
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
|
||||
The rotation matrix is defined again via the daughter frame axes with respect to the mother frame. \n\n
|
||||
|
||||
- \link DetectorConstruction::PlaceWithAxialRotations() PlaceWithAxialRotations() \endlink \n
|
||||
This method is using G4PVPlacement with G4Transform3D again, but in difference from
|
||||
PlaceWithDirectMatrix(), the rotation matrix is defined via rotate[X,Y,Z]() member functions of G4RotationMatrix. \n\n
|
||||
|
||||
- \link DetectorConstruction::PlaceWithEulerAngles() PlaceWithEulerAngles() \endlink \n
|
||||
This method is using G4PVPlacement with G4Transform3D again, but with the rotation matrix is defined via Euler angles. \n\n
|
||||
|
||||
- \link DetectorConstruction::PlaceWithReflections() PlaceWithReflections() \endlink \n
|
||||
In this method, in addition to two positions defined via "PlaceWithAxialRotations" method, two more positions including reflection symmetry are defined.
|
||||
When reflections are present in geometry, the placements have to be applied
|
||||
via G4ReflectionFactory::Place() method, where a G4Transform3D with reflection
|
||||
can be used.
|
||||
|
||||
These functions are then called from the Construct() function.
|
||||
All methods define exactly same geometry except for the placement
|
||||
with reflection where trapezoids are placed with their symmetry axis
|
||||
in parallel with z-axis in order to make easier to check reflection
|
||||
visually.
|
||||
|
||||
The method of placement can be selected interactively via the command
|
||||
(see DetectorMessenger and transforms.in):
|
||||
\verbatim
|
||||
/placement/setMethod method
|
||||
where method = WithDirectMatrix, WithInverseMatrix, WithAxialRotations,
|
||||
WithEulerAngles, WithReflections
|
||||
\endverbatim
|
||||
|
||||
\section Transforms_s2 Physics list
|
||||
|
||||
PhysicsList.cc defines only geantino and transportation process.
|
||||
|
||||
\section Transforms_s3 Primary generator
|
||||
|
||||
Default kinematic is a geantino, at coordinate origin.
|
||||
Can be changed with particleGun commands.
|
||||
|
||||
\section Transforms_s4 Physics
|
||||
|
||||
No physics; only transportation.
|
||||
|
||||
\section Transforms_s5 Visualisation
|
||||
|
||||
In interactive mode, visualization manager is set in the main().
|
||||
Initialisation of the drawing is done via the commands
|
||||
/vis/.. in the macro vis.mac : /control/execute vis.mac
|
||||
|
||||
\section Transforms_s6 How to start ?
|
||||
|
||||
- Execute transforms in 'interactive mode' with visualization
|
||||
\verbatim
|
||||
% transforms
|
||||
....
|
||||
Idle> ---> type your commands. For instance:
|
||||
Idle> /placement/setMethod WithInverseMatrix
|
||||
Idle> /control/execute vis.mac
|
||||
Idle> /tracking/verbose 1
|
||||
Idle> /run/beamOn 1
|
||||
Idle> exit
|
||||
\endverbatim
|
||||
or, simply
|
||||
\verbatim
|
||||
Idle> /control/execute rotations.mac
|
||||
Idle> /control/execute reflections.mac
|
||||
\endverbatim
|
||||
|
||||
- Execute transforms in 'batch' mode from macro files
|
||||
\verbatim
|
||||
% transforms transforms.in
|
||||
\endverbatim
|
||||
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
transforms
|
||||
----------
|
||||
|
||||
This example illustrates various ways to place a volume.
|
||||
There are two G4PVPlacement constructors. One uses a direct rotation matrix,
|
||||
via G4Transform3D class. The other uses an inverse rotation matrix.
|
||||
The rotation matrices themselves, direct or inverse, can be explicitely computed
|
||||
by users, or built with various G4 build-in transformations methods,
|
||||
like axial rotations.
|
||||
|
||||
1- Geometry construction
|
||||
---------------------
|
||||
Two G4Trd volumes (daughters) are placed within a G4Tubs (mother), in such a way
|
||||
that their z_axis are in the mother xy plane.
|
||||
To see the picture, run the example in interactive mode.
|
||||
|
||||
The various ways of placement are implemented in the DetectorConstruction class
|
||||
in the following private functions:
|
||||
|
||||
- PlaceWithDirectMatrix()
|
||||
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.
|
||||
The rotation matrix is defined via the daughter frame axes with respect to the mother frame.
|
||||
|
||||
- PlaceWithInverseMatrix()
|
||||
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.
|
||||
- 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.
|
||||
The rotation matrix is defined again via the daughter frame axes with respect to the mother frame.
|
||||
|
||||
- PlaceWithAxialRotations()
|
||||
This method is using G4PVPlacement with G4Transform3D again, but in difference from
|
||||
PlaceWithDirectMatrix(), the rotation matrix is defined via rotate[X,Y,Z]() member functions of G4RotationMatrix.
|
||||
|
||||
- PlaceWithEulerAngles()
|
||||
This method is using G4PVPlacement with G4Transform3D again, but with the rotation matrix is defined via Euler angles.
|
||||
|
||||
- PlaceWithReflections()
|
||||
In this method, in addition to two positions defined via "PlaceWithAxialRotations" method, two more positions including reflection symmetry are defined.
|
||||
When reflections are present in geometry, the placements have to be applied
|
||||
via G4ReflectionFactory::Place() method, where a G4Transform3D with reflection
|
||||
can be used.
|
||||
|
||||
These functions are then called from the Construct() function.
|
||||
All methods define exactly same geometry except for the placement
|
||||
with reflection where trapezoids are placed with their symmetry axis
|
||||
in parallel with z-axis in order to make easier to check reflection
|
||||
visually.
|
||||
|
||||
The method of placement can be selected interactively via the command
|
||||
(see DetectorMessenger):
|
||||
/placement/setMethod method (see transfoms.in)
|
||||
|
||||
|
||||
2- Physics list
|
||||
------------
|
||||
PhysicsList.cc defines only geantino and transportation process.
|
||||
|
||||
3- Primary generator
|
||||
-----------------
|
||||
Default kinematic is a geantino at coordinate origin.
|
||||
Can be changed with particleGun commands.
|
||||
|
||||
4- Physics
|
||||
-------
|
||||
No physics; only transportation.
|
||||
|
||||
5- Visualisation
|
||||
-------------
|
||||
In interactive mode, visualization manager is set in the main().
|
||||
Initialisation of the drawing is done via the commands
|
||||
/vis/.. in the macro vis.mac : /control/execute vis.mac
|
||||
|
||||
6- How to start ?
|
||||
--------------
|
||||
- execute transforms in 'interactive mode' with visualization
|
||||
% transforms
|
||||
....
|
||||
Idle> ---> type your commands. For example:
|
||||
Idle> /placement/setMethod WithInverseMatrix
|
||||
Idle> /control/execute vis.mac
|
||||
Idle> /tracking/verbose 1
|
||||
Idle> /run/beamOn 1
|
||||
Idle> exit
|
||||
or, simply
|
||||
Idle> /control/execute rotations.mac
|
||||
Idle> /control/execute reflections.mac
|
||||
|
||||
- execute transforms in 'batch' mode from macro files
|
||||
% transforms transforms.in
|
||||
@@ -0,0 +1,39 @@
|
||||
///\file "geometry/vecGeomNavigation/.README.txt"
|
||||
///\brief Extended example vecGeomNavigation README page
|
||||
|
||||
/*! \page ExamplevecGeomNavigation Example vecGeomNavigation
|
||||
|
||||
This example demonstrates integration of the navigation elements of
|
||||
[VecGeom](https://gitlab.cern.ch/VecGeom/VecGeom), to investigate the
|
||||
performance benefits.
|
||||
|
||||
This integration is in development. Supporting Placement volumes -- other
|
||||
volumes would be handled by existing Geant4 navigation.
|
||||
|
||||
The example loads a GDML file for the geometry, and can execute a batch
|
||||
file (first) or run interactive commands or both.
|
||||
|
||||
# Installation / Configuration
|
||||
|
||||
## Dependencies
|
||||
|
||||
In addition to Geant4, two projects: are required VecGeom and G4VecGeomNav.
|
||||
VecCore is also required, but can be found through VecGeom.
|
||||
|
||||
It is optionally possible to use Root in G4VecGeomNav to store voxel
|
||||
information for safety computation. These can require significant computation
|
||||
to calculate if at least one logical volume contains many daughter volume.
|
||||
|
||||
## Configuration
|
||||
|
||||
To configure you must set:
|
||||
|
||||
setenv CMAKE_PREFIX_PATH "${VECCORE_DIR}:${VECGEOM_DIR}"
|
||||
|
||||
or if you are using Vc from Root
|
||||
|
||||
setenv CMAKE_PREFIX_PATH "${ROOTSYS}:${VECGEOM_DIR}"
|
||||
|
||||
where VecGeom has also been built with the same installation of Vc from Root.
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
|
||||
This example demonstrates integration of the navigation elements of
|
||||
[VecGeom](https://gitlab.cern.ch/VecGeom/VecGeom), to investigate the
|
||||
performance benefits.
|
||||
|
||||
This integration is in development. Supporting Placement volumes -- other
|
||||
volumes would be handled by existing Geant4 navigation.
|
||||
|
||||
The example loads a GDML file for the geometry, and can execute a batch
|
||||
file (first) or run interactive commands or both.
|
||||
|
||||
# Installation / Configuration
|
||||
|
||||
## Dependencies
|
||||
|
||||
In addition to Geant4, two projects: are required VecGeom and G4VecGeomNav.
|
||||
VecCore is also required, but can be found through VecGeom.
|
||||
|
||||
It is optionally possible to use Root in G4VecGeomNav to store voxel
|
||||
information for safety computation. These can require significant computation
|
||||
to calculate if at least one logical volume contains many daughter volume.
|
||||
|
||||
## Configuration
|
||||
- To configure you must set:
|
||||
|
||||
setenv CMAKE_PREFIX_PATH "${VECCORE_DIR}:${VECGEOM_DIR}"
|
||||
|
||||
or if you are using Vc from Root
|
||||
setenv CMAKE_PREFIX_PATH "${ROOTSYS}:${VECGEOM_DIR}"
|
||||
where VecGeom has also been built with the same installation of Vc from Root.
|
||||
|
||||
Reference in New Issue
Block a user