12#include "detray/definitions/algebra.hpp"
13#include "detray/definitions/detail/qualifiers.hpp"
14#include "detray/propagator/base_actor.hpp"
15#include "detray/utils/logging.hpp"
18#include <vecmem/containers/device_vector.hpp>
23namespace detray::actor {
27template <
typename sf_descriptor_t>
45 DETRAY_HOST_DEVICE
bool overflow()
const {
return m_overflow; }
50 m_collect_only_material_surfaces = material_only;
55 return m_collect_only_material_surfaces;
70 bool m_overflow =
false;
72 bool m_collect_only_material_surfaces =
false;
80 template <
typename propagator_state_t>
81 requires std::same_as<
83 typename propagator_state_t::detector_type::surface_type>
85 propagator_state_t& propagation)
const {
86 const auto& navigation = propagation.navigation();
88 DETRAY_VERBOSE_HOST_DEVICE(
89 "Actor: Checking for next surface in sequence...");
92 navigation.is_on_sensitive()) {
94 }
else if (!(navigation.is_on_sensitive() ||
95 navigation.encountered_sf_material())) {
100 if (actor_state.
sequence().capacity() == 0) {
101 DETRAY_VERBOSE_HOST_DEVICE(
102 "Actor: No capacity to store surface candidate - skipping");
104 DETRAY_VERBOSE_HOST_DEVICE(
"Actor: Sequence overflow!");
106 propagation.navigation().exit();
107 propagation.heartbeat(
false);
112 const auto& sf_desc = std::as_const(navigation).current().surface();
113 assert(!sf_desc.identifier().is_invalid());
115 actor_state.
sequence().push_back(sf_desc);
116 DETRAY_VERBOSE_HOST(
"Actor: Added surface: " << sf_desc);
Buffer and collection options maintained for one propagation.
Definition surface_sequencer.hpp:30
bool overflow() const
Definition surface_sequencer.hpp:45
state(sequence_type seq)
Constructor with the vector of track states.
Definition surface_sequencer.hpp:39
vecmem::device_vector< sf_descriptor_t > sequence_type
Device vector storing the encountered surface sequence.
Definition surface_sequencer.hpp:34
void collect_only_material_surfaces(bool material_only)
Configure whether to collect only material surfaces.
Definition surface_sequencer.hpp:49
sf_descriptor_t surface_type
Surface descriptor type recorded by the actor.
Definition surface_sequencer.hpp:32
bool collect_only_material_surfaces() const
Definition surface_sequencer.hpp:54
sequence_type & sequence()
Definition surface_sequencer.hpp:64
void set_overflow()
Flags that the internal buffer has experienced an overflow.
Definition surface_sequencer.hpp:42
const sequence_type & sequence() const
Definition surface_sequencer.hpp:59
Actor that records sensitive or material-bearing surfaces along a propagation.
Definition surface_sequencer.hpp:28
void operator()(state &actor_state, propagator_state_t &propagation) const
Record detector surfaces in sequence if they are sensitive or have material.
Definition surface_sequencer.hpp:84
Base class actor implementation.
Definition base_actor.hpp:20