31 xml_comp_t x_step = x_det.child(_Unicode(step_file));
32 xml_comp_t x_pos = x_det.child(_Unicode(position));
33 xml_comp_t x_rot = x_det.child(_Unicode(rotation));
34 xml_comp_t x_mat = x_det.child(_Unicode(material));
36 std::string name = x_det.nameStr();
37 std::string path = x_step.attr<std::string>(_Unicode(path));
42 }
catch (
const std::exception& ex) {
43 throw std::runtime_error(
"G4OCCT_STEPSolid: failed to import '" + path +
"' (" + ex.what() +
47 throw std::runtime_error(
"G4OCCT_STEPSolid: import of '" + path +
48 "' returned a null TGeoOCCTSolid");
50 printout(INFO,
"G4OCCT_STEPSolid",
"Imported '%s' from '%s' as exact TGeoOCCTSolid", name.c_str(),
54 Material mat = description.material(x_mat.attr<std::string>(_Unicode(name)));
55 Volume vol(name +
"_vol", Solid(stepSolid), mat);
56 vol.setVisAttributes(description, x_det.visStr());
58 DetElement det(name, x_det.id());
59 Position pos(x_pos.x(), x_pos.y(), x_pos.z());
60 RotationZYX rot(x_rot.z(), x_rot.y(), x_rot.x());
61 PlacedVolume pv = description.pickMotherVolume(det).placeVolume(vol, Transform3D(rot, pos));
62 pv.addPhysVolID(
"system", x_det.id());