79 std::vector< volumePtr > detectorVolumeBoundingVolumes{};
80 std::vector< volumePtr > detectorVolumePassiveVolumes{};
82 detectorVolumeBoundingVolumes.reserve(chambers.size());
83 std::vector<surfacePtr> surfaces{};
84 std::vector<surfacePtr> materialSurfaces{};
86 auto portalGenerator = Acts::Experimental::defaultPortalAndSubPortalGenerator();
87 unsigned int numChambers = chambers.size();
89 Acts::SurfaceBoundFactory materialBounds{};
94 std::shared_ptr<Acts::TrapezoidVolumeBounds> bounds =
chamber->bounds();
95 materialSurfaces.push_back(material);
96 std::pair<std::vector<volumePtr>, std::vector<surfacePtr>> readoutElements =
98 readoutElements.second.push_back(material);
99 volumePtr detectorVolume = Acts::Experimental::DetectorVolumeFactory::construct(portalGenerator,
102 chamber->localToGlobalTrans(*gctx),
103 bounds, readoutElements.second,
104 readoutElements.first,
105 Acts::Experimental::tryAllSubVolumes(),
106 Acts::Experimental::tryAllPortalsAndSurfaces());
108 detectorVolume->assignGeometryId(Acts::GeometryIdentifier{}.withLayer(numChambers--));
111 Acts::ObjVisualization3D
helper;
112 Acts::GeometryView3D::drawDetectorVolume(
helper, *detectorVolume, gctx->
context());
116 detectorVolumeBoundingVolumes.push_back(std::move(detectorVolume));
117 readoutElements.first.clear();
118 readoutElements.second.clear();
122 Acts::ObjVisualization3D
helper;
123 for (
const auto& surf : materialSurfaces){
124 Acts::GeometryView3D::drawSurface(
helper, *surf, gctx->
context());
126 helper.write(
"materialSurfaces.obj");
130 ATH_MSG_VERBOSE(
"Number of detector volumes: "<< detectorVolumeBoundingVolumes.size());
131 ATH_MSG_VERBOSE(
"Number of chamber passives volumes: "<< detectorVolumePassiveVolumes.size());
132 std::vector<GeoChildNodeWithTrf> childNodes = getChildrenWithRef(
m_detMgr->
getTreeTop(0),
false);
133 std::set<std::string> skipNodes{
"MuonBarrel",
"NSW",
"MuonEndcap_sideA",
"MuonEndcap_sideC",
"TGCSystem"};
134 for (
const GeoChildNodeWithTrf&
node : childNodes){
136 if(skipNodes.count(
node.nodeName)) {
143 ATH_MSG_VERBOSE(
"Number of total passive volumes: "<< detectorVolumePassiveVolumes.size());
147 Acts::ObjVisualization3D
helper;
148 for (
const auto& vol : detectorVolumePassiveVolumes){
149 Acts::GeometryView3D::drawDetectorVolume(
helper, *vol, gctx->
context());
156 detectorVolumeBoundingVolumes.insert(detectorVolumeBoundingVolumes.end(), detectorVolumePassiveVolumes.begin(), detectorVolumePassiveVolumes.end());
158 std::unique_ptr<Acts::CutoutCylinderVolumeBounds> msBounds = std::make_unique<Acts::CutoutCylinderVolumeBounds>(0, 4000, 14500, 22500, 3200);
159 volumePtr msDetectorVolume = Acts::Experimental::DetectorVolumeFactory::construct(
160 portalGenerator, gctx->
context(),
"Muon Spectrometer Envelope",
161 Acts::Transform3::Identity(), std::move(msBounds), surfaces,
162 detectorVolumeBoundingVolumes, Acts::Experimental::tryAllSubVolumes(),
163 Acts::Experimental::tryAllPortalsAndSurfaces());
164 msDetectorVolume->assignGeometryId(Acts::GeometryIdentifier{}.withVolume(15));
168 Acts::ObjVisualization3D
helper;
169 Acts::GeometryView3D::drawDetectorVolume(
helper, *msDetectorVolume, gctx->
context());
174 Acts::Experimental::DetectorComponent::PortalContainer portalContainer;
175 for (
auto [
ip,
p] : Acts::enumerate(msDetectorVolume->portalPtrs())) {
176 portalContainer[
ip] =
p;
178 detectorVolumeBoundingVolumes.push_back(msDetectorVolume);
179 return Acts::Experimental::DetectorComponent{
180 {detectorVolumeBoundingVolumes},
182 {{msDetectorVolume}, Acts::Experimental::tryAllSubVolumes()}};