ATLAS Offline Software
Loading...
Searching...
No Matches
Geo2G4AssemblyTriplet.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef GEO2G4_ASSEMBLYTRIPLET_H
6#define GEO2G4_ASSEMBLYTRIPLET_H
7
8#include "G4ThreeVector.hh"
9#include "G4RotationMatrix.hh"
10
11class G4LogicalVolume;
13
15{
16 public: // with description
17
19 // Default constructor
20
21 Geo2G4AssemblyTriplet( G4LogicalVolume* pVolume,
22 G4ThreeVector& translation,
23 G4RotationMatrix* pRotation,
24 G4bool isReflection = false);
25 // An explicit constructor for a logical volume
26
28 G4ThreeVector& translation,
29 G4RotationMatrix* pRotation,
30 G4bool isReflection = false);
31 // An explicit constructor for an assembly volume
32
33 Geo2G4AssemblyTriplet( const Geo2G4AssemblyTriplet& second ) = default;
34 // Copy constructor
35
37 // Destructor
38
40 // Assignment operator
41
42 const G4LogicalVolume* GetVolume() const { return m_volume; }
43 G4LogicalVolume* GetVolume() { return m_volume; }
44 // Retrieve the logical volume reference
45
46 void SetVolume( G4LogicalVolume* pVolume );
47 // Update the logical volume reference
48
49 const Geo2G4AssemblyVolume* GetAssembly() const { return m_assembly; }
51 // Retrieve the assembly volume reference
52
53 void SetAssembly( Geo2G4AssemblyVolume* pAssembly );
54 // Update the assembly volume reference
55
56 const G4ThreeVector GetTranslation() const { return m_translation; }
57 G4ThreeVector GetTranslation() { return m_translation; }
58 // Retrieve the logical volume translation
59
60 void SetTranslation( G4ThreeVector& pVolume );
61 // Update the logical volume translation
62
63 const G4RotationMatrix* GetRotation() const { return m_rotation; }
64 G4RotationMatrix* GetRotation() { return m_rotation; }
65 // Retrieve the logical volume rotation
66
67 void SetRotation( G4RotationMatrix* pVolume );
68 // Update the logical volume rotation
69
70 G4bool IsReflection() const;
71 // Return true if the logical or assembly volume has reflection
72
73 private:
74
75 G4LogicalVolume* m_volume;
76 // A logical volume
77
78 G4ThreeVector m_translation;
79 // A logical volume translation
80
81 G4RotationMatrix* m_rotation;
82 // A logical volume rotation
83
84 private:
85
86 // Member data for handling assemblies of assemblies and reflections
87
89 // An assembly volume
90
92 // True if the logical or assembly volume has reflection
93};
94
95inline
97 : m_volume( 0 ), m_rotation( 0 ), m_assembly(0), m_isReflection(false)
98{
99 G4ThreeVector v(0.,0.,0.);
100 m_translation = v;
101}
102
103inline
105 G4ThreeVector& translation,
106 G4RotationMatrix* pRotation,
107 G4bool isReflection )
108 : m_volume( pVolume ), m_translation( translation ), m_rotation( pRotation ),
109 m_assembly( 0 ), m_isReflection(isReflection)
110{
111}
112
113inline
115 G4ThreeVector& translation,
116 G4RotationMatrix* pRotation,
117 G4bool isReflection )
118 : m_volume( 0 ), m_translation( translation ), m_rotation( pRotation ),
119 m_assembly( pAssembly ), m_isReflection(isReflection)
120{
121}
122
123inline
127
128inline
129void Geo2G4AssemblyTriplet::SetVolume( G4LogicalVolume* pVolume )
130{
131 if ( m_assembly )
132 {
133 G4Exception("Geo2G4AssemblyTriplet::SetVolume()",
134 "IllegalCall", JustWarning,
135 "There is an assembly already set, it will be ignored.");
136 }
137 m_volume = pVolume;
138 m_assembly = 0;
139}
140
141inline
143{
144 if ( m_volume )
145 {
146 G4Exception("Geo2G4AssemblyTriplet::SetAssembly()",
147 "IllegalCall", JustWarning,
148 "There is a volume already set, it will be ignored.");
149 }
150 m_assembly = pAssembly;
151 m_volume = 0;
152}
153
154inline
155void Geo2G4AssemblyTriplet::SetTranslation( G4ThreeVector& translation )
156{
157 m_translation = translation;
158}
159
160inline
161void Geo2G4AssemblyTriplet::SetRotation( G4RotationMatrix* pRotation )
162{
163 m_rotation = pRotation;
164}
165
166inline
168{
169 return m_isReflection;
170}
171
172#endif
const Geo2G4AssemblyVolume * GetAssembly() const
const G4LogicalVolume * GetVolume() const
void SetTranslation(G4ThreeVector &pVolume)
Geo2G4AssemblyVolume * GetAssembly()
void SetRotation(G4RotationMatrix *pVolume)
Geo2G4AssemblyVolume * m_assembly
const G4RotationMatrix * GetRotation() const
void SetVolume(G4LogicalVolume *pVolume)
Geo2G4AssemblyTriplet(const Geo2G4AssemblyTriplet &second)=default
Geo2G4AssemblyTriplet & operator=(const Geo2G4AssemblyTriplet &second)=default
G4RotationMatrix * GetRotation()
G4RotationMatrix * m_rotation
G4LogicalVolume * GetVolume()
const G4ThreeVector GetTranslation() const
void SetAssembly(Geo2G4AssemblyVolume *pAssembly)