41G4ThreadLocal unsigned int G4AssemblyVolume::fsInstanceCounter = 0;
53 std::ostringstream message;
54 message <<
"The assembly has NOT been registered !" <<
G4endl
55 <<
" Assembly " << fAssemblyID
56 <<
" already existing in store !" <<
G4endl;
57 G4Exception(
"G4AssemblyVolume::G4AssemblyVolume()",
"GeomVol1001",
79 std::ostringstream message;
80 message <<
"The assembly has NOT been registered !" <<
G4endl
81 <<
" Assembly " << fAssemblyID
82 <<
" already existing in store !" <<
G4endl;
83 G4Exception(
"G4Assembly::G4Assembly()",
"GeomVol1001",
96 std::size_t howmany = fTriplets.size();
99 for( std::size_t i = 0; i < howmany; ++i )
102 if( pRotToClean != 0 )
134 if( pRotation !=
nullptr ) { *toStore = *pRotation; }
137 fTriplets.push_back( toAdd );
155 G4bool isReflection =
false;
156 if (scale(0,0)*scale(1,1)*scale(2,2) < 0.) { isReflection =
true; }
159 fTriplets.push_back( toAdd );
171 if( pRotation !=
nullptr ) { *toStore = *pRotation; }
174 fTriplets.push_back( toAdd );
194 G4bool isReflection =
false;
195 if (scale(0,0)*scale(1,1)*scale(2,2) < 0.) { isReflection =
true; }
198 fTriplets.push_back( toAdd );
245 std::size_t numberOfDaughters;
247 if( copyNumBase == 0 )
253 numberOfDaughters = copyNumBase;
262 auto triplets = pAssembly->fTriplets;
267 for( std::size_t i = 0; i < triplets.size(); ++i )
270 triplets[i].GetTranslation() );
271 if ( triplets[i].IsReflection() ) { Ta = Ta *
G4ReflectZ3D(); }
275 if ( triplets[i].GetVolume() )
287 std::stringstream pvName;
293 << triplets[i].GetVolume()->GetName().c_str()
304 pvName.str().c_str(),
305 triplets[i].GetVolume(),
308 G4int(numberOfDaughters+i),
313 fPVStore.push_back( pvPlaced.first );
314 if ( pvPlaced.second ) { fPVStore.push_back( pvPlaced.second ); }
320 else if ( triplets[i].GetAssembly() )
325 Tfinal, (
G4int)i*100+copyNumBase, surfCheck );
331 "Triplet has no volume and no assembly");
350 if( pRotationInMother ==
nullptr )
359 translationInMother );
360 MakeImprint(
this, pMotherLV, transform, copyNumBase, surfCheck);
374 MakeImprint(
this, pMotherLV, transformation, copyNumBase, surfCheck);
379 return G4AssemblyVolume::fsInstanceCounter;
384 G4AssemblyVolume::fsInstanceCounter = value;
389 G4AssemblyVolume::fsInstanceCounter++;
394 G4AssemblyVolume::fsInstanceCounter--;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::pair< G4VPhysicalVolume *, G4VPhysicalVolume * > G4PhysicalVolumesPair
CLHEP::HepRotation G4RotationMatrix
static DLL_API const HepRotation IDENTITY
static G4AssemblyStore * GetInstance()
static void DeRegister(G4AssemblyVolume *pAssembly)
G4AssemblyVolume * GetAssembly(unsigned int id, G4bool verbose=true) const
static void Register(G4AssemblyVolume *pAssembly)
unsigned int GetImprintsCount() const
void MakeImprint(G4LogicalVolume *pMotherLV, G4ThreeVector &translationInMother, G4RotationMatrix *pRotationInMother, G4int copyNumBase=0, G4bool surfCheck=false)
void InstanceCountMinus()
void SetAssemblyID(unsigned int value)
void AddPlacedAssembly(G4AssemblyVolume *pAssembly, G4Transform3D &transformation)
unsigned int GetAssemblyID() const
void SetInstanceCount(unsigned int value)
void AddPlacedVolume(G4LogicalVolume *pPlacedVolume, G4ThreeVector &translation, G4RotationMatrix *rotation)
void SetImprintsCount(unsigned int value)
unsigned int GetInstanceCount() const
std::size_t GetNoDaughters() const
static G4ReflectionFactory * Instance()
G4PhysicalVolumesPair Place(const G4Transform3D &transform3D, const G4String &name, G4LogicalVolume *LV, G4LogicalVolume *motherLV, G4bool isMany, G4int copyNo, G4bool surfCheck=false)