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

feat: Allow Core CKF to skip the start surface #3535

Merged
merged 10 commits into from
Aug 30, 2024
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15 changes: 15 additions & 0 deletions Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ struct CombinatorialKalmanFilterOptions {

/// Whether to consider energy loss.
bool energyLoss = true;

/// Skip the pre propagation call. This effectively skips the first surface
/// @note This is useful if the first surface should not be considered in a second reverse pass
bool skipPrePropagationUpdate = false;
};

template <typename track_container_t>
Expand Down Expand Up @@ -524,6 +528,9 @@ class CombinatorialKalmanFilter {
/// Whether to consider energy loss.
bool energyLoss = true;

/// Skip the pre propagation call. This effectively skips the first surface
bool skipPrePropagationUpdate = false;

/// Calibration context for the finding run
const CalibrationContext* calibrationContextPtr{nullptr};

Expand All @@ -547,6 +554,12 @@ class CombinatorialKalmanFilter {
return;
}

if (state.stage == PropagatorStage::prePropagation &&
skipPrePropagationUpdate) {
ACTS_VERBOSE("Skip first surface");
andiwand marked this conversation as resolved.
Show resolved Hide resolved
return;
}

ACTS_VERBOSE("CombinatorialKalmanFilter step");

assert(!result.activeBranches.empty() && "No active branches");
Expand Down Expand Up @@ -1263,6 +1276,8 @@ class CombinatorialKalmanFilter {
combKalmanActor.targetReached.surface = tfOptions.targetSurface;
combKalmanActor.multipleScattering = tfOptions.multipleScattering;
combKalmanActor.energyLoss = tfOptions.energyLoss;
combKalmanActor.skipPrePropagationUpdate =
tfOptions.skipPrePropagationUpdate;
combKalmanActor.actorLogger = m_actorLogger.get();
combKalmanActor.updaterLogger = m_updaterLogger.get();
combKalmanActor.calibrationContextPtr = &tfOptions.calibrationContext.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ ProcessCode TrackFindingAlgorithm::execute(const AlgorithmContext& ctx) const {
ctx.calibContext, slAccessorDelegate,
extensions, secondPropOptions);
secondOptions.targetSurface = m_cfg.reverseSearch ? nullptr : pSurface.get();
secondOptions.skipPrePropagationUpdate = true;

using Extrapolator = Acts::Propagator<Acts::SympyStepper, Acts::Navigator>;
using ExtrapolatorOptions =
Expand Down Expand Up @@ -542,9 +543,6 @@ ProcessCode TrackFindingAlgorithm::execute(const AlgorithmContext& ctx) const {
ACTS_WARNING("Second track has no reference surface.");
continue;
}
if (secondTrack.nMeasurements() <= 1) {
continue;
}

// TODO a copy of the track should not be necessary but is the
// safest way with the current EDM
Expand All @@ -559,8 +557,7 @@ ProcessCode TrackFindingAlgorithm::execute(const AlgorithmContext& ctx) const {
secondTrackCopy.reverseTrackStates(true);

firstState.previous() =
(*std::next(secondTrackCopy.trackStatesReversed().begin()))
.index();
secondTrackCopy.outermostTrackState().index();

// finalize the track candidate

Expand Down
8 changes: 4 additions & 4 deletions Examples/Python/tests/root_file_hashes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ test_digitization_example_input[smeared]__particles.root: 5fe7dda2933ee6b9615b06
test_digitization_example_input[smeared]__measurements.root: 243c2f69b7b0db9dbeaa7494d4ea0f3dd1691dc90f16e10df6c0491ff4dc7d62
test_digitization_example_input[geometric]__particles.root: 5fe7dda2933ee6b9615b064d192322fe07831133cd998e5ed99a3b992b713a10
test_digitization_example_input[geometric]__measurements.root: 63ec81635979058fb8976f94455bf490cf92b7b142c4a05cc39de6225f5de2fb
test_ckf_tracks_example[generic-full_seeding]__trackstates_ckf.root: c4eb6e58fe2351f41dce134878e523f8b78b875ffd5c87bb094ebb3aa0e8e432
test_ckf_tracks_example[generic-full_seeding]__tracksummary_ckf.root: 4fa859b395e172c613d466a2ea25cdd56ed1ab3cfd857d230f21bc184310d668
test_ckf_tracks_example[generic-full_seeding]__trackstates_ckf.root: b61fa5d207d3d87742a8bae454eb4c97b2ef6613fe38f388f147da104ec7ff84
test_ckf_tracks_example[generic-full_seeding]__tracksummary_ckf.root: 18580d384e3ceb126be9c5d8857e176cff6c7d549155012d87939c91dba87015
test_ckf_tracks_example[generic-full_seeding]__performance_seeding_trees.root: 0e0676ffafdb27112fbda50d1cf627859fa745760f98073261dcf6db3f2f991e
test_ckf_tracks_example[generic-truth_estimated]__trackstates_ckf.root: afc9984f5b1f0b9d42156a1c3917df68144f1c486dd2b9b9a199309aa958cddc
test_ckf_tracks_example[generic-truth_estimated]__tracksummary_ckf.root: e5db2791d9d09d88705c0dbeba666b4df441ecc920b9e400510df2913766e112
test_ckf_tracks_example[generic-truth_estimated]__performance_seeding.root: 1facb05c066221f6361b61f015cdf0918e94d9f3fce2269ec7b6a4dffeb2bc7e
test_ckf_tracks_example[generic-truth_smeared]__trackstates_ckf.root: 47c5e18de310363fdebe79d6c82c3cf5407200f2f06879f79217924d28a67a6e
test_ckf_tracks_example[generic-truth_smeared]__tracksummary_ckf.root: 961aa19995a8a1c64a365c6d72a90eee9809efaaee652b674db287acacfb810c
test_ckf_tracks_example[odd-full_seeding]__trackstates_ckf.root: 4d3003d1d49a46d354301d2dc2689fc806b2a3e1f68a2e675435d4758b3f21e0
test_ckf_tracks_example[odd-full_seeding]__tracksummary_ckf.root: 59537c52d23a77dbed9230c7b92cf653f7592c72fb882e8a24a2b33f1d27019e
test_ckf_tracks_example[odd-full_seeding]__trackstates_ckf.root: a4e58050b9b655774a29679980a0e9b09aeda576da91c8d4220d84f2ff0bb9cb
test_ckf_tracks_example[odd-full_seeding]__tracksummary_ckf.root: 7f27186a9678c1e36e68836a916b09c4d54d92ddd5c3fb60d1077fd74ae18bbe
test_ckf_tracks_example[odd-full_seeding]__performance_seeding_trees.root: 43c58577aafe07645e5660c4f43904efadf91d8cda45c5c04c248bbe0f59814f
test_ckf_tracks_example[odd-truth_estimated]__trackstates_ckf.root: 2c6feb705cdb17010d4a0d1287693c376b77b7f91cf80e595059ea43de2721e5
test_ckf_tracks_example[odd-truth_estimated]__tracksummary_ckf.root: 3a092423e717b1fe76f78f6b95eb6df67648a196e8c4da32158061d4bc490578
Expand Down
Loading