49G4String G4LevelManager::fFloatingLevels[] = {
50 "-",
"+X",
"+Y",
"+Z",
"+U",
"+V",
"+W",
"+R",
"+S",
"+T",
"+A",
"+B",
"+C"};
53 const std::vector<G4double>& energies,
54 const std::vector<G4int>& spin,
55 const std::vector<const G4NucLevel*>& levels)
59 nTransitions = ntrans - 1;
60 fLevelEnergy.reserve(ntrans);
61 fSpin.reserve(ntrans);
62 fLevels.reserve(ntrans);
63 for(
size_t i=0; i<ntrans; ++i) {
64 fLevelEnergy.push_back(energies[i]);
65 fSpin.push_back(spin[i]);
66 fLevels.push_back(levels[i]);
75 G4int In = N - (N/2)*2;
76 G4int Iz = Z - (Z/2)*2;
78 if(In == 0 && Iz == 0) {
79 fLevelDensity = 0.067946*
A*(1.0 + 4.1277*a13);
80 }
else if(In == 0 && Iz == 1) {
81 fLevelDensity = 0.053061*
A*(1.0 + 7.1862*a13);
82 }
else if(In == 1 && Iz == 0) {
83 fLevelDensity = 0.060920*
A*(1.0 + 3.8767*a13);
85 fLevelDensity = 0.065291*
A*(1.0 + 4.4505*a13);
91 for(
size_t i=0; i<=nTransitions; ++i) {
delete fLevels[i]; }
99 size_t idx = std::min(index, nTransitions);
100 static const G4double tolerance = 1.0f-6;
101 if(0 == nTransitions || std::abs(energy - fLevelEnergy[idx]) <= tolerance) {
105 if(energy <= fLevelEnergy[1]*0.5)
108 else if((fLevelEnergy[nTransitions] + fLevelEnergy[nTransitions-1])*0.5 <= energy)
109 { idx = nTransitions; }
113 idx = std::lower_bound(fLevelEnergy.begin(), fLevelEnergy.end(), energy)
114 - fLevelEnergy.begin() - 1;
115 if(energy - fLevelEnergy[idx] > fLevelEnergy[idx+1] - energy) { ++idx; }
125 if(i > nTransitions) { PrintError(i,
"FloatingType(idx)"); }
127 return fFloatingLevels[fSpin[i]/100000];
131void G4LevelManager::PrintError(
size_t idx,
const G4String& ss)
const
133 G4String sss =
"G4LevelManager::"+ss+
"()";
135 ed <<
"Index of a level " << idx <<
" >= "
136 << nTransitions+1 <<
" (Nlevels) ";
143 for(
size_t i=0; i<=nTransitions; ++i) {
144 G4int prec = out.precision(6);
145 out << std::setw(6) << i <<
". "
146 << std::setw(8) << fLevelEnergy[i];
148 out << std::setw(8) << fLevels[i]->GetTimeGamma()
149 << std::setw(4) << fLevels[i]->NumberOfTransitions()
151 << std::setw(4) <<
Parity(i)
156 if(fLevels[i]) { fLevels[i]->StreamInfo(out); }
double A(double temperature)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
void StreamInfo(std::ostream &os) const
G4LevelManager(G4int Z, G4int A, size_t nlev, const std::vector< G4double > &energies, const std::vector< G4int > &spin, const std::vector< const G4NucLevel * > &levels)
size_t NearestLevelIndex(G4double energy, size_t index=0) const
G4int FloatingLevel(size_t i) const
G4int SpinTwo(size_t i) const
G4int Parity(size_t i) const
const G4String & FloatingType(size_t i) const
G4ShellCorrection * GetShellCorrection()
static G4NuclearLevelData * GetInstance()
static G4Pow * GetInstance()
G4double Z13(G4int Z) const