Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Check if we end up in the expected volume in Gen1 Navigator #3442

Merged
merged 15 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified CI/physmon/reference/trackfinding_ttbar_pu200/performance_ckf.root
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions CI/physmon/workflows/physmon_trackfinding_ttbar_pu200.py
andiwand marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
addPythia8,
addFatras,
addDigitization,
ParticleSelectorConfig,
)
from acts.examples.reconstruction import (
addSeeding,
Expand Down Expand Up @@ -63,6 +64,10 @@
setup.trackingGeometry,
setup.field,
rnd=rnd,
preSelectParticles=ParticleSelectorConfig(
rho=(0.0, 24 * u.mm),
absZ=(0.0, 1.0 * u.m),
),
)

addDigitization(
Expand Down
76 changes: 49 additions & 27 deletions Core/include/Acts/Propagator/Navigator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,24 +276,6 @@ class Navigator {
m_cfg.trackingGeometry->highestTrackingVolume();
}

// We set the current surface to the start surface
// for eventual post-update action, e.g. material integration
// or collection when leaving a surface at the start of
// an extrapolation process
state.navigation.currentSurface = state.navigation.startSurface;
if (state.navigation.currentSurface != nullptr) {
ACTS_VERBOSE(volInfo(state)
<< "Current surface set to start surface "
<< state.navigation.currentSurface->geometryId());

assert(state.navigation.currentSurface->isOnSurface(
state.geoContext, stepper.position(state.stepping),
stepper.direction(state.stepping),
BoundaryTolerance::Infinite(),
state.options.surfaceTolerance) &&
"Stepper not on surface");
}

// Fast Navigation initialization for start condition:
// - short-cut through object association, saves navigation in the
// - geometry and volume tree search for the lowest volume
Expand All @@ -302,18 +284,26 @@ class Navigator {
ACTS_VERBOSE(
volInfo(state)
<< "Fast start initialization through association from Surface.");

// assign the current layer and volume by association
state.navigation.startLayer =
state.navigation.startSurface->associatedLayer();
state.navigation.currentLayer = state.navigation.startLayer;

state.navigation.startVolume =
state.navigation.startLayer->trackingVolume();
state.navigation.currentVolume = state.navigation.startVolume;
} else if (state.navigation.startVolume != nullptr) {
ACTS_VERBOSE(
volInfo(state)
<< "Fast start initialization through association from Volume.");

state.navigation.currentVolume = state.navigation.startVolume;

state.navigation.startLayer =
state.navigation.startVolume->associatedLayer(
state.geoContext, stepper.position(state.stepping));
state.navigation.currentLayer = state.navigation.startLayer;
} else {
ACTS_VERBOSE(volInfo(state)
<< "Slow start initialization through search.");
Expand All @@ -323,15 +313,17 @@ class Navigator {
<< toString(stepper.position(state.stepping))
<< " and direction "
<< toString(stepper.direction(state.stepping)));

state.navigation.startVolume =
m_cfg.trackingGeometry->lowestTrackingVolume(
state.geoContext, stepper.position(state.stepping));
state.navigation.startLayer =
state.navigation.startVolume != nullptr
? state.navigation.startVolume->associatedLayer(
state.geoContext, stepper.position(state.stepping))
: nullptr;
state.navigation.currentVolume = state.navigation.startVolume;

if (state.navigation.startVolume != nullptr) {
state.navigation.startLayer =
state.navigation.startVolume->associatedLayer(
state.geoContext, stepper.position(state.stepping));
state.navigation.currentLayer = state.navigation.startLayer;
ACTS_VERBOSE(volInfo(state) << "Start volume resolved.");
} else {
ACTS_VERBOSE(volInfo(state)
Expand All @@ -341,15 +333,41 @@ class Navigator {
}
}

if (state.navigation.startVolume != nullptr) {
ACTS_VERBOSE(volInfo(state) << "Start volume resolved.");
assert(state.navigation.startVolume->inside(
stepper.position(state.stepping),
state.options.surfaceTolerance) &&
"We did not end up inside the volume.");
}

if (state.navigation.startLayer != nullptr) {
ACTS_VERBOSE(volInfo(state) << "Start layer resolved "
<< state.navigation.startLayer->geometryId());
// We provide the layer to the resolve surface method in this case
resolveSurfaces(state, stepper);
}

// Set the start volume as current volume
state.navigation.currentVolume = state.navigation.startVolume;
// Set the start layer as current layer
state.navigation.currentLayer = state.navigation.startLayer;

if (state.navigation.startLayer != nullptr) {
ACTS_VERBOSE(volInfo(state) << "Start layer to be resolved.");
// We provide the layer to the resolve surface method in this case
resolveSurfaces(state, stepper);
// We set the current surface to the start surface for eventual post-update
// action, e.g. material integration or collection when leaving a surface at
// the start of an extrapolation process
state.navigation.currentSurface = state.navigation.startSurface;
if (state.navigation.currentSurface != nullptr) {
ACTS_VERBOSE(volInfo(state)
<< "Current surface set to start surface "
<< state.navigation.currentSurface->geometryId());

assert(state.navigation.currentSurface->isOnSurface(
state.geoContext, stepper.position(state.stepping),
stepper.direction(state.stepping),
BoundaryTolerance::Infinite(),
state.options.surfaceTolerance) &&
"Stepper not on surface");
}
}

Expand Down Expand Up @@ -551,6 +569,10 @@ class Navigator {
return;
} else {
ACTS_VERBOSE(volInfo(state) << "Volume updated.");
assert(state.navigation.currentVolume->inside(
stepper.position(state.stepping),
state.options.surfaceTolerance) &&
"We did not end up inside the volume.");
// Forget the boundary information
state.navigation.navBoundaries.clear();
state.navigation.navBoundaryIndex =
Expand Down
Loading