143 std::vector< volumePtr > detectorVolumeBoundingVolumes{};
144 std::vector< volumePtr > detectorVolumePassiveVolumes{};
146 detectorVolumeBoundingVolumes.reserve(chambers.size());
147 std::vector<surfacePtr> surfaces = {};
148 std::pair<std::vector<volumePtr>, std::vector<surfacePtr>> readoutElements;
150 auto portalGenerator = Acts::Experimental::defaultPortalAndSubPortalGenerator();
151 unsigned int numChambers = chambers.size();
154 unsigned int num = 0;
157 std::shared_ptr<Acts::TrapezoidVolumeBounds> bounds =
chamber->bounds();
159 volumePtr detectorVolume = Acts::Experimental::DetectorVolumeFactory::construct(portalGenerator,
162 chamber->localToGlobalTrans(*gctx),
163 bounds, readoutElements.second,
164 readoutElements.first,
165 Acts::Experimental::tryRootVolumes(),
166 Acts::Experimental::tryAllPortalsAndSurfaces());
168 detectorVolume->assignGeometryId(Acts::GeometryIdentifier{}.setLayer(numChambers--));
171 Acts::ObjVisualization3D
helper;
172 Acts::GeometryView3D::drawDetectorVolume(
helper, *detectorVolume, gctx->
context());
176 detectorVolumeBoundingVolumes.push_back(std::move(detectorVolume));
177 readoutElements.first.clear();
178 readoutElements.second.clear();
181 ATH_MSG_VERBOSE(
"Number of detector volumes: "<< detectorVolumeBoundingVolumes.size());
182 ATH_MSG_VERBOSE(
"Number of chamber passives volumes: "<< detectorVolumePassiveVolumes.size());
183 std::vector<GeoChildNodeWithTrf> childNodes = getChildrenWithRef(
m_detMgr->
getTreeTop(0),
false);
184 std::set<std::string> skipNodes{
"MuonBarrel",
"NSW",
"MuonEndcap_sideA",
"MuonEndcap_sideC",
"TGCSystem"};
185 for (
const GeoChildNodeWithTrf&
node : childNodes){
187 if(skipNodes.count(
node.nodeName)) {
194 ATH_MSG_VERBOSE(
"Number of total passive volumes: "<< detectorVolumePassiveVolumes.size());
198 Acts::ObjVisualization3D
helper;
199 for (
const auto& vol : detectorVolumePassiveVolumes){
200 Acts::GeometryView3D::drawDetectorVolume(
helper, *vol, gctx->
context());
207 detectorVolumeBoundingVolumes.insert(detectorVolumeBoundingVolumes.end(), detectorVolumePassiveVolumes.begin(), detectorVolumePassiveVolumes.end());
209 std::unique_ptr<Acts::CutoutCylinderVolumeBounds> msBounds = std::make_unique<Acts::CutoutCylinderVolumeBounds>(0, 4000, 14500, 22500, 3200);
210 volumePtr msDetectorVolume = Acts::Experimental::DetectorVolumeFactory::construct(
211 portalGenerator, gctx->
context(),
"Muon Spectrometer Envelope",
212 Acts::Transform3::Identity(), std::move(msBounds), surfaces,
213 detectorVolumeBoundingVolumes, Acts::Experimental::tryRootVolumes(),
214 Acts::Experimental::tryAllPortalsAndSurfaces());
215 msDetectorVolume->assignGeometryId(Acts::GeometryIdentifier{}.setVolume(15));
219 Acts::ObjVisualization3D
helper;
220 Acts::GeometryView3D::drawDetectorVolume(
helper, *msDetectorVolume, gctx->
context());
225 Acts::Experimental::DetectorComponent::PortalContainer portalContainer;
226 for (
auto [
ip,
p] : Acts::enumerate(msDetectorVolume->portalPtrs())) {
227 portalContainer[
ip] =
p;
229 detectorVolumeBoundingVolumes.push_back(msDetectorVolume);
230 return Acts::Experimental::DetectorComponent{
231 {detectorVolumeBoundingVolumes},
233 {{msDetectorVolume}, Acts::Experimental::tryRootVolumes()}};