File indexing completed on 2025-09-17 08:53:32
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include "corecel/Macros.hh"
0010 #include "corecel/Types.hh"
0011 #include "corecel/grid/TwodGridData.hh"
0012 #include "celeritas/Quantities.hh"
0013 #include "celeritas/Types.hh"
0014
0015 namespace celeritas
0016 {
0017
0018
0019
0020
0021 struct MuPairProductionIds
0022 {
0023 ParticleId mu_minus;
0024 ParticleId mu_plus;
0025 ParticleId electron;
0026 ParticleId positron;
0027
0028
0029 explicit CELER_FUNCTION operator bool() const
0030 {
0031 return mu_minus && mu_plus && electron && positron;
0032 }
0033 };
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 template<Ownership W, MemSpace M>
0048 struct MuPairProductionTableData
0049 {
0050
0051
0052 template<class T>
0053 using Items = Collection<T, W, M>;
0054
0055
0056
0057 ItemRange<real_type> logz_grid;
0058 Items<TwodGridData> grids;
0059
0060
0061 Items<real_type> reals;
0062
0063
0064
0065
0066 explicit CELER_FUNCTION operator bool() const
0067 {
0068 return !reals.empty() && !logz_grid.empty()
0069 && logz_grid.size() == grids.size();
0070 }
0071
0072
0073 template<Ownership W2, MemSpace M2>
0074 MuPairProductionTableData&
0075 operator=(MuPairProductionTableData<W2, M2> const& other)
0076 {
0077 CELER_EXPECT(other);
0078 reals = other.reals;
0079 logz_grid = other.logz_grid;
0080 grids = other.grids;
0081 return *this;
0082 }
0083 };
0084
0085
0086
0087
0088
0089 template<Ownership W, MemSpace M>
0090 struct MuPairProductionData
0091 {
0092
0093
0094
0095 MuPairProductionIds ids;
0096
0097
0098 units::MevMass electron_mass;
0099
0100
0101 MuPairProductionTableData<W, M> table;
0102
0103
0104
0105
0106 explicit CELER_FUNCTION operator bool() const
0107 {
0108 return ids && electron_mass > zero_quantity() && table;
0109 }
0110
0111
0112 template<Ownership W2, MemSpace M2>
0113 MuPairProductionData& operator=(MuPairProductionData<W2, M2> const& other)
0114 {
0115 CELER_EXPECT(other);
0116 ids = other.ids;
0117 electron_mass = other.electron_mass;
0118 table = other.table;
0119 return *this;
0120 }
0121 };
0122
0123
0124 }