Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4AssemblyTriplet.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4AssemblyTriplet
27//
28// Class description:
29//
30// A class to help place logical or assembly volumes inside a generic
31// container (like STL vector) together with information about its rotation,
32// placement and eventually reflection.
33// How to interpret the rotation and translation depends on the class which
34// uses a container of these triplets. The first class using G4AssemblyTriplet
35// is G4AssemblyVolume.
36// The pointer to the logical or assembly volume is copied so this class
37// does not take its ownership and does not delete the object behind.
38
39// Author: Radovan Chytracek (CERN), November 2000
40// ----------------------------------------------------------------------
41#ifndef G4_ASSEMBLYTRIPLET_HH
42#define G4_ASSEMBLYTRIPLET_HH
43
44#include "G4ThreeVector.hh"
45#include "G4RotationMatrix.hh"
46
47class G4LogicalVolume;
49
50/**
51 * @brief G4AssemblyTriplet is a helper class for placing logical or assembly
52 * volumes inside a generic container together with information about its
53 * rotation, placement and eventually reflection.
54 * How to interpret the rotation and translation depends on the class which
55 * uses a container of these triplets. The first class using G4AssemblyTriplet
56 * is G4AssemblyVolume.
57 * The pointer to the logical or assembly volume is copied so this class
58 * does not take its ownership and does not delete the object behind.
59 */
60
62{
63 public:
64
65 /**
66 Default constructor.
67 */
69
70 /**
71 * An explicit constructor for a logical volume.
72 * @param[in] pVolume Pointer to the logical volume.
73 * @param[in] translation Translation vector.
74 * @param[in] pRotation Pointer to the rotation matrix.
75 * @param[in] isReflection Flag to specify if volume is reflected.
76 */
78 G4ThreeVector& translation,
79 G4RotationMatrix* pRotation,
80 G4bool isReflection = false );
81
82 /**
83 * An explicit constructor for an assembly volume.
84 * @param[in] pAssembly Pointer to the assembly volume.
85 * @param[in] translation Translation vector.
86 * @param[in] pRotation Pointer to the rotation matrix.
87 * @param[in] isReflection Flag to specify if volume is reflected.
88 */
90 G4ThreeVector& translation,
91 G4RotationMatrix* pRotation,
92 G4bool isReflection = false );
93
94 /**
95 Copy constructor.
96 */
98
99 /**
100 Destructor.
101 */
103
104 /**
105 Assignment operator.
106 */
108
109 /**
110 Retrieves the logical volume reference.
111 */
112 inline G4LogicalVolume* GetVolume() const;
113
114 /**
115 Updates the logical volume reference.
116 */
117 inline void SetVolume( G4LogicalVolume* pVolume );
118
119 /**
120 Retrieves the assembly volume reference.
121 */
123
124 /**
125 Updates the assembly volume reference.
126 */
127 inline void SetAssembly( G4AssemblyVolume* pAssembly );
128
129 /**
130 Retrieves the logical volume translation.
131 */
133
134 /**
135 Updates the logical volume translation.
136 */
137 inline void SetTranslation( G4ThreeVector& pVolume );
138
139 /**
140 Retrieves the logical volume rotation.
141 */
143
144 /**
145 Updates the logical volume rotation.
146 */
147 inline void SetRotation( G4RotationMatrix* pVolume );
148
149 /**
150 Returns true if the logical or assembly volume has reflection.
151 */
152 inline G4bool IsReflection() const;
153
154 private:
155
156 /** A logical volume. */
157 G4LogicalVolume* fVolume = nullptr;
158
159 /** A logical volume translation. */
160 G4ThreeVector fTranslation;
161
162 /** A logical volume rotation. */
163 G4RotationMatrix* fRotation = nullptr;
164
165 // Member data for handling assemblies of assemblies and reflections
166
167 /** An assembly volume. */
168 G4AssemblyVolume* fAssembly = nullptr;
169
170 /** True if the logical or assembly volume has reflection. */
171 G4bool fIsReflection = false;
172};
173
174#include "G4AssemblyTriplet.icc"
175
176#endif
CLHEP::HepRotation G4RotationMatrix
CLHEP::Hep3Vector G4ThreeVector
bool G4bool
Definition G4Types.hh:86
void SetTranslation(G4ThreeVector &pVolume)
G4AssemblyTriplet(const G4AssemblyTriplet &second)
void SetVolume(G4LogicalVolume *pVolume)
G4AssemblyTriplet(G4AssemblyVolume *pAssembly, G4ThreeVector &translation, G4RotationMatrix *pRotation, G4bool isReflection=false)
G4LogicalVolume * GetVolume() const
G4AssemblyVolume * GetAssembly() const
void SetRotation(G4RotationMatrix *pVolume)
G4AssemblyTriplet & operator=(const G4AssemblyTriplet &second)
G4bool IsReflection() const
G4ThreeVector GetTranslation() const
G4AssemblyTriplet(G4LogicalVolume *pVolume, G4ThreeVector &translation, G4RotationMatrix *pRotation, G4bool isReflection=false)
G4RotationMatrix * GetRotation() const
void SetAssembly(G4AssemblyVolume *pAssembly)
G4AssemblyVolume is a helper class to make the build process of geometry easier. It allows one to com...
G4LogicalVolume represents a leaf node or unpositioned subtree in the geometry hierarchy....