10 #include "DD4hep/DetFactoryHelper.h"
13 using namespace dd4hep;
17 xml_det_t x_det = xml;
18 string det_name = x_det.nameStr();
21 DetElement beamPipeElement(det_name, x_det.id());
24 beamPipeExtension->addType(
"beampipe",
"layer");
28 xml_comp_t x_det_def = x_det.child(_U(description));
29 Tube tube_shape(x_det_def.rmin(), x_det_def.rmax(), x_det_def.dz());
30 Volume tube_vol(det_name, tube_shape, lcdd.material(x_det_def.materialStr()));
31 tube_vol.setVisAttributes(lcdd, x_det.visStr());
34 Volume mother_vol = lcdd.pickMotherVolume(beamPipeElement);
35 PlacedVolume placedTube = mother_vol.placeVolume(tube_vol);
36 placedTube.addPhysVolID(
"BeamTube", beamPipeElement.id());
37 beamPipeElement.setPlacement(placedTube);
39 return beamPipeElement;