Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4AssemblyVolume Class Reference

#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 ()
 
unsigned int TotalImprintedVolumes () 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 ()
 

Detailed Description

Definition at line 60 of file G4AssemblyVolume.hh.

Constructor & Destructor Documentation

◆ G4AssemblyVolume() [1/2]

G4AssemblyVolume::G4AssemblyVolume ( )

Definition at line 48 of file G4AssemblyVolume.cc.

49 : fAssemblyID( 0 )
50{
54}
void SetAssemblyID(unsigned int value)
void SetImprintsCount(unsigned int value)
unsigned int GetInstanceCount() const

◆ G4AssemblyVolume() [2/2]

G4AssemblyVolume::G4AssemblyVolume ( G4LogicalVolume volume,
G4ThreeVector translation,
G4RotationMatrix rotation 
)

Definition at line 58 of file G4AssemblyVolume.cc.

61 : fAssemblyID( 0 )
62{
66 AddPlacedVolume(volume, translation, rotation);
67}
void AddPlacedVolume(G4LogicalVolume *pPlacedVolume, G4ThreeVector &translation, G4RotationMatrix *rotation)

◆ ~G4AssemblyVolume()

G4AssemblyVolume::~G4AssemblyVolume ( )

Definition at line 71 of file G4AssemblyVolume.cc.

72{
73 unsigned int howmany = fTriplets.size();
74 if( howmany != 0 )
75 {
76 for( unsigned int i = 0; i < howmany; i++ )
77 {
78 G4RotationMatrix* pRotToClean = fTriplets[i].GetRotation();
79 if( pRotToClean != 0 )
80 {
81 delete pRotToClean;
82 }
83 }
84 }
85 fTriplets.clear();
86
87 howmany = fPVStore.size();
88 if( howmany != 0 )
89 {
90 for( unsigned int j = 0; j < howmany; j++ )
91 {
92 delete fPVStore[j];
93 }
94 }
95 fPVStore.clear();
97}

Member Function Documentation

◆ AddPlacedAssembly() [1/2]

void G4AssemblyVolume::AddPlacedAssembly ( G4AssemblyVolume pAssembly,
G4ThreeVector translation,
G4RotationMatrix rotation 
)

Definition at line 146 of file G4AssemblyVolume.cc.

149{
150 G4RotationMatrix* toStore = new G4RotationMatrix;
151
152 if( pRotation != 0 ) { *toStore = *pRotation; }
153
154 G4AssemblyTriplet toAdd( pAssembly, translation, toStore );
155 fTriplets.push_back( toAdd );
156}
CLHEP::HepRotation G4RotationMatrix

◆ AddPlacedAssembly() [2/2]

void G4AssemblyVolume::AddPlacedAssembly ( G4AssemblyVolume pAssembly,
G4Transform3D transformation 
)

Definition at line 161 of file G4AssemblyVolume.cc.

163{
164 // Decompose transformation
165 //
166 G4Scale3D scale;
167 G4Rotate3D rotation;
168 G4Translate3D translation;
169 transformation.getDecomposition(scale, rotation, translation);
170
171 G4ThreeVector v = translation.getTranslation();
173 *r = rotation.getRotation();
174
175 G4bool isReflection = false;
176 if (scale(0,0)*scale(1,1)*scale(2,2) < 0.) { isReflection = true; }
177
178 G4AssemblyTriplet toAdd( pAssembly, v, r, isReflection );
179 fTriplets.push_back( toAdd );
180}
bool G4bool
Definition: G4Types.hh:67
CLHEP::HepRotation getRotation() const
void getDecomposition(Scale3D &scale, Rotate3D &rotation, Translate3D &translation) const
Definition: Transform3D.cc:174
CLHEP::Hep3Vector getTranslation() const

◆ AddPlacedVolume() [1/2]

void G4AssemblyVolume::AddPlacedVolume ( G4LogicalVolume pPlacedVolume,
G4ThreeVector translation,
G4RotationMatrix rotation 
)

Definition at line 109 of file G4AssemblyVolume.cc.

112{
113 G4RotationMatrix* toStore = new G4RotationMatrix;
114
115 if( pRotation != 0 ) { *toStore = *pRotation; }
116
117 G4AssemblyTriplet toAdd( pVolume, translation, toStore );
118 fTriplets.push_back( toAdd );
119}

Referenced by G4tgbVolume::ConstructG4PhysVol(), G4AssemblyVolume(), and G4GDMLReadStructure::PhysvolRead().

◆ AddPlacedVolume() [2/2]

void G4AssemblyVolume::AddPlacedVolume ( G4LogicalVolume pPlacedVolume,
G4Transform3D transformation 
)

Definition at line 123 of file G4AssemblyVolume.cc.

