Skip to content
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
6 changes: 3 additions & 3 deletions core/include/detray/builders/detector_builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ class detector_builder {

detector_type det{resource};

DETRAY_INFO_HOST("Have " << m_volumes.size()
<< " configured volume builders");
DETRAY_VERBOSE_HOST("Have " << m_volumes.size()
<< " configured volume builders");
DETRAY_VERBOSE_HOST("Start building the volumes...");
for (auto& vol_builder : m_volumes) {

Expand All @@ -132,7 +132,6 @@ class detector_builder {

// TODO: Add sorting, data deduplication etc. here later...

DETRAY_INFO_HOST("Detector building complete: " << name());
DETRAY_INFO_HOST("-> Built " << det.volumes().size() << " volumes");
DETRAY_INFO_HOST("-> Built " << det.surfaces().size() << " surfaces:");
DETRAY_INFO_HOST("--> portals: " << detray::n_portals(det));
Expand All @@ -155,6 +154,7 @@ class detector_builder {
DETRAY_INFO_HOST("--> slabs: " << detray::n_material_slabs(det));
DETRAY_INFO_HOST("--> rods: " << detray::n_material_rods(det));
}
DETRAY_INFO_HOST("Detector building complete: " << name());

return det;
}
Expand Down
2 changes: 1 addition & 1 deletion core/include/detray/core/detail/multi_store.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class multi_store {
/// (host-side only)
template <typename allocator_t = vecmem::memory_resource,
typename T = tuple_t<Ts...>>
requires(std::is_same_v<T, detray::tuple<Ts...>> &&
requires(std::is_same_v<T, dtuple<Ts...>> &&
std::derived_from<allocator_t, std::pmr::memory_resource>)
DETRAY_HOST explicit multi_store(allocator_t &resource, const Ts &...args)
: m_tuple_container(resource, args...) {}
Expand Down
45 changes: 45 additions & 0 deletions core/include/detray/definitions/actor.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/** Detray library, part of the ACTS project (R&D line)
*
* (c) 2026 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/

#pragma once

// Project include(s)
#include "detray/definitions/detail/qualifiers.hpp"

// System include(s)
#include <cstdint>
#include <ostream>

namespace detray::actor {

enum class status : std::uint8_t {
e_notify = 0u,
e_success = 1u,
e_unknown = 2u,
e_failure = 3u,
};

// Print the values of an enum by identifier
#define ENUM_PRINT(x) \
case x: \
os << #x; \
break

DETRAY_HOST inline std::ostream& operator<<(std::ostream& os, status s) {

switch (s) {
using enum status;
ENUM_PRINT(e_notify);
ENUM_PRINT(e_success);
ENUM_PRINT(e_unknown);
ENUM_PRINT(e_failure);
}
return os;
}

#undef ENUM_PRINT
} // namespace detray::actor
2 changes: 1 addition & 1 deletion core/include/detray/materials/material_slab.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct material_slab {
const material_slab& mat) {
os << "slab: ";
os << mat.get_material();
os << " | thickness = " << mat.thickness() << "mm";
os << " | thickness = " << mat.thickness() << " mm";

return os;
}
Expand Down
8 changes: 4 additions & 4 deletions core/include/detray/navigation/policies.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace detray {

/// Struct that represents the most conservative navigation policy: alway re-
/// initialize the current volume
struct always_init : actor {
struct always_init : public base_actor {

struct state {};

Expand All @@ -38,7 +38,7 @@ struct always_init : actor {

/// During guided navigation only the next surface should be re-evaluated. This
/// maps to the 'high trust' level in the navigator
struct guided_navigation : actor {
struct guided_navigation : public base_actor {

struct state {};

Expand All @@ -58,7 +58,7 @@ struct guided_navigation : actor {
/// The reasoning is, that the track state might have changed much when a
/// constraint was triggered.
template <concepts::scalar scalar_t>
struct stepper_default_policy : actor {
struct stepper_default_policy : public base_actor {

struct state {
scalar_t tol{std::numeric_limits<scalar_t>::epsilon()};
Expand Down Expand Up @@ -96,7 +96,7 @@ struct stepper_default_policy : actor {
/// amount of step size correction as a measure for the change in direction of
/// the track state.
template <concepts::scalar scalar_t>
struct stepper_rk_policy : actor {
struct stepper_rk_policy : public base_actor {

struct state {
scalar_t m_threshold_fair_trust{0.05f};
Expand Down
18 changes: 10 additions & 8 deletions core/include/detray/propagator/actor_chain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ class actor_chain {
using actor_tuple = dtuple<actors_t...>;

// Tuple of actor states (including states of observing actors, if present)
using state_tuple = detail::tuple_cat_t<detail::state_tuple_t<actors_t>...>;
using state_tuple = detail::unique_t<
detail::tuple_cat_t<detail::state_tuple_t<actors_t>...>>;

// Tuple of state references that is used in the propagator
using state_ref_tuple =
detail::tuple_cat_t<detail::state_ref_tuple_t<actors_t>...>;
using state_ref_tuple = detail::unique_t<
detail::tuple_cat_t<detail::state_ref_tuple_t<actors_t>...>>;

/// Call all actors in the chain.
///
Expand All @@ -63,10 +64,11 @@ class actor_chain {
/// @returns a tuple of default constructible actor states
DETRAY_HOST_DEVICE
static constexpr auto make_default_actor_states() {
// Only possible if each state is default initializable
if constexpr ((std::default_initializable<typename actors_t::state> &&
...)) {
return state_tuple{};
// Only possible if each state is default initializable (including
// obsevers to the actors in actors_t)
if constexpr (detail::tuple_all_v<std::is_default_constructible,
state_tuple>) {
return state_tuple();
} else {
return std::nullopt;
}
Expand All @@ -93,7 +95,7 @@ class actor_chain {
if constexpr (!typename actor_t::is_comp_actor()) {
// No actor state defined (empty)
if constexpr (std::same_as<typename actor_t::state,
detray::actor::state>) {
detray::base_actor::state>) {
actr(p_state);
} else {
actr(detail::get<typename actor_t::state &>(states), p_state);
Expand Down
3 changes: 1 addition & 2 deletions core/include/detray/propagator/actors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
// Include all core actors
#include "detray/propagator/actor_chain.hpp"
#include "detray/propagator/actors/aborters.hpp"
#include "detray/propagator/actors/parameter_resetter.hpp"
#include "detray/propagator/actors/parameter_transporter.hpp"
#include "detray/propagator/actors/parameter_updater.hpp"
#include "detray/propagator/actors/pointwise_material_interactor.hpp"
#include "detray/propagator/actors/surface_sequencer.hpp"
#include "detray/propagator/concepts.hpp"
12 changes: 6 additions & 6 deletions core/include/detray/propagator/actors/aborters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
// System include(s)
#include <limits>

namespace detray {
namespace detray::actor {

/// Aborter that checks whether the track has exceeded its pathlimit
template <concepts::scalar scalar_t>
struct pathlimit_aborter : actor {
struct pathlimit_aborter : public base_actor {

/// Pathlimit for a single propagation workflow
struct state {
Expand Down Expand Up @@ -77,7 +77,7 @@ struct pathlimit_aborter : actor {

/// Aborter that checks whether the track fell below a minimum momentum
template <concepts::scalar scalar_t>
struct momentum_aborter : actor {
struct momentum_aborter : public base_actor {

struct state {
/// @returns the momentum limit.
Expand All @@ -102,7 +102,7 @@ struct momentum_aborter : actor {
scalar_t m_min_pT = 10.f * unit<scalar_t>::MeV;
};

/// Enforces a minimum momentum magnitude
/// Actor interface: Enforces a minimum momentum magnitude
///
/// @param abrt_state contains the momentum limit
/// @param prop_state state of the propagation
Expand Down Expand Up @@ -143,7 +143,7 @@ struct momentum_aborter : actor {
};

/// Aborter checks whether a specific surface was reached
struct target_aborter : actor {
struct target_aborter : public base_actor {

/// Keeps the index for the target surface
struct state {
Expand Down Expand Up @@ -174,4 +174,4 @@ struct target_aborter : actor {
}
};

} // namespace detray
} // namespace detray::actor
83 changes: 0 additions & 83 deletions core/include/detray/propagator/actors/parameter_resetter.hpp

This file was deleted.

Loading
Loading