82 std::vector< volumePtr > detectorVolumeBoundingVolumes{};
83 std::vector< volumePtr > detectorVolumePassiveVolumes{};
85 detectorVolumeBoundingVolumes.reserve(chambers.size());
86 std::vector<surfacePtr> surfaces{};
87 std::vector<surfacePtr> materialSurfaces{};
89 auto portalGenerator = Acts::Experimental::defaultPortalAndSubPortalGenerator();
90 unsigned int numChambers = chambers.size();
97 std::shared_ptr<Acts::TrapezoidVolumeBounds> bounds =
chamber->bounds();
98 materialSurfaces.push_back(material);
99 std::pair<std::vector<volumePtr>, std::vector<surfacePtr>> readoutElements =
101 readoutElements.second.push_back(material);
102 volumePtr detectorVolume = Acts::Experimental::DetectorVolumeFactory::construct(portalGenerator,
105 chamber->localToGlobalTrans(*gctx),
106 bounds, readoutElements.second,
107 readoutElements.first,
108 Acts::Experimental::tryAllSubVolumes(),
109 Acts::Experimental::tryAllPortalsAndSurfaces());
111 detectorVolume->assignGeometryId(Acts::GeometryIdentifier{}.withLayer(numChambers--));
114 Acts::ObjVisualization3D
helper;
115 Acts::GeometryView3D::drawDetectorVolume(
helper, *detectorVolume, gctx->
context());
119 detectorVolumeBoundingVolumes.push_back(std::move(detectorVolume));
120 readoutElements.first.clear();
121 readoutElements.second.clear();
125 Acts::ObjVisualization3D
helper;
126 for (
const auto& surf : materialSurfaces){
127 Acts::GeometryView3D::drawSurface(
helper, *surf, gctx->
context());
129 helper.write(
"materialSurfaces.obj");
133 ATH_MSG_VERBOSE(
"Number of detector volumes: "<< detectorVolumeBoundingVolumes.size());
134 ATH_MSG_VERBOSE(
"Number of chamber passives volumes: "<< detectorVolumePassiveVolumes.size());
135 std::vector<GeoChildNodeWithTrf> childNodes = getChildrenWithRef(
m_detMgr->
getTreeTop(0),
false);
136 std::set<std::string> skipNodes{
"MuonBarrel",
"NSW",
"MuonEndcap_sideA",
"MuonEndcap_sideC",
"TGCSystem"};
137 for (
const GeoChildNodeWithTrf&
node : childNodes){
139 if(skipNodes.count(
node.nodeName)) {
146 ATH_MSG_VERBOSE(
"Number of total passive volumes: "<< detectorVolumePassiveVolumes.size());
150 Acts::ObjVisualization3D
helper;
151 for (
const auto& vol : detectorVolumePassiveVolumes){
152 Acts::GeometryView3D::drawDetectorVolume(
helper, *vol, gctx->
context());
159 detectorVolumeBoundingVolumes.insert(detectorVolumeBoundingVolumes.end(), detectorVolumePassiveVolumes.begin(), detectorVolumePassiveVolumes.end());
161 std::unique_ptr<Acts::CutoutCylinderVolumeBounds> msBounds = std::make_unique<Acts::CutoutCylinderVolumeBounds>(0, 4000, 14500, 22500, 3200);
162 volumePtr msDetectorVolume = Acts::Experimental::DetectorVolumeFactory::construct(
163 portalGenerator, gctx->
context(),
"Muon Spectrometer Envelope",
164 Acts::Transform3::Identity(), std::move(msBounds), surfaces,
165 detectorVolumeBoundingVolumes, Acts::Experimental::tryAllSubVolumes(),
166 Acts::Experimental::tryAllPortalsAndSurfaces());
167 msDetectorVolume->assignGeometryId(Acts::GeometryIdentifier{}.withVolume(15));
171 Acts::ObjVisualization3D
helper;
172 Acts::GeometryView3D::drawDetectorVolume(
helper, *msDetectorVolume, gctx->
context());
177 Acts::Experimental::DetectorComponent::PortalContainer portalContainer;
178 for (
auto [
ip,
p] : Acts::enumerate(msDetectorVolume->portalPtrs())) {
179 portalContainer[
ip] =
p;
181 detectorVolumeBoundingVolumes.push_back(msDetectorVolume);
182 return Acts::Experimental::DetectorComponent{
183 {detectorVolumeBoundingVolumes},
185 {{msDetectorVolume}, Acts::Experimental::tryAllSubVolumes()}};