|
Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
|
G4AssemblyVolume is a helper class to make the build process of geometry easier. It allows one to combine several volumes together in an arbitrary way in 3D space and then work with the result as with a single logical volume for placement. The resulting objects are independent copies of each of the assembled logical volumes. The placements are not, however, bound one to each other when placement is done. They are seen as independent physical volumes in space. More...
#include <G4AssemblyVolume.hh>
Public Member Functions | |
| G4AssemblyVolume () | |
| G4AssemblyVolume (G4LogicalVolume *volume, G4ThreeVector &translation, G4RotationMatrix *rotation) | |
| ~G4AssemblyVolume () | |
| void | AddPlacedVolume (G4LogicalVolume *pPlacedVolume, G4ThreeVector &translation, G4RotationMatrix *rotation) |
| void | AddPlacedVolume (G4LogicalVolume *pPlacedVolume, G4Transform3D &transformation) |
| void | AddPlacedAssembly (G4AssemblyVolume *pAssembly, G4Transform3D &transformation) |
| void | AddPlacedAssembly (G4AssemblyVolume *pAssembly, G4ThreeVector &translation, G4RotationMatrix *rotation) |
| void | MakeImprint (G4LogicalVolume *pMotherLV, G4ThreeVector &translationInMother, G4RotationMatrix *pRotationInMother, G4int copyNumBase=0, G4bool surfCheck=false) |
| void | MakeImprint (G4LogicalVolume *pMotherLV, G4Transform3D &transformation, G4int copyNumBase=0, G4bool surfCheck=false) |
| std::vector< G4VPhysicalVolume * >::iterator | GetVolumesIterator () |
| std::size_t | TotalImprintedVolumes () const |
| G4Transform3D & | GetImprintTransformation (unsigned int imprintID) |
| std::vector< G4AssemblyTriplet >::iterator | GetTripletsIterator () |
| std::size_t | TotalTriplets () const |
| unsigned int | GetImprintsCount () const |
| unsigned int | GetInstanceCount () const |
| unsigned int | GetAssemblyID () const |
Protected Member Functions | |
| void | SetInstanceCount (unsigned int value) |
| void | SetAssemblyID (unsigned int value) |
| void | InstanceCountPlus () |
| void | InstanceCountMinus () |
| void | SetImprintsCount (unsigned int value) |
| void | ImprintsCountPlus () |
| void | ImprintsCountMinus () |
G4AssemblyVolume is a helper class to make the build process of geometry easier. It allows one to combine several volumes together in an arbitrary way in 3D space and then work with the result as with a single logical volume for placement. The resulting objects are independent copies of each of the assembled logical volumes. The placements are not, however, bound one to each other when placement is done. They are seen as independent physical volumes in space.
Definition at line 62 of file G4AssemblyVolume.hh.
| G4AssemblyVolume::G4AssemblyVolume | ( | ) |
Default Constructor.
Definition at line 47 of file G4AssemblyVolume.cc.
Referenced by AddPlacedAssembly(), AddPlacedAssembly(), and ImprintsCountMinus().
| G4AssemblyVolume::G4AssemblyVolume | ( | G4LogicalVolume * | volume, |
| G4ThreeVector & | translation, | ||
| G4RotationMatrix * | rotation ) |
Constructor. The rotation matrix passed as argument can be nullptr (identity) or an address even of an object on the upper stack frame. During assembly imprint, a new matrix is created anyway and it is kept track of it so it can be automatically deleted later at the end of the application. This policy is adopted since user has no control on the way the rotations are combined.
| [in] | volume | Pointer to the logical volume of the assembly. |
| [in] | translation | Translation vector of the assembly. |
| [in] | rotation | Pointer to the rotation matrix of the assembly. |
Definition at line 71 of file G4AssemblyVolume.cc.
| G4AssemblyVolume::~G4AssemblyVolume | ( | ) |
Destructor. At destruction all the generated physical volumes and associated rotation matrices of the imprints will be destroyed.
Definition at line 98 of file G4AssemblyVolume.cc.
| void G4AssemblyVolume::AddPlacedAssembly | ( | G4AssemblyVolume * | pAssembly, |
| G4ThreeVector & | translation, | ||
| G4RotationMatrix * | rotation ) |
The same as previous method, but takes an assembly volume as its argument with translation and rotation.
| [in] | pAssembly | Pointer to the assembly volume to be added to the assembly. |
| [in] | translation | Translation vector of the volume. |
| [in] | rotation | Pointer to the rotation matrix of the volume. |
Definition at line 169 of file G4AssemblyVolume.cc.
| void G4AssemblyVolume::AddPlacedAssembly | ( | G4AssemblyVolume * | pAssembly, |
| G4Transform3D & | transformation ) |
The same as previous method, but takes an assembly volume as argument.
| [in] | pAssembly | Pointer to the assembly volume to be added to the assembly. |
| [in] | transformation | The 3D transformation in space. |
Definition at line 185 of file G4AssemblyVolume.cc.
Referenced by G4GDMLReadStructure::PhysvolRead().
| void G4AssemblyVolume::AddPlacedVolume | ( | G4LogicalVolume * | pPlacedVolume, |
| G4ThreeVector & | translation, | ||
| G4RotationMatrix * | rotation ) |
Places the given volume 'pPlacedVolume' inside the assembly.
The adopted approach:
The other possible approaches:
The rotation matrix passed as argument can be nullptr (identity) or an address even of an object on the upper stack frame. During assembly imprint, a new matrix is created anyway and it is kept track of it so it can be automatically deleted later at the end of the application. This policy is adopted since user has no control on the way the rotations are combined.
| [in] | pPlacedVolume | Pointer to the logical volume of the volume to be added to the assembly. |
| [in] | translation | Translation vector of the volume. |
| [in] | rotation | Pointer to the rotation matrix of the volume. |
Definition at line 130 of file G4AssemblyVolume.cc.
Referenced by G4AssemblyVolume(), and G4GDMLReadStructure::PhysvolRead().
| void G4AssemblyVolume::AddPlacedVolume | ( | G4LogicalVolume * | pPlacedVolume, |
| G4Transform3D & | transformation ) |
The same as previous method, except that it takes the complete 3D transformation in space as its argument.
| [in] | pPlacedVolume | Pointer to the logical volume of the volume to be added to the assembly. |
| [in] | transformation | The 3D transformation in space. |
Definition at line 145 of file G4AssemblyVolume.cc.
|
inline |
Returns the instance number of the assembly.
|
inline |
Returns the number of currently made imprints.
|
inline |
To access the 3D transformation in space for each imprint, given the ID.
Referenced by G4GDMLWriteStructure::TraverseVolumeTree().
| unsigned int G4AssemblyVolume::GetInstanceCount | ( | ) | const |
Returns the number of existing instances of G4AssemblyVolume class.
Definition at line 386 of file G4AssemblyVolume.cc.
Referenced by G4AssemblyVolume(), and G4AssemblyVolume().
|
inline |
To access the created triplets in the assembly through an iterator.
Referenced by G4GDMLWriteStructure::AssemblyWrite().
|
inline |
To access the physical volumes imprinted through an iterator.
|
inlineprotected |
|
inlineprotected |
|
protected |
Definition at line 404 of file G4AssemblyVolume.cc.
Referenced by ~G4AssemblyVolume().
|
protected |
Definition at line 398 of file G4AssemblyVolume.cc.
Referenced by G4AssemblyVolume(), and G4AssemblyVolume().
| void G4AssemblyVolume::MakeImprint | ( | G4LogicalVolume * | pMotherLV, |
| G4ThreeVector & | translationInMother, | ||
| G4RotationMatrix * | pRotationInMother, | ||
| G4int | copyNumBase = 0, | ||
| G4bool | surfCheck = false ) |
Creates instance of an assembly volume inside the given mother volume.
| [in] | pMotherLV | Pointer to the logical volume of the assembly. |
| [in] | translationInMother | Translation vector of the imprint. |
| [in] | pRotationInMother | Pointer to the rotation of the imprint. |
| [in] | copyNumBase | Optional index to assign to the imprint. |
| [in] | surfCheck | Flag to enable overlaps checking while imprinting. |
Definition at line 343 of file G4AssemblyVolume.cc.
Referenced by MakeImprint(), MakeImprint(), and G4GDMLReadStructure::PhysvolRead().
| void G4AssemblyVolume::MakeImprint | ( | G4LogicalVolume * | pMotherLV, |
| G4Transform3D & | transformation, | ||
| G4int | copyNumBase = 0, | ||
| G4bool | surfCheck = false ) |
The same as previous Imprint() method, but takes a complete 3D transformation in space as its argument.
| [in] | pMotherLV | Pointer to the logical volume of the assembly. |
| [in] | transformation | The 3D transformation in space of the imprint. |
| [in] | copyNumBase | Optional index to assign to the imprint. |
| [in] | surfCheck | Flag to enable overlaps checking while imprinting. |
Definition at line 371 of file G4AssemblyVolume.cc.
|
inlineprotected |
Referenced by G4AssemblyVolume(), and G4AssemblyVolume().
|
inlineprotected |
Referenced by G4AssemblyVolume(), and G4AssemblyVolume().
|
inlineprotected |
Definition at line 392 of file G4AssemblyVolume.cc.
|
inline |
Returns the total number of imprinted volumes of the assembly.
|
inline |
Returns the total number of triplets in the assembly.
Referenced by G4GDMLWriteStructure::AssemblyWrite().