15 #include <G4LogicalVolume.hh>
16 #include <G4VPhysicalVolume.hh>
17 #include <G4ReflectionFactory.hh>
45 G4LogicalVolume* pPlacedVolume,
46 G4Transform3D& transformation)
51 m_assembly->AddPlacedVolume(pPlacedVolume, transformation);
58 G4Transform3D& transformation)
62 m_places.emplace_back(pPlacedVolume);
69 const TGeoNode* parent,
72 G4LogicalVolume* pMotherLV,
73 G4Transform3D& transformation,
78 { _Wrap* w = (_Wrap*)p; w->ImprintsCountPlus(); }
81 TGeoVolume* vol = parent->GetVolume();
85 _Wrap::imprintsCountPlus(par_ass);
89 "++ Assembly: %s", path.c_str());
90 std::vector<G4AssemblyTriplet>::iterator iter = par_ass->GetTripletsIterator();
91 for(
unsigned int i = 0, n = par_ass->TotalTriplets(); i < n; i++, iter++ ) {
92 Chain new_chain = chain;
93 const auto& triplet = *iter;
94 const TGeoNode* node = pParentAssembly->
m_entries[i];
97 new_chain.emplace_back(node);
100 " Assembly: Entry: %s", path.c_str());
102 G4Transform3D Ta( *(triplet.GetRotation()), triplet.GetTranslation() );
103 if ( triplet.IsReflection() ) {
104 Ta = Ta * G4ReflectZ3D();
106 G4Transform3D Tfinal = transformation * Ta;
107 if ( triplet.GetVolume() ) {
118 std::stringstream pvName;
124 << parent->GetNumber()
134 G4PhysicalVolumesPair pvPlaced
135 = G4ReflectionFactory::Instance()->Place( Tfinal,
136 pvName.str().c_str(),
143 info.g4VolumeImprints[vol].emplace_back(new_chain,pvPlaced.first);
145 "Geant4Converter",
"++ Place %svolume %s in assembly.",
146 triplet.IsReflection() ?
"REFLECTED " :
"", path.c_str());
148 "Geant4Converter",
" Assembly:Parent: %s %s %p G4:%s",
149 parent->GetName(), node->GetName(),
150 (
void*)node, pvName.str().c_str());
151 if ( pvPlaced.second ) {
152 G4Exception(
"Geant4AssemblyVolume::imprint(..)",
"GeomVol0003", FatalException,
153 "Fancy construct popping new mother from the stack!");
156 else if ( triplet.GetAssembly() ) {
158 imprint(cnv, parent, std::move(new_chain), avol, pMotherLV, Tfinal, surfCheck );
161 G4Exception(
"Geant4AssemblyVolume::imprint(..)",
"GeomVol0003", FatalException,
162 "Triplet has no volume and no assembly");