17 #include <type_traits>
20 namespace ActsFatras {
26 template <
class T,
class Tuple>
28 template <
class T,
class... Types>
30 static constexpr std::size_t
value = 0
u;
32 template <
class T,
class U,
class... Types>
34 static constexpr std::size_t
value =
55 template <
template <
typename>
typename predicate_t,
typename tuple_t,
56 size_t kCounter,
size_t... kIndices>
58 static constexpr
auto kIndex = kCounter - 1
u;
60 predicate_t<std::tuple_element_t<kIndex, tuple_t>>
::value;
69 std::conditional_t<kElementSelection, SelectElement, SkipElement>;
71 template <
template <
typename>
typename predicate_t,
typename tuple_t,
74 using Type = std::index_sequence<kIndices...>;
76 template <
template <
typename>
typename predicate_t,
typename tuple_t>
78 std::tuple_size_v<tuple_t>>::Type;
83 template <
typename process_t>
93 METHOD_TRAIT(generatePathLimits_method_t, generatePathLimits);
103 template <
typename process_t>
108 template <
typename processes_t>
110 template <
typename processes_t>
174 template <
typename... processes_t>
176 using Mask = std::bitset<
sizeof...(processes_t)>;
185 std::numeric_limits<Particle::Scalar>::infinity();
187 std::numeric_limits<Particle::Scalar>::infinity();
198 template <
typename process_t>
204 template <
size_t kProcess>
205 std::tuple_element_t<kProcess, Processes>&
get() {
212 template <
typename process_t>
225 template <
typename generator_t>
228 std::vector<Particle>& generated)
const {
240 template <
typename generator_t>
259 template <
typename generator_t>
261 std::vector<Particle>& generated)
const {
274 template <
typename generator_t, std::size_t kI0, std::size_t... kIs>
277 std::index_sequence<kI0, kIs...> )
const {
280 if (not
m_mask[kI0] and
process(rng, slab, particle, generated)) {
285 std::index_sequence<kIs...>());
287 template <
typename generator_t>
291 std::vector<Particle>& ,
292 std::index_sequence<> )
const {
299 template <
typename generator_t, std::size_t kI0, std::size_t... kIs>
302 std::index_sequence<kI0, kIs...> )
const {
305 auto [x0Limit, l0Limit] =
306 std::get<kI0>(
m_processes).generatePathLimits(rng, particle);
307 if (x0Limit < selection.
x0Limit) {
311 if (l0Limit < selection.
l0Limit) {
319 template <
typename generator_t>
322 std::index_sequence<> )
const {}
328 template <
typename generator_t,
size_t kI0,
size_t... kIs>
331 std::index_sequence<kI0, kIs...> )
const {
332 if (kI0 == processIndex) {
342 std::index_sequence<kIs...>());
344 template <
typename generator_t>
347 std::vector<Particle>& ,
348 std::index_sequence<> )
const {