Geant4 11.1.1
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, std::size_t nlev, const std::vector< G4double > &energies, const std::vector< G4int > &spin, const std::vector< const G4NucLevel * > &levels)
 
 ~G4LevelManager ()
 
std::size_t NearestLevelIndex (const G4double energy, const std::size_t index=0) const
 
std::size_t NumberOfTransitions () const
 
const G4NucLevelGetLevel (const std::size_t i) const
 
G4double LevelEnergy (const std::size_t i) const
 
G4double MaxLevelEnergy () const
 
std::size_t NearestLowEdgeLevelIndex (const G4double energy) const
 
const G4NucLevelNearestLevel (const G4double energy, const std::size_t index=0) const
 
G4double NearestLevelEnergy (const G4double energy, const std::size_t index=0) const
 
G4double NearestLowEdgeLevelEnergy (const G4double energy) const
 
G4double LifeTime (const std::size_t i) const
 
G4int SpinTwo (const std::size_t i) const
 
G4int Parity (const std::size_t i) const
 
G4int FloatingLevel (const std::size_t i) const
 
G4double ShellCorrection () const
 
G4double LevelDensity (const G4double U) const
 
const G4StringFloatingType (const std::size_t i) const
 
void StreamInfo (std::ostream &os) const
 
 G4LevelManager (const G4LevelManager &right)=delete
 
const G4LevelManageroperator= (const G4LevelManager &right)=delete
 
G4bool operator== (const G4LevelManager &right) const =delete
 
G4bool operator!= (const G4LevelManager &right) const =delete
 

Detailed Description

Definition at line 53 of file G4LevelManager.hh.

Constructor & Destructor Documentation

◆ G4LevelManager() [1/2]

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

Definition at line 53 of file G4LevelManager.cc.

57 : nTransitions(0)
58{
59 if(0 < ntrans) {
60 nTransitions = ntrans - 1;
61 fLevelEnergy.reserve(ntrans);
62 fSpin.reserve(ntrans);
63 fLevels.reserve(ntrans);
64 for(std::size_t i=0; i<ntrans; ++i) {
65 fLevelEnergy.push_back(energies[i]);
66 fSpin.push_back(spin[i]);
67 fLevels.push_back(levels[i]);
68 }
69 //G4cout << "New G4LevelManager N= " << nTransitions << " "
70 //<< fLevelEnergy.size() << " <" << this << ">" << G4endl;
71 }
73 fLevelDensity = ndata->GetLevelDensity(Z, A, 0.0);
74
75 // J. Nucl. Sci. Tech. 31(2): 151-162 (1994)
76 fShellCorrection = ndata->GetShellCorrection()->GetShellCorrection(A,Z);
77 if(A > 20) {
78 G4int N = A - Z;
79 G4int In = N - (N/2)*2;
80 G4int Iz = Z - (Z/2)*2;
81 G4double a13 = 1.0/G4Pow::GetInstance()->Z13(A);
82 if(In == 0 && Iz == 0) {
83 fLevelDensity = 0.067946*A*(1.0 + 4.1277*a13);
84 } else if(In == 0 && Iz == 1) {
85 fLevelDensity = 0.053061*A*(1.0 + 7.1862*a13);
86 } else if(In == 1 && Iz == 0) {
87 fLevelDensity = 0.060920*A*(1.0 + 3.8767*a13);
88 } else {
89 fLevelDensity = 0.065291*A*(1.0 + 4.4505*a13);
90 }
91 }
92}
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
const G4int Z[17]
const G4double A[17]
static G4NuclearLevelData * GetInstance()
static G4Pow * GetInstance()
Definition: G4Pow.cc:41
G4double Z13(G4int Z) const
Definition: G4Pow.hh:123
#define N
Definition: crc32.c:56

◆ ~G4LevelManager()

G4LevelManager::~G4LevelManager ( )

Definition at line 94 of file G4LevelManager.cc.

95{
96 for(std::size_t i=0; i<=nTransitions; ++i) { delete fLevels[i]; }
97}

◆ G4LevelManager() [2/2]

G4LevelManager::G4LevelManager ( const G4LevelManager right)
delete

Member Function Documentation

◆ FloatingLevel()

G4int G4LevelManager::FloatingLevel ( const std::size_t  i) const
inline

Definition at line 197 of file G4LevelManager.hh.

198{
199 return fSpin[i]/100000;
200}

Referenced by StreamInfo().

◆ FloatingType()

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

Definition at line 114 of file G4LevelManager.cc.

115{
116 return fFloatingLevels[fSpin[i]/100000];
117}

◆ GetLevel()

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

Definition at line 137 of file G4LevelManager.hh.

138{
139 return fLevels[i];
140}

Referenced by NearestLevel().

◆ LevelDensity()

G4double G4LevelManager::LevelDensity ( const G4double  U) const
inline

Definition at line 207 of file G4LevelManager.hh.

208{
209 return fLevelDensity;
210}

Referenced by G4NuclearLevelData::GetLevelDensity().

◆ LevelEnergy()

G4double G4LevelManager::LevelEnergy ( const std::size_t  i) const
inline

Definition at line 142 of file G4LevelManager.hh.

143{
144 return fLevelEnergy[i];
145}

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

