File indexing completed on 2025-01-18 09:58:37
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
0037
0038
0039
0040
0041
0042
0043
0044
0045 #ifndef G4LEVELMANAGER_HH
0046 #define G4LEVELMANAGER_HH 1
0047
0048 #include "globals.hh"
0049 #include "G4NucLevel.hh"
0050 #include <vector>
0051 #include <iostream>
0052
0053 class G4LevelManager
0054 {
0055
0056 public:
0057
0058
0059
0060
0061
0062 explicit G4LevelManager(G4int Z, G4int A, std::size_t nlev,
0063 const std::vector<G4double>& energies,
0064 const std::vector<G4int>& spin,
0065 const std::vector<const G4NucLevel*>& levels);
0066
0067 ~G4LevelManager();
0068
0069
0070
0071
0072
0073
0074 std::size_t NearestLevelIndex(const G4double energy, const std::size_t index=0) const;
0075
0076 inline std::size_t NumberOfTransitions() const;
0077
0078 inline const G4NucLevel* GetLevel(const std::size_t i) const;
0079
0080 inline G4double LevelEnergy(const std::size_t i) const;
0081
0082 inline G4double MaxLevelEnergy() const;
0083
0084 inline std::size_t NearestLowEdgeLevelIndex(const G4double energy) const;
0085
0086 inline const G4NucLevel* NearestLevel(const G4double energy,
0087 const std::size_t index=0) const;
0088
0089 inline G4double NearestLevelEnergy(const G4double energy,
0090 const std::size_t index=0) const;
0091
0092 inline G4double NearestLowEdgeLevelEnergy(const G4double energy) const;
0093
0094
0095 inline G4double LifeTime(const std::size_t i) const;
0096
0097 inline G4int TwoSpinParity(const std::size_t i) const;
0098
0099 inline G4int Parity(const std::size_t i) const;
0100
0101 inline G4int FloatingLevel(const std::size_t i) const;
0102
0103 inline G4double ShellCorrection() const;
0104
0105 inline G4double LevelDensity(const G4double U) const;
0106
0107 inline const std::vector<G4double>& GetLevelEnergies() const;
0108
0109 inline const std::vector<const G4NucLevel*>& GetLevels() const;
0110
0111 const G4String& FloatingType(const std::size_t i) const;
0112
0113 void StreamInfo(std::ostream& os) const;
0114
0115 G4LevelManager(const G4LevelManager & right) = delete;
0116 const G4LevelManager& operator=(const G4LevelManager &right) = delete;
0117 G4bool operator==(const G4LevelManager &right) const = delete;
0118 G4bool operator!=(const G4LevelManager &right) const = delete;
0119
0120 private:
0121
0122 std::vector<G4double> fLevelEnergy;
0123 std::vector<G4int> fSpin;
0124 std::vector<const G4NucLevel*> fLevels;
0125
0126 G4double fShellCorrection;
0127 G4double fLevelDensity;
0128
0129 std::size_t nTransitions;
0130
0131 static const G4int nfloting = 13;
0132 static G4String fFloatingLevels[nfloting];
0133
0134 };
0135
0136 inline std::size_t G4LevelManager::NumberOfTransitions() const
0137 {
0138 return nTransitions;
0139 }
0140
0141 inline const G4NucLevel* G4LevelManager::GetLevel(const std::size_t i) const
0142 {
0143 return fLevels[i];
0144 }
0145
0146 inline G4double G4LevelManager::LevelEnergy(const std::size_t i) const
0147 {
0148 return fLevelEnergy[i];
0149 }
0150
0151 inline G4double G4LevelManager::MaxLevelEnergy() const
0152 {
0153 return fLevelEnergy[nTransitions];
0154 }
0155
0156 inline std::size_t
0157 G4LevelManager::NearestLowEdgeLevelIndex(const G4double energy) const
0158 {
0159 std::size_t idx = nTransitions;
0160 if(energy < fLevelEnergy[nTransitions]) {
0161 idx = std::lower_bound(fLevelEnergy.begin(), fLevelEnergy.end(), energy)
0162 - fLevelEnergy.begin() - 1;
0163 }
0164 return idx;
0165 }
0166
0167 inline const G4NucLevel*
0168 G4LevelManager::NearestLevel(const G4double energy, const std::size_t index) const
0169 {
0170 return GetLevel(NearestLevelIndex(energy, index));
0171 }
0172
0173 inline G4double
0174 G4LevelManager::NearestLevelEnergy(const G4double energy,
0175 const std::size_t index) const
0176 {
0177 return LevelEnergy(NearestLevelIndex(energy, index));
0178 }
0179
0180 inline G4double
0181 G4LevelManager::NearestLowEdgeLevelEnergy(const G4double energy) const
0182 {
0183 return LevelEnergy(NearestLowEdgeLevelIndex(energy));
0184 }
0185
0186 inline G4double G4LevelManager::LifeTime(const std::size_t i) const
0187 {
0188 return (fLevels[i]) ? fLevels[i]->GetTimeGamma() : 0.0;
0189 }
0190
0191 inline G4int G4LevelManager::TwoSpinParity(const std::size_t i) const
0192 {
0193 return fSpin[i]%100000 - 100;
0194 }
0195
0196 inline G4int G4LevelManager::Parity(const std::size_t i) const
0197 {
0198 return (fSpin[i]%100000 - 100 > 0) ? 1 : -1;
0199 }
0200
0201 inline G4int G4LevelManager::FloatingLevel(const std::size_t i) const
0202 {
0203 return fSpin[i]/100000;
0204 }
0205
0206 inline G4double G4LevelManager::ShellCorrection() const
0207 {
0208 return fShellCorrection;
0209 }
0210
0211 inline G4double G4LevelManager::LevelDensity(const G4double) const
0212 {
0213 return fLevelDensity;
0214 }
0215
0216 inline const std::vector<G4double>& G4LevelManager::GetLevelEnergies() const
0217 {
0218 return fLevelEnergy;
0219 }
0220
0221 inline const std::vector<const G4NucLevel*>& G4LevelManager::GetLevels() const
0222 {
0223 return fLevels;
0224 }
0225
0226 #endif