Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions
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::G4AssemblyVolume ( )

Definition at line 48 of file G4AssemblyVolume.cc.

References GetInstanceCount(), InstanceCountPlus(), SetAssemblyID(), and SetImprintsCount().

49  : fAssemblyID( 0 )
50 {
53  SetImprintsCount( 0 );
54 }
unsigned int GetInstanceCount() const
void SetImprintsCount(unsigned int value)
void SetAssemblyID(unsigned int value)
G4AssemblyVolume::G4AssemblyVolume ( G4LogicalVolume volume,
G4ThreeVector translation,
G4RotationMatrix rotation 
)

Definition at line 58 of file G4AssemblyVolume.cc.

References AddPlacedVolume(), GetInstanceCount(), InstanceCountPlus(), SetAssemblyID(), and SetImprintsCount().

61  : fAssemblyID( 0 )
62 {
65  SetImprintsCount( 0 );
66  AddPlacedVolume(volume, translation, rotation);
67 }
unsigned int GetInstanceCount() const
void SetImprintsCount(unsigned int value)
void SetAssemblyID(unsigned int value)
void AddPlacedVolume(G4LogicalVolume *pPlacedVolume, G4ThreeVector &translation, G4RotationMatrix *rotation)
G4AssemblyVolume::~G4AssemblyVolume ( )

Definition at line 71 of file G4AssemblyVolume.cc.

References InstanceCountMinus().

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

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

Definition at line 161 of file G4AssemblyVolume.cc.

References HepGeom::Transform3D::getDecomposition(), HepGeom::Transform3D::getRotation(), HepGeom::Transform3D::getTranslation(), and test::v.

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 }
CLHEP::HepRotation G4RotationMatrix
void getDecomposition(Scale3D &scale, Rotate3D &rotation, Translate3D &translation) const
Definition: Transform3D.cc:174
bool G4bool
Definition: G4Types.hh:79
CLHEP::HepRotation getRotation() const
CLHEP::Hep3Vector getTranslation() const
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
void G4AssemblyVolume::AddPlacedVolume ( G4LogicalVolume pPlacedVolume,
G4ThreeVector translation,
G4RotationMatrix rotation 
)

Definition at line 109 of file G4AssemblyVolume.cc.

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

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 }
CLHEP::HepRotation G4RotationMatrix
void G4AssemblyVolume::AddPlacedVolume ( G4LogicalVolume pPlacedVolume,
G4Transform3D transformation 
)

Definition at line 123 of file G4AssemblyVolume.cc.

References HepGeom::Transform3D::getDecomposition(), HepGeom::Transform3D::getRotation(), HepGeom::Transform3D::getTranslation(), and test::v.

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 }
CLHEP::HepRotation G4RotationMatrix
void getDecomposition(Scale3D &scale, Rotate3D &rotation, Translate3D &translation) const
Definition: Transform3D.cc:174
bool G4bool
Definition: G4Types.hh:79
CLHEP::HepRotation getRotation() const
CLHEP::Hep3Vector getTranslation() const
unsigned int G4AssemblyVolume::GetAssemblyID ( ) const
unsigned int G4AssemblyVolume::GetImprintsCount ( ) const
unsigned int G4AssemblyVolume::GetInstanceCount ( ) const

Definition at line 351 of file G4AssemblyVolume.cc.

Referenced by G4AssemblyVolume().

352 {
353  return G4AssemblyVolume::fsInstanceCounter;
354 }
std::vector<G4VPhysicalVolume*>::iterator G4AssemblyVolume::GetVolumesIterator ( )
inline
void G4AssemblyVolume::ImprintsCountMinus ( )
protected
void G4AssemblyVolume::ImprintsCountPlus ( )
protected
void G4AssemblyVolume::InstanceCountMinus ( )
protected

Definition at line 366 of file G4AssemblyVolume.cc.

Referenced by ~G4AssemblyVolume().

367 {
368  G4AssemblyVolume::fsInstanceCounter--;
369 }
void G4AssemblyVolume::InstanceCountPlus ( )
protected

Definition at line 361 of file G4AssemblyVolume.cc.

Referenced by G4AssemblyVolume().

362 {
363  G4AssemblyVolume::fsInstanceCounter++;
364 }
void G4AssemblyVolume::MakeImprint ( G4LogicalVolume pMotherLV,
G4ThreeVector translationInMother,
G4RotationMatrix pRotationInMother,
G4int  copyNumBase = 0,
G4bool  surfCheck = false 
)

Definition at line 310 of file G4AssemblyVolume.cc.

References CLHEP::HepRotation::IDENTITY.

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

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 }
void MakeImprint(G4LogicalVolume *pMotherLV, G4ThreeVector &translationInMother, G4RotationMatrix *pRotationInMother, G4int copyNumBase=0, G4bool surfCheck=false)
static DLL_API const HepRotation IDENTITY
Definition: Rotation.h:369
void G4AssemblyVolume::MakeImprint ( G4LogicalVolume pMotherLV,
G4Transform3D transformation,
G4int  copyNumBase = 0,
G4bool  surfCheck = false 
)

Definition at line 337 of file G4AssemblyVolume.cc.

References MakeImprint().

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 }
void MakeImprint(G4LogicalVolume *pMotherLV, G4ThreeVector &translationInMother, G4RotationMatrix *pRotationInMother, G4int copyNumBase=0, G4bool surfCheck=false)
void G4AssemblyVolume::SetAssemblyID ( unsigned int  value)
protected

Referenced by G4AssemblyVolume().

void G4AssemblyVolume::SetImprintsCount ( unsigned int  value)
protected

Referenced by G4AssemblyVolume().

void G4AssemblyVolume::SetInstanceCount ( unsigned int  value)
protected

Definition at line 356 of file G4AssemblyVolume.cc.

357 {
358  G4AssemblyVolume::fsInstanceCounter = value;
359 }
const XML_Char int const XML_Char * value
unsigned int G4AssemblyVolume::TotalImprintedVolumes ( ) const
inline

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