37 PVConstLink theGeoPhysChild;
38 const GeoSerialTransformer* serialTransformerChild{
nullptr};
39 G4LogicalVolume* theG4LogChild{
nullptr};
40 unsigned int numChildNodes;
42 bool serialExists =
false;
43 std::string nameChild;
52 G4LogicalVolume* theG4LogVolume = LVFactory.Build(theGeoPhysVolume,
descend);
55 return theG4LogVolume;
57 numChildNodes = theGeoPhysVolume->getNChildVolAndST();
67 for(
size_t counter1=0; counter1<numChildNodes; ++counter1) {
68 GeoAccessVolAndSTAction actionVolAndST(counter1);
69 theGeoPhysVolume->exec(&actionVolAndST);
71 serialTransformerChild=actionVolAndST.getSerialTransformer();
72 if(serialTransformerChild) {
73 nameChild = actionVolAndST.getName();
91 if(serialExists && numChildNodes==1) {
92 theGeoPhysChild = serialTransformerChild->getVolume();
95 theG4LogChild =
Build(theGeoPhysChild,optical_volumes);
99 if (nameChild ==
"ANON") {
100 nameChild=theG4LogChild->GetName();
102 nameChild +=
"_Param";
105 serialTransformerChild->getNCopies());
107 [[maybe_unused]] G4VPhysicalVolume* pvParametrised =
new G4PVParameterised(nameChild,
111 serialTransformerChild->getNCopies(),
115 PrintSTInfo(theGeoPhysVolume->getLogVol()->getName());
118 GeoVolumeCursor av(theGeoPhysVolume);
119 while (!av.atEnd()) {
123 theGeoPhysChild = av.getVolume();
127 std::optional<int> Qint = av.getId();
132 const bool isEther = theGeoPhysChild->getLogVol()->getMaterial()->getName() ==
"special::Ether";
133 const bool isHypUr = theGeoPhysChild->getLogVol()->getMaterial()->getName() ==
"special::HyperUranium";
139 assembly->
MakeImprint(theG4LogVolume,theG4Position,
id);
141 assembly->
MakeImprint(theG4LogVolume,theG4Position);
147 assembly->
MakeImprint(theG4LogVolume,theG4Position,
id,
true);
149 assembly->
MakeImprint(theG4LogVolume,theG4Position,0,
true);
152 nameChild = av.getName();
155 theG4LogChild =
Build(theGeoPhysChild,optical_volumes);
159 if (nameChild ==
"ANON") {
160 nameChild=theG4LogChild->GetName();
162 G4PhysicalVolumesPair pvPair = G4ReflectionFactory::Instance()->Place(theG4Position, nameChild,
163 theG4LogChild, theG4LogVolume,
false,
id);
166 if(optical_volumes!=
nullptr) {
168 if(opticalGeoPhysChild) {
169 (*optical_volumes)[opticalGeoPhysChild] = pvPair.first;
177 return theG4LogVolume;
181 PVConstLink theGeoPhysChild;
182 G4LogicalVolume* theG4LogChild{
nullptr};
192 return assemblyVolume;
195 GeoVolumeCursor av(pv);
196 while (!av.atEnd()) {
197 theGeoPhysChild = av.getVolume();
198 std::string nameChild = av.getName();
200 std::string strVolume = std::format(
"Volume {:} ({:})", nameChild,
201 theGeoPhysChild->getLogVol()->getName());
204 bool isEther = theGeoPhysChild->getLogVol()->getMaterial()->getName() ==
"special::Ether";
205 bool isHypUr = theGeoPhysChild->getLogVol()->getMaterial()->getName() ==
"special::HyperUranium";
207 if(isEther || isHypUr) {
210 if(!theG4AssemblyChild) {
218 std::optional<int> Qint = av.getId();
221 theG4LogChild =
Build(theGeoPhysChild);
229 if(Qint) placedID = *Qint;
231 std::string placedName = nameChild==
"ANON" ?
"" : nameChild;
233 assemblyVolume->
AddPlacedVolume(theG4LogChild,theG4Position,placedID,placedName);
237 return assemblyVolume;