12 #include "DD4hep/DetFactoryHelper.h"
15 using namespace dd4hep;
19 xml_det_t x_det = xml;
20 string detName = x_det.nameStr();
23 xml_comp_t x_det_tubs = x_det.child(_U(tubs));
26 DetElement cylinderElement(detName, x_det.id());
30 bool isBeamPipe = x_det.hasChild(_U(
beampipe));
31 pcExtension->addType(
"passive cylinder",
"layer");
33 pcExtension->addType(
"beampipe",
"layer");
36 for (xml_coll_t lmat(x_det_tubs, _Unicode(layer_material)); lmat; ++lmat) {
37 xml_comp_t x_layer_material = lmat;
42 string shapeName = x_det_tubs.nameStr();
43 Tube tubeShape(shapeName, x_det_tubs.rmin(), x_det_tubs.rmax(),
45 Volume tubeVolume(detName, tubeShape,
46 oddd.material(x_det_tubs.materialStr()));
47 tubeVolume.setVisAttributes(oddd, x_det.visStr());
50 Volume motherVolume = oddd.pickMotherVolume(cylinderElement);
51 PlacedVolume placedTube = motherVolume.placeVolume(tubeVolume);
52 placedTube.addPhysVolID(detName, cylinderElement.id());
53 cylinderElement.setPlacement(placedTube);
56 return cylinderElement;