File indexing completed on 2026-11-07 10:11:41
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include <memory>
0010
0011 #include "celeritas/inp/StandaloneInput.hh"
0012 #include "celeritas/setup/StandaloneInput.hh"
0013 #include "celeritas/user/ActionTimes.hh"
0014 #include "celeritas/user/StepTimes.hh"
0015
0016 #include "Transporter.hh"
0017 #include "gen/DirectGeneratorAction.hh"
0018 #include "gen/GeneratorAction.hh"
0019 #include "gen/PrimaryGeneratorAction.hh"
0020
0021 namespace celeritas
0022 {
0023 namespace optical
0024 {
0025 class CoreStateBase;
0026 class CoreParams;
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 class Runner
0041 {
0042 public:
0043
0044
0045 using Input = inp::OpticalStandaloneInput;
0046 using SPConstParams = std::shared_ptr<CoreParams const>;
0047 using SpanConstTrackInit = DirectGeneratorAction::SpanConstData;
0048 using SpanConstGenDist = GeneratorAction::SpanConstData;
0049
0050
0051 struct Result
0052 {
0053 CounterAccumStats counters;
0054 ActionTimes::MapStrDbl action_times;
0055 StepTimes::VecDbl step_times;
0056 };
0057
0058 public:
0059
0060 explicit Runner(Input&&);
0061
0062
0063 void insert();
0064
0065
0066 void insert(SpanConstTrackInit);
0067
0068
0069 void insert(SpanConstGenDist);
0070
0071
0072 Result operator()();
0073
0074
0075 CounterAccumStats exchange_counters();
0076
0077
0078 ActionTimes::MapStrDbl exchange_action_times();
0079
0080
0081 StepTimes::VecDbl exchange_step_times();
0082
0083
0084 SPConstParams const& params() const
0085 {
0086 return loaded_.problem.transporter->params();
0087 }
0088
0089
0090 setup::OpticalProblemLoaded const& problem() const
0091 {
0092 return loaded_.problem;
0093 }
0094
0095 private:
0096 setup::OpticalStandaloneLoaded loaded_;
0097 std::shared_ptr<CoreStateBase> state_;
0098 };
0099
0100
0101 }
0102 }