Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4LevelManager Class Reference

#include <G4LevelManager.hh>

Public Member Functions

 G4LevelManager (G4int Z, G4int A, size_t nlev, const std::vector< G4double > &energies, const std::vector< G4int > &spin, const std::vector< const G4NucLevel * > &levels)
 
 ~G4LevelManager ()
 
size_t NumberOfTransitions () const
 
const G4NucLevelGetLevel (size_t i) const
 
G4double LevelEnergy (size_t i) const
 
G4double MaxLevelEnergy () const
 
size_t NearestLevelIndex (G4double energy, size_t index=0) const
 
size_t NearestLowEdgeLevelIndex (G4double energy) const
 
const G4NucLevelNearestLevel (G4double energy, size_t index=0) const
 
G4double NearestLevelEnergy (G4double energy, size_t index=0) const
 
G4double NearestLowEdgeLevelEnergy (G4double energy) const
 
G4double LifeTime (size_t i) const
 
G4int SpinTwo (size_t i) const
 
G4int Parity (size_t i) const
 
G4int FloatingLevel (size_t i) const
 
G4double ShellCorrection () const
 
G4double LevelDensity (G4double U) const
 
const G4StringFloatingType (size_t i) const
 
void StreamInfo (std::ostream &os) const
 

Detailed Description

Definition at line 53 of file G4LevelManager.hh.

Constructor & Destructor Documentation

◆ G4LevelManager()

G4LevelManager::G4LevelManager ( G4int  Z,
G4int  A,
size_t  nlev,
const std::vector< G4double > &  energies,
const std::vector< G4int > &  spin,
const std::vector< const G4NucLevel * > &  levels 
)
explicit

Definition at line 52 of file G4LevelManager.cc.

56 : nTransitions(0)
57{
58 if(0 < ntrans) {
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]);
67 }
68 //G4cout << "New G4LevelManager N= " << nTransitions << " "
69 //<< fLevelEnergy.size() << " <" << this << ">" << G4endl;
70 }
71 // J. Nucl. Sci. Tech. 31(2): 151-162 (1994)
72 fShellCorrection = G4NuclearLevelData::GetInstance()->
73 GetShellCorrection()->GetShellCorrection(A,Z);
74 G4int N = A - Z;
75 G4int In = N - (N/2)*2;
76 G4int Iz = Z - (Z/2)*2;
77 G4double a13 = 1.0/G4Pow::GetInstance()->Z13(A);
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);
84 } else {
85 fLevelDensity = 0.065291*A*(1.0 + 4.4505*a13);
86 }
87}
double A(double temperature)
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
G4ShellCorrection * GetShellCorrection()
static G4NuclearLevelData * GetInstance()
static G4Pow * GetInstance()
Definition: G4Pow.cc:41
G4double Z13(G4int Z) const
Definition: G4Pow.hh:123

◆ ~G4LevelManager()

G4LevelManager::~G4LevelManager ( )

Definition at line 89 of file G4LevelManager.cc.

90{
91 for(size_t i=0; i<=nTransitions; ++i) { delete fLevels[i]; }
92}

Member Function Documentation

◆ FloatingLevel()

G4int G4LevelManager::FloatingLevel ( size_t  i) const
inline

Definition at line 210 of file G4LevelManager.hh.

211{
212#ifdef G4VERBOSE
213 if(i > nTransitions) { PrintError(i, "Floating"); }
214#endif
215 return fSpin[i]/100000;
216}

Referenced by StreamInfo().

◆ FloatingType()

const G4String & G4LevelManager::FloatingType ( size_t  i) const

Definition at line 122 of file G4LevelManager.cc.

123{
124#ifdef G4VERBOSE
125 if(i > nTransitions) { PrintError(i, "FloatingType(idx)"); }
126#endif
127 return fFloatingLevels[fSpin[i]/100000];
128}

◆ GetLevel()

const G4NucLevel * G4LevelManager::GetLevel ( size_t  i) const
inline

Definition at line 138 of file G4LevelManager.hh.

139{
140#ifdef G4VERBOSE
141 if(i > nTransitions) { PrintError(i, "GetLevel(idx)"); }
142#endif
143 return fLevels[i];
144}

Referenced by NearestLevel().

◆ LevelDensity()

G4double G4LevelManager::LevelDensity ( G4double  U) const
inline

Definition at line 223 of file G4LevelManager.hh.

224{
225 return fLevelDensity;
226}

Referenced by G4NuclearLevelData::GetLevelDensity().

◆ LevelEnergy()

G4double G4LevelManager::LevelEnergy ( size_t  i) const
inline

Definition at line 146 of file G4LevelManager.hh.

147{
148#ifdef G4VERBOSE
149 if(i > nTransitions) { PrintError(i, "LevelEnergy(idx)"); }
150#endif
151 return fLevelEnergy[i];
152}

Referenced by G4NuclearLevelData::FindLevel(), NearestLevelEnergy(), and NearestLowEdgeLevelEnergy().

◆ LifeTime()

G4double G4LevelManager::LifeTime ( size_t  i) const
inline

Definition at line 186 of file G4LevelManager.hh.

187{
188#ifdef G4VERBOSE
189 if(i > nTransitions) { PrintError(i, "LifeTime"); }
190#endif
191 return (fLevels[i]) ? fLevels[i]->GetTimeGamma() : 0.0;
192}

