11 #include "DD4hep/DetFactoryHelper.h"
14 using namespace dd4hep;
18 xml_det_t x_det = xml;
19 string detName = x_det.nameStr();
22 xml_comp_t x_det_tubs = x_det.child(_U(tubs));
25 DetElement cylinderElement(detName, x_det.id());
29 bool isBeamPipe = x_det.hasChild(_U(beampipe));
30 pcExtension->addType(
"passive cylinder",
"layer");
32 pcExtension->addType(
"beampipe",
"layer");
35 for (xml_coll_t lmat(x_det_tubs, _Unicode(layer_material)); lmat; ++lmat) {
36 xml_comp_t x_layer_material = lmat;
41 string shapeName = x_det_tubs.nameStr();
42 Tube tubeShape(shapeName, x_det_tubs.rmin(), x_det_tubs.rmax(),
44 Volume tubeVolume(detName, tubeShape,
45 oddd.material(x_det_tubs.materialStr()));
46 tubeVolume.setVisAttributes(oddd, x_det.visStr());
49 Volume motherVolume = oddd.pickMotherVolume(cylinderElement);
50 PlacedVolume placedTube = motherVolume.placeVolume(tubeVolume);
51 placedTube.addPhysVolID(detName, cylinderElement.id());
52 cylinderElement.setPlacement(placedTube);
55 return cylinderElement;