File indexing completed on 2025-12-16 10:11:31
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include <unordered_map>
0010
0011 #include "corecel/Macros.hh"
0012 #include "corecel/Types.hh"
0013 #include "corecel/cont/Span.hh"
0014 #include "corecel/data/Collection.hh"
0015 #include "celeritas/Quantities.hh"
0016 #include "celeritas/Types.hh"
0017
0018 #include "../data/AtomicRelaxationData.hh"
0019
0020 namespace celeritas
0021 {
0022 namespace detail
0023 {
0024
0025
0026
0027
0028
0029
0030 class MaxSecondariesCalculator
0031 {
0032 public:
0033
0034
0035 using Energy = units::MevEnergy;
0036 using Values = HostCRef<AtomicRelaxParamsData>;
0037
0038
0039 public:
0040
0041 MaxSecondariesCalculator(Values const& data,
0042 ItemRange<AtomicRelaxSubshell> const& shells,
0043 Energy electron_cut,
0044 Energy gamma_cut);
0045
0046
0047 size_type operator()();
0048
0049 private:
0050 Values const& data_;
0051 Span<AtomicRelaxSubshell const> shells_;
0052 Energy const electron_cut_;
0053 Energy const gamma_cut_;
0054 std::unordered_map<SubshellId, size_type> visited_;
0055
0056
0057
0058 size_type calc(SubshellId vacancy_shell, size_type count);
0059 };
0060
0061
0062
0063
0064
0065
0066
0067 class MaxStackSizeCalculator
0068 {
0069 public:
0070
0071
0072 using Values = HostCRef<AtomicRelaxParamsData>;
0073
0074
0075 public:
0076
0077 MaxStackSizeCalculator(Values const& data,
0078 ItemRange<AtomicRelaxSubshell> const& shells);
0079
0080
0081 size_type operator()();
0082
0083 private:
0084 Values const& data_;
0085 Span<AtomicRelaxSubshell const> shells_;
0086 std::unordered_map<SubshellId, size_type> visited_;
0087
0088
0089
0090 size_type calc(SubshellId vacancy_shell);
0091 };
0092
0093
0094
0095 size_type calc_max_secondaries(MaxSecondariesCalculator::Values const& data,
0096 ItemRange<AtomicRelaxSubshell> const& shells,
0097 units::MevEnergy electron_cut,
0098 units::MevEnergy gamma_cut);
0099
0100
0101 size_type calc_max_stack_size(MaxStackSizeCalculator::Values const& data,
0102 ItemRange<AtomicRelaxSubshell> const& shells);
0103
0104
0105 }
0106 }