125{
126 // Decompose transformation
127 G4Scale3D scale;
128 G4Rotate3D rotation;
129 G4Translate3D translation;
130 transformation.getDecomposition(scale, rotation, translation);
131
132 G4ThreeVector v = translation.getTranslation();
134 *r = rotation.getRotation();
135
136 G4bool isReflection = false;
137 if (scale(0,0)*scale(1,1)*scale(2,2) < 0.) { isReflection = true; }
138
139 G4AssemblyTriplet toAdd( pVolume, v, r, isReflection );
140 fTriplets.push_back( toAdd );
141}

◆ GetAssemblyID()

unsigned int G4AssemblyVolume::GetAssemblyID ( ) const

◆ GetImprintsCount()

unsigned int G4AssemblyVolume::GetImprintsCount ( ) const

◆ GetInstanceCount()

unsigned int G4AssemblyVolume::GetInstanceCount ( ) const

Definition at line 351 of file G4AssemblyVolume.cc.

352{
353 return G4AssemblyVolume::fsInstanceCounter;
354}

Referenced by G4AssemblyVolume().

◆ GetVolumesIterator()

std::vector< G4VPhysicalVolume * >::iterator G4AssemblyVolume::GetVolumesIterator ( )
inline

◆ ImprintsCountMinus()

void G4AssemblyVolume::ImprintsCountMinus ( )
protected

◆ ImprintsCountPlus()

void G4AssemblyVolume::ImprintsCountPlus ( )
protected

◆ InstanceCountMinus()

void G4AssemblyVolume::InstanceCountMinus ( )
protected

Definition at line 366 of file G4AssemblyVolume.cc.

367{
368 G4AssemblyVolume::fsInstanceCounter--;
369}

Referenced by ~G4AssemblyVolume().

◆ InstanceCountPlus()

void G4AssemblyVolume::InstanceCountPlus ( )
protected

Definition at line 361 of file G4AssemblyVolume.cc.

362{
363 G4AssemblyVolume::fsInstanceCounter++;
364}

Referenced by G4AssemblyVolume().

◆ MakeImprint() [1/2]

void G4AssemblyVolume::MakeImprint ( G4LogicalVolume pMotherLV,
G4ThreeVector translationInMother,
G4RotationMatrix pRotationInMother,
G4int  copyNumBase = 0,
G4bool  surfCheck = false 
)

Definition at line 310 of file G4AssemblyVolume.cc.

315{
316 // If needed user can specify explicitely the base count from which to start
317 // off for the generation of phys. vol. copy numbers.
318 // The old behaviour is preserved when copyNumBase == 0, e.g. the generated
319 // copy numbers start from the count equal to current number of daughter
320 // volumes before an imprint is made
321
322 // Compose transformation
323 //
324 if( pRotationInMother == 0 )
325 {
326 // Make it by default an indentity matrix
327 //
328 pRotationInMother =
330 }
331
332 G4Transform3D transform( *pRotationInMother,
333 translationInMother );
334 MakeImprint(this, pMotherLV, transform, copyNumBase, surfCheck);
335}
static DLL_API const HepRotation IDENTITY
Definition: Rotation.h:369
void MakeImprint(G4LogicalVolume *pMotherLV, G4ThreeVector &translationInMother, G4RotationMatrix *pRotationInMother, G4int copyNumBase=0, G4bool surfCheck=false)

Referenced by G4tgbVolume::ConstructG4PhysVol(), MakeImprint(), and G4GDMLReadStructure::PhysvolRead().

◆ MakeImprint() [2/2]

void G4AssemblyVolume::MakeImprint ( G4LogicalVolume pMotherLV,
G4Transform3D transformation,
G4int  copyNumBase = 0,
G4bool  surfCheck = false 
)

Definition at line 337 of file G4AssemblyVolume.cc.

341{
342 // If needed user can specify explicitely the base count from which to start
343 // off for the generation of phys. vol. copy numbers.
344 // The old behaviour is preserved when copyNumBase == 0, e.g. the generated
345 // copy numbers start from the count equal to current number of daughter
346 // volumes before a imprint is made
347
348 MakeImprint(this, pMotherLV, transformation, copyNumBase, surfCheck);
349}

◆ SetAssemblyID()

void G4AssemblyVolume::SetAssemblyID ( unsigned int  value)
protected

Referenced by G4AssemblyVolume().

◆ SetImprintsCount()

void G4AssemblyVolume::SetImprintsCount ( unsigned int  value)
protected

Referenced by G4AssemblyVolume().

◆ SetInstanceCount()

void G4AssemblyVolume::SetInstanceCount ( unsigned int  value)
protected

Definition at line 356 of file G4AssemblyVolume.cc.

357{
358 G4AssemblyVolume::fsInstanceCounter = value;
359}

◆ TotalImprintedVolumes()

unsigned int G4AssemblyVolume::TotalImprintedVolumes ( ) const
inline

The documentation for this class was generated from the following files: