81 std::vector< volumePtr > detectorVolumeBoundingVolumes{};
82 std::vector< volumePtr > detectorVolumePassiveVolumes{};
84 detectorVolumeBoundingVolumes.reserve(chambers.size());
85 std::vector<surfacePtr> surfaces{};
86 std::vector<surfacePtr> materialSurfaces{};
88 auto portalGenerator = Acts::Experimental::defaultPortalAndSubPortalGenerator();
89 unsigned int numChambers = chambers.size();
96 std::shared_ptr<Acts::TrapezoidVolumeBounds> bounds =
chamber->bounds();
97 materialSurfaces.push_back(material);
98 std::pair<std::vector<volumePtr>, std::vector<surfacePtr>> readoutElements =
100 readoutElements.second.push_back(material);
101 volumePtr detectorVolume = Acts::Experimental::DetectorVolumeFactory::construct(portalGenerator,
104 chamber->localToGlobalTrans(*gctx),
105 bounds, readoutElements.second,
106 readoutElements.first,
107 Acts::Experimental::tryAllSubVolumes(),
108 Acts::Experimental::tryAllPortalsAndSurfaces());
110 detectorVolume->assignGeometryId(Acts::GeometryIdentifier{}.setLayer(numChambers--));
113 Acts::ObjVisualization3D
helper;
114 Acts::GeometryView3D::drawDetectorVolume(
helper, *detectorVolume, gctx->
context());
118 detectorVolumeBoundingVolumes.push_back(std::move(detectorVolume));
119 readoutElements.first.clear();
120 readoutElements.second.clear();
124 Acts::ObjVisualization3D
helper;
125 for (
const auto& surf : materialSurfaces){
126 Acts::GeometryView3D::drawSurface(
helper, *surf, gctx->
context());
128 helper.write(
"materialSurfaces.obj");
132 ATH_MSG_VERBOSE(
"Number of detector volumes: "<< detectorVolumeBoundingVolumes.size());
133 ATH_MSG_VERBOSE(
"Number of chamber passives volumes: "<< detectorVolumePassiveVolumes.size());
134 std::vector<GeoChildNodeWithTrf> childNodes = getChildrenWithRef(
m_detMgr->
getTreeTop(0),
false);
135 std::set<std::string> skipNodes{
"MuonBarrel",
"NSW",
"MuonEndcap_sideA",
"MuonEndcap_sideC",
"TGCSystem"};
136 for (
const GeoChildNodeWithTrf&
node : childNodes){
138 if(skipNodes.count(
node.nodeName)) {
145 ATH_MSG_VERBOSE(
"Number of total passive volumes: "<< detectorVolumePassiveVolumes.size());
149 Acts::ObjVisualization3D
helper;
150 for (
const auto& vol : detectorVolumePassiveVolumes){
151 Acts::GeometryView3D::drawDetectorVolume(
helper, *vol, gctx->
context());
158 detectorVolumeBoundingVolumes.insert(detectorVolumeBoundingVolumes.end(), detectorVolumePassiveVolumes.begin(), detectorVolumePassiveVolumes.end());
160 std::unique_ptr<Acts::CutoutCylinderVolumeBounds> msBounds = std::make_unique<Acts::CutoutCylinderVolumeBounds>(0, 4000, 14500, 22500, 3200);
161 volumePtr msDetectorVolume = Acts::Experimental::DetectorVolumeFactory::construct(
162 portalGenerator, gctx->
context(),
"Muon Spectrometer Envelope",
163 Acts::Transform3::Identity(), std::move(msBounds), surfaces,
164 detectorVolumeBoundingVolumes, Acts::Experimental::tryAllSubVolumes(),
165 Acts::Experimental::tryAllPortalsAndSurfaces());
166 msDetectorVolume->assignGeometryId(Acts::GeometryIdentifier{}.setVolume(15));
170 Acts::ObjVisualization3D
helper;
171 Acts::GeometryView3D::drawDetectorVolume(
helper, *msDetectorVolume, gctx->
context());
176 Acts::Experimental::DetectorComponent::PortalContainer portalContainer;
177 for (
auto [
ip,
p] : Acts::enumerate(msDetectorVolume->portalPtrs())) {
178 portalContainer[
ip] =
p;
180 detectorVolumeBoundingVolumes.push_back(msDetectorVolume);
181 return Acts::Experimental::DetectorComponent{
182 {detectorVolumeBoundingVolumes},
184 {{msDetectorVolume}, Acts::Experimental::tryAllSubVolumes()}};