20 #include "GaudiKernel/MsgStream.h"
26 m_world(highestVolume),
27 m_navigationLevel(navLev) {
34 if (m_world)
delete m_world;
37 m_detachedVolGarbage.insert(m_detachedVolGarbage.end(),
38 std::make_move_iterator(garbageVec.begin()),
39 std::make_move_iterator(garbageVec.end()));
42 m_trkVolumeGarbage.insert(m_trkVolumeGarbage.end(),
43 std::make_move_iterator(garbageVec.begin()),
44 std::make_move_iterator(garbageVec.end()));
52 while (currentVolume != searchVolume && searchVolume) {
53 currentVolume = searchVolume;
56 return (currentVolume);
59 std::vector<const Trk::DetachedTrackingVolume*>
76 while (currentVolume != searchVolume && searchVolume) {
77 currentVolume = searchVolume;
81 return (currentVolume);
91 for (
int l = 0;
l < lvl; ++
l){
96 m_trackingVolumes[tvol.
volumeName()] = (&tvol);
98 if (confinedVolumes) {
99 std::span<Trk::TrackingVolume* const> volumes = confinedVolumes->
arrayObjects();
100 for (
const auto& volumesIter : volumes){
102 registerTrackingVolumes(*volumesIter, &tvol, sublvl);
108 if (!confinedDenseVolumes.empty()) {
109 for (
const auto& volumesIter : confinedDenseVolumes){
111 registerTrackingVolumes(*volumesIter, &tvol, sublvl);
117 if (!confinedDetachedVolumes.empty()) {
118 for (
const auto& volumesIter : confinedDetachedVolumes){
120 tvol.
inside(volumesIter->trackingVolume()->center(), 0.)){
121 registerTrackingVolumes( *(volumesIter->trackingVolume()), &tvol, sublvl);
128 for (
const auto & bound : bounds) {
131 int& layerCount{m_boundaryLayers[bLayer]};
140 <<
"====== Calling TrackingGeometry::compactify() ===== " << std::endl;
142 size_t cSurfaces = 0;
143 size_t tSurfaces = 0;
147 msg <<
MSG::VERBOSE <<
" --> set TG ownership of " << cSurfaces <<
" out of "
148 << tSurfaces << std::endl;
149 for (
const auto& bLayerIter : m_boundaryLayers) {
150 bLayerIter.first->surfaceRepresentation().setOwner(
Trk::TGOwn);
152 msg <<
MSG::VERBOSE <<
" --> set TG ownership of " << m_boundaryLayers.size()
153 <<
" boundary layers." << std::endl;
169 m_boundaryLayers.clear();
170 return checkoutVolume;
176 msg <<
"TrackingGeometry Summary : " << std::endl;
180 printVolumeInformation(
msg, *highestVolume,
level);
189 int sublevel = lvl + 1;
193 msg <<
"TrackingVolume ( at : " << (&tvol) <<
") name: " << tvol.
volumeName()
197 if (confinedLayers) {
198 std::span<Trk::Layer const* const>
layers =
202 msg <<
"- found : " <<
layers.size() <<
" confined Layers" << std::endl;
207 if (confinedVolumes) {
208 std::span<Trk::TrackingVolume const* const> volumes =
213 msg <<
"- found : " << volumes.size() <<
" confined TrackingVolumes"
216 for (
const auto& volumesIter : volumes)
218 printVolumeInformation(
msg, *volumesIter, sublevel);
223 if (!confinedDenseVolumes.empty()) {
227 msg <<
"- found : " << confinedDenseVolumes.size()
228 <<
" confined unordered (dense) TrackingVolumes" << std::endl;
230 for (
const auto& volumesIter : (confinedDenseVolumes))
232 printVolumeInformation(
msg, *volumesIter, sublevel);
240 m_world->indexContainedStaticLayers(geosit,
offset);
241 m_world->indexContainedMaterialLayers(geosit,
offset);
250 bool isAtBoundary =
false;
254 for (
size_t ib = 0;
ib < bounds.size(); ++
ib) {
271 bool isAtBoundary =
false;
276 for (
size_t ib = 0;
ib < bounds.size(); ++
ib) {
281 bounds[
ib]->attachedVolume(gp,
mom,
dir);
282 if (!nextVol && attachedVol)
283 nextVol = attachedVol;
293 for (
const auto& bound_layers : m_boundaryLayers) {
294 out <<
head <<
" [" << bound_layers.second <<
"] ";
295 dumpLayer(
out,
"", bound_layers.first);
298 for (
const std::pair<const std::string, const TrackingVolume*>& volume : m_trackingVolumes) {
299 out <<
head <<
" [" <<
counter++ <<
"] " << volume.first <<
" volumeBound=";
300 volume.second->volumeBounds().dump(
out);
303 volume.second->confinedArbitraryLayers();
304 if (!confArbLayers.empty()) {
306 for (
const Layer* confined_layer : confArbLayers) {
308 <<
" confinedArbitrary layer " << j++ <<
" ";
309 dumpLayer(
out,
"", confined_layer);
312 if (volume.second->confinedLayers()) {
314 for (
const Layer* confined_layer :
315 volume.second->confinedLayers()->arrayObjects()) {
317 <<
" confined layer" << j++ <<
" ";
318 dumpLayer(
out,
"", confined_layer);
326 const std::string&
head,
333 <<
"] d=" <<
layer->thickness();
334 out <<
layer->surfaceRepresentation();