◆ LifeTime()

G4double G4LevelManager::LifeTime ( const std::size_t  i) const
inline

Definition at line 182 of file G4LevelManager.hh.

183{
184 return (fLevels[i]) ? fLevels[i]->GetTimeGamma() : 0.0;
185}

Referenced by G4Radioactivation::CalculateChainsFromParent().

◆ MaxLevelEnergy()

G4double G4LevelManager::MaxLevelEnergy ( ) const
inline

Definition at line 147 of file G4LevelManager.hh.

148{
149 return fLevelEnergy[nTransitions];
150}

Referenced by G4GEMProbabilityVI::G4GEMProbabilityVI().

◆ NearestLevel()

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

Definition at line 164 of file G4LevelManager.hh.

165{
166 return GetLevel(NearestLevelIndex(energy, index));
167}
const G4NucLevel * GetLevel(const std::size_t i) const
std::size_t NearestLevelIndex(const G4double energy, const std::size_t index=0) const

◆ NearestLevelEnergy()

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

Definition at line 170 of file G4LevelManager.hh.

172{
173 return LevelEnergy(NearestLevelIndex(energy, index));
174}
G4double LevelEnergy(const std::size_t i) const

Referenced by G4Radioactivation::CalculateChainsFromParent(), G4PhotonEvaporation::GetFinalLevelEnergy(), and G4NuclearLevelData::GetLevelEnergy().

◆ NearestLevelIndex()

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

Definition at line 99 of file G4LevelManager.cc.

101{
102 std::size_t idx = std::min(index, nTransitions);
103 static const G4double tolerance = 10*CLHEP::eV;
104 if(0 == nTransitions || std::abs(energy - fLevelEnergy[idx]) <= tolerance) {
105 return idx;
106 }
107 idx = NearestLowEdgeLevelIndex(energy);
108 if(idx < nTransitions &&
109 (fLevelEnergy[idx] + fLevelEnergy[idx+1])*0.5 <= energy) { ++idx; }
110
111 return idx;
112}
std::size_t NearestLowEdgeLevelIndex(const G4double energy) const

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

◆ NearestLowEdgeLevelEnergy()

G4double G4LevelManager::NearestLowEdgeLevelEnergy ( const G4double  energy) const
inline

Definition at line 177 of file G4LevelManager.hh.

178{
180}

Referenced by G4NuclearLevelData::GetLowEdgeLevelEnergy().

◆ NearestLowEdgeLevelIndex()

std::size_t G4LevelManager::NearestLowEdgeLevelIndex ( const G4double  energy) const
inline

Definition at line 153 of file G4LevelManager.hh.

154{
155 std::size_t idx = nTransitions;
156 if(energy < fLevelEnergy[nTransitions]) {
157 idx = std::lower_bound(fLevelEnergy.begin(), fLevelEnergy.end(), energy)
158 - fLevelEnergy.begin() - 1;
159 }
160 return idx;
161}

Referenced by NearestLevelIndex(), and NearestLowEdgeLevelEnergy().

◆ NumberOfTransitions()

std::size_t G4LevelManager::NumberOfTransitions ( ) const
inline

◆ operator!=()

G4bool G4LevelManager::operator!= ( const G4LevelManager right) const
delete

◆ operator=()

const G4LevelManager & G4LevelManager::operator= ( const G4LevelManager right)
delete

◆ operator==()

G4bool G4LevelManager::operator== ( const G4LevelManager right) const
delete

◆ Parity()

G4int G4LevelManager::Parity ( const std::size_t  i) const
inline

Definition at line 192 of file G4LevelManager.hh.

193{
194 return (fSpin[i]%100000 - 100 > 0) ? 1 : -1;
195}

Referenced by StreamInfo().

◆ ShellCorrection()

G4double G4LevelManager::ShellCorrection ( ) const
inline

Definition at line 202 of file G4LevelManager.hh.

203{
204 return fShellCorrection;
205}

◆ SpinTwo()

G4int G4LevelManager::SpinTwo ( const std::size_t  i) const
inline

Definition at line 187 of file G4LevelManager.hh.

188{
189 return std::abs(fSpin[i]%100000 - 100);
190}

Referenced by StreamInfo().

◆ StreamInfo()

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

Definition at line 119 of file G4LevelManager.cc.

120{
121 for(std::size_t i=0; i<=nTransitions; ++i) {
122 G4long prec = out.precision(6);
123 out << std::setw(6) << i << ". "
124 << std::setw(8) << fLevelEnergy[i];
125 if(fLevels[i]) {
126 out << std::setw(8) << fLevels[i]->GetTimeGamma()
127 << std::setw(4) << fLevels[i]->NumberOfTransitions()
128 << std::setw(4) << SpinTwo(i)
129 << std::setw(4) << Parity(i)
130 << std::setw(4) << FloatingLevel(i);
131 }
132 out << "\n";
133 out.precision(prec);
134 if(fLevels[i]) { fLevels[i]->StreamInfo(out); }
135 }
136}
long G4long
Definition: G4Types.hh:87
G4int FloatingLevel(const std::size_t i) const
G4int SpinTwo(const std::size_t i) const
G4int Parity(const std::size_t i) const

Referenced by G4NuclearLevelData::StreamLevels().


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