576 ++cache.m_methodSequence;
577 ATH_MSG_DEBUG(
"M-[" << cache.m_methodSequence <<
"] extrapolateToNextMaterialLayer(...) ");
593 std::vector<unsigned int> solutions;
597 bool resolveActive = destSurf ==
nullptr;
601 if (cache.m_lastMaterialLayer && !cache.m_lastMaterialLayer->isOnLayer(parm->position())) {
602 cache.m_lastMaterialLayer =
nullptr;
606 if (!cache.m_highestVolume) {
607 cache.m_highestVolume = cache.m_trackingGeometry->highestTrackingVolume();
614 staticVol = cache.m_trackingGeometry->lowestStaticTrackingVolume(gp);
617 nextStatVol != staticVol) {
618 staticVol = nextStatVol;
626 cache.m_navigSurfs.
clear();
628 cache.m_navigSurfs.emplace_back(destSurf,
false);
635 cache.m_identifiedParameters.reset();
637 ctx, cache, prop, currPar.index(), destSurf, alignTV,
dir,
particle);
642 if (staticVol && (staticVol != cache.m_currentStatic || resolveActive !=
m_resolveActive)) {
644 cache.m_currentStatic = staticVol;
645 cache.retrieveBoundaries();
647 cache.m_detachedVols.
clear();
648 cache.m_detachedBoundaries.clear();
649 cache.m_denseVols.clear();
650 cache.m_denseBoundaries.clear();
651 cache.m_layers.clear();
652 cache.m_navigLays.clear();
656 if (!detVols.empty()) {
658 for (; iTer != detVols.end(); ++iTer) {
660 const Trk::Layer* layR = (*iTer)->layerRepresentation();
662 const auto detBounds = (*iTer)->trackingVolume()->boundarySurfaces();
665 cache.m_detachedVols.emplace_back(*iTer, detBounds.size());
666 for (
unsigned int ibb = 0; ibb < detBounds.size(); ibb++) {
667 const Trk::Surface& surf = (detBounds[ibb])->surfaceRepresentation();
668 cache.m_detachedBoundaries.emplace_back(&surf,
true);
672 cache.addOneNavigationLayer((*iTer)->trackingVolume(), layR);
675 const auto&
multi = (*iTer)->multilayerRepresentation();
676 for (
const auto *
i :
multi) {
677 cache.addOneNavigationLayer((*iTer)->trackingVolume(),
i);
683 (*iTer)->name().compare((*iTer)->name().size() - 4, 4,
"PERM") ==
690 if ((*iTer)->trackingVolume()->zOverAtimesRho() != 0. &&
691 ((*iTer)->trackingVolume()->confinedDenseVolumes().empty()) &&
692 ((*iTer)->trackingVolume()->confinedArbitraryLayers().empty())) {
693 cache.m_denseVols.emplace_back((*iTer)->trackingVolume(), detBounds.size());
695 for (
unsigned int ibb = 0; ibb < detBounds.size(); ibb++) {
696 const Trk::Surface& surf = (detBounds[ibb])->surfaceRepresentation();
697 cache.m_denseBoundaries.emplace_back(&surf,
true);
701 (*iTer)->trackingVolume()->confinedArbitraryLayers();
702 if (!(*iTer)->trackingVolume()->confinedDenseVolumes().empty() ||
703 (confLays.size() > detBounds.size())) {
704 cache.m_detachedVols.emplace_back(*iTer, detBounds.size());
705 for (
unsigned int ibb = 0; ibb < detBounds.size(); ibb++) {
707 (detBounds[ibb])->surfaceRepresentation();
708 cache.m_detachedBoundaries.emplace_back(&surf,
true);
710 }
else if (!confLays.empty()) {
711 for (
const Trk::Layer*
const lIt : confLays) {
712 cache.addOneNavigationLayer((*iTer)->trackingVolume(), (lIt));
718 cache.m_denseResolved = std::pair<unsigned int, unsigned int>(cache.m_denseVols.size(),
719 cache.m_denseBoundaries.size());
720 cache.m_layerResolved = cache.m_layers.size();
723 cache.m_navigSurfs.insert(
724 cache.m_navigSurfs.end(), cache.m_staticBoundaries.begin(), cache.m_staticBoundaries.end());
740 std::unique_ptr<Trk::TrackParameters> pNextPar = prop.propagate(ctx,*currPar,cache.m_navigSurfs,
749 cache.m_parametersAtBoundary.resetBoundaryInformation();
754 if (propagVol->
zOverAtimesRho() != 0. && !cache.m_matstates && cache.m_extrapolationCache) {
755 if (not cache.elossPointerOverwritten()) {
757 ATH_MSG_DEBUG(cache.to_string(
" extrapolateToNextMaterialLayer"));
759 double dInX0 = std::abs(
path) / propagVol->
x0();
761 cache.m_extrapolationCache->updateX0(dInX0);
763 double currentqoverp = nextPar->parameters()[
Trk::qOverP];
765 materialProperties, std::abs(1. / currentqoverp), 1.,
dir,
particle);
767 << nextPar->momentum().mag() - currPar->momentum().mag() <<
","
769 cache.m_extrapolationCache->updateEloss(
770 eloss.meanIoni(), eloss.sigmaIoni(), eloss.meanRad(), eloss.sigmaRad());
779 double dInX0 = std::abs(
path) / propagVol->
x0();
781 double scatsigma = std::sqrt(
m_msupdater->sigmaSquare(
782 materialProperties, 1. / std::abs(nextPar->parameters()[
qOverP]), 1.,
particle));
786 double currentqoverp = nextPar->parameters()[
Trk::qOverP];
788 materialProperties, std::abs(1. / currentqoverp), 1.,
dir,
particle);
791 << nextPar->momentum().mag() - currPar->momentum().mag() <<
","
795 nextPar->position(), nextPar->momentum(), nextPar->charge()));
797 if (cache.m_extrapolationCache) {
799 ATH_MSG_DEBUG(cache.to_string(
" mat states extrapolateToNextMaterialLayer"));
801 cache.m_extrapolationCache->updateX0(dInX0);
802 cache.m_extrapolationCache->updateEloss(
803 eloss.meanIoni(), eloss.sigmaIoni(), eloss.meanRad(), eloss.sigmaRad());
808 auto mefot = std::make_unique<Trk::MaterialEffectsOnTrack>(
809 dInX0, newsa, std::make_unique<Trk::EnergyLoss>(std::move(eloss)),
810 cvlTP->associatedSurface());
811 cache.m_matstates->push_back(
new TrackStateOnSurface(
812 nullptr, std::move(cvlTP), std::move(mefot)));
814 <<
"', t/X0 = " << dInX0);
817 currPar = std::move(nextPar);
818 unsigned int isurf = destSurf ? 1 : 0;
819 if (destSurf && solutions[0] == 0) {
822 if (destSurf && solutions.size() > 1 && solutions[1] == 0) {
825 if (solutions[0] <= isurf + cache.m_staticBoundaries.size()) {
828 cache.m_currentStatic->
boundarySurfaces()[solutions[0] - isurf]->attachedVolume(
829 currPar->position(), currPar->momentum(),
dir);
830 cache.m_parametersAtBoundary.boundaryInformation(nextVol, currPar, currPar);
832 ATH_MSG_DEBUG(
" [!] World boundary at position R,z: " << currPar->position().perp() <<
","
833 << currPar->position().z());
846 cache.m_currentDense = cache.m_dense ? cache.m_currentStatic : cache.m_highestVolume;
847 cache.m_navigBoundaries.clear();
848 if (cache.m_denseVols.size() > cache.m_denseResolved.first) {
849 cache.m_denseVols.resize(cache.m_denseResolved.first);
851 while (cache.m_denseBoundaries.size() > cache.m_denseResolved.second) {
852 cache.m_denseBoundaries.pop_back();
854 if (cache.m_layers.size() > cache.m_layerResolved) {
855 cache.m_navigLays.resize(cache.m_layerResolved);
857 while (cache.m_layers.size() > cache.m_layerResolved) {
858 cache.m_layers.pop_back();
868 cache.m_navigVolsInt.clear();
870 gp = currPar->position();
871 std::vector<const Trk::DetachedTrackingVolume*> detVols =
872 cache.m_trackingGeometry->lowestDetachedTrackingVolumes(gp);
874 for (; dIter != detVols.end(); ++dIter) {
875 const Trk::Layer* layR = (*dIter)->layerRepresentation();
877 if (
active && !resolveActive) {
881 (*dIter)->name().compare((*dIter)->name().size() - 4, 4,
"PERM") != 0) {
895 if (!
active && confinedDense.empty() && confinedLays.empty()) {
899 if (!
active && confinedDense.empty() && confinedLays.size() <= bounds.size()) {
902 if (!confinedDense.empty() || !confinedLays.empty()) {
903 cache.m_navigVolsInt.emplace_back(dVol, bounds.size());
904 for (
unsigned int ib = 0;
ib < bounds.size();
ib++) {
906 cache.m_navigBoundaries.emplace_back(&surf,
true);
909 if (!confinedDense.empty()) {
910 auto vIter = confinedDense.begin();
911 for (; vIter != confinedDense.end(); ++vIter) {
912 const auto bounds = (*vIter)->boundarySurfaces();
913 cache.m_denseVols.emplace_back(*vIter, bounds.size());
914 for (
unsigned int ib = 0;
ib < bounds.size();
ib++) {
916 cache.m_denseBoundaries.emplace_back(&surf,
true);
921 if (!confinedLays.empty()) {
922 for (
const auto *confinedLay : confinedLays) {
923 cache.addOneNavigationLayer(dVol, confinedLay);
930 for (
const auto *subvol : subvols) {
944 if (vExit && nextVol && nextVol->inside(gp,
m_tolerance)) {
950 cache.m_navigVolsInt.emplace_back(detVol, bounds.size());
951 for (
unsigned int ib = 0;
ib < bounds.size();
ib++) {
953 cache.m_navigBoundaries.emplace_back(&surf,
true);
956 cache.m_denseVols.emplace_back(detVol, bounds.size());
957 for (
unsigned int ib = 0;
ib < bounds.size();
ib++) {
959 cache.m_denseBoundaries.emplace_back(&surf,
true);
967 cache.addOneNavigationLayer(detVol, lay);
971 detVol->
nextLayer(currPar->position(),
dir * currPar->momentum().unit(),
true);
972 if (nextLayer && nextLayer != lay) {
973 cache.addOneNavigationLayer(detVol, nextLayer);
978 cache.addOneNavigationLayer(detVol,
layer);
984 cache.copyToNavigationSurfaces();
987 cache.m_currentDense = cache.m_highestVolume;
988 if (cache.m_dense && cache.m_denseVols.empty()) {
989 cache.m_currentDense = cache.m_currentStatic;
991 for (
unsigned int i = 0;
i < cache.m_denseVols.size();
i++) {
996 cache.m_currentDense = dVol;
1010 std::vector<unsigned int> solutions;
1013 currPar->position() + 2 *
m_tolerance *
dir * currPar->momentum().normalized();
1014 if (!(cache.m_currentDense->inside(
tp, 0.))) {
1015 cache.m_currentDense = cache.m_highestVolume;
1016 if (cache.m_dense && cache.m_denseVols.empty()) {
1017 cache.m_currentDense = cache.m_currentStatic;
1019 for (
unsigned int i = 0;
i < cache.m_denseVols.size();
i++) {
1022 cache.m_currentDense = dVol;
1030 <<
" (current momentum: " << currPar->momentum().mag() <<
")");
1031 ATH_MSG_DEBUG(
" [+] " << cache.m_navigSurfs.size() <<
" target surfaces in '"
1032 << cache.m_currentDense->volumeName() <<
"'.");
1034 cache.manage(prop.propagate(ctx,
1044 cache.m_currentDense)));
1050 if (nextPar && !(cache.m_currentDense->inside(nextPar->position(),
m_tolerance) ||
1052 nextPar.get(), cache.m_currentDense,
dir, assocVol,
m_tolerance))) {
1053 ATH_MSG_DEBUG(
" [!] ERROR: missing volume boundary for volume"
1054 << cache.m_currentDense->volumeName());
1055 if (cache.m_currentDense->zOverAtimesRho() != 0.) {
1056 ATH_MSG_DEBUG(
" [!] ERROR: trying to recover: repeat the propagation step in"
1057 << cache.m_highestVolume->volumeName());
1058 cache.m_currentDense = cache.m_highestVolume;
1063 ATH_MSG_DEBUG(
" [+] Number of intersection solutions: " << solutions.size());
1064 if (cache.m_currentDense->zOverAtimesRho() != 0. && !cache.m_matstates &&
1065 cache.m_extrapolationCache) {
1066 if (not cache.elossPointerOverwritten()) {
1068 ATH_MSG_DEBUG(cache.to_string(
" extrapolateToNextMaterialLayer dense "));
1070 double dInX0 = std::abs(
path) / cache.m_currentDense->x0();
1071 cache.m_extrapolationCache->updateX0(dInX0);
1073 double currentqoverp = nextPar->parameters()[
Trk::qOverP];
1075 materialProperties, std::abs(1. / currentqoverp), 1.,
dir,
particle);
1076 cache.m_extrapolationCache->updateEloss(
1086 if (cache.m_currentDense->zOverAtimesRho() != 0. && cache.m_matstates) {
1087 double dInX0 = std::abs(
path) / cache.m_currentDense->x0();
1092 double scatsigma = std::sqrt(
m_msupdater->sigmaSquare(
1093 materialProperties, 1. / std::abs(nextPar->parameters()[
qOverP]), 1.,
particle));
1097 double currentqoverp = nextPar->parameters()[
Trk::qOverP];
1099 materialProperties, std::abs(1. / currentqoverp), 1.,
dir,
particle);
1102 << nextPar->momentum().mag() - currPar->momentum().mag() <<
","
1107 nextPar->position(), nextPar->momentum(), nextPar->charge()));
1109 if (cache.m_extrapolationCache) {
1111 ATH_MSG_DEBUG(cache.to_string(
" extrapolateToNextMaterialLayer dense"));
1113 cache.m_extrapolationCache->updateX0(dInX0);
1114 cache.m_extrapolationCache->updateEloss(eloss.meanIoni(),
1122 auto mefot = std::make_unique<Trk::MaterialEffectsOnTrack>(
1123 dInX0, newsa, std::make_unique<Trk::EnergyLoss>(std::move(eloss)), cvlTP->associatedSurface());
1125 cache.m_matstates->push_back(
new TrackStateOnSurface(
1126 nullptr, std::move(cvlTP), std::move(mefot)));
1128 ATH_MSG_DEBUG(
" [M] Collecting material from dense volume '"
1129 << cache.m_currentDense->volumeName() <<
"', t/X0 = " << dInX0);
1132 if (destSurf && solutions[0] == 0) {
1135 if (destSurf && solutions.size() > 1 && solutions[1] == 0) {
1142 nextPar->position(), nextPar->momentum().normalized());
1144 dist = distSol.
first();
1154 if (dist *
dir < 0.) {
1156 cache.m_parametersAtBoundary.resetBoundaryInformation();
1159 ATH_MSG_DEBUG(
" [+] New 3D-distance to destinatiion - d3 = " << dist *
dir);
1162 int iDest = destSurf ? 1 : 0;
1163 unsigned int iSol = 0;
1164 while (iSol < solutions.size()) {
1165 if (solutions[iSol] < iDest + cache.m_staticBoundaries.size()) {
1167 const Trk::Layer*
mb = cache.m_navigSurfs[solutions[iSol]].first->materialLayer();
1169 if (
mb->layerMaterialProperties() &&
1170 mb->layerMaterialProperties()->fullMaterial(nextPar->position())) {
1172 const IMaterialEffectsUpdator* currentUpdator =
1174 IMaterialEffectsUpdator::ICache& currentUpdatorCache =
1175 cache.subMaterialEffectsUpdatorCache();
1177 if (currentUpdator) {
1178 nextPar = cache.manage(
1179 currentUpdator->update(currentUpdatorCache,
1187 cache.m_parametersAtBoundary.resetBoundaryInformation();
1193 double lx0 = lmat->
x0();
1194 double layThick =
mb->thickness();
1198 std::abs(nextPar->momentum().normalized().dot(
mb->surfaceRepresentation().normal()));
1200 if (
mb->surfaceRepresentation().isOnSurface(
1201 mb->surfaceRepresentation().center(),
false, 0., 0.)) {
1202 thick = fmin(
mb->surfaceRepresentation().bounds().r(),
1203 layThick / std::abs(nextPar->momentum().normalized().dot(
1204 mb->surfaceRepresentation().normal())));
1206 thick = fmin(2 *
mb->thickness(), layThick / (1 - costr));
1209 if (!cache.m_matstates && cache.m_extrapolationCache) {
1210 if (not cache.elossPointerOverwritten()) {
1211 double dInX0 = thick / lx0;
1213 ATH_MSG_DEBUG(cache.to_string(
" extrapolateToNextMaterialLayer thin "));
1215 cache.m_extrapolationCache->updateX0(dInX0);
1216 double currentqoverp = nextPar->parameters()[
Trk::qOverP];
1218 *lmat, std::abs(1. / currentqoverp), 1. / costr,
dir,
particle);
1219 cache.m_extrapolationCache->updateEloss(
1220 eloss.meanIoni(), eloss.sigmaIoni(), eloss.meanRad(), eloss.sigmaRad());
1230 if (cache.m_matstates) {
1231 double dInX0 = thick / lx0;
1232 double scatsigma = std::sqrt(
m_msupdater->sigmaSquare(
1233 *lmat, 1. / std::abs(nextPar->parameters()[
qOverP]), 1.,
particle));
1237 double currentqoverp = nextPar->parameters()[
Trk::qOverP];
1239 *lmat, std::abs(1. / currentqoverp), 1. / costr,
dir,
particle);
1243 nextPar->position(), nextPar->momentum(), nextPar->charge()));
1244 if (cache.m_extrapolationCache) {
1245 if (not cache.elossPointerOverwritten()) {
1247 ATH_MSG_DEBUG(cache.to_string(
" extrapolateToNextMaterialLayer thin "));
1249 cache.m_extrapolationCache->updateX0(dInX0);
1250 cache.m_extrapolationCache->updateEloss(
1251 eloss.meanIoni(), eloss.sigmaIoni(), eloss.meanRad(), eloss.sigmaRad());
1260 std::make_unique<Trk::MaterialEffectsOnTrack>(
1262 std::make_unique<Trk::EnergyLoss>(std::move(eloss)),
1263 cvlTP->associatedSurface());
1264 cache.m_matstates->push_back(
new TrackStateOnSurface(
1265 nullptr, std::move(cvlTP), std::move(mefot)));
1271 unsigned int index = solutions[iSol] - iDest;
1273 nextVol = (cache.m_currentStatic->boundarySurfaces())[
index]->attachedVolume(
1274 nextPar->position(), nextPar->momentum(),
dir);
1277 !(nextVol->inside(nextPar->position() + 0.01 *
dir * nextPar->momentum().normalized(),
1279 ATH_MSG_DEBUG(
" [!] WARNING: wrongly assigned static volume ?"
1280 << cache.m_currentStatic->volumeName() <<
"->" << nextVol->volumeName());
1281 nextVol = cache.m_trackingGeometry->lowestStaticTrackingVolume(
1282 nextPar->position() + 0.01 * nextPar->momentum().normalized());
1284 ATH_MSG_DEBUG(
" new search yields: " << nextVol->volumeName());
1288 if (nextVol != cache.m_currentStatic) {
1289 cache.m_parametersAtBoundary.boundaryInformation(nextVol, nextPar, nextPar);
1291 << cache.m_currentStatic->volumeName() <<
"'.");
1293 nextPar.get(), cache.m_currentStatic,
dir, assocVol,
m_tolerance) &&
1294 assocVol != cache.m_currentStatic) {
1303 if (nextVol && nextPar) {
1304 ATH_MSG_DEBUG(
" [+] Crossing to next volume '" << nextVol->volumeName() <<
"'");
1310 }
else if (solutions[iSol] <
1311 iDest + cache.m_staticBoundaries.size() + cache.m_layers.size()) {
1313 unsigned int index = solutions[iSol] - iDest - cache.m_staticBoundaries.size();
1318 if (nextLayer == cache.m_lastMaterialLayer &&
1321 " [!] This layer is identical to the one with last material update, return layer "
1322 "without repeating the update");
1328 double layThick = nextLayer->
thickness();
1329 if (
collect && layThick > 0.) {
1332 const IMaterialEffectsUpdator* currentUpdator =
1334 IMaterialEffectsUpdator::ICache& currentUpdatorCache =
1335 cache.subMaterialEffectsUpdatorCache();
1337 if (currentUpdator) {
1338 nextPar = cache.manage(
1339 currentUpdator->update(currentUpdatorCache,
1347 cache.m_parametersAtBoundary.resetBoundaryInformation();
1355 double costr = std::abs(
1361 layThick / std::abs(nextPar->momentum().normalized().dot(
1364 thick = fmin(2 * nextLayer->
thickness(), layThick / (1 - costr));
1367 if (!cache.m_matstates && cache.m_extrapolationCache) {
1368 if (not cache.elossPointerOverwritten()) {
1369 double dInX0 = thick / lx0;
1371 ATH_MSG_DEBUG(cache.to_string(
" extrapolateToNextMaterialLayer thin "));
1373 cache.m_extrapolationCache->updateX0(dInX0);
1376 double currentqoverp = nextPar->parameters()[
Trk::qOverP];
1378 materialProperties, std::abs(1. / currentqoverp), 1. / costr,
dir,
particle);
1379 cache.m_extrapolationCache->updateEloss(
1380 eloss.meanIoni(), eloss.sigmaIoni(), eloss.meanRad(), eloss.sigmaRad());
1389 if (cache.m_matstates) {
1390 double dInX0 = thick / lx0;
1393 double scatsigma = std::sqrt(
m_msupdater->sigmaSquare(
1394 materialProperties, 1. / std::abs(nextPar->parameters()[
qOverP]), 1.,
particle));
1395 const double par_theta = std::abs(nextPar->parameters()[
Trk::theta]) > FLT_EPSILON
1400 double currentqoverp = nextPar->parameters()[
Trk::qOverP];
1402 materialProperties, std::abs(1. / currentqoverp), 1. / costr,
dir,
particle);
1405 auto cvlTP = std::make_unique<Trk::CurvilinearParameters>(
1406 nextPar->position(), nextPar->momentum(), nextPar->charge());
1407 if (cache.m_extrapolationCache) {
1408 if (not cache.elossPointerOverwritten()) {
1410 ATH_MSG_DEBUG(cache.to_string(
" extrapolateToNextMaterialLayer thin "));
1412 cache.m_extrapolationCache->updateX0(dInX0);
1413 cache.m_extrapolationCache->updateEloss(
1414 eloss.meanIoni(), eloss.sigmaIoni(), eloss.meanRad(), eloss.sigmaRad());
1422 auto mefot = std::make_unique<Trk::MaterialEffectsOnTrack>(
1423 dInX0, newsa, std::make_unique<Trk::EnergyLoss>(std::move(eloss)), cvlTP->associatedSurface());
1424 cache.m_matstates->push_back(
new TrackStateOnSurface(
1425 nullptr, std::move(cvlTP), std::move(mefot)));
1429 cache.m_lastMaterialLayer = nextLayer;
1435 if (resolveActive) {
1437 if (cache.m_navigLays[
index].first &&
1438 cache.m_navigLays[
index].first->confinedLayers()) {
1440 nextPar->position(),
dir * nextPar->momentum().normalized(),
true);
1442 cache.m_navigLays[
index].second = newLayer;
1449 }
else if (solutions[iSol] < iDest + cache.m_staticBoundaries.size() +
1450 cache.m_layers.size() + cache.m_denseBoundaries.size()) {
1452 unsigned int index =
1453 solutions[iSol] - iDest - cache.m_staticBoundaries.size() - cache.m_layers.size();
1454 std::vector<std::pair<const Trk::TrackingVolume*, unsigned int>>
::iterator dIter =
1455 cache.m_denseVols.begin();
1456 while (dIter != cache.m_denseVols.end() &&
index >= (*dIter).second) {
1457 index -= (*dIter).second;
1460 if (dIter != cache.m_denseVols.end()) {
1461 currVol = (*dIter).first;
1463 ((*dIter).first->boundarySurfaces())[
index]->attachedVolume(*nextPar,
dir);
1466 nextPar->position() + 2 *
m_tolerance *
dir * nextPar->momentum().normalized();
1468 cache.m_currentDense = currVol;
1470 cache.m_currentDense = cache.m_highestVolume;
1471 if (cache.m_dense && cache.m_denseVols.empty()) {
1472 cache.m_currentDense = cache.m_currentStatic;
1474 for (
unsigned int i = 0;
i < cache.m_denseVols.size();
i++) {
1477 cache.m_currentDense = dVol;
1479 << cache.m_currentDense->volumeName() <<
"'.");
1485 cache.m_currentDense = nextVol;
1486 ATH_MSG_DEBUG(
" [+] Next dense volume: '" << cache.m_currentDense->volumeName()
1490 }
else if (solutions[iSol] < iDest + cache.m_staticBoundaries.size() +
1491 cache.m_layers.size() + cache.m_denseBoundaries.size() +
1492 cache.m_navigBoundaries.size()) {
1494 unsigned int index = solutions[iSol] - iDest - cache.m_staticBoundaries.size() -
1495 cache.m_layers.size() - cache.m_denseBoundaries.size();
1496 std::vector<std::pair<const Trk::TrackingVolume*, unsigned int>>
::iterator nIter =
1497 cache.m_navigVolsInt.begin();
1498 while (nIter != cache.m_navigVolsInt.end() &&
index >= (*nIter).second) {
1499 index -= (*nIter).second;
1502 if (nIter != cache.m_navigVolsInt.end()) {
1503 currVol = (*nIter).first;
1505 ((*nIter).first->boundarySurfaces())[
index]->attachedVolume(*nextPar,
dir);
1508 nextPar->position() + 2 *
m_tolerance *
dir * nextPar->momentum().normalized();
1509 if (nextVol && nextVol->inside(
tp, 0.)) {
1510 ATH_MSG_DEBUG(
" [+] Navigation volume boundary, entering volume '"
1511 << nextVol->volumeName() <<
"'.");
1512 }
else if (currVol->
inside(
tp, 0.)) {
1514 ATH_MSG_DEBUG(
" [+] Navigation volume boundary, entering volume '"
1515 << nextVol->volumeName() <<
"'.");
1518 ATH_MSG_DEBUG(
" [+] Navigation volume boundary, leaving volume '"
1529 cache.m_currentStatic,
1536 }
else if (solutions[iSol] < iDest + cache.m_staticBoundaries.size() +
1537 cache.m_layers.size() + cache.m_denseBoundaries.size() +
1538 cache.m_navigBoundaries.size() +
1539 cache.m_detachedBoundaries.size()) {
1541 unsigned int index = solutions[iSol] - iDest - cache.m_staticBoundaries.size() -
1542 cache.m_layers.size() - cache.m_denseBoundaries.size() -
1543 cache.m_navigBoundaries.size();
1544 std::vector<std::pair<const Trk::DetachedTrackingVolume*, unsigned int>>
::iterator dIter =
1545 cache.m_detachedVols.begin();
1546 while (dIter != cache.m_detachedVols.end() &&
index >= (*dIter).second) {
1547 index -= (*dIter).second;
1550 if (dIter != cache.m_detachedVols.end()) {
1551 currVol = (*dIter).first->trackingVolume();
1554 ((*dIter).first->trackingVolume()->boundarySurfaces())[
index]->attachedVolume(
1557 nextPar->position() + 2 *
m_tolerance *
dir * nextPar->momentum().normalized();
1558 if (nextVol && nextVol->inside(
tp, 0.)) {
1559 ATH_MSG_DEBUG(
" [+] Detached volume boundary, entering volume '"
1560 << nextVol->volumeName() <<
"'.");
1561 }
else if (currVol->
inside(
tp, 0.)) {
1563 ATH_MSG_DEBUG(
" [+] Detached volume boundary, entering volume '"
1564 << nextVol->volumeName() <<
"'.");
1567 ATH_MSG_DEBUG(
" [+] Detached volume boundary, leaving volume '"
1578 cache.m_currentStatic,
1590 cache.m_parametersAtBoundary.boundaryInformation(cache.m_currentStatic, nextPar, nextPar);
1593 currPar = std::move(nextPar);