19 #include "GaudiKernel/MsgStream.h"
25 m_world(highestVolume),
26 m_navigationLevel(navLev) {
33 if (m_world)
delete m_world;
36 std::copy_if(std::make_move_iterator(garbageVec.begin()), std::make_move_iterator(garbageVec.end()),
37 std::back_inserter(m_detachedVolGarbage),
38 [](
const std::unique_ptr<DetachedTrackingVolume>& ptr){
39 return ptr.get () != nullptr;
44 std::copy_if(std::make_move_iterator(garbageVec.begin()), std::make_move_iterator(garbageVec.end()),
45 std::back_inserter(m_trkVolumeGarbage),
46 [](
const std::unique_ptr<TrackingVolume>& ptr){
47 return ptr.get () != nullptr;
57 while (currentVolume != searchVolume && searchVolume) {
58 currentVolume = searchVolume;
61 return (currentVolume);
64 std::vector<const Trk::DetachedTrackingVolume*>
81 while (currentVolume != searchVolume && searchVolume) {
82 currentVolume = searchVolume;
86 return (currentVolume);
96 for (
int l = 0;
l < lvl; ++
l,
indent +=
" ")
100 m_trackingVolumes[tvol.
volumeName()] = (&tvol);
103 if (confinedVolumes) {
106 for (
const auto& volumesIter : volumes)
108 registerTrackingVolumes(*volumesIter, &tvol, sublvl);
113 if (!confinedDenseVolumes.empty()) {
114 for (
const auto& volumesIter : confinedDenseVolumes)
116 registerTrackingVolumes(*volumesIter, &tvol, sublvl);
121 if (!confinedDetachedVolumes.empty()) {
122 for (
const auto& volumesIter : confinedDetachedVolumes)
124 tvol.
inside(volumesIter->trackingVolume()->center(), 0.))
125 registerTrackingVolumes(
126 *(volumesIter->trackingVolume()), &tvol, sublvl);
131 for (
const auto &
bound : bounds) {
133 bound->surfaceRepresentation().materialLayer();
135 int& layerCount{m_boundaryLayers[bLayer]};
144 <<
"====== Calling TrackingGeometry::compactify() ===== " << std::endl;
146 size_t cSurfaces = 0;
147 size_t tSurfaces = 0;
151 msg <<
MSG::VERBOSE <<
" --> set TG ownership of " << cSurfaces <<
" out of "
152 << tSurfaces << std::endl;
153 for (
const auto& bLayerIter : m_boundaryLayers) {
154 bLayerIter.first->surfaceRepresentation().setOwner(
Trk::TGOwn);
156 msg <<
MSG::VERBOSE <<
" --> set TG ownership of " << m_boundaryLayers.size()
157 <<
" boundary layers." << std::endl;
173 m_boundaryLayers.clear();
174 return checkoutVolume;
180 msg <<
"TrackingGeometry Summary : " << std::endl;
184 printVolumeInformation(
msg, *highestVolume,
level);
193 int sublevel = lvl + 1;
197 msg <<
"TrackingVolume ( at : " << (&tvol) <<
") name: " << tvol.
volumeName()
201 if (confinedLayers) {
206 msg <<
"- found : " <<
layers.size() <<
" confined Layers" << std::endl;
211 if (confinedVolumes) {
217 msg <<
"- found : " << volumes.size() <<
" confined TrackingVolumes"
220 for (
const auto& volumesIter : volumes)
222 printVolumeInformation(
msg, *volumesIter, sublevel);
227 if (!confinedDenseVolumes.empty()) {
231 msg <<
"- found : " << confinedDenseVolumes.size()
232 <<
" confined unordered (dense) TrackingVolumes" << std::endl;
234 for (
const auto& volumesIter : (confinedDenseVolumes))
236 printVolumeInformation(
msg, *volumesIter, sublevel);
244 m_world->indexContainedStaticLayers(geosit,
offset);
245 m_world->indexContainedMaterialLayers(geosit,
offset);
254 bool isAtBoundary =
false;
258 for (
size_t ib = 0;
ib < bounds.size(); ++
ib) {
275 bool isAtBoundary =
false;
280 for (
size_t ib = 0;
ib < bounds.size(); ++
ib) {
285 bounds[
ib]->attachedVolume(gp,
mom,
dir);
286 if (!nextVol && attachedVol)
287 nextVol = attachedVol;
297 for (
const auto& bound_layers : m_boundaryLayers) {
298 out <<
head <<
" [" << bound_layers.second <<
"] ";
299 dumpLayer(
out,
"", bound_layers.first);
302 for (
const std::pair<const std::string, const TrackingVolume*>& volume :
304 out <<
head <<
" [" <<
counter++ <<
"] " << volume.first <<
" volumeBound=";
305 volume.second->volumeBounds().dump(
out);
308 volume.second->confinedArbitraryLayers();
309 if (!confArbLayers.empty()) {
311 for (
const Layer* confined_layer : confArbLayers) {
313 <<
" confinedArbitrary layer " << j++ <<
" ";
314 dumpLayer(
out,
"", confined_layer);
317 if (volume.second->confinedLayers()) {
319 for (
const Layer* confined_layer :
320 volume.second->confinedLayers()->arrayObjects()) {
322 <<
" confined layer" << j++ <<
" ";
323 dumpLayer(
out,
"", confined_layer);
331 const std::string&
head,
338 <<
"] d=" <<
layer->thickness();
339 out <<
layer->surfaceRepresentation();