Referenced by G4Radioactivation::CalculateChainsFromParent(), and G4RadioactiveDecay::CalculateChainsFromParent().

◆ MaxLevelEnergy()

G4double G4LevelManager::MaxLevelEnergy ( ) const
inline

Definition at line 154 of file G4LevelManager.hh.

155{
156 return fLevelEnergy[nTransitions];
157}

Referenced by G4GEMProbabilityVI::G4GEMProbabilityVI().

◆ NearestLevel()

const G4NucLevel * G4LevelManager::NearestLevel ( G4double  energy,
size_t  index = 0 
) const
inline

Definition at line 170 of file G4LevelManager.hh.

171{
172 return GetLevel(NearestLevelIndex(energy, index));
173}
const G4NucLevel * GetLevel(size_t i) const
size_t NearestLevelIndex(G4double energy, size_t index=0) const

◆ NearestLevelEnergy()

G4double G4LevelManager::NearestLevelEnergy ( G4double  energy,
size_t  index = 0 
) const
inline

◆ NearestLevelIndex()

size_t G4LevelManager::NearestLevelIndex ( G4double  energy,
size_t  index = 0 
) const

Definition at line 95 of file G4LevelManager.cc.

96{
97 //G4cout<< "index= " << index << " max= " << nTransitions << " exc= " << ener
98 // << " Emax= " << fLevelEnergy[nTransitions] << G4endl;
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) {
102 return idx;
103 }
104 // ground state
105 if(energy <= fLevelEnergy[1]*0.5)
106 { idx = 0; }
107 // take top level
108 else if((fLevelEnergy[nTransitions] + fLevelEnergy[nTransitions-1])*0.5 <= energy)
109 { idx = nTransitions; }
110
111 // if shortcuts are not working, make binary search
112 else {
113 idx = std::lower_bound(fLevelEnergy.begin(), fLevelEnergy.end(), energy)
114 - fLevelEnergy.begin() - 1;
115 if(energy - fLevelEnergy[idx] > fLevelEnergy[idx+1] - energy) { ++idx; }
116 //G4cout << "E= " << energy << " " << fLevelEnergy[idx-1]
117 //<< " " << fLevelEnergy[idx] << G4endl;
118 }
119 return idx;
120}

Referenced by G4Radioactivation::CalculateChainsFromParent(), G4RadioactiveDecay::CalculateChainsFromParent(), G4NuclearLevelData::FindLevel(), NearestLevel(), and NearestLevelEnergy().

◆ NearestLowEdgeLevelEnergy()

G4double G4LevelManager::NearestLowEdgeLevelEnergy ( G4double  energy) const
inline

Definition at line 181 of file G4LevelManager.hh.

182{
184}
size_t NearestLowEdgeLevelIndex(G4double energy) const

Referenced by G4NuclearLevelData::GetLowEdgeLevelEnergy().

◆ NearestLowEdgeLevelIndex()

size_t G4LevelManager::NearestLowEdgeLevelIndex ( G4double  energy) const
inline

Definition at line 159 of file G4LevelManager.hh.

160{
161 size_t idx = nTransitions;
162 if(energy < fLevelEnergy[nTransitions]) {
163 idx = std::lower_bound(fLevelEnergy.begin(), fLevelEnergy.end(), energy)
164 - fLevelEnergy.begin() - 1;
165 }
166 return idx;
167}

Referenced by NearestLowEdgeLevelEnergy().

◆ NumberOfTransitions()

size_t G4LevelManager::NumberOfTransitions ( ) const
inline

◆ Parity()

G4int G4LevelManager::Parity ( size_t  i) const
inline

Definition at line 202 of file G4LevelManager.hh.

203{
204#ifdef G4VERBOSE
205 if(i > nTransitions) { PrintError(i, "SpinTwo"); }
206#endif
207 return (fSpin[i]%100000 - 100 > 0) ? 1 : -1;
208}

Referenced by StreamInfo().

◆ ShellCorrection()

G4double G4LevelManager::ShellCorrection ( ) const
inline

Definition at line 218 of file G4LevelManager.hh.

219{
220 return fShellCorrection;
221}

◆ SpinTwo()

G4int G4LevelManager::SpinTwo ( size_t  i) const
inline

Definition at line 194 of file G4LevelManager.hh.

195{
196#ifdef G4VERBOSE
197 if(i > nTransitions) { PrintError(i, "SpinTwo"); }
198#endif
199 return std::abs(fSpin[i]%100000 - 100);
200}

Referenced by StreamInfo().

◆ StreamInfo()

void G4LevelManager::StreamInfo ( std::ostream &  os) const

Definition at line 141 of file G4LevelManager.cc.

142{
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];
147 if(fLevels[i]) {
148 out << std::setw(8) << fLevels[i]->GetTimeGamma()
149 << std::setw(4) << fLevels[i]->NumberOfTransitions()
150 << std::setw(4) << SpinTwo(i)
151 << std::setw(4) << Parity(i)
152 << std::setw(4) << FloatingLevel(i);
153 }
154 out << "\n";
155 out.precision(prec);
156 if(fLevels[i]) { fLevels[i]->StreamInfo(out); }
157 }
158}
G4int FloatingLevel(size_t i) const
G4int SpinTwo(size_t i) const
G4int Parity(size_t i) const

Referenced by G4NuclearLevelData::StreamLevels().


The documentation for this class was generated from the following files: