File indexing completed on 2025-01-18 09:58:46
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #ifndef G4NuclideTable_hh
0037 #define G4NuclideTable_hh 1
0038
0039 #include "G4DecayTable.hh"
0040 #include "G4IonTable.hh"
0041 #include "G4Ions.hh"
0042 #include "G4IsotopeProperty.hh"
0043 #include "G4ParticleTable.hh"
0044 #include "G4VIsotopeTable.hh"
0045 #include "globals.hh"
0046
0047 #include <cmath>
0048 #include <vector>
0049
0050 class G4NuclideTableMessenger;
0051
0052 class G4NuclideTable : public G4VIsotopeTable
0053 {
0054 public:
0055 using G4IsotopeList = std::vector<G4IsotopeProperty*>;
0056
0057 ~G4NuclideTable() override;
0058
0059 G4NuclideTable(const G4NuclideTable&) = delete;
0060 G4NuclideTable& operator=(const G4NuclideTable&) = delete;
0061
0062 static G4NuclideTable* GetInstance();
0063 static G4NuclideTable* GetNuclideTable();
0064
0065 void GenerateNuclide();
0066
0067 void SetThresholdOfHalfLife(G4double);
0068 inline G4double GetThresholdOfHalfLife();
0069
0070 void SetMeanLifeThreshold(G4double);
0071 inline G4double GetMeanLifeThreshold();
0072
0073 inline void SetLevelTolerance(G4double x);
0074 inline G4double GetLevelTolerance();
0075
0076 void AddState(G4int, G4int, G4double, G4double, G4int ionJ = 0, G4double ionMu = 0.0);
0077 void AddState(G4int, G4int, G4double, G4int, G4double, G4int ionJ = 0, G4double ionMu = 0.0);
0078 void AddState(G4int, G4int, G4double, G4Ions::G4FloatLevelBase, G4double, G4int ionJ = 0,
0079 G4double ionMu = 0.0);
0080
0081 inline std::size_t GetSizeOfIsotopeList();
0082
0083
0084
0085
0086
0087
0088
0089
0090 G4IsotopeProperty*
0091 GetIsotope(G4int Z, G4int A, G4double E,
0092 G4Ions::G4FloatLevelBase flb = G4Ions::G4FloatLevelBase::no_Float) override;
0093 G4IsotopeProperty* GetIsotopeByIsoLvl(G4int Z, G4int A, G4int lvl = 0) override;
0094
0095 inline std::size_t entries() const;
0096 inline G4IsotopeProperty* GetIsotopeByIndex(std::size_t idx) const;
0097
0098
0099
0100 static G4double GetTruncationError(G4double eex);
0101 static G4double Round(G4double eex);
0102 static G4long Truncate(G4double eex);
0103 static G4double Tolerance();
0104
0105 private:
0106 G4NuclideTable();
0107
0108 G4double StripFloatLevelBase(G4double E, G4int& flbIndex);
0109 G4Ions::G4FloatLevelBase StripFloatLevelBase(const G4String&);
0110
0111 private:
0112 G4double mean_life_threshold = 0.0;
0113 G4double minimum_mean_life_threshold = DBL_MAX;
0114
0115 G4IsotopeList* fUserDefinedList = nullptr;
0116
0117
0118
0119 std::map<G4int, std::multimap<G4double, G4IsotopeProperty*>> map_pre_load_list;
0120
0121
0122
0123 std::map<G4int, std::multimap<G4double, G4IsotopeProperty*>> map_full_list;
0124
0125
0126
0127
0128
0129
0130
0131
0132 enum
0133 {
0134 idxZ = 0,
0135 idxA,
0136 idxEnergy,
0137 idxLife,
0138 idxSpin,
0139 idxMu
0140 };
0141
0142 G4IsotopeList* fIsotopeList = nullptr;
0143 G4double flevelTolerance = 0.0;
0144 G4NuclideTableMessenger* fMessenger = nullptr;
0145 };
0146
0147
0148
0149
0150
0151 inline G4double G4NuclideTable::GetThresholdOfHalfLife()
0152 {
0153 return mean_life_threshold * 0.69314718;
0154 }
0155
0156 inline G4double G4NuclideTable::GetMeanLifeThreshold()
0157 {
0158 return mean_life_threshold;
0159 }
0160
0161 inline void G4NuclideTable::SetLevelTolerance(G4double x)
0162 {
0163 flevelTolerance = x;
0164 }
0165
0166 inline G4double G4NuclideTable::GetLevelTolerance()
0167 {
0168 return flevelTolerance;
0169 }
0170
0171 inline std::size_t G4NuclideTable::GetSizeOfIsotopeList()
0172 {
0173 return (fIsotopeList != nullptr ? fIsotopeList->size() : static_cast<size_t>(0));
0174 }
0175
0176 inline std::size_t G4NuclideTable::entries() const
0177 {
0178 return (fIsotopeList != nullptr ? fIsotopeList->size() : std::size_t(0));
0179 }
0180
0181 inline G4IsotopeProperty* G4NuclideTable::GetIsotopeByIndex(std::size_t idx) const
0182 {
0183 if ((fIsotopeList != nullptr) && idx < fIsotopeList->size()) return (*fIsotopeList)[idx];
0184 return nullptr;
0185 }
0186
0187 #endif