Skip to content

Commit

Permalink
Merge branch 'main' into fix/pythia8-rng
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Jul 16, 2024
2 parents 8888bbe + f533f07 commit 2f129d4
Show file tree
Hide file tree
Showing 43 changed files with 461 additions and 525 deletions.
9 changes: 4 additions & 5 deletions Core/include/Acts/Detector/Detector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "Acts/Geometry/GeometryIdentifier.hpp"
#include "Acts/Navigation/NavigationDelegates.hpp"
#include "Acts/Surfaces/SurfaceVisitorConcept.hpp"
#include "Acts/Utilities/Concepts.hpp"
#include "Acts/Utilities/Delegate.hpp"

#include <cstddef>
Expand Down Expand Up @@ -117,7 +116,7 @@ class Detector : public std::enable_shared_from_this<Detector> {
/// @note due to the fact that portals can be shared between volumes, multiple
/// visits may occur, duplicated addressing needs to be taken care of by the
/// visitor
template <ACTS_CONCEPT(SurfaceVisitor) visitor_t>
template <SurfaceVisitor visitor_t>
void visitSurfaces(visitor_t&& visitor) const {
for (const auto& v : rootVolumes()) {
v->template visitSurfaces<visitor_t>(std::forward<visitor_t>(visitor));
Expand All @@ -138,7 +137,7 @@ class Detector : public std::enable_shared_from_this<Detector> {
/// @note due to the fact that this doesn't run over root volumes, and
/// due to the fact that portals can be shared between volumes, multiple
/// visits may occur, duplicated addressing needs to be taken care of by the
template <ACTS_CONCEPT(MutableSurfaceVisitor) visitor_t>
template <MutableSurfaceVisitor visitor_t>
void visitMutableSurfaces(visitor_t&& visitor) {
for (auto& v : volumePtrs()) {
v->template visitMutableSurfaces<visitor_t>(
Expand All @@ -156,7 +155,7 @@ class Detector : public std::enable_shared_from_this<Detector> {
///
/// @note if a context is needed for the visit, the vistitor has to provide
/// it, e.g. as a private member
template <ACTS_CONCEPT(DetectorVolumeVisitor) visitor_t>
template <DetectorVolumeVisitor visitor_t>
void visitVolumes(visitor_t&& visitor) const {
for (const auto& v : rootVolumes()) {
v->template visitVolumes<visitor_t>(std::forward<visitor_t>(visitor));
Expand All @@ -177,7 +176,7 @@ class Detector : public std::enable_shared_from_this<Detector> {
/// @note that due to non running over root volumes, multiple visits
/// may occur, duplicated addressing needs to be taken care of by the
/// visitor
template <ACTS_CONCEPT(MutableDetectorVolumeVisitor) visitor_t>
template <MutableDetectorVolumeVisitor visitor_t>
void visitMutableVolumes(visitor_t&& visitor) {
for (const auto& v : volumePtrs()) {
v->template visitMutableVolumes<visitor_t>(
Expand Down
9 changes: 4 additions & 5 deletions Core/include/Acts/Detector/DetectorVolume.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "Acts/Surfaces/BoundaryTolerance.hpp"
#include "Acts/Surfaces/SurfaceVisitorConcept.hpp"
#include "Acts/Utilities/BoundingBox.hpp"
#include "Acts/Utilities/Concepts.hpp"
#include "Acts/Utilities/Delegate.hpp"
#include "Acts/Utilities/Helpers.hpp"

Expand Down Expand Up @@ -291,7 +290,7 @@ class DetectorVolume : public std::enable_shared_from_this<DetectorVolume> {
///
/// @param visitor will be called for each found surface,
/// it will be handed down to contained volumes and portals
template <ACTS_CONCEPT(SurfaceVisitor) visitor_t>
template <SurfaceVisitor visitor_t>
void visitSurfaces(visitor_t&& visitor) const {
for (const auto& s : surfaces()) {
visitor(s);
Expand All @@ -310,7 +309,7 @@ class DetectorVolume : public std::enable_shared_from_this<DetectorVolume> {
///
/// @param visitor will be called for each found surface,
/// it will be handed down to contained volumes and portals
template <ACTS_CONCEPT(MutableSurfaceVisitor) visitor_t>
template <MutableSurfaceVisitor visitor_t>
void visitMutableSurfaces(visitor_t&& visitor) {
for (auto& s : surfacePtrs()) {
visitor(s.get());
Expand All @@ -333,7 +332,7 @@ class DetectorVolume : public std::enable_shared_from_this<DetectorVolume> {
///
/// @note if a context is needed for the visit, the vistitor has to provide
/// it, e.g. as a private member
template <ACTS_CONCEPT(DetectorVolumeVisitor) visitor_t>
template <DetectorVolumeVisitor visitor_t>
void visitVolumes(visitor_t&& visitor) const {
visitor(this);
for (const auto& v : volumes()) {
Expand All @@ -351,7 +350,7 @@ class DetectorVolume : public std::enable_shared_from_this<DetectorVolume> {
///
/// @note if a context is needed for the visit, the vistitor has to provide
/// it, e.g. as a private member
template <ACTS_CONCEPT(MutableDetectorVolumeVisitor) visitor_t>
template <MutableDetectorVolumeVisitor visitor_t>
void visitMutableVolumes(visitor_t&& visitor) {
visitor(this);
for (auto& v : volumePtrs()) {
Expand Down
5 changes: 1 addition & 4 deletions Core/include/Acts/Detector/DetectorVolumeVisitorConcept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

#pragma once

#if defined(__cpp_concepts)
#include <concepts>
#include <utility>

namespace Acts {

Expand All @@ -28,5 +27,3 @@ concept MutableDetectorVolumeVisitor = requires(T v) {
};

} // namespace Acts

#endif
5 changes: 2 additions & 3 deletions Core/include/Acts/Detector/Portal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "Acts/Surfaces/RegularSurface.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/Surfaces/SurfaceVisitorConcept.hpp"
#include "Acts/Utilities/Concepts.hpp"

#include <array>
#include <map>
Expand Down Expand Up @@ -71,7 +70,7 @@ class Portal {
/// @tparam visitor_t Type of the callable visitor
///
/// @param visitor will be called with the represented surface
template <ACTS_CONCEPT(SurfaceVisitor) visitor_t>
template <SurfaceVisitor visitor_t>
void visitSurface(visitor_t&& visitor) const {
visitor(m_surface.get());
}
Expand All @@ -81,7 +80,7 @@ class Portal {
/// @tparam visitor_t Type of the callable visitor
///
/// @param visitor will be called with the represented surface
template <ACTS_CONCEPT(MutableSurfaceVisitor) visitor_t>
template <MutableSurfaceVisitor visitor_t>
void visitMutableSurface(visitor_t&& visitor) {
visitor(m_surface.get());
}
Expand Down
12 changes: 7 additions & 5 deletions Core/include/Acts/EventData/Charge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Definitions/Units.hpp"
#include "Acts/EventData/ChargeConcept.hpp"
#include "Acts/Utilities/Concepts.hpp"

#include <cassert>
#include <cmath>
Expand Down Expand Up @@ -93,7 +92,7 @@ struct Neutral {
}
};

ACTS_STATIC_CHECK_CONCEPT(ChargeConcept, Neutral);
static_assert(ChargeConcept<Neutral>, "Neutral does not fulfill ChargeConcept");

/// Charge and momentum interpretation for particles with +-e charge.
struct SinglyCharged {
Expand Down Expand Up @@ -136,7 +135,8 @@ struct SinglyCharged {
}
};

ACTS_STATIC_CHECK_CONCEPT(ChargeConcept, SinglyCharged);
static_assert(ChargeConcept<SinglyCharged>,
"SinglyCharged does not fulfill ChargeConcept");

/// Charge and momentum interpretation for arbitrarily charged but not neutral
/// particles.
Expand Down Expand Up @@ -174,7 +174,8 @@ class NonNeutralCharge {
float m_absQ{};
};

ACTS_STATIC_CHECK_CONCEPT(ChargeConcept, NonNeutralCharge);
static_assert(ChargeConcept<NonNeutralCharge>,
"NonNeutralCharge does not fulfill ChargeConcept");

/// Charge and momentum interpretation for arbitrarily charged particles.
///
Expand Down Expand Up @@ -215,7 +216,8 @@ class AnyCharge {
float m_absQ{};
};

ACTS_STATIC_CHECK_CONCEPT(ChargeConcept, AnyCharge);
static_assert(ChargeConcept<AnyCharge>,
"AnyCharge does not fulfill ChargeConcept");

/// @}

Expand Down
6 changes: 1 addition & 5 deletions Core/include/Acts/EventData/ChargeConcept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
#include "Acts/Utilities/HashedString.hpp"

#include <any>
#include <type_traits>

#if defined(__cpp_concepts)
#include <concepts>
#include <type_traits>

namespace Acts {

Expand All @@ -35,5 +33,3 @@ concept ChargeConcept = requires(C c, C c2, float f, double d) {
};

} // namespace Acts

#endif
3 changes: 1 addition & 2 deletions Core/include/Acts/EventData/GenericParticleHypothesis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "Acts/Definitions/ParticleData.hpp"
#include "Acts/Definitions/PdgParticle.hpp"
#include "Acts/EventData/ChargeConcept.hpp"
#include "Acts/Utilities/Concepts.hpp"

#include <cassert>
#include <ostream>
Expand All @@ -23,7 +22,7 @@ namespace Acts {
///
/// The reconstruction hypothesis consists of absolute PDG code, mass and
/// absolute charge.
template <ACTS_CONCEPT(ChargeConcept) charge_t>
template <ChargeConcept charge_t>
class GenericParticleHypothesis {
public:
using ChargeType = charge_t;
Expand Down
1 change: 0 additions & 1 deletion Core/include/Acts/EventData/MultiTrajectory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "Acts/EventData/Types.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Utilities/AlgebraHelpers.hpp"
#include "Acts/Utilities/Concepts.hpp"
#include "Acts/Utilities/HashedString.hpp"
#include "Acts/Utilities/Helpers.hpp"
#include "Acts/Utilities/ThrowAssert.hpp"
Expand Down
8 changes: 0 additions & 8 deletions Core/include/Acts/EventData/MultiTrajectoryBackendConcept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
#include "Acts/Utilities/HashedString.hpp"

#include <any>
#include <iterator>
#include <type_traits>

#if defined(__cpp_concepts)

#include <concepts>

namespace Acts {

Expand Down Expand Up @@ -144,5 +138,3 @@ concept MutableMultiTrajectoryBackend = CommonMultiTrajectoryBackend<T> &&
};

} // namespace Acts

#endif
8 changes: 2 additions & 6 deletions Core/include/Acts/EventData/ProxyAccessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@

#include "Acts/EventData/TrackProxy.hpp"
#include "Acts/EventData/TrackStateProxy.hpp"
#include "Acts/Utilities/Concepts.hpp"
#include "Acts/Utilities/HashedString.hpp"

#include <type_traits>

#if defined(__cpp_concepts)
#include <concepts>
namespace Acts::detail {

template <typename T>
Expand All @@ -42,7 +39,6 @@ concept ProxyType = (MutableProxyType<T> || ConstProxyType<T>)&&requires {
};

} // namespace Acts::detail
#endif

namespace Acts {

Expand Down Expand Up @@ -84,7 +80,7 @@ struct ProxyAccessorBase {
/// @tparam proxy_t the type of the proxy
/// @param proxy the proxy object to access
/// @return mutable reference to the column behind the key
template <ACTS_CONCEPT(detail::MutableProxyType) proxy_t, bool RO = ReadOnly,
template <detail::MutableProxyType proxy_t, bool RO = ReadOnly,
typename = std::enable_if_t<!RO>>
T& operator()(proxy_t proxy) const {
static_assert(!proxy_t::ReadOnly,
Expand All @@ -96,7 +92,7 @@ struct ProxyAccessorBase {
/// @tparam proxy_t the type of the track proxy
/// @param proxy the proxy to access
/// @return const reference to the column behind the key
template <ACTS_CONCEPT(detail::ProxyType) proxy_t, bool RO = ReadOnly,
template <detail::ProxyType proxy_t, bool RO = ReadOnly,
typename = std::enable_if_t<RO>>
const T& operator()(proxy_t proxy) const {
if constexpr (proxy_t::ReadOnly) {
Expand Down
12 changes: 4 additions & 8 deletions Core/include/Acts/EventData/TrackContainer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ struct IsReadOnlyTrackContainer;
/// @tparam track_container_t the track container backend
/// @tparam traj_t the track state container backend
/// @tparam holder_t ownership management class for the backend
template <ACTS_CONCEPT(TrackContainerBackend) track_container_t,
typename traj_t,
template <TrackContainerBackend track_container_t, typename traj_t,
template <typename> class holder_t = detail::RefHolder>
class TrackContainer {
public:
Expand Down Expand Up @@ -407,18 +406,15 @@ class TrackContainer {
detail_tc::ConstIf<holder_t<traj_t>, ReadOnly> m_traj;
};

template <ACTS_CONCEPT(TrackContainerBackend) track_container_t,
typename traj_t>
template <TrackContainerBackend track_container_t, typename traj_t>
TrackContainer(track_container_t& container, traj_t& traj)
-> TrackContainer<track_container_t, traj_t, detail::RefHolder>;

template <ACTS_CONCEPT(TrackContainerBackend) track_container_t,
typename traj_t>
template <TrackContainerBackend track_container_t, typename traj_t>
TrackContainer(const track_container_t& container, const traj_t& traj)
-> TrackContainer<track_container_t, traj_t, detail::ConstRefHolder>;

template <ACTS_CONCEPT(TrackContainerBackend) track_container_t,
typename traj_t>
template <TrackContainerBackend track_container_t, typename traj_t>
TrackContainer(track_container_t&& container, traj_t&& traj)
-> TrackContainer<track_container_t, traj_t, detail::ValueHolder>;

Expand Down
6 changes: 0 additions & 6 deletions Core/include/Acts/EventData/TrackContainerBackendConcept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
#include "Acts/Utilities/HashedString.hpp"

#include <any>
#include <type_traits>

#if defined(__cpp_concepts)
#include <concepts>

namespace Acts {

Expand Down Expand Up @@ -94,5 +90,3 @@ template <typename T>
concept TrackContainerBackend = ConstTrackContainerBackend<T> &&
(IsReadOnlyTrackContainer<T>::value || MutableTrackContainerBackend<T>);
} // namespace Acts

#endif
5 changes: 2 additions & 3 deletions Core/include/Acts/EventData/TrackProxy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "Acts/EventData/TrackContainerBackendConcept.hpp"
#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/EventData/TrackStatePropMask.hpp"
#include "Acts/Utilities/Concepts.hpp"
#include "Acts/Utilities/HashedString.hpp"
#include "Acts/Utilities/UnitVectors.hpp"

Expand All @@ -23,8 +22,8 @@

namespace Acts {

template <ACTS_CONCEPT(Acts::TrackContainerBackend) track_container_t,
typename traj_t, template <typename> class holder_t>
template <Acts::TrackContainerBackend track_container_t, typename traj_t,
template <typename> class holder_t>
class TrackContainer;

namespace detail_tc {
Expand Down
5 changes: 2 additions & 3 deletions Core/include/Acts/EventData/TrackStateProxy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "Acts/EventData/Types.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/Utilities/AlgebraHelpers.hpp"
#include "Acts/Utilities/Concepts.hpp"
#include "Acts/Utilities/HashedString.hpp"
#include "Acts/Utilities/Helpers.hpp"

Expand Down Expand Up @@ -864,8 +863,8 @@ class TrackStateProxy {
/// an exception is thrown.
/// @note The mask parameter will not cause a copy of components that are
/// not allocated in the source track state proxy.
template <ACTS_CONCEPT(TrackStateProxyConcept) track_state_proxy_t,
bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
template <TrackStateProxyConcept track_state_proxy_t, bool RO = ReadOnly,
typename = std::enable_if_t<!RO>>
void copyFrom(const track_state_proxy_t& other,
TrackStatePropMask mask = TrackStatePropMask::All,
bool onlyAllocated = true) {
Expand Down
4 changes: 0 additions & 4 deletions Core/include/Acts/EventData/TrackStateProxyConcept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@

#include <utility>

#if defined(__cpp_concepts)
#include <concepts>

namespace Acts {

namespace detail {
Expand Down Expand Up @@ -247,4 +244,3 @@ concept MutableTrackStateProxyConcept = TrackStateProxyConcept<T> &&
{ v.typeFlags() } -> std::same_as<TrackStateType>;
};
} // namespace Acts
#endif
Loading

0 comments on commit 2f129d4

Please sign in to comment.