forked from celeritas-project/celeritas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
InitializeTracksAction.hh
62 lines (50 loc) · 2.19 KB
/
InitializeTracksAction.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//----------------------------------*-C++-*----------------------------------//
// Copyright 2023-2024 UT-Battelle, LLC, and other Celeritas developers.
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
//---------------------------------------------------------------------------//
//! \file celeritas/track/InitializeTracksAction.hh
//---------------------------------------------------------------------------//
#pragma once
#include "celeritas/global/ActionInterface.hh"
namespace celeritas
{
//---------------------------------------------------------------------------//
/*!
* Initialize track states.
*
* Tracks created from secondaries produced in this action will have the
* geometry state copied over from the parent instead of initialized from the
* position. If there are more empty slots than new secondaries, they will be
* filled by any track initializers remaining from previous steps using the
* position.
*/
class InitializeTracksAction final : public ExplicitCoreActionInterface
{
public:
//! Construct with explicit Id
explicit InitializeTracksAction(ActionId id) : id_(id) {}
//! Execute the action with host data
void execute(CoreParams const& params, CoreStateHost& state) const final;
//! Execute the action with device data
void execute(CoreParams const& params, CoreStateDevice& state) const final;
//! ID of the action
ActionId action_id() const final { return id_; }
//! Short name for the action
std::string_view label() const final { return "initialize-tracks"; }
//! Description of the action for user interaction
std::string_view description() const final
{
return "initialize track states";
}
//! Dependency ordering of the action
ActionOrder order() const final { return ActionOrder::start; }
private:
ActionId id_;
template<MemSpace M>
void execute_impl(CoreParams const&, CoreState<M>&) const;
void execute_impl(CoreParams const&, CoreStateHost&, size_type) const;
void execute_impl(CoreParams const&, CoreStateDevice&, size_type) const;
};
//---------------------------------------------------------------------------//
} // namespace celeritas