forked from acts-project/acts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: New DetectorNavigator tests and some fixes (acts-project#2988)
Adding new tests for the `DetectorNavigator` and introducing some fixes. In the `DetectorNavigator` itself: 1) Adding `DetectorVolume`, `CandidateSurfaces` and `NavigationState` initialization into `initialize`. Previously, if you ran with the `endOfWorld` aborter, Propagation didn't enter the stepping loop, because the current volume was `nullptr` and there were no candidates to try. 2) Adding implicit `endOfWorld` check after the `Portal` update. Previously, the `initialize` was called and volume was set to the one the Navigator is currently exiting (volume finders treat the boundary as a part of the volume). This resulted in the stepping loop continuing until the limit in the number of steps is reached. 3) Adding navigation breaks. Some of the aborters (related to the KF and its tests) were not exiting properly before. 4) Removed `initialize` call in the post step to insure the proper abortion. 5) Added iteration over the intersection list to store candidates. Previously, if the surface was intersected more than once, only one of the intersections was taken into account, even if more of them were valid. 6) Took direction (e.g. `Acts::Forward`) into account during the `NavigationState` filling. Previously, the `Backward` direction propagation didn't work. 7) Small changes in the material-related files to resolve the `currentVolume` conflicts in the compilation. In the tests: 1) Added initialization tests, analogous to the ones for the `Navigator` 2) Navigation through a simple cubic geometry in the `Forward` and `Backward` directions. Consistency checks, and things like that. 3) Tests that ensure the proper behaviour when the multiple valid intersections are encountered. Like the double crossing of the Cylindrical surface. --------- Co-authored-by: Andreas Stefl <stefl.andreas@gmail.com> Co-authored-by: Andreas Salzburger <asalzburger@gmail.com>
- Loading branch information
1 parent
9d9800f
commit 131e095
Showing
7 changed files
with
761 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
Core/include/Acts/Detector/GeometryCompatibilityConcept.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// This file is part of the Acts project. | ||
// | ||
// Copyright (C) 2023 CERN for the benefit of the Acts project | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
#pragma once | ||
|
||
#include "Acts/Detector/DetectorVolume.hpp" | ||
#include "Acts/Geometry/TrackingVolume.hpp" | ||
#include "Acts/Utilities/TypeTraits.hpp" | ||
|
||
namespace Acts { | ||
|
||
namespace Concepts { | ||
|
||
// Types to check compatibility of | ||
template <typename propagator_state_t, typename navigator_t> | ||
using ReturnTypeCurrentVolume = | ||
decltype(std::declval<navigator_t>().currentVolume( | ||
std::declval<propagator_state_t>().navigation)); | ||
|
||
/// @brief Concept ensuring compatibility TrackingGeometry | ||
/// and Detector navigation interfaces with the client code | ||
/// @tparam propagator_state_t Type of the object for navigation state | ||
/// @tparam navigator_t Type of the navigator object | ||
template <typename propagator_state_t, typename navigator_t> | ||
struct NavigationCompatibilityConceptImpl { | ||
/// @brief Ensure that the currentVolume method | ||
/// returns one of the known volume types | ||
constexpr static bool isCurrentVolumePtr = | ||
(Acts::Concepts::identical_to<const TrackingVolume*, | ||
ReturnTypeCurrentVolume, propagator_state_t, | ||
navigator_t> || | ||
Acts::Concepts::identical_to<const Acts::Experimental::DetectorVolume*, | ||
ReturnTypeCurrentVolume, propagator_state_t, | ||
navigator_t>); | ||
|
||
static_assert(isCurrentVolumePtr, | ||
"Return type is not a known volume pointer type"); | ||
|
||
constexpr static bool value = Acts::Concepts::require<isCurrentVolumePtr>; | ||
}; | ||
|
||
template <typename propagator_state_t, typename navigator_t> | ||
constexpr bool NavigationCompatibilityConcept = | ||
NavigationCompatibilityConceptImpl<propagator_state_t, navigator_t>::value; | ||
|
||
} // namespace Concepts | ||
|
||
} // namespace Acts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.