60 class RecursionCounter {
62 RecursionCounter(std::array<unsigned short,Trk::Cache::kNRecursionValues> &the_counter)
63 : m_counter(&the_counter)
70 std::array<unsigned short,Trk::Cache::kNRecursionValues> *m_counter;
75constexpr double s_distIncreaseTolerance = 100. * Gaudi::Units::millimeter;
85 const double prePositionR =
pars.position().perp();
87 return (prePositionR > (
pars.position() + dir * 0.5 * prePositionR *
88 pars.momentum().normalized())
96 std::stringstream outStream;
101 return outStream.str();
106 std::stringstream outStream;
108 outStream <<
"[eta,phi] = [ " <<
mom.eta() <<
", " <<
mom.phi() <<
" ]";
109 return outStream.str();
122 declareInterface<IExtrapolator>(
this);
141 const auto numberOfSubPropagatorsGiven =
m_propNames.size();
142 const auto numberOfSubMatEffUpdatersGiven =
m_updatNames.size();
145 m_propagators.push_back(
"Trk::RungeKuttaPropagator/DefaultPropagator");
148 m_updaters.push_back(
"Trk::MaterialEffectsUpdator/DefaultMaterialEffectsUpdator");
160 ATH_MSG_WARNING(
"None of the defined propagators could be retrieved!");
182 const unsigned int validmeuts =
m_updaters.size();
183 std::vector<std::string> fullPropagatorNames(
m_propagators.size());
184 std::vector<std::string> fullUpdatorNames(
m_updaters.size());
185 auto extractNameFromTool = [](
const auto& toolHndl) {
return toolHndl->name(); };
195 "Inconsistent setup of Extrapolator, no sub-propagators configured, doing it for you. ");
199 ATH_MSG_ERROR(
"Some configured propagators have same name but different owners");
207 ATH_MSG_DEBUG(
"Inconsistent setup of Extrapolator, no sub-material updaters configured, doing "
212 ATH_MSG_ERROR(
"Some configured material updaters have same name but different owners");
225 if (validprop && validmeuts) {
228 unsigned int index = 0;
229 for (
unsigned int iProp = 0; iProp <
m_propagators.size(); iProp++) {
236 " subPropagator:" << isign <<
" pointing to propagator: " <<
m_propagators[
index]->name());
241 for (
unsigned int iUp = 0; iUp <
m_updaters.size(); iUp++) {
254 "Configuration Problem of Extrapolator: "
255 <<
" -- At least one IPropagator and IMaterialUpdator instance have to be given.! ");
257 const std::string propStr = std::to_string(numberOfSubPropagatorsGiven) +
" propagator" +
258 std::string((numberOfSubPropagatorsGiven == 1) ?
"" :
"s");
259 const std::string updStr = std::to_string(numberOfSubMatEffUpdatersGiven) +
" updater" +
260 std::string((numberOfSubMatEffUpdatersGiven == 1) ?
"" :
"s");
261 std::string msgString{
"\nThe extrapolator uses six sub-propagators and "
262 "sub-material effects updaters:\n" };
263 msgString += propStr +
" and " + updStr +
" were given in the configuration,\n";
264 msgString +=
"the extrapolator sub-tools have been defined as follows: \n";
266 msgString += std::to_string(i) +
") propagator: " +
m_subPropagators[i]->name() +
272 return StatusCode::SUCCESS;
279 if (m_propStat.m_maxRecursionCount>0) {
280 ATH_MSG_INFO(
"ExtrapolatorStat: maximum-recursion-depth = " << m_propStat.m_maxRecursionCount);
282 if (m_propStat.m_maxPropagations>0) {
283 ATH_MSG_INFO(
"ExtrapolatorStat: maximum-number-of-propagations = " << m_propStat.m_maxPropagations);
285 if (m_propStat.m_maxMethodSequence>0) {
286 ATH_MSG_INFO(
"ExtrapolatorStat: maximum-method-sequence-number = " << m_propStat.m_maxMethodSequence);
290 ATH_MSG_INFO(
" [P] Method Statistics ------- ------------------------------------");
299 ATH_MSG_INFO(
"[P] Navigation Initialization -------------------------------------");
309 ATH_MSG_INFO(
" -> Number of destination global searches : "
311 ATH_MSG_INFO(
"[P] Navigation Breaks ---------------------------------------------");
320 ATH_MSG_INFO(
" -> Number of navigation breaks: dist. increase : "
325 <<
" loops occured in the following volumes: ");
327 <<
" oscillations occured in following volumes: ");
329 <<
" times no next volume found of volumes: ");
331 <<
" distance increases detected at volumes: ");
333 <<
" no propagator configured for volumes: ");
336 ATH_MSG_INFO(
"[P] Overlaps found ------------------------------------------------");
338 ATH_MSG_INFO(
" ------------------------------------------------------------------");
341 return StatusCode::SUCCESS;
345std::unique_ptr<Trk::TrackParameters>
355 if (!currentPropagator) {
360 ctx, (*currentPropagator), parm, sf, dir, bcheck, particle);
364std::unique_ptr<Trk::TrackParameters>
374 Cache cache(m_propStat);
379 dir, bcheck, particle,
380 matupmode, extrapolationCache));
384std::unique_ptr<Trk::NeutralParameters>
392 if (currentPropagator) {
393 return currentPropagator->
propagate(parameters, sf, dir, bcheck);
411 if (currentPropagator) {
416 " [!] No default Propagator is configured !");
421std::unique_ptr<Trk::TrackParameters>
423 const EventContext& ctx,
433 if (closestTrackParameters) {
435 ctx, *closestTrackParameters, sf, dir, bcheck, particle, matupmode, extrapolationCache));
438 if (closestTrackParameters) {
440 ctx, *closestTrackParameters, sf, dir, bcheck, particle, matupmode, extrapolationCache));
457 if (currentPropagator) {
458 Cache cache(m_propStat);
462 clonedInput, dir, bcheck, particle,
470std::vector<const Trk::TrackStateOnSurface*>*
480 Cache cache(m_propStat);
485 cache.
m_matstates =
new std::vector<const Trk::TrackStateOnSurface*>;
487 ATH_MSG_DEBUG(
" extrapolateM pointer extrapolationCache " << extrapolationCache <<
" x0tot "
488 << extrapolationCache->
x0tot());
495 if (parameterAtDestination) {
496 ATH_MSG_VERBOSE(
" [+] Adding the destination surface to the TSOS vector in extrapolateM() ");
498 nullptr, cache.
m_ownedPtrs.move(parameterAtDestination),
nullptr));
500 ATH_MSG_VERBOSE(
" [-] Destination surface was not hit extrapolateM()");
503 std::vector<const Trk::TrackStateOnSurface*>* tmpMatStates = cache.
m_matstates;
510std::unique_ptr<std::vector<std::pair<std::unique_ptr<Trk::TrackParameters>,
int>>>
512 const EventContext& ctx,
516 int destination)
const
520 Cache cache(m_propStat);
538 ctx, cache, cloneInput, -1., dir, particle, boundaryVol);
540 while (subDetBounds) {
541 ATH_MSG_DEBUG(
" Identified subdetector boundary crossing saved "
544 subDetBounds->uniqueClone(),
553 ctx, cache, subDetBounds, -1., dir, particle, boundaryVol);
562std::pair<std::unique_ptr<Trk::TrackParameters>,
const Trk::Layer*>
564 const EventContext& ctx,
568 std::vector<const Trk::TrackStateOnSurface*>& material,
576 if (currentPropagator) {
578 dir, bcheck, material, particle,
582 " [!] No default Propagator is configured ! Please check jobOptions.");
583 return {
nullptr,
nullptr};
587std::unique_ptr<Trk::TrackParameters>
598 if (currentPropagator) {
603 " [!] No default Propagator is configured ! Please check jobOptions.");
623 Cache cache(m_propStat);
639 ctx, cache, prop, clonedInput, sf, dir, bcheck, particle);
642 tmp.emplace_back(cache.
m_ownedPtrs.move(parameterOnSf));
651std::pair<std::unique_ptr<Trk::TrackParameters>,
const Trk::Layer*>
653 const EventContext& ctx,
658 std::vector<const Trk::TrackStateOnSurface*>& material,
662 Cache cache(m_propStat);
679 assocLayer =
nullptr;
682 staticVol, dir, bcheck, particle,
701 ATH_MSG_DEBUG(
" [+] Static volume boundary: continue loop over active layers in '"
715 if (currPar && assocLayer && assocLayer->
layerType() != 0) {
722 return {cache.
m_ownedPtrs.move(currPar), assocLayer};
739 ATH_MSG_WARNING(
"Too many recursive calls of extrapolateToNextMaterialLayer: "
747 ATH_MSG_WARNING(
"Too many method sequence calls of extrapolateToNextMaterialLayer: "
766 std::vector<unsigned int> solutions;
770 bool resolveActive = destSurf ==
nullptr;
790 nextStatVol != staticVol) {
791 staticVol = nextStatVol;
810 alignTV, dir, particle);
829 if (!detVols.empty()) {
830 Trk::ArraySpan<const Trk::DetachedTrackingVolume* const>::iterator iTer = detVols.begin();
831 for (; iTer != detVols.end(); ++iTer) {
833 const Trk::Layer* layR = (*iTer)->layerRepresentation();
835 const auto detBounds = (*iTer)->trackingVolume()->boundarySurfaces();
839 for (
unsigned int ibb = 0; ibb < detBounds.size(); ibb++) {
840 const Trk::Surface& surf = (detBounds[ibb])->surfaceRepresentation();
848 const auto& multi = (*iTer)->multilayerRepresentation();
849 for (
const auto *i : multi) {
856 (*iTer)->name().compare((*iTer)->name().size() - 4, 4,
"PERM") ==
863 if ((*iTer)->trackingVolume()->zOverAtimesRho() != 0. &&
864 ((*iTer)->trackingVolume()->confinedDenseVolumes().empty()) &&
865 ((*iTer)->trackingVolume()->confinedArbitraryLayers().empty())) {
866 cache.
m_denseVols.emplace_back((*iTer)->trackingVolume(), detBounds.size());
868 for (
unsigned int ibb = 0; ibb < detBounds.size(); ibb++) {
869 const Trk::Surface& surf = (detBounds[ibb])->surfaceRepresentation();
874 (*iTer)->trackingVolume()->confinedArbitraryLayers();
875 if (!(*iTer)->trackingVolume()->confinedDenseVolumes().empty() ||
876 (confLays.size() > detBounds.size())) {
878 for (
unsigned int ibb = 0; ibb < detBounds.size(); ibb++) {
880 (detBounds[ibb])->surfaceRepresentation();
883 }
else if (!confLays.empty()) {
884 for (
const Trk::Layer*
const lIt : confLays) {
933 const double dInX0 = std::abs(path) / propagVol->
x0();
937 const double currentqoverp = nextPar->parameters()[
Trk::qOverP];
939 materialProperties, std::abs(1. / currentqoverp), 1., dir, particle);
941 << nextPar->momentum().mag() - currPar->momentum().mag() <<
","
953 const double dInX0 = std::abs(path) / propagVol->
x0();
955 const double scatsigma = std::sqrt(
m_msupdater->sigmaSquare(
956 materialProperties, 1. / std::abs(nextPar->parameters()[
qOverP]), 1., particle));
958 0, 0, scatsigma / std::sin(nextPar->parameters()[
Trk::theta]), scatsigma);
960 const double currentqoverp = nextPar->parameters()[
Trk::qOverP];
962 materialProperties, std::abs(1. / currentqoverp), 1., dir, particle);
965 << nextPar->momentum().mag() - currPar->momentum().mag() <<
","
969 nextPar->position(), nextPar->momentum(), nextPar->charge()));
982 auto mefot = std::make_unique<Trk::MaterialEffectsOnTrack>(
983 dInX0, newsa, std::make_unique<Trk::EnergyLoss>(std::move(eloss)),
984 cvlTP->associatedSurface());
986 nullptr, std::move(cvlTP), std::move(mefot)));
988 <<
"', t/X0 = " << dInX0);
992 const unsigned int isurf = destSurf ? 1 : 0;
993 if (destSurf && solutions[0] == 0) {
996 if (destSurf && solutions.size() > 1 && solutions[1] == 0) {
1003 currPar->position(), currPar->momentum(), dir);
1006 ATH_MSG_DEBUG(
" [!] World boundary at position R,z: " << currPar->position().perp() <<
","
1007 << currPar->position().z());
1044 gp = currPar->position();
1045 std::vector<const Trk::DetachedTrackingVolume*> detVols =
1047 std::vector<const Trk::DetachedTrackingVolume*>::iterator dIter = detVols.begin();
1048 for (; dIter != detVols.end(); ++dIter) {
1049 const Trk::Layer* layR = (*dIter)->layerRepresentation();
1051 if (
active && !resolveActive) {
1055 (*dIter)->name().compare((*dIter)->name().size() - 4, 4,
"PERM") != 0) {
1069 if (!
active && confinedDense.empty() && confinedLays.empty()) {
1073 if (!
active && confinedDense.empty() && confinedLays.size() <= bounds.size()) {
1076 if (!confinedDense.empty() || !confinedLays.empty()) {
1078 for (
unsigned int ib = 0; ib < bounds.size(); ib++) {
1079 const Trk::Surface& surf = (bounds[ib])->surfaceRepresentation();
1083 if (!confinedDense.empty()) {
1084 auto vIter = confinedDense.begin();
1085 for (; vIter != confinedDense.end(); ++vIter) {
1086 const auto bounds = (*vIter)->boundarySurfaces();
1087 cache.
m_denseVols.emplace_back(*vIter, bounds.size());
1088 for (
unsigned int ib = 0; ib < bounds.size(); ib++) {
1089 const Trk::Surface& surf = (bounds[ib])->surfaceRepresentation();
1095 if (!confinedLays.empty()) {
1096 for (
const auto *confinedLay : confinedLays) {
1104 for (
const auto *subvol : subvols) {
1125 for (
unsigned int ib = 0; ib < bounds.size(); ib++) {
1126 const Trk::Surface& surf = (bounds[ib])->surfaceRepresentation();
1130 cache.
m_denseVols.emplace_back(detVol, bounds.size());
1131 for (
unsigned int ib = 0; ib < bounds.size(); ib++) {
1132 const Trk::Surface& surf = (bounds[ib])->surfaceRepresentation();
1145 detVol->
nextLayer(currPar->position(), dir * currPar->momentum().unit(),
true);
1146 if (nextLayer && nextLayer != lay) {
1151 for (
const auto *layer : layers) {
1165 for (
unsigned int i = 0; i < cache.
m_denseVols.size(); i++) {
1182 std::vector<unsigned int> solutions;
1185 currPar->position() + 2 *
m_tolerance * dir * currPar->momentum().normalized();
1191 for (
unsigned int i = 0; i < cache.
m_denseVols.size(); i++) {
1202 <<
" (current momentum: " << currPar->momentum().mag() <<
")");
1217 ATH_MSG_DEBUG(
" [!] ERROR: missing volume boundary for volume"
1220 ATH_MSG_DEBUG(
" [!] ERROR: trying to recover: repeat the propagation step in"
1227 ATH_MSG_DEBUG(
" [+] Number of intersection solutions: " << solutions.size());
1237 const double currentqoverp = nextPar->parameters()[
Trk::qOverP];
1239 materialProperties, std::abs(1. / currentqoverp), 1., dir, particle);
1252 if (path * dir < 0.) {
1256 const double scatsigma = std::sqrt(
m_msupdater->sigmaSquare(
1257 materialProperties, 1. / std::abs(nextPar->parameters()[
qOverP]), 1., particle));
1259 0, 0, scatsigma / std::sin(nextPar->parameters()[
Trk::theta]), scatsigma);
1261 const double currentqoverp = nextPar->parameters()[
Trk::qOverP];
1263 materialProperties, std::abs(1. / currentqoverp), 1., dir, particle);
1266 << nextPar->momentum().mag() - currPar->momentum().mag() <<
","
1271 nextPar->position(), nextPar->momentum(), nextPar->charge()));
1286 auto mefot = std::make_unique<Trk::MaterialEffectsOnTrack>(
1287 dInX0, newsa, std::make_unique<Trk::EnergyLoss>(std::move(eloss)), cvlTP->associatedSurface());
1290 nullptr, std::move(cvlTP), std::move(mefot)));
1292 ATH_MSG_DEBUG(
" [M] Collecting material from dense volume '"
1296 if (destSurf && solutions[0] == 0) {
1299 if (destSurf && solutions.size() > 1 && solutions[1] == 0) {
1306 nextPar->position(), nextPar->momentum().normalized());
1308 dist = distSol.
first();
1318 if (dist * dir < 0.) {
1319 ATH_MSG_DEBUG(
" [+] Destination surface missed ? " << dist <<
"," << dir);
1323 ATH_MSG_DEBUG(
" [+] New 3D-distance to destinatiion - d3 = " << dist * dir);
1326 int const iDest = destSurf ? 1 : 0;
1327 unsigned int iSol = 0;
1328 while (iSol < solutions.size()) {
1333 if (mb->layerMaterialProperties() &&
1334 mb->layerMaterialProperties()->fullMaterial(nextPar->position())) {
1341 if (currentUpdator) {
1343 currentUpdator->
update(currentUpdatorCache, nextPar,
1344 *mb, dir, particle, matupmode));
1353 const double lx0 = lmat->
x0();
1354 const double layThick = mb->thickness();
1357 const double costr =
1358 std::abs(nextPar->momentum().normalized().dot(mb->surfaceRepresentation().normal()));
1360 if (mb->surfaceRepresentation().isOnSurface(
1361 mb->surfaceRepresentation().center(),
false, 0., 0.)) {
1362 thick = fmin(mb->surfaceRepresentation().bounds().r(),
1363 layThick / std::abs(nextPar->momentum().normalized().dot(
1364 mb->surfaceRepresentation().normal())));
1366 thick = fmin(2 * mb->thickness(), layThick / (1 - costr));
1371 const double dInX0 = thick / lx0;
1376 const double currentqoverp = nextPar->parameters()[
Trk::qOverP];
1378 *lmat, std::abs(1. / currentqoverp), 1. / costr, dir, particle);
1391 const double dInX0 = thick / lx0;
1392 const double scatsigma = std::sqrt(
m_msupdater->sigmaSquare(
1393 *lmat, 1. / std::abs(nextPar->parameters()[
qOverP]), 1., particle));
1395 0, 0, scatsigma / std::sin(nextPar->parameters()[
Trk::theta]), scatsigma);
1397 const double currentqoverp = nextPar->parameters()[
Trk::qOverP];
1399 *lmat, std::abs(1. / currentqoverp), 1. / costr, dir, particle);
1403 nextPar->position(), nextPar->momentum(), nextPar->charge()));
1420 std::make_unique<Trk::MaterialEffectsOnTrack>(
1422 std::make_unique<Trk::EnergyLoss>(std::move(eloss)),
1423 cvlTP->associatedSurface());
1425 nullptr, std::move(cvlTP), std::move(mefot)));
1431 const unsigned int index = solutions[iSol] - iDest;
1434 nextPar->position(), nextPar->momentum(), dir);
1437 !(nextVol->
inside(nextPar->position() + 0.01 * dir * nextPar->momentum().normalized(),
1439 ATH_MSG_DEBUG(
" [!] WARNING: wrongly assigned static volume ?"
1442 nextPar->position() + 0.01 * nextPar->momentum().normalized());
1463 if (nextVol && nextPar) {
1470 }
else if (solutions[iSol] <
1477 bool collect =
true;
1481 " [!] This layer is identical to the one with last material update, return layer "
1482 "without repeating the update");
1484 if (!destSurf && (nextLayer->
layerType() > 0)) {
1488 const double layThick = nextLayer->
thickness();
1489 if (collect && layThick > 0.) {
1497 if (currentUpdator) {
1499 currentUpdator->
update(currentUpdatorCache, nextPar,
1500 *nextLayer, dir, particle, matupmode));
1511 const double costr = std::abs(
1517 layThick / std::abs(nextPar->momentum().normalized().dot(
1520 thick = fmin(2 * nextLayer->
thickness(), layThick / (1 - costr));
1525 const double dInX0 = thick / lx0;
1532 const double currentqoverp = nextPar->parameters()[
Trk::qOverP];
1534 materialProperties, std::abs(1. / currentqoverp), 1. / costr, dir, particle);
1546 const double dInX0 = thick / lx0;
1549 const double scatsigma = std::sqrt(
m_msupdater->sigmaSquare(
1550 materialProperties, 1. / std::abs(nextPar->parameters()[
qOverP]), 1., particle));
1551 const double par_theta = std::abs(nextPar->parameters()[
Trk::theta]) > FLT_EPSILON
1556 const double currentqoverp = nextPar->parameters()[
Trk::qOverP];
1558 materialProperties, std::abs(1. / currentqoverp), 1. / costr, dir, particle);
1561 auto cvlTP = std::make_unique<Trk::CurvilinearParameters>(
1562 nextPar->position(), nextPar->momentum(), nextPar->charge());
1578 auto mefot = std::make_unique<Trk::MaterialEffectsOnTrack>(
1579 dInX0, newsa, std::make_unique<Trk::EnergyLoss>(std::move(eloss)), cvlTP->associatedSurface());
1581 nullptr, std::move(cvlTP), std::move(mefot)));
1587 if (!destSurf && nextLayer->
layerType() > 0) {
1591 if (resolveActive) {
1596 nextPar->position(), dir * nextPar->momentum().normalized(),
true);
1608 unsigned int index =
1610 std::vector<std::pair<const Trk::TrackingVolume*, unsigned int>>
::iterator dIter =
1613 index -= (*dIter).second;
1617 currVol = (*dIter).first;
1619 ((*dIter).first->boundarySurfaces())[
index]->attachedVolume(*nextPar, dir);
1622 nextPar->position() + 2 *
m_tolerance * dir * nextPar->momentum().normalized();
1630 for (
unsigned int i = 0; i < cache.
m_denseVols.size(); i++) {
1652 std::vector<std::pair<const Trk::TrackingVolume*, unsigned int>>
::iterator nIter =
1655 index -= (*nIter).second;
1659 currVol = (*nIter).first;
1661 ((*nIter).first->boundarySurfaces())[
index]->attachedVolume(*nextPar, dir);
1664 nextPar->position() + 2 *
m_tolerance * dir * nextPar->momentum().normalized();
1665 if (nextVol && nextVol->
inside(tp, 0.)) {
1666 ATH_MSG_DEBUG(
" [+] Navigation volume boundary, entering volume '"
1668 }
else if (currVol->
inside(tp, 0.)) {
1670 ATH_MSG_DEBUG(
" [+] Navigation volume boundary, entering volume '"
1674 ATH_MSG_DEBUG(
" [+] Navigation volume boundary, leaving volume '"
1682 dir, bcheck, particle, matupmode);
1693 std::vector<std::pair<const Trk::DetachedTrackingVolume*, unsigned int>>
::iterator dIter =
1696 index -= (*dIter).second;
1700 currVol = (*dIter).first->trackingVolume();
1703 ((*dIter).first->trackingVolume()->boundarySurfaces())[
index]->attachedVolume(
1706 nextPar->position() + 2 *
m_tolerance * dir * nextPar->momentum().normalized();
1707 if (nextVol && nextVol->
inside(tp, 0.)) {
1708 ATH_MSG_DEBUG(
" [+] Detached volume boundary, entering volume '"
1710 }
else if (currVol->
inside(tp, 0.)) {
1712 ATH_MSG_DEBUG(
" [+] Detached volume boundary, entering volume '"
1716 ATH_MSG_DEBUG(
" [+] Detached volume boundary, leaving volume '"
1724 dir, bcheck, particle, matupmode);
1766 std::vector<unsigned int> solutions;
1784 nextStatVol != currVol) {
1785 currVol = nextStatVol;
1787 if (currVol && currVol != vol) {
1797 ATH_MSG_DEBUG(
" [!] failing in retrieval of AlignableTV, return 0");
1806 if (binIDMat->second > 0) {
1807 std::unique_ptr<Trk::TrackParameters> identified_parm = currPar->uniqueClone();
1809 std::pair<std::unique_ptr<Trk::TrackParameters>,
int>(std::move(identified_parm), binIDMat->second));
1840 std::vector<unsigned int> solutions;
1844 <<
" (current momentum: " << currPar->momentum().mag() <<
")");
1858 solutions, cache.
m_matstates, intersections, path,
false,
false,
1865 ATH_MSG_DEBUG(
" [+] Number of intersection solutions: " << solutions.size());
1867 if (destSurf && solutions[0] == 0) {
1870 if (destSurf && solutions.size() > 1 && solutions[1] == 0) {
1877 nextPar->position(), nextPar->momentum().normalized());
1879 dist = distSol.
first();
1889 if (dist * dir < 0.) {
1890 ATH_MSG_DEBUG(
" [+] Destination surface missed ? " << dist <<
"," << dir);
1894 ATH_MSG_DEBUG(
" [+] New 3D-distance to destinatiion - d3 = " << dist * dir);
1897 int const iDest = destSurf ? 1 : 0;
1898 unsigned int iSol = 0;
1899 while (iSol < solutions.size()) {
1903 const unsigned int index = solutions[iSol] - iDest;
1906 nextPar->position(), nextPar->momentum(), dir);
1909 !(nextVol->
inside(nextPar->position() + 0.01 * dir * nextPar->momentum().normalized(),
1911 ATH_MSG_DEBUG(
" [!] WARNING: wrongly assigned static volume ?"
1914 nextPar->position() + 0.01 * nextPar->momentum().normalized());
1933 std::unique_ptr<Trk::TrackParameters> identified_parm = nextPar->uniqueClone();
1935 std::pair<std::unique_ptr<Trk::TrackParameters>,
int>(std::move(identified_parm),
1936 -binIDMat->second));
1957 if (nextVol && nextPar) {
1983std::unique_ptr<Trk::TrackParameters>
1997std::unique_ptr<Trk::TrackParameters>
2008 <<
"] extrapolateToVolume(...) to volume '" << vol.
volumeName() <<
"'.");
2009 std::unique_ptr<TrackParameters> returnParms =
nullptr;
2015 std::vector<std::pair<const Trk::Surface*, double>> surfaces;
2016 surfaces.reserve(bounds.size());
2017 for (
unsigned int ib = 0; ib < bounds.size(); ib++) {
2018 const Trk::Surface* nextSurface = &((bounds[ib])->surfaceRepresentation());
2023 dist = distSol.
first();
2027 if (!surfaces.empty() && distSol.
numberOfSolutions() >= 0 && dist < surfaces.back().second) {
2028 std::vector<std::pair<const Trk::Surface*, double>>
::iterator sIter = surfaces.begin();
2029 while (sIter != surfaces.end()) {
2030 if (dist < (*sIter).second) {
2035 sIter = surfaces.insert(sIter, (std::pair<const Trk::Surface*, double>(nextSurface, dist)));
2037 surfaces.emplace_back(nextSurface, dist);
2043 for (std::pair<const Trk::Surface*, double>
const& a_surface : surfaces) {
2044 if (a_surface.second > 0) {
2045 Cache cache(m_propStat);
2051 propDir,
true, particle));
2052 if (returnParms.get() == &parm) {
2053 throw std::logic_error(
"Did not create new track parameters.");
2062 for (std::vector<std::pair<const Trk::Surface*, double>>::reverse_iterator rsIter =
2064 rsIter != surfaces.rend();
2066 if ((*rsIter).second < 0) {
2067 Cache cache(m_propStat);
2074 if (returnParms.get() == &parm) {
2075 throw std::logic_error(
"Did not create new track parameters.");
2114 for (
unsigned int imueot = 0; imueot <
m_subupdaters.size(); ++imueot) {
2138 refParameters, nextLayer, nextVolume, destVolume);
2147 " [!] Navigation direction could not be resolved, switching to extrapolateDirectly()");
2154 startVolume = nextVolume;
2156 bool fallback =
false;
2158 double currentDistance = 0.;
2159 double previousDistance = 0.;
2161 if (refParameters) {
2164 currentDistance = (refParameters->
position() - parm->position()).mag();
2168 sf.straightLineDistanceEstimate(parm->position(), dir * parm->momentum().normalized());
2176 ATH_MSG_VERBOSE(
" [+] Initial 3D-distance to destination - d3 = " << currentDistance);
2183 << ((nextVolume) ? nextVolume->
volumeName() :
"Unknown (ERROR)")
2186 :
"Unknown (blind extrapolation)"));
2190 ATH_MSG_VERBOSE(
" [+] Starting layer determined - with " << layerRZoutput(*nextLayer));
2207 bool updateLastValid =
true;
2209 bool punchThroughDone =
false;
2216 while (nextVolume && nextVolume != destVolume && nextVolume != lastVolume && nextParameters &&
2220 if (!currentPropagator) {
2224 ATH_MSG_DEBUG(
" - Reason : No Propagator found for Volume '"
2235 if (updateLastValid) {
2239 previousVolume = lastVolume;
2241 lastVolume = nextVolume;
2243 lastParameters = nextParameters;
2267 if (nextParameters) {
2270 "extrapolation in Calo/MS called without configured STEP propagator, aborting");
2275 *nextVolume, dir, bcheck, particle, matupmode);
2277 if (resultParameters) {
2280 for (
unsigned int imueot = 0; imueot <
m_subupdaters.size(); ++imueot) {
2286 ATH_MSG_DEBUG(
" [+] Destination surface successfully hit.");
2288 return resultParameters;
2292 ATH_MSG_DEBUG(
" [-] Destination surface could not be hit.");
2293 return resultParameters;
2316 previousDistance = currentDistance;
2324 if (distParameters) {
2327 if (refParameters) {
2328 currentDistance = (refParameters->
position() - distParameters->
position()).mag();
2332 distParameters->
position(), dir * distParameters->
momentum().normalized());
2340 << currentDistance <<
" (from "
2342 ?
"boundary parameters"
2343 :
"last parameters within volume ")
2348 if (nextVolume == lastVolume && nextVolume) {
2350 if (nextParameters && lastParameters &&
2351 (nextParameters->position() - lastParameters->
position())
2352 .dot(lastParameters->
momentum().normalized()) *
2358 if (nextParameters && lastParameters) {
2360 "last step:" << (nextParameters->position() - lastParameters->
position()).mag());
2362 ATH_MSG_DEBUG(
"- Reason : Loop detected in TrackingVolume '"
2373 else if (nextVolume == previousVolume && nextVolume) {
2375 if (punchThroughDone) {
2378 ATH_MSG_DEBUG(
"- Reason : Oscillation detected in TrackingVolume '"
2381 ++navigationBreakOscillation;
2388 punchThroughDone =
true;
2389 ATH_MSG_DEBUG(
" [!] One time punch-through a volume done.");
2401 ++navigationBreakNoVolume;
2411 currentDistance > s_distIncreaseTolerance + previousDistance) {
2415 << previousDistance <<
" to " << currentDistance <<
"] in TrackingVolume '"
2418 ++navigationBreakDistIncrease;
2427 ATH_MSG_DEBUG(
" [+] Navigation stop : either the update killed the "
2428 "track, or end of detector/boundary volume reached");
2436 " [+] Navigation stop : next navigation step would lead outside given boundary volume");
2441 else if (nextVolume) {
2446 !nextVolume || currentDistance <= previousDistance;
2448 if (!nextParameters) {
2449 nextParameters = lastParameters;
2452 nextLayer =
nullptr;
2460 ?
"return 0 (configured) "
2461 :
"switch to extrapolateDirectly() "));
2469 if (!currentPropagator) {
2478 if (!resultParameters) {
2483 return resultParameters;
2495 ATH_MSG_DEBUG(
"create finalNextParameters " << *finalNextParameters);
2501 if (currentPropagator) {
2503 ctx, cache, *currentPropagator, nextParameters, sf, nextLayer,
2504 *nextVolume, dir, bcheck, particle, matupmode);
2510 if (finalNextParameters)
2511 ATH_MSG_DEBUG(
"propagate using parameters " << *finalNextParameters);
2513 ATH_MSG_DEBUG(
"no finalNextParameters, bailing out of extrapolateDirectly");
2516 ATH_MSG_DEBUG(
" [-] Fallback to extrapolateDirectly triggered ! ");
2518 prop.
propagate(ctx, *finalNextParameters, sf, dir, bcheck,
2523 return resultParameters;
2531 const std::vector<MaterialEffectsOnTrack>& sfMeff,
2542 <<
"] extrapolate with given MaterialEffectsOnTrack in Volume '"
2553 prop.
propagate(ctx, *currPar, a_sfMeff.associatedSurface(), dir,
true,
2559 return (currPar!= parm)
2571 if (currentUpdator) {
2573 currentUpdatorCache, currPar, a_sfMeff, particle, matupmode));
2597 cache.
m_cacheEloss = extrapolationCache ? extrapolationCache->
eloss() :
nullptr;
2600 ATH_MSG_DEBUG(
" In extrapolate cache pointer input: " << extrapolationCache
2601 <<
" cache.m_extrapolationCache "
2611 if (currentPropagator) {
2612 return extrapolateImpl(ctx, cache, (*currentPropagator), parm, sf, dir,
2613 bcheck, particle, matupmode);
2616 " [!] No default Propagator is configured ! Please check jobOptions.");
2660 const Layer* assocLayer,
2670 ctx, cache, prop, parm, sf, tvol, dir, bcheck, particle, matupmode);
2674 ctx, cache,
false, prop, parm, assocLayer, tvol, dir, bcheck, particle, matupmode);
2692 << tvol.
volumeName() <<
"' to destination surface. ");
2709 nextParameters->position(), dir * nextParameters->momentum().normalized());
2711 dist = distSol.
first();
2716 if (destinationLayer && destinationLayer->
isOnLayer(nextParameters->position())) {
2717 ATH_MSG_DEBUG(
" [-] Already at destination layer, distance:" << dist);
2720 particle,
false, currVol));
2728 prop.
propagate(ctx, *nextParameters, sf, oppDir, bcheck,
2738 particle,
false, currVol));
2743 prop.
propagate(ctx, *nextParameters, sf, oppDir, bcheck,
2747 ATH_MSG_DEBUG(
" [!] Initial 3D-distance to the surface negative ("
2748 << dist <<
") -> skip extrapolation.");
2753 ATH_MSG_DEBUG(
" [+] Initial 3D-distance to destination - d3 = " << dist);
2764 while (nextParameters) {
2767 ctx, cache, prop, nextParameters, &sf, currVol, dir, bchk, particle, matupmode);
2772 onNextLayer->position(), dir * onNextLayer->momentum().normalized());
2780 if (sf.type() != onNextLayer->associatedSurface().type()) {
2782 <<
static_cast<int>(sf.type())
2783 <<
"," <<
static_cast<int>(onNextLayer->associatedSurface().type())
2784 <<
":distance to the destination surface:" << currentDistance);
2796 nextParameters = onNextLayer;
2809 dist = distSol.
first();
2821 if (last_boundary_parameters &&
2824 " [!] Already tried parameters at boundary -> exit: pos="
2841 nextParameters = onNextLayer;
2845 ATH_MSG_DEBUG(
" [+] extrapolateWithinDetachedVolumes(...) reached static boundary, return to "
2847 return nextParameters;
2855 const Layer* assocLayer,
2865 " [!] toVolumeBoundaryDetachedVolumes(...) with confined detached volumes? This should "
2866 "not happen ! volume name and signature: "
2871 ctx, cache,
true, prop, parm, assocLayer, tvol, dir, bcheck, particle, matupmode));
2905 const double rPos = parm->position().perp();
2906 double rComponent = parm->momentum().normalized().perp();
2908 rComponent = rComponent < 10e-5 ? 10e-5 : rComponent;
2910 double rScalor = (toBoundary && tvol.
boundarySurfaces().size() == 3) ? 2. * rPos / rComponent
2911 : 0.5 * rPos / rComponent;
2912 rScalor = rScalor * rScalor < 10e-10 ? 0.1 : rScalor;
2917 <<
"] insideVolumeStaticLayers(...) to volume boundary of '"
2921 <<
"] insideVolumeStaticLayers(...) to destination surface in '"
2926 " [+] Volume does not contain layers, just propagate to destination surface.");
2931 if (!nextParameters) {
2936 return nextParameters;
2942 " [+] Perpendicular direction of the track : " << radialDirection(*navParameters, dir));
2944 const Trk::Layer* associatedLayer = assocLayer;
2946 const Trk::Layer* assocLayerReference = assocLayer;
2953 const Trk::Layer* destinationLayer =
nullptr;
2957 if (!destinationLayer) {
2964 if (destinationLayer) {
2966 << layerRZoutput(*destinationLayer));
2979 " [+] In starting volume: check for eventual necessary postUpdate and overlapSearch.");
2982 const Trk::Layer* parsLayer = nextParameters->associatedSurface().associatedLayer();
2983 if ((parsLayer && parsLayer == associatedLayer) ||
2991 overlapSearch(ctx, cache, prop, parm, nextParameters, *associatedLayer,
2992 tvol, dir, bcheck, particle,
true);
2996 ATH_MSG_VERBOSE(
" [+] Calling postUpdate on inital track parameters.");
3004 if (currentUpdator) {
3006 currentUpdatorCache, *nextParameters, *associatedLayer, dir,
3007 particle, matupmode));
3012 ctx, cache, prop, nextParameters, *associatedLayer, tvol, dir, particle);
3014 if (nextParameters && nextParameters != parm) {
3017 nextParameters = parm;
3026 assocLayer =
nullptr;
3033 if (!associatedLayer) {
3034 ATH_MSG_VERBOSE(
" [+] Volume switch has happened, searching for entry layers.");
3042 << layerRZoutput(*associatedLayer));
3047 ctx, cache, prop, parm, *associatedLayer, tvol, dir, bcheck, particle, matupmode);
3048 nextParameters = new_track_parm;
3058 ATH_MSG_VERBOSE(
" [+] Parameter outside the given boundary/world stopping loop.");
3065 if (nextParameters) {
3071 if (!nextParameters) {
3072 nextParameters = parm;
3080 if (nextParameters != parm) {
3081 navParameters = nextParameters;
3084 if (destinationLayer != assocLayerReference || toBoundary) {
3086 associatedLayer = assocLayer ? assocLayer : tvol.
associatedLayer(navParameters->position());
3090 (associatedLayer && associatedLayer == assocLayerReference)
3091 ? associatedLayer->
nextLayer(navParameters->position(),
3092 dir * rScalor * navParameters->momentum().normalized())
3096 if (associatedLayer) {
3097 ATH_MSG_VERBOSE(
" [+] Associated layer at start with " << layerRZoutput(*associatedLayer));
3101 if (destinationLayer || toBoundary) {
3103 if (associatedLayer && associatedLayer != destinationLayer) {
3106 << layerRZoutput(*associatedLayer));
3110 ctx, cache, prop, nextParameters, tvol, associatedLayer,
3111 destinationLayer, navParameters, dir, bcheck, particle,
3122 ATH_MSG_VERBOSE(
" [+] Parameter outside the given boundary/world stopping loop.");
3130 nextParameters = updateNext;
3138 *destinationLayer, tvol, assocLayerReference, dir, bcheck, particle,
3144 return nextParameters;
3148 }
else if (!toBoundary) {
3156 return nextParameters;
3160 if (!nextParameters) {
3161 nextParameters = parm;
3165 unsigned int navprop = 0;
3174 const bool vetoNavParameters =
false;
3179 if (nextParameters != parm || assocLayerReference) {
3180 navParameters = nextParameters;
3190 << momentumOutput(navParameters->momentum()));
3194 m_navigator->nextTrackingVolume(ctx, *navPropagator, *navParameters, dir, tvol);
3199 bParameters = navParameters;
3209 m_navigator->nextTrackingVolume(ctx, prop, *navParameters, dir, tvol);
3213 bParameters = navParameters;
3220 if (navParameters) {
3229 if (bParameters && bParameters->associatedSurface().materialLayer()) {
3237 if (currentUpdator) {
3239 currentUpdatorCache, bParameters,
3240 *(bParameters->associatedSurface().materialLayer()), dir, particle,
3246 ctx, cache, prop, bParameters,
3247 *(bParameters->associatedSurface().materialLayer()), tvol, dir,
3250 navParameters = bParameters;
3256 nextVolume, nextParameters, navParameters, exitFace);
3259 return navParameters;
3270 const Layer* startLayer,
3271 const Layer* destinationLayer,
3293 bool perpCheck = radialDirection(*currPar, dir) * radialDirection(*navParameters, dir) > 0;
3296 unsigned int failedAttempts = 0;
3299 const unsigned int layersInVolume =
3302 const unsigned int maxAttempts =
3304 static_cast<unsigned int>(layersInVolume * 0.5));
3306 ATH_MSG_VERBOSE(
" [+] Maximum number of failed layer attempts: " << maxAttempts);
3315 while (nextLayer && nextLayer != previousLayer && nextLayer != lastLayer &&
3316 nextLayer != destinationLayer && failedAttempts < maxAttempts) {
3320 :
"navigation layer with "))
3321 << layerRZoutput(*nextLayer));
3328 ctx, cache, prop, currPar, *nextLayer, tvol, dir, bcheck, particle,
3329 matupmode, perpCheck);
3333 previousLayer = lastLayer;
3334 lastLayer = nextLayer;
3338 ATH_MSG_VERBOSE(
" [+] Material update killed the track parameters - return 0");
3346 ATH_MSG_VERBOSE(
" [+] Parameter outside the given boundary/world stopping loop.");
3350 ATH_MSG_VERBOSE(
" [+] Intersection successful: allowing for " << maxAttempts
3351 <<
" more failed attempt.");
3355 navParameters = nextPar;
3364 nextLayer->
nextLayer(navParameters->position(), dir * navParameters->momentum().normalized());
3368 ATH_MSG_VERBOSE(
" [+] No next Layer provided by the previous layer -> stop of layer2layer");
3371 if (failedAttempts >= maxAttempts) {
3387 const Layer* startLayer,
3398 const bool startIsDestLayer = startLayer == (&lay);
3404 if (!destParameters) {
3416 if (currentUpdator && destParameters && !startIsDestLayer) {
3418 currentUpdatorCache, destParameters, lay, dir, particle, matupmode));
3420 preUpdatedParameters = destParameters;
3425 currentUpdator && !startIsDestLayer &&
3428 ctx, cache, prop, preUpdatedParameters, lay, tvol, dir, particle);
3433 ATH_MSG_VERBOSE(
" [o] Calling overlapSearch() on destination layer.");
3435 overlapSearch(ctx, cache, prop, parm, preUpdatedParameters, lay, tvol, dir,
3436 bcheck, particle, startIsDestLayer);
3439 if (preUpdatedParameters) {
3444 return preUpdatedParameters;
3447std::pair<Trk::CacheOwnedPtr<Trk::TrackParameters>,
bool>
3458 bool doPerpCheck)
const
3478 return std::make_pair(
nullptr,
false);
3482 int const rDirection = radialDirection(*parm, dir);
3483 int const newrDirection = radialDirection(*parsOnLayer, dir);
3484 if (newrDirection != rDirection && doPerpCheck) {
3486 ATH_MSG_DEBUG(
" [!] Perpendicular direction of track has changed -- checking");
3490 ATH_MSG_DEBUG(
" [+] Perpendicular direction check cancelled this layer intersection.");
3498 << momentumOutput(parsOnLayer->momentum()));
3505 ATH_MSG_VERBOSE(
" [o] Calling overlapSearch() on intermediate layer.");
3506 overlapSearch(ctx, cache, prop, parm, parsOnLayer, lay, tvol, dir, bcheck, particle);
3511 if (lastElement >= 0 && sizeBeforeSearch < sizeAfterSearch) {
3516 throw std::logic_error(
"Invalid track parameters on det elements (lastElement)");
3522 ATH_MSG_DEBUG(
" [+] Detector element & overlapSearch successful,"
3523 <<
" call update on last parameter on this layer.");
3530 currentUpdatorCache, parsOnLayer, lay, dir, particle, matupmode));
3539 return std::make_pair(
nullptr,
true);
3542 return std::make_pair(parsOnLayer,
false);
3556 bool startingLayer)
const
3559 const bool isDestinationLayer = (&parsOnLayer->associatedSurface() == cache.
m_destinationSurface);
3563 ((parm->associatedSurface()).associatedDetectorElement() && startingLayer)
3564 ? &(parm->associatedSurface())
3569 ? &parsOnLayer->associatedSurface()
3572 ATH_MSG_VERBOSE(
" [o] OverlapSearch called " << (startSurface ?
"with " :
"w/o ") <<
"start, "
3573 << (endSurface ?
"with " :
"w/o ")
3580 detSurface = isDestinationLayer ? lay.
subSurface(parsOnLayer->localPosition())
3583 ATH_MSG_VERBOSE(
" [o] Detector surface found through subSurface() call");
3588 ATH_MSG_VERBOSE(
" [o] Detector surface found through parameter on layer association");
3592 const bool isStartLayer = (detSurface && detSurface == startSurface);
3596 bool reorderDetParametersOnLayer =
false;
3601 if (isDestinationLayer) {
3602 detParameters = parsOnLayer;
3603 }
else if (isStartLayer) {
3604 detParameters = parm;
3605 }
else if (detSurface) {
3611 bool surfaceHit =
true;
3615 if (detParameters && !isStartLayer && !isDestinationLayer) {
3616 ATH_MSG_VERBOSE(
" [o] First intersection with Detector surface: " << *detParameters);
3618 surfaceHit = detParameters && detSurface ? detSurface->
isOnSurface(detParameters->position())
3621 surfaceHit = (surfaceHit && startSurface)
3622 ? ((detParameters->position() - parm->position())
3623 .dot(dir * parm->momentum().normalized()) > 0)
3625 surfaceHit =(surfaceHit && endSurface)
3626 ? ((detParameters->position() - parsOnLayer->position())
3627 .dot(dir * parsOnLayer->momentum().normalized()) < 0)
3639 detParametersOnLayer.emplace_back(cache.
m_ownedPtrs.move(detParameters));
3640 }
else if (detParameters) {
3643 " [-] Detector surface hit cancelled through bounds check or start/end surface check.");
3648 if (track_parm_for_overlap) {
3650 std::vector<Trk::SurfaceIntersection> cSurfaces;
3651 size_t const ncSurfaces =
3656 ATH_MSG_VERBOSE(
"found " << ncSurfaces <<
" candidate sensitive surfaces to test.");
3661 for (
auto& csf : cSurfaces) {
3668 if (overlapParameters) {
3669 ATH_MSG_VERBOSE(
" [+] Overlap surface was hit, checking start/end surface condition.");
3672 surfaceHit = (startSurface) ? ((overlapParameters->position() - parm->position())
3673 .dot(dir * parm->momentum().normalized()) > 0)
3676 surfaceHit = (surfaceHit && endSurface)
3677 ? ((overlapParameters->position() - parsOnLayer->position())
3678 .dot(dir * parsOnLayer->momentum().normalized()) < 0)
3684 ++overlapSurfaceHit;
3686 reorderDetParametersOnLayer =
true;
3688 detParametersOnLayer.emplace_back(cache.
m_ownedPtrs.move(overlapParameters));
3692 " [-] Detector surface hit cancelled through start/end surface check.");
3701 if (reorderDetParametersOnLayer) {
3704 sort(detParametersOnLayer.begin(), detParametersOnLayer.end(), parameterSorter);
3710 std::move(detParametersOnLayer.begin(), detParametersOnLayer.end(),
3725 const Layer*& associatedLayer,
3732 ATH_MSG_DEBUG(
" [I] initializeNaviagtion() -------------------------- ");
3735 ATH_MSG_DEBUG(
" [I] (re)initializeNaviagtion() ---------------------- ");
3742 " [I] Starting with Start Layer/Volume search: ------------------------------");
3749 const char* startSearchType =
"association";
3753 const Trk::Surface* associatedSurface = &parm->associatedSurface();
3754 associatedLayer = (associatedSurface) ? associatedSurface->
associatedLayer() : associatedLayer;
3759 if (!associatedVolume && associatedSurface && associatedSurface == cache.
m_recallSurface &&
3766 startSearchType =
"recall";
3767 }
else if (!associatedVolume) {
3772 associatedVolume = cache.
volume(ctx,parm->position());
3775 (associatedVolume) ? associatedVolume->
associatedLayer(parm->position()) :
nullptr;
3778 startSearchType =
"global search";
3785 if (lowestStaticVol && lowestStaticVol != associatedVolume) {
3786 associatedVolume = lowestStaticVol;
3796 if (
m_navigator->atVolumeBoundary(parm, associatedVolume, dir, nextAssVol,
3798 nextAssVol != associatedVolume) {
3800 associatedVolume = nextAssVol;
3803 << associatedVolume->
volumeName() <<
" no action taken");
3810 " [I] 'AnyDirection' has been chosen: approaching direction must be determined.");
3817 if (refParameters) {
3819 const Amg::Vector3D surfaceDir(refParameters->position() - parm->position());
3820 if (surfaceDir.dot(parm->momentum()) > 0.) {
3828 << ((navigationDirection < 0) ?
"oppositeMomentum." :
"alongMomentum"));
3831 " [+] Approaching direction could not be determined, they remain: anyDirection.");
3834 ATH_MSG_VERBOSE(
" [I] Starting Information gathered through : " << startSearchType <<
".");
3840 ATH_MSG_VERBOSE(
" [I] Starting with destination Volume search: -----------------------------");
3844 destVolume = (sf.associatedLayer()) ? sf.associatedLayer()->enclosingTrackingVolume() :
nullptr;
3846 std::string destinationSearchType =
"association";
3852 if (!destVolume && ((&sf) == cache.
m_recallSurface) && sf.associatedDetectorElement()) {
3854 destinationSearchType =
"recall";
3857 }
else if (!destVolume) {
3859 destinationSearchType =
"global search";
3863 if (!refParameters && associatedVolume) {
3869 if (refParameters) {
3870 destVolume = cache.
volume(ctx,refParameters->position());
3877 destVolume = cache.
volume(ctx,sf.globalReferencePoint());
3880 ATH_MSG_VERBOSE(
" [I] Destination Information gathered through : " << destinationSearchType
3884 if (
msgLvl(MSG::VERBOSE)) {
3886 << (associatedVolume ?
"ok." :
"failed."));
3888 << (associatedLayer ?
"ok." :
"failed."));
3889 ATH_MSG_VERBOSE(
" [+] Destinaiton Volume search ...... " << (destVolume ?
"ok." :
"failed."));
3891 if (destVolume == associatedVolume) {
3894 const std::string navDirString =
3895 ((navigationDirection < 0) ?
"oppositeMomentum"
3896 : (navigationDirection > 0) ?
"alongMomentum" :
"undefined");
3898 ATH_MSG_VERBOSE(
" [I] initializeNaviagtion() end ---------------------- ");
3902 return navigationDirection;
3919 const double distToLayer = (startPosition - onLayerPosition).
mag();
3924 if (boundarySurfaces.size() == 4) {
3929 std::unique_ptr<const Trk::TrackParameters>
const parsOnInsideSurface(prop.
propagateParameters(
3932 const double distToInsideSurface =
3933 parsOnInsideSurface ? (startPosition - (parsOnInsideSurface->position())).mag() : 10e10;
3937 if (parsOnInsideSurface) {
3943 ATH_MSG_VERBOSE(
" [+] Check radial direction: distance layer / boundary = "
3944 << distToLayer <<
" / " << distToInsideSurface);
3946 return distToLayer < distToInsideSurface;
3954 std::stringstream outStream;
3957 outStream <<
"[r,phi,z] = [ " << pos.perp() <<
", " << pos.phi() <<
", " << pos.z() <<
" ]";
3959 outStream <<
"[xyz] = [ " << pos.x() <<
", " << pos.y() <<
", " << pos.z() <<
" ]";
3961 return outStream.str();
3978 double pathCorrection = 0.;
3986 parsOnLayer = parms;
3993 pathCorrection = pathCorrection > 0. ? pathCorrection
3995 parsOnLayer->position(), parsOnLayer->momentum());
3998 if (!materialProperties) {
4002 if (!materialProperties) {
4003 ATH_MSG_DEBUG(
" [!] No MaterialProperties on Layer after intersection.");
4009 const double tInX0 = pathCorrection * materialProperties->
thicknessInX0();
4014 const double currentQoP = parsOnLayer->parameters()[
Trk::qOverP];
4016 *materialProperties, std::abs(1. / currentQoP), pathCorrection, propDir, particle));
4025 ATH_MSG_VERBOSE(
" [V] Validation mode: MaterialProperties found on this layer.");
4028 const double tInX0 = pathCorrection * materialProperties->
thicknessInX0();
4030 const double currentQoP = parsOnLayer->parameters()[
Trk::qOverP];
4032 *materialProperties, std::abs(1. / currentQoP), pathCorrection, propDir,
4035 const double sigmaMS = std::sqrt(
m_msupdater->sigmaSquare(
4036 *materialProperties, std::abs(1. / currentQoP), pathCorrection, particle));
4042 if (energyLoss.meanIoni() == 0. && tInX0 > 0.) {
4044 "because the ElossUpdator is wrongly configured: "
4045 "switch joboption DetailedEloss on ");
4052 energyLoss.sigmaIoni(),
4053 energyLoss.meanRad(),
4054 energyLoss.sigmaRad());
4059 auto meot = std::make_unique<Trk::MaterialEffectsOnTrack>(
4060 tInX0, scatAngles, std::make_unique<Trk::EnergyLoss>(std::move(energyLoss)),
4064 nullptr, cache.
m_ownedPtrs.move(parsOnLayer), std::move(meot)));
4087 unsigned int iDest = 0;
4093 nextVol != destVol) {
4098 const bool resolveActive =
true;
4113 if (!tgVol || tgVol != destVol) {
4115 for (
unsigned int ib = 0; ib < bounds.size(); ib++) {
4116 const Trk::Surface& surf = (bounds[ib])->surfaceRepresentation();
4119 iDest = bounds.size();
4124 bool updateStatic =
false;
4128 updateStatic =
true;
4133 bool navigDone =
false;
4142 updateStatic =
true;
4161 updateStatic =
true;
4173 ctx, cache, nextPar, pathLim, dir, particle, destVol, matupmod);
4194 if (!detVols.empty()) {
4195 Trk::ArraySpan<const Trk::DetachedTrackingVolume* const>::iterator iTer = detVols.begin();
4196 for (; iTer != detVols.end(); ++iTer) {
4198 const Trk::Layer* layR = (*iTer)->layerRepresentation();
4200 const auto& detBounds = (*iTer)->trackingVolume()->boundarySurfaces();
4203 for (
unsigned int ibb = 0; ibb < detBounds.size(); ibb++) {
4204 const Trk::Surface& surf = (detBounds[ibb])->surfaceRepresentation();
4209 (*iTer)->name().compare((*iTer)->name().size() - 4, 4,
"PERM") ==
4213 if ((*iTer)->trackingVolume()->zOverAtimesRho() != 0. &&
4214 ((*iTer)->trackingVolume()->confinedDenseVolumes().empty()) &&
4215 ((*iTer)->trackingVolume()->confinedArbitraryLayers().empty())) {
4216 cache.
m_denseVols.emplace_back((*iTer)->trackingVolume(), detBounds.size());
4217 for (
unsigned int ibb = 0; ibb < detBounds.size(); ibb++) {
4218 const Trk::Surface& surf = (detBounds[ibb])->surfaceRepresentation();
4223 (*iTer)->trackingVolume()->confinedArbitraryLayers();
4224 if (!(*iTer)->trackingVolume()->confinedDenseVolumes().empty() ||
4225 (confLays.size() > detBounds.size())) {
4227 for (
unsigned int ibb = 0; ibb < detBounds.size(); ibb++) {
4228 const Trk::Surface& surf = (detBounds[ibb])->surfaceRepresentation();
4231 }
else if (!confLays.empty()) {
4232 for (
const Trk::Layer*
const lIt : confLays) {
4273 std::vector<std::pair<const Trk::TrackingVolume*, unsigned int>> navigVols;
4275 gp = currPar->position();
4276 std::vector<const Trk::DetachedTrackingVolume*> detVols =
4278 std::vector<const Trk::DetachedTrackingVolume*>::iterator dIter = detVols.begin();
4279 for (; dIter != detVols.end(); ++dIter) {
4280 const Trk::Layer* layR = (*dIter)->layerRepresentation();
4282 if (
active && !resolveActive) {
4286 (*dIter)->name().compare((*dIter)->name().size() - 4, 4,
"PERM") != 0) {
4300 if (!
active && confinedDense.empty() && confinedLays.empty()) {
4304 if (!
active && confinedDense.empty() && confinedLays.size() <= bounds.size()) {
4307 if (!confinedDense.empty() || !confinedLays.empty()) {
4308 navigVols.emplace_back(dVol, bounds.size());
4309 for (
unsigned int ib = 0; ib < bounds.size(); ib++) {
4310 const Trk::Surface& surf = (bounds[ib])->surfaceRepresentation();
4314 if (!confinedDense.empty()) {
4315 auto vIter = confinedDense.begin();
4316 for (; vIter != confinedDense.end(); ++vIter) {
4317 const auto& bounds = (*vIter)->boundarySurfaces();
4318 cache.
m_denseVols.emplace_back(*vIter, bounds.size());
4319 for (
unsigned int ib = 0; ib < bounds.size(); ib++) {
4320 const Trk::Surface& surf = (bounds[ib])->surfaceRepresentation();
4326 if (!confinedLays.empty()) {
4327 for (
const auto *confinedLay : confinedLays) {
4335 for (
const auto *subvol : subvols) {
4355 navigVols.emplace_back(detVol, bounds.size());
4356 for (
unsigned int ib = 0; ib < bounds.size(); ib++) {
4357 const Trk::Surface& surf = (bounds[ib])->surfaceRepresentation();
4361 cache.
m_denseVols.emplace_back(detVol, bounds.size());
4362 for (
unsigned int ib = 0; ib < bounds.size(); ib++) {
4363 const Trk::Surface& surf = (bounds[ib])->surfaceRepresentation();
4370 for (
const auto* cLay : cLays) {
4371 if (cLay->layerType() > 0 || cLay->layerMaterialProperties()) {
4388 for (
const auto* cLay : cLays) {
4389 if (cLay->layerType() > 0 || cLay->layerMaterialProperties()) {
4401 for (
unsigned int i = 0; i < cache.
m_denseVols.size(); i++) {
4423 std::vector<unsigned int> solutions;
4426 <<
" (current momentum: " << currPar->momentum().mag() <<
")");
4431 <<
" with path limit" << pathLim
4434 <<
" in the direction" << dir <<
".");
4447 ATH_MSG_DEBUG(
" [+] Momentum after propagation - " << nextPar->momentum());
4450 if (pathLim > 0. && cache.
m_path + path >= pathLim) {
4458 ATH_MSG_DEBUG(
" [!] ERROR: missing volume boundary for volume"
4461 ATH_MSG_DEBUG(
" [!] ERROR: trying to recover: repeat the propagation step in"
4477 ATH_MSG_DEBUG(
" [+] Number of intersection solutions: " << solutions.size());
4482 const double currentqoverp = nextPar->parameters()[
Trk::qOverP];
4485 materialProperties, std::abs(1. / currentqoverp), 1., dir, particle));
4497 unsigned int iSol = 0;
4498 while (iSol < solutions.size()) {
4499 if (solutions[iSol] < iDest) {
4505 if (mb->layerMaterialProperties() &&
4506 mb->layerMaterialProperties()->fullMaterial(nextPar->position())) {
4507 const double pIn = nextPar->momentum().mag();
4512 if (currentUpdator) {
4515 currentUpdatorCache, nextPar, *mb, dir, particle, matupmod));
4522 ATH_MSG_VERBOSE(
" Updated energy loss:" << nextPar->momentum().mag() - pIn
4523 <<
"at position:" << nextPar->position());
4528 const unsigned int index = solutions[iSol] - iDest;
4531 nextPar->position(), nextPar->momentum(), dir);
4566 ctx, cache, nextPar, pathLim, dir, particle, destVol, matupmod);
4568 }
else if (solutions[iSol] <
4584 const double pIn = nextPar->momentum().mag();
4585 if (currentUpdator) {
4588 currentUpdatorCache, nextPar, *nextLayer, dir, particle, matupmod));
4596 << nextPar->momentum().mag() - pIn <<
"at position:"
4597 << nextPar->position() <<
", current momentum:" << nextPar->momentum());
4607 }
else if (nextLayer->
layerType() > 0 &&
4608 nextLayer->
isOnLayer(nextPar->position())) {
4618 if (postFactor > 0.1) {
4619 const double pIn = nextPar->momentum().mag();
4620 if (currentUpdator) {
4622 currentUpdatorCache, *nextPar, *nextLayer, dir, particle,
4631 ATH_MSG_VERBOSE(
" Post-update energy loss:" << nextPar->momentum().mag() - pIn
4633 << nextPar->position());
4637 const double pIn = nextPar->momentum().mag();
4638 if (currentUpdator) {
4640 currentUpdator->
update(currentUpdatorCache, nextPar,
4641 *nextLayer, dir, particle, matupmod));
4648 ATH_MSG_VERBOSE(
" Update energy loss:" << nextPar->momentum().mag() - pIn
4649 <<
"at position:" << nextPar->position());
4657 unsigned int index =
4659 std::vector<std::pair<const Trk::TrackingVolume*, unsigned int>>
::iterator dIter =
4662 index -= (*dIter).second;
4666 currVol = (*dIter).first;
4668 ((*dIter).first->boundarySurfaces())[
index]->attachedVolume(*nextPar, dir);
4671 nextPar->position() + 2 *
m_tolerance * dir * nextPar->momentum().normalized();
4672 if (currVol->
inside(tp, 0.)) {
4674 }
else if (!nextVol || !nextVol->
inside(tp, 0.)) {
4679 for (
unsigned int i = 0; i < cache.
m_denseVols.size(); i++) {
4701 std::vector<std::pair<const Trk::TrackingVolume*, unsigned int>>
::iterator nIter =
4703 while (nIter != navigVols.end() &&
index >= (*nIter).second) {
4704 index -= (*nIter).second;
4707 if (nIter != navigVols.end()) {
4708 currVol = (*nIter).first;
4710 ((*nIter).first->boundarySurfaces())[
index]->attachedVolume(*nextPar, dir);
4713 nextPar->position() + 2 *
m_tolerance * dir * nextPar->momentum().normalized();
4714 if (nextVol && nextVol->
inside(tp, 0.)) {
4715 ATH_MSG_DEBUG(
" [+] Navigation volume boundary, entering volume '"
4717 }
else if (currVol->
inside(tp, 0.)) {
4719 ATH_MSG_DEBUG(
" [+] Navigation volume boundary, entering volume '"
4723 ATH_MSG_DEBUG(
" [+] Navigation volume boundary, leaving volume '"
4730 ctx, cache, nextPar, pathLim, dir, particle, destVol, matupmod);
4742 std::vector<std::pair<const Trk::DetachedTrackingVolume*, unsigned int>>
::iterator dIter =
4745 index -= (*dIter).second;
4749 currVol = (*dIter).first->trackingVolume();
4751 ((*dIter).first->trackingVolume()->boundarySurfaces())[
index]->attachedVolume(
4755 nextPar->position() + 2 *
m_tolerance * dir * nextPar->momentum().normalized();
4756 if (nextVol && nextVol->
inside(tp, 0.)) {
4757 ATH_MSG_DEBUG(
" [+] Detached volume boundary, entering volume '"
4759 }
else if (currVol->
inside(tp, 0.)) {
4761 ATH_MSG_DEBUG(
" [+] Detached volume boundary, entering volume '"
4765 ATH_MSG_DEBUG(
" [+] Detached volume boundary, leaving volume '"
4771 ctx, cache, nextPar, pathLim, dir, particle, destVol, matupmod);
Scalar mag() const
mag method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Mixin class to perform additional checks on a component.
bool msgLvl(const MSG::Level lvl) const
Base Class for a navigation object (active) in the Calo realm.
const BinnedMaterial * binnedMaterial() const
access to binned material
virtual std::span< T *const > arrayObjects()=0
Return all objects of the Array non-const we can still modify the T.
for description of non-homogenous dense volumes
const IdentifiedMaterial * material(const Amg::Vector3D &position) const
access to material/id per bin
The BoundaryCheck class allows to steer the way surface boundaries are used for inside/outside checks...
Access to distance solutions.
double second() const
Distance to second intersection solution along direction (for a cylinder surface)
int numberOfSolutions() const
Number of intersection solutions.
double absClosest() const
Absolute Distance to closest solution.
double toPointOfClosestApproach() const
Distance to point of closest approach along direction.
double first() const
Distance to first intersection solution along direction.
This class describes energy loss material effects in the ATLAS tracking EDM.
double deltaE() const
returns the
Cache class to allow passing information to/between calls.
Interface class for the updater AlgTool, it inherits from IAlgTool.
virtual std::unique_ptr< TrackParameters > update(ICache &icache, const TrackParameters *param, const Layer &sf, PropDirection dir=alongMomentum, ParticleHypothesis particle=pion, MaterialUpdateMode matupmode=addNoise) const =0
Updator interface (full update for a layer): The parameters are given as a pointer owned by the calle...
virtual std::unique_ptr< TrackParameters > postUpdate(ICache &icache, const TrackParameters ¶m, const Layer &sf, PropDirection dir=alongMomentum, ParticleHypothesis particle=pion, MaterialUpdateMode matupmode=addNoise) const =0
Updator interface (pre-update for a layer): The parameters are given as a pointer owned by the caller...
virtual std::unique_ptr< TrackParameters > preUpdate(ICache &icache, const TrackParameters *param, const Layer &sf, PropDirection dir=alongMomentum, ParticleHypothesis particle=pion, MaterialUpdateMode matupmode=addNoise) const =0
Updator interface (pre-update for a layer): The parameters are given as a pointer owned by the caller...
Interface class IPropagators It inherits from IAlgTool.
virtual std::unique_ptr< TrackParameters > propagateParameters(const EventContext &ctx, const TrackParameters &parm, const Surface &sf, PropDirection dir, const BoundaryCheck &bcheck, const MagneticFieldProperties &mprop, ParticleHypothesis particle=pion, bool returnCurv=false, const TrackingVolume *tVol=nullptr) const =0
Main propagation method for parameters only.
virtual std::unique_ptr< NeutralParameters > propagate(const NeutralParameters ¶meters, const Surface &sf, PropDirection dir, const BoundaryCheck &bcheck, bool returnCurv=false) const =0
Main propagation method for NeutralParameters.
virtual std::unique_ptr< TrackParameters > propagateM(const EventContext &ctx, const TrackParameters &parm, std::vector< DestSurf > &sfs, PropDirection dir, const MagneticFieldProperties &mprop, ParticleHypothesis particle, std::vector< unsigned int > &solutions, std::vector< const Trk::TrackStateOnSurface * > *matstates, std::vector< std::pair< std::unique_ptr< Trk::TrackParameters >, int > > *intersections, double &path, bool usePathLim=false, bool returnCurv=false, const TrackingVolume *tVol=nullptr, Trk::ExtrapolationCache *cache=nullptr) const =0
Propagation interface: The propagation method with internal material collection.
int value() const
layerIndex expressed in an integer
Base Class for a Detector Layer in the Tracking realm.
size_t compatibleSurfaces(std::vector< SurfaceIntersection > &cSurfaces, const TrackParameters &pars, PropDirection pdir, const BoundaryCheck &bcheck, bool materialSurfacesOnly=true, const Surface *startSurface=nullptr, const Surface *endSurface=nullptr, const ICompatibilityEstimator *ice=nullptr) const
get compatible surfaces starting from charged parameters
int layerType() const
get the Layer coding
virtual const Surface & surfaceRepresentation() const =0
Transforms the layer into a Surface representation for extrapolation.
const MaterialProperties * fullUpdateMaterialProperties(const TrackParameters &par) const
getting the MaterialProperties back - for full update
virtual bool isOnLayer(const Amg::Vector3D &gp, const BoundaryCheck &bcheck=BoundaryCheck(true)) const
isOnLayer() method, using isOnSurface() with Layer specific tolerance
const Layer * nextLayer(const Amg::Vector3D &gp, const Amg::Vector3D &udir) const
getting the next/previous Layer if registered - unit for direction vector required
const SurfaceArray * surfaceArray() const
Return the entire SurfaceArray, returns nullptr if no SurfaceArray.
const LayerMaterialProperties * layerMaterialProperties() const
getting the LayerMaterialProperties including full/pre/post update
const LayerIndex & layerIndex() const
get the layerIndex
virtual double postUpdateMaterialFactor(const TrackParameters &, PropDirection) const
getting the MaterialProperties back - for pre-update
virtual double preUpdateMaterialFactor(const TrackParameters &, PropDirection) const
getting the MaterialProperties back - for pre-update
double thickness() const
Return the Thickness of the Layer.
const TrackingVolume * enclosingTrackingVolume() const
get the confining TrackingVolume
const Surface * subSurface(const Amg::Vector3D &gp) const
If no subSurface array is defined or no subSurface can be found to the given Amg::Vector3D,...
magnetic field properties to steer the behavior of the extrapolation
represents the full description of deflection and e-loss of a track in material.
Material with information about thickness of material.
float thicknessInX0() const
Return the radiationlength fraction.
float x0() const
Return the radiation length.
float zOverAtimesRho() const
access to members
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
std::unique_ptr< ParametersBase< DIM, T > > uniqueClone() const
clone method for polymorphic deep copy returning unique_ptr; it is not overriden, but uses the existi...
represents a deflection of the track caused through multiple scattering in material.
virtual double r() const =0
Interface method for the maximal extension or the radius.
Abstract Base Class for tracking surfaces.
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
virtual DistanceSolution straightLineDistanceEstimate(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const =0
fast straight line distance evaluation to Surface
virtual const Trk::Surface * baseSurface() const
return the base surface (simplified for persistification)
virtual double pathCorrection(const Amg::Vector3D &pos, const Amg::Vector3D &mom) const
the pathCorrection for derived classes with thickness - it reflects if the direction projection is po...
virtual const Amg::Vector3D & normal() const
Returns the normal vector of the Surface (i.e.
virtual constexpr SurfaceType type() const =0
Returns the Surface type to avoid dynamic casts.
virtual const Amg::Vector3D & globalReferencePoint() const
Returns a global reference point on the surface, for PlaneSurface, StraightLineSurface,...
virtual bool isOnSurface(const Amg::Vector3D &glopo, const BoundaryCheck &bchk=true, double tol1=0., double tol2=0.) const
This method returns true if the GlobalPosition is on the Surface for both, within or without check of...
virtual const SurfaceBounds & bounds() const =0
Surface Bounds method.
const Trk::Layer * associatedLayer() const
return the associated Layer
const Amg::Vector3D & center() const
Returns the center position of the Surface.
represents the track state (measurement, material, fit parameters and quality) at a surface.
const DataVector< const TrackParameters > * trackParameters() const
Return a pointer to a vector of TrackParameters.
std::vector< const Trk::DetachedTrackingVolume * > lowestDetachedTrackingVolumes(const Amg::Vector3D &gp) const
return the vector of lowest detached tracking Volume(->overlaps)
const TrackingVolume * trackingVolume(const std::string &name) const
return the tracking Volume by name, 0 if it doesn't exist
const Layer * associatedLayer(const Amg::Vector3D &gp) const
Forward the associated Layer information.
const TrackingVolume * highestTrackingVolume() const
return the world
const TrackingVolume * lowestStaticTrackingVolume(const Amg::Vector3D &gp) const
return the lowest static tracking Volume
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
const LayerArray * confinedLayers() const
Return the subLayer array.
GeometrySignature geometrySignature() const
return the Signature
const Layer * associatedLayer(const Amg::Vector3D &gp) const
Return the associated Layer.
const TrackingVolumeArray * confinedVolumes() const
Return the subLayer array.
const TrackingVolume * associatedSubVolume(const Amg::Vector3D &gp) const
Return the associated sub Volume, returns THIS if no subVolume exists.
std::vector< std::shared_ptr< BoundarySurface< TrackingVolume > > > & boundarySurfaces()
Method to return the BoundarySurfaces.
const std::string & volumeName() const
Returns the VolumeName - for debug reason, might be depreciated later.
const Layer * nextLayer(const Amg::Vector3D &gp, const Amg::Vector3D &mom, bool asres=true, bool skipNavLayer=false) const
Return the next Layer if existing, NULL if no next layer corresponds.
ArraySpan< DetachedTrackingVolume const *const > confinedDetachedVolumes() const
Return detached subVolumes - not the ownership.
virtual bool isAlignable() const
ArraySpan< Layer const *const > confinedArbitraryLayers() const
Return the confined subLayer array.
ArraySpan< TrackingVolume const *const > confinedDenseVolumes() const
Return unordered subVolumes - not the ownership.
Base class for all volumes inside the tracking realm, it defines the interface for inherited Volume c...
bool inside(const Amg::Vector3D &gp, double tol=0.) const
Inside() method for checks.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
PropDirection
PropDirection, enum for direction of the propagation.
static const Amg::Transform3D s_idTransform
idendity transformation
ParametersBase< NeutralParametersDim, Neutral > NeutralParameters
BoundarySurfaceFace
Enum to describe the position of the BoundarySurface respectively to the frame orientatin of the volu...
CurvilinearParametersT< TrackParametersDim, Charged, PlaneSurface > CurvilinearParameters
ComparisonFunction< TrackParameters > TrkParametersComparisonFunction
@ FastField
call the fast field access method of the FieldSvc
@ FullField
Field is set to be realistic, but within a given Volume.
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.
MaterialUpdateMode
This is a steering enum to force the material update it can be: (1) addNoise (-1) removeNoise Second ...
std::pair< std::shared_ptr< Material >, int > IdentifiedMaterial
std::vector< std::unique_ptr< Trk::TrackParameters > > TrackParametersUVector
ParametersBase< TrackParametersDim, Charged > TrackParameters
const Surface * m_destinationSurface
the boundary volume check
const Layer * m_lastMaterialLayer
cache for collecting the total X0 ans Eloss
std::string elossPointerErrorMsg(int lineNumber=0) const
String error message if the cache has a problem.
const Volume * m_boundaryVolume
Destination Surface for recall.
const Trk::EnergyLoss * m_cacheEloss
cache of TrackStateOnSurfaces
void retrieveBoundaries()
Retrieve boundaries.
const Trk::TrackingVolume * volume(const EventContext &, const Amg::Vector3D &gp) const
void setRecallInformation(const Surface &, const Layer &, const TrackingVolume &)
Private method for setting recall Information.
bool elossPointerOverwritten() const
Check cache integrity.
std::vector< std::pair< const Trk::Surface *, Trk::BoundaryCheck > > m_navigSurfs
std::array< unsigned short, kNRecursionValues > m_recursionCount
const TrackingVolume * m_recallTrackingVolume
const Layer * m_recallLayer
Destination TrackingVolume for recall.
std::pair< unsigned int, unsigned int > m_denseResolved
double m_path
Pointer (not owning) pointing.
std::vector< Trk::IMaterialEffectsUpdator::ICache > m_MaterialUpCache
internal switch for resolved configuration
unsigned int m_layerResolved
void addOneNavigationLayer(const Trk::TrackingVolume *pDetVol, const Trk::Layer *pLayer, bool boundaryCheck=true)
Add one layer and navigLayer.
std::vector< DestSurf > m_detachedBoundaries
void populateMatEffUpdatorCache(const std::vector< const IMaterialEffectsUpdator * > &updaters)
std::vector< std::pair< const Trk::TrackingVolume *, const Trk::Layer * > > m_navigLays
unsigned int m_nPropagations
@ kRecursionCountExceeded
const Surface * m_recallSurface
Destination Layer for recall.
std::vector< DestSurf > m_staticBoundaries
const Trk::TrackingVolume * m_highestVolume
Trk::ExtrUniquePtrHolder< Trk::TrackParameters > m_ownedPtrs
parameters to be used for final propagation in case of fallback
IMaterialEffectsUpdator::ICache & subMaterialEffectsUpdatorCache(const TrackingVolume &tvol)
Get the IMaterialEffectsUpdator::ICache for the MaterialEffectsUpdator.
Trk::TrackParameters * m_lastValidParameters
return helper for parameters and boundary
std::vector< std::pair< const Trk::TrackingVolume *, unsigned int > > m_navigVolsInt
std::vector< const Trk::TrackStateOnSurface * > * m_matstates
void setTrackingGeometry(const Trk::INavigator &navigator, const EventContext &ctx)
void resetRecallInformation()
std::vector< std::pair< const Trk::DetachedTrackingVolume *, unsigned int > > m_detachedVols
std::string to_string(const std::string &txt) const
String representation of cache.
std::vector< std::pair< const Trk::TrackingVolume *, unsigned int > > m_denseVols
std::vector< DestSurf > m_navigBoundaries
const Trk::TrackingGeometry * m_trackingGeometry
std::unique_ptr< identifiedParameters_t > m_identifiedParameters
enum Trk::Cache::EStatus m_status
void copyToNavigationSurfaces()
Insert navigation surfaces from layers, dense boundaries, navig boundaries and detached boundaries.
Trk::ExtrapolationCache * m_extrapolationCache
cache pointer for Eloss
ParametersNextVolume m_parametersAtBoundary
Caches per MaterialUpdator.
const Trk::TrackingVolume * m_currentStatic
const Trk::TrackingVolume * m_currentDense
std::vector< DestSurf > m_layers
TrackParametersUVector * m_parametersOnDetElements
cache layer with last material update
unsigned int m_methodSequence
std::vector< DestSurf > m_denseBoundaries
useful struct for a single navigation cell
const TrackingVolume * nextVolume
BoundarySurfaceFace exitFace
std::unique_ptr< TrackParameters > parametersOnBoundary
void resetBoundaryInformation()
BoundarySurfaceFace exitFace
void boundaryInformation(const TrackingVolume *tvol, Trk::TrackParameters *nextPars, Trk::TrackParameters *navPars, BoundarySurfaceFace face=undefinedFace)
reset the boundary information by invalidating it
Trk::TrackParameters * navParameters
const TrackingVolume * nextVolume
< the members
Trk::TrackParameters * nextParameters