13 #include "G4VPhysicalVolume.hh"
14 #include "G4PVPlacement.hh"
15 #include "G4LogicalVolume.hh"
16 #include "G4VSolid.hh"
17 #include "G4Region.hh"
18 #include "G4RegionStore.hh"
20 #include "G4GenericMessenger.hh"
21 #include "G4VisAttributes.hh"
22 #include "G4Version.hh"
42 "Define the input GDML file");
43 gdmlCmd.SetToBeBroadcasted(
false);
44 gdmlCmd.SetStates(G4State_PreInit);
46 "Define material definition file");
47 matCmd.SetToBeBroadcasted(
false);
48 matCmd.SetStates(G4State_PreInit);
55 G4Exception(
"eASTDetectorComponentGDML::Construct",
"eASTDetectorComponentGDML000",
56 FatalException,
"GDML file is not specified.");
60 #if G4VERSION_NUMBER > 1100
72 regInfo->SetDetectorComponentGDML();
73 pRegion->SetUserInformation(regInfo);
78 auto tempEnvLog = tempEnv->GetLogicalVolume();
79 auto tempEnvSolid = tempEnvLog->GetSolid();
80 G4int ndaughter = G4int(tempEnvLog->GetNoDaughters());
81 auto visAtt =
new G4VisAttributes(G4Colour(1.0,0.0,1.0));
84 for(G4int idaughter=0;idaughter<ndaughter;idaughter++)
86 auto daughter = tempEnvLog->GetDaughter(idaughter);
91 if(new_rmat!=G4RotationMatrix())
93 auto prmat =
const_cast<G4RotationMatrix*
>(daughter->GetFrameRotation());
94 if(prmat==
nullptr) prmat =
new G4RotationMatrix();
95 *prmat *= new_rmat.inverse();
96 daughter->SetRotation(prmat);
98 auto tran = daughter->GetObjectTranslation();
100 daughter->SetTranslation(tran);
101 daughter->GetLogicalVolume()->SetVisAttributes(visAtt);
102 worldPhys->GetLogicalVolume()->AddDaughter(daughter);
103 daughter->SetMotherLogical(worldPhys->GetLogicalVolume());
104 daughter->GetLogicalVolume()->SetRegion(
pRegion);
105 pRegion->AddRootLogicalVolume(daughter->GetLogicalVolume());
108 for (
size_t i=0; i<daughter->GetLogicalVolume()->GetNoDaughters() ; i++ ){
109 auto dd = daughter->GetLogicalVolume()->GetDaughter(i);
111 for (
size_t j=0; j<dd->GetLogicalVolume()->GetNoDaughters() ; j++ ){
112 auto ddd = dd->GetLogicalVolume()->GetDaughter(j);
113 std::string name3 = ddd->GetName();