Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4LevelManager.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27// -------------------------------------------------------------------
28//
29// GEANT4 header file
30//
31// File name: G4LevelManager
32//
33// Author: V.Ivanchenko
34//
35// Creation date: 4 January 2012
36//
37// Modifications:
38// 13.02.2015 Design change for gamma de-excitation
39//
40// -------------------------------------------------------------------
41//
42// Nuclear level manager for photon de-excitation process
43//
44
45#ifndef G4LEVELMANAGER_HH
46#define G4LEVELMANAGER_HH 1
47
48#include "globals.hh"
49#include "G4NucLevel.hh"
50#include <vector>
51#include <iostream>
52
54{
55
56public:
57 // levels - vector of nuclear level objects, ground state
58 // level has NULL pointer
59 // energies - list of excitation energies of nuclear levels starting
60 // from the ground state with energy zero
61 // spin - 2J, where J is the full angular momentum of the state
62 explicit G4LevelManager(G4int Z, G4int A, std::size_t nlev,
63 const std::vector<G4double>& energies,
64 const std::vector<G4int>& spin,
65 const std::vector<const G4NucLevel*>& levels);
66
68
69 //===================================================================
70 // run time inlined const functions
71 //===================================================================
72
73 // only in this method there is a check on the vector boundary
74 std::size_t NearestLevelIndex(const G4double energy, const std::size_t index=0) const;
75
76 inline std::size_t NumberOfTransitions() const;
77
78 inline const G4NucLevel* GetLevel(const std::size_t i) const;
79
80 inline G4double LevelEnergy(const std::size_t i) const;
81
82 inline G4double MaxLevelEnergy() const;
83
84 inline std::size_t NearestLowEdgeLevelIndex(const G4double energy) const;
85
86 inline const G4NucLevel* NearestLevel(const G4double energy,
87 const std::size_t index=0) const;
88
89 inline G4double NearestLevelEnergy(const G4double energy,
90 const std::size_t index=0) const;
91
92 inline G4double NearestLowEdgeLevelEnergy(const G4double energy) const;
93
94 // for stable isotopes life time is -1
95 inline G4double LifeTime(const std::size_t i) const;
96
97 inline G4int TwoSpinParity(const std::size_t i) const;
98
99 inline G4int Parity(const std::size_t i) const;
100
101 inline G4int FloatingLevel(const std::size_t i) const;
102
103 inline G4double ShellCorrection() const;
104
105 inline G4double LevelDensity(const G4double U) const;
106
107 inline const std::vector<G4double>& GetLevelEnergies() const;
108
109 inline const std::vector<const G4NucLevel*>& GetLevels() const;
110
111 const G4String& FloatingType(const std::size_t i) const;
112
113 void StreamInfo(std::ostream& os) const;
114
115 G4LevelManager(const G4LevelManager & right) = delete;
116 const G4LevelManager& operator=(const G4LevelManager &right) = delete;
117 G4bool operator==(const G4LevelManager &right) const = delete;
118 G4bool operator!=(const G4LevelManager &right) const = delete;
119
120private:
121
122 std::vector<G4double> fLevelEnergy;
123 std::vector<G4int> fSpin;
124 std::vector<const G4NucLevel*> fLevels;
125
126 G4double fShellCorrection;
127 G4double fLevelDensity;
128
129 std::size_t nTransitions;
130
131 static const G4int nfloting = 13;
132 static G4String fFloatingLevels[nfloting];
133
134};
135
136inline std::size_t G4LevelManager::NumberOfTransitions() const
137{
138 return nTransitions;
139}
140
141inline const G4NucLevel* G4LevelManager::GetLevel(const std::size_t i) const
142{
143 return fLevels[i];
144}
145
146inline G4double G4LevelManager::LevelEnergy(const std::size_t i) const
147{
148 return fLevelEnergy[i];
149}
150
152{
153 return fLevelEnergy[nTransitions];
154}
155
156inline std::size_t
158{
159 std::size_t idx = nTransitions;
160 if(energy < fLevelEnergy[nTransitions]) {
161 idx = std::lower_bound(fLevelEnergy.begin(), fLevelEnergy.end(), energy)
162 - fLevelEnergy.begin() - 1;
163 }
164 return idx;
165}
166
167inline const G4NucLevel*
168G4LevelManager::NearestLevel(const G4double energy, const std::size_t index) const
169{
170 return GetLevel(NearestLevelIndex(energy, index));
171}
172
173inline G4double
175 const std::size_t index) const
176{
177 return LevelEnergy(NearestLevelIndex(energy, index));
178}
179
180inline G4double
185
186inline G4double G4LevelManager::LifeTime(const std::size_t i) const
187{
188 return (fLevels[i]) ? fLevels[i]->GetTimeGamma() : 0.0;
189}
190
191inline G4int G4LevelManager::TwoSpinParity(const std::size_t i) const
192{
193 return fSpin[i]%100000 - 100;
194}
195
196inline G4int G4LevelManager::Parity(const std::size_t i) const
197{
198 return (fSpin[i]%100000 - 100 > 0) ? 1 : -1;
199}
200
201inline G4int G4LevelManager::FloatingLevel(const std::size_t i) const
202{
203 return fSpin[i]/100000;
204}
205
207{
208 return fShellCorrection;
209}
210
212{
213 return fLevelDensity;
214}
215
216inline const std::vector<G4double>& G4LevelManager::GetLevelEnergies() const
217{
218 return fLevelEnergy;
219}
220
221inline const std::vector<const G4NucLevel*>& G4LevelManager::GetLevels() const
222{
223 return fLevels;
224}
225
226#endif
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
const G4double A[17]
const G4NucLevel * GetLevel(const std::size_t i) const
void StreamInfo(std::ostream &os) const
G4double NearestLowEdgeLevelEnergy(const G4double energy) const
G4double ShellCorrection() const
std::size_t NearestLevelIndex(const G4double energy, const std::size_t index=0) const
G4int FloatingLevel(const std::size_t i) const
G4double LevelEnergy(const std::size_t i) const
G4double LevelDensity(const G4double U) const
G4LevelManager(const G4LevelManager &right)=delete
std::size_t NumberOfTransitions() const
const std::vector< const G4NucLevel * > & GetLevels() const
G4bool operator==(const G4LevelManager &right) const =delete
const std::vector< G4double > & GetLevelEnergies() const
const G4String & FloatingType(const std::size_t i) const
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)
const G4NucLevel * NearestLevel(const G4double energy, const std::size_t index=0) const
std::size_t NearestLowEdgeLevelIndex(const G4double energy) const
G4double MaxLevelEnergy() const
G4int Parity(const std::size_t i) const
G4double LifeTime(const std::size_t i) const
const G4LevelManager & operator=(const G4LevelManager &right)=delete
G4double NearestLevelEnergy(const G4double energy, const std::size_t index=0) const
G4bool operator!=(const G4LevelManager &right) const =delete
G4int TwoSpinParity(const std::size_t i) const