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

refactor: Large GSF refactoring #1629

Merged
merged 116 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from 115 commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
d42b259
first things
Jul 22, 2022
5e732d9
update
benjaminhuth Jul 24, 2022
65e6aec
refactor MultiEigenStepperLoop::step
Jul 25, 2022
ae5fec4
revert some debug changes, improve comment
Jul 25, 2022
dac2673
revert some changes
Jul 25, 2022
9296ec7
fix some compile bugs
Jul 25, 2022
f91afbd
fix unit test
Jul 25, 2022
9f113be
fix docs
Jul 25, 2022
c47566f
Merge branch 'fix/stepping-failure-all-components' into fix/direction…
Jul 25, 2022
3dd8330
update
Jul 25, 2022
7749ff2
experiment in unit test
benjaminhuth Jul 27, 2022
7125638
update
benjaminhuth Jul 27, 2022
3c39918
update
benjaminhuth Jul 28, 2022
5278ba4
update and polish
Jul 29, 2022
0c8b8ca
again update and polish
Jul 29, 2022
f49ee2c
add perigee and exact computations
Jul 29, 2022
5734a9e
update
benjaminhuth Aug 2, 2022
c205fe4
Revert "update"
Aug 3, 2022
d95b27e
Revert "add perigee and exact computations"
Aug 3, 2022
c754753
now it should work
Aug 3, 2022
4132fbb
initial implementation and unit test that only checks if it compiles
Aug 3, 2022
cd4e6d8
Merge branch 'main' into fix/direction-change-in-gsf
benjaminhuth Aug 4, 2022
2b85070
mode finding now should work + clang-format
Aug 4, 2022
59c0862
Merge branch 'main' into feature/gaussian-mixture-mode
Aug 4, 2022
ca0728d
update, but no mode is ever found (inversion problem, small variances)
Aug 8, 2022
d54fd00
clang format
benjaminhuth Aug 11, 2022
a0ab595
Merge branch 'main' into feature/gaussian-mixture-mode
benjaminhuth Aug 11, 2022
919f9f6
allow configurable particle selection and reproducible seeds for geant4
benjaminhuth Aug 12, 2022
383227b
allow configurable particle selection and reproducible seeds for geant4
benjaminhuth Aug 12, 2022
bf0c15b
Merge branch 'main' into feature/geant4-reproducible-seeds
asalzburger Aug 12, 2022
f661291
small fixes to python
benjaminhuth Aug 12, 2022
83075fd
fix gcc-12 uninitialized warning
benjaminhuth Aug 12, 2022
3e0962a
small fix
benjaminhuth Aug 12, 2022
e83066e
Merge branch 'feature/geant4-reproducible-seeds' into feature/gaussia…
benjaminhuth Aug 12, 2022
9005b67
Merge branch 'fix/direction-change-in-gsf' into feature/gaussian-mixt…
benjaminhuth Aug 12, 2022
c7520a3
'never push without compile'-fix
benjaminhuth Aug 12, 2022
0e32413
Merge branch 'fix/direction-change-in-gsf' into feature/gaussian-mixt…
benjaminhuth Aug 12, 2022
b57808f
Merge branch 'main' into feature/gaussian-mixture-mode
benjaminhuth Sep 19, 2022
7b58845
add max as option, switch from bool to enum
benjaminhuth Sep 19, 2022
4bc6db4
fix python typos
benjaminhuth Sep 19, 2022
d8ba3a9
Put GSF in Acts::Experimental and add some hints in the docs
Oct 20, 2022
ecf05ed
update GSF docs
Oct 20, 2022
c87282b
Merge branch 'main' into refactor/make-gsf-experimental
benjaminhuth Oct 20, 2022
f603349
fix tests
Oct 20, 2022
4e023c8
Merge branch 'main' into feature/gaussian-mixture-mode
Oct 24, 2022
a4f567b
checkout relevant files
Oct 26, 2022
31c7a15
removing unused stuff and adapting
Oct 26, 2022
f9e7e1f
update
Oct 26, 2022
d1a4ef4
Merge branch 'main' into refactor/make-gsf-experimental
Oct 26, 2022
4fd15ff
Merge branch 'main' into feature/gaussian-mixture-mode
Oct 26, 2022
d18177a
Merge branch 'main' into refactor/make-gsf-experimental
kodiakhq[bot] Oct 26, 2022
dc746c8
Merge branch 'feature/gaussian-mixture-mode' into feature/multi-stepp…
Oct 26, 2022
54a0f70
remove mode computation as it is not yet stable
Oct 26, 2022
1d5dd06
why the hack this was modified? however, restore it
Oct 26, 2022
6c81c14
clang-format
Oct 26, 2022
16dd6b3
remove mode test
Oct 26, 2022
b08df2f
clean up code
Oct 26, 2022
9365091
Merge branch 'refactor/make-gsf-experimental' into refactor/gsf-big-r…
Oct 26, 2022
507f988
add TODO to multi eigen stepper
Oct 26, 2022
c0e568a
Merge branch 'refactor/bethe-heitler-distribution' into refactor/gsf-…
Oct 26, 2022
05cac03
fix variable name
Oct 26, 2022
d309eac
remove mode from enum
Oct 26, 2022
d3397af
Merge branch 'main' into refactor/bethe-heitler-distribution
benjaminhuth Oct 27, 2022
6161498
Merge branch 'refactor/bethe-heitler-distribution' into refactor/gsf-…
Oct 27, 2022
b2a49a5
refactor default approximation
Oct 27, 2022
1978f84
clang-format
Oct 27, 2022
b2437a9
Merge branch 'refactor/bethe-heitler-distribution' into feature/multi…
Oct 27, 2022
e02c7dc
Merge branch 'feature/multi-stepper-max-weight' into refactor/gsf-big…
Oct 27, 2022
e39e7b6
fix python
Oct 27, 2022
6a76f30
fix python binding
Oct 27, 2022
b9c4692
multistepper workaround & clang-format
Oct 27, 2022
9a6791d
remove missed components from multi stepper
Oct 27, 2022
bf94f24
make multistepper abort if average is on surface -> maybe seperate PR?
Oct 27, 2022
7231618
expose bethe heitler to python
Oct 28, 2022
00a948d
change to boost::static_vector and allow non-transforming files
Oct 28, 2022
100785b
remove dead code and minor refactorings
Oct 28, 2022
5c78e5e
add warning when encountering invalid x/x0 and improve docs
Oct 28, 2022
53f393d
clang-format
Oct 28, 2022
2c99fac
Merge branch 'refactor/bethe-heitler-distribution' into feature/multi…
Oct 28, 2022
01aa00f
Merge branch 'feature/multi-stepper-max-weight' into refactor/gsf-big…
Oct 28, 2022
630e60b
changes & clang-format
Oct 28, 2022
1c05ce3
use only one typedef
Oct 28, 2022
63cc3aa
fix unit test
Oct 28, 2022
ff72913
Merge branch 'main' into refactor/bethe-heitler-distribution
kodiakhq[bot] Oct 28, 2022
49f5185
fix python function binding typo
Oct 31, 2022
7f35b8b
Merge branch 'refactor/bethe-heitler-distribution' into feature/multi…
Oct 31, 2022
b8bf7e6
Merge branch 'feature/multi-stepper-max-weight' into refactor/gsf-big…
Oct 31, 2022
d3b8078
unit-test related fixes
Nov 1, 2022
10799eb
clang-format
Nov 1, 2022
85d022f
some minor logginig changes
Nov 1, 2022
cfa3b8e
fix docs
Nov 1, 2022
8f8df58
improve invalid warning
Nov 1, 2022
2a6e38f
Merge branch 'refactor/bethe-heitler-distribution' into feature/multi…
Nov 1, 2022
8fc4ec8
Merge branch 'feature/multi-stepper-max-weight' into refactor/gsf-big…
Nov 1, 2022
d68e348
fix clang-tidy
Nov 2, 2022
0dd9240
Merge branch 'main' into refactor/gsf-big-refactoring
benjaminhuth Nov 2, 2022
bcedd7d
fix unit test finally hopefully
Nov 3, 2022
51e3744
Merge branch 'main' into refactor/gsf-big-refactoring
Nov 7, 2022
00d50ed
Merge branch 'main' into refactor/gsf-big-refactoring
benjaminhuth Nov 8, 2022
9e319e4
Apply suggestions from code review
benjaminhuth Nov 8, 2022
4e2318c
Merge branch 'main' into refactor/gsf-big-refactoring
benjaminhuth Nov 8, 2022
fcde671
requested changes & make weightCutoff configurable
Nov 9, 2022
4cecb7c
restore changes in reconstruction.py
Nov 9, 2022
1cb27e6
restore changes in reconstruction.py
Nov 9, 2022
3674113
add weight cutoff to python
Nov 9, 2022
4652df6
format-py
Nov 9, 2022
127a094
Update root_file_hashes.txt
benjaminhuth Nov 9, 2022
ea5a56a
Update root_file_hashes.txt
benjaminhuth Nov 9, 2022
ffe522b
Merge branch 'main' into refactor/gsf-big-refactoring
kodiakhq[bot] Nov 9, 2022
ea21ea8
make smoothed zero and update root hashes
Nov 10, 2022
4d1abc3
make it better with a copyFrom-mask
Nov 10, 2022
25f3212
clang-format
Nov 10, 2022
0b52dce
fix some weird bug in unit test
Nov 10, 2022
85d9679
fix namespace
Nov 10, 2022
fce51fa
Update root_file_hashes.txt
benjaminhuth Nov 11, 2022
d3d1572
Merge branch 'main' into refactor/gsf-big-refactoring
benjaminhuth Nov 11, 2022
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
15 changes: 4 additions & 11 deletions Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,6 @@ Result<double> MultiEigenStepperLoop<E, R, A>::step(
const auto& logger = state.options.logger;
State& stepping = state.stepping;

// It is not possible to remove components from the vector, since the
// GSF actor relies on the fact that the ordering and number of
// components does not change
auto invalidateComponent = [](auto& cmp) {
cmp.status = Intersection3D::Status::missed;
cmp.weight = 0.0;
cmp.state.pars.template segment<3>(eFreeDir0) = Vector3::Zero();
};

// Lambda for reweighting the components
auto reweight = [](auto& cmps) {
ActsScalar sumOfWeights = 0.0;
Expand All @@ -147,10 +138,11 @@ Result<double> MultiEigenStepperLoop<E, R, A>::step(
m_stepLimitAfterFirstComponentOnSurface) {
for (auto& cmp : stepping.components) {
if (cmp.status != Intersection3D::Status::onSurface) {
invalidateComponent(cmp);
cmp.status = Intersection3D::Status::missed;
benjaminhuth marked this conversation as resolved.
Show resolved Hide resolved
}
}

removeMissedComponents(stepping);
reweight(stepping.components);

ACTS_VERBOSE("Stepper performed "
Expand Down Expand Up @@ -194,12 +186,13 @@ Result<double> MultiEigenStepperLoop<E, R, A>::step(
accumulatedPathLength += component.weight * results.back()->value();
} else {
++errorSteps;
invalidateComponent(component);
component.status = Intersection3D::Status::missed;
}
}

// Since we have invalidated some components, we need to reweight
if (errorSteps > 0) {
removeMissedComponents(stepping);
reweight(stepping.components);
}

Expand Down
27 changes: 27 additions & 0 deletions Core/include/Acts/Propagator/MultiStepperAborters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ namespace Acts {
struct MultiStepperSurfaceReached {
MultiStepperSurfaceReached() = default;

/// If this is set, we are also happy if the mean of the components is on the
/// surface. How the averaging is performed depends on the stepper
/// implementation
bool averageOnSurface = true;

/// A configurable tolerance within which distance to the intersection we
/// consider the surface as reached. Has no effect if averageOnSurface is
/// false
double averageOnSurfaceTolerance = 0.2;

/// boolean operator for abort condition without using the result
///
/// @tparam propagator_state_t Type of the propagator state
Expand All @@ -40,6 +50,7 @@ struct MultiStepperSurfaceReached {
template <typename propagator_state_t, typename stepper_t>
bool operator()(propagator_state_t& state, const stepper_t& stepper,
const Surface& targetSurface) const {
const auto& logger = state.options.logger;
bool reached = true;
const auto oldCurrentSurface = state.navigation.currentSurface;
benjaminhuth marked this conversation as resolved.
Show resolved Hide resolved

Expand All @@ -52,6 +63,22 @@ struct MultiStepperSurfaceReached {
}
}

// However, if mean of all is on surface, we are happy as well
if (averageOnSurface) {
const auto sIntersection = targetSurface.intersect(
state.geoContext, stepper.position(state.stepping),
state.stepping.navDir * stepper.direction(state.stepping), true);

if (sIntersection.intersection.status ==
Intersection3D::Status::onSurface or
sIntersection.intersection.pathLength < averageOnSurfaceTolerance) {
ACTS_VERBOSE("Reached target in average mode");
state.navigation.currentSurface = &targetSurface;
state.navigation.targetReached = true;
return true;
}
}

// These values are changed by the single component aborters but must be
// reset if not all components are on the target
if (!reached) {
Expand Down
Loading