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,
79 { _Wrap* w = (_Wrap*)p; w->ImprintsCountPlus(); }
82 TGeoVolume* vol = parent->GetVolume();
85 unsigned int numberOfDaughters = (copyNumBase == 0) ? pMotherLV->GetNoDaughters() : copyNumBase;
89 _Wrap::imprintsCountPlus(par_ass);
93 "++ Assembly: %s", path.c_str());
94 std::vector<G4AssemblyTriplet>::iterator iter = par_ass->GetTripletsIterator();
95 for(
unsigned int i = 0, n = par_ass->TotalTriplets(); i < n; i++, iter++ ) {
96 Chain new_chain = chain;
97 const auto& triplet = *iter;
98 const TGeoNode* node = pParentAssembly->
m_entries[i];
101 new_chain.emplace_back(node);
104 " Assembly: Entry: %s", path.c_str());
106 G4Transform3D Ta( *(triplet.GetRotation()), triplet.GetTranslation() );
107 if ( triplet.IsReflection() ) {
108 Ta = Ta * G4ReflectZ3D();
110 G4Transform3D Tfinal = transformation * Ta;
111 if ( triplet.GetVolume() ) {
122 std::stringstream pvName;
128 << parent->GetNumber()
138 G4PhysicalVolumesPair pvPlaced
139 = G4ReflectionFactory::Instance()->Place( Tfinal,
140 pvName.str().c_str(),
144 numberOfDaughters + i,
147 info.g4VolumeImprints[vol].emplace_back(new_chain,pvPlaced.first);
149 "Geant4Converter",
"++ Place %svolume %s in assembly.",
150 triplet.IsReflection() ?
"REFLECTED " :
"", path.c_str());
152 "Geant4Converter",
" Assembly:Parent: %s %s %p G4:%s",
153 parent->GetName(), node->GetName(),
154 (
void*)node, pvName.str().c_str());
155 if ( pvPlaced.second ) {
156 G4Exception(
"Geant4AssemblyVolume::imprint(..)",
"GeomVol0003", FatalException,
157 "Fancy construct popping new mother from the stack!");
160 else if ( triplet.GetAssembly() ) {
162 imprint(cnv, parent, std::move(new_chain), avol, pMotherLV, Tfinal, i*100+copyNumBase, surfCheck );
165 G4Exception(
"Geant4AssemblyVolume::imprint(..)",
"GeomVol0003", FatalException,
166 "Triplet has no volume and no assembly");