50 if (instance ==
nullptr) {
57G4AtomicTransitionManager::G4AtomicTransitionManager()
64G4AtomicTransitionManager::~G4AtomicTransitionManager()
68 for (
auto& pos : shellTable){
69 std::vector<G4AtomicShell*>vec =
pos.second;
70 std::size_t vecSize = vec.size();
71 for (std::size_t i=0; i< vecSize; ++i){
77 for (
auto& ppos : transitionTable)
79 std::vector<G4FluoTransition*>vec = ppos.second;
80 std::size_t vecSize=vec.size();
82 for (std::size_t i=0; i< vecSize; ++i){
92 auto pos = shellTable.find(Z);
94 if (pos!= shellTable.end())
96 std::vector<G4AtomicShell*> v = (*pos).second;
97 if (shellIndex < v.size()) {
return v[shellIndex]; }
101 size_t lastShell = v.size();
103 ed <<
"No de-excitation for Z= " << Z
104 <<
" shellIndex= " << shellIndex
105 <<
">= numberOfShells= " << lastShell;
106 if (verboseLevel > 0)
107 G4Exception(
"G4AtomicTransitionManager::Shell()",
"de0001",
109 if (lastShell > 0) {
return v[lastShell - 1]; }
115 ed <<
"No de-excitation for Z= " << Z
116 <<
" shellIndex= " << shellIndex
117 <<
". AtomicShell not found - check if data are uploaded";
118 G4Exception(
"G4AtomicTransitionManager::Shell()",
"de0001",
132 auto pos = transitionTable.find(Z);
133 if (pos!= transitionTable.end())
135 std::vector<G4FluoTransition*> v = (*pos).second;
136 if (shellIndex < v.size()) {
return(v[shellIndex]); }
140 ed <<
"No fluo transition for Z= " << Z
141 <<
" shellIndex= " << shellIndex;
142 G4Exception(
"G4AtomicTransitionManager::ReachebleShell()",
"de0002",
149 ed <<
"No transition table for Z= " << Z
150 <<
" shellIndex= " << shellIndex;
151 G4Exception(
"G4AtomicTransitionManager::ReachableShell()",
"de0001",
160 G4int vacancyShellIndex)
const
168 auto pos = shellTable.find(Z);
171 if (pos != shellTable.cend()){
173 res = ((*pos).second).size();
177 ed <<
"No deexcitation for Z= " << Z;
178 G4Exception(
"G4AtomicTransitionManager::NumberOfShells()",
"de0001",
190 auto pos = transitionTable.find(Z);
192 if (pos!= transitionTable.cend())
194 res = ((*pos).second).size();
199 ed <<
"No deexcitation for Z= " << Z
200 <<
", so energy deposited locally";
201 G4Exception(
"G4AtomicTransitionManager::NumberOfReachebleShells()",
218 G4int Z,
size_t shellIndex)
const
220 auto pos = transitionTable.find(Z);
223 if (pos!= transitionTable.end())
225 std::vector<G4FluoTransition*> v = (*pos).second;
227 if (shellIndex < v.size())
232 for (
size_t j=0; j<transProb.size(); ++j)
234 totalRadTransProb += transProb[j];
240 ed <<
"Zero transition probability for Z=" << Z
241 <<
" shellIndex= " << shellIndex;
243 "G4AtomicTransitionManager::TotalRadiativeTransitionProbability()",
250 ed <<
"No deexcitation for Z=" << Z
251 <<
" shellIndex= " << shellIndex;
253 "G4AtomicTransitionManager::TotalRadiativeTransitionProbability()",
254 "de0001",
FatalException,ed,
"Cannot compute transition probability");
256 return totalRadTransProb;
261 G4int Z,
size_t shellIndex)
const
264 if(prob > 1.0 || prob < 0.0) {
266 ed <<
"Total probability mismatch Z= " << Z
267 <<
" shellIndex= " << shellIndex
268 <<
" prob= " << prob;
270 "G4AtomicTransitionManager::TotalNonRadiativeTransitionProbability()",
271 "de0003",
FatalException,ed,
"Cannot compute non-radiative probability");
280 if(isInitialized) {
return; }
283 if(isInitialized) {
return; }
284 isInitialized =
true;
288 G4String defaultDirectory =
"/fluor";
289 G4String fluoDirectory = defaultDirectory;
290 G4String bindingDirectory = defaultDirectory;
292 G4int zLim = zMax + 1;
296 bindingDirectory = fluoDirectory =
"/fluor_Bearden";
299 fluoDirectory =
"/fluor_ANSTO";
303 bindingDirectory = fluoDirectory =
"/fluor_XDB_EADL";
308 shellManager->
LoadData(bindingDirectory +
"/binding");
315 for (
G4int Z = zMin; Z <= zMax; ++Z)
317 std::vector<G4AtomicShell*> vectorOfShells;
318 G4int shellIndex = 0;
321 for (shellIndex = 0; shellIndex<numberOfShells; ++shellIndex)
326 vectorOfShells.push_back(shell);
328 shellTable[Z] = vectorOfShells;
334 for (
G4int Znum= infTableLimit; Znum<=supTableLimit; ++Znum)
336 if (Znum == zLim) { dir = defaultDirectory; }
338 std::vector<G4FluoTransition*> vectorOfTransitions;
342 for(
G4int vacancyIndex = 0; vacancyIndex<numberOfVacancies;
345 std::vector<G4int> vectorOfIds;
352 for (
G4int origShellIndex = 0; origShellIndex < numberOfTransitions;
355 G4int originatingShellId =
357 vectorOfIds.push_back(originatingShellId);
361 vectorOfEnergies.push_back(transitionEnergy);
364 vectorOfProbabilities.push_back(transitionProbability);
368 vectorOfEnergies,vectorOfProbabilities);
369 vectorOfTransitions.push_back(transition);
371 transitionTable[Znum] = vectorOfTransitions;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
#define G4MUTEX_INITIALIZER
G4int NumberOfReachableShells(G4int Z) const
G4double TotalRadiativeTransitionProbability(G4int Z, size_t shellIndex) const
const G4AugerTransition * ReachableAugerShell(G4int Z, G4int shellIndex) const
G4AtomicShell * Shell(G4int Z, size_t shellIndex) const
const G4FluoTransition * ReachableShell(G4int Z, size_t shellIndex) const
void Initialise()
needs to be called once from other code before start of run
G4int NumberOfShells(G4int Z) const
G4double TotalNonRadiativeTransitionProbability(G4int Z, size_t shellIndex) const
static G4AtomicTransitionManager * Instance()
G4int NumberOfReachableAugerShells(G4int Z) const
size_t NumberOfVacancies(G4int Z) const
G4AugerTransition * GetAugerTransition(G4int Z, G4int vacancyShellIndex)
static G4EmParameters * Instance()
G4EmFluoDirectory FluoDirectory() const
std::size_t NumberOfTransitions(G4int vacancyIndex) const
G4double StartShellEnergy(G4int initIndex, G4int vacancyIndex) const
G4int VacancyId(G4int vacancyIndex) const
Given the index of the vacancy returns its identity.
std::size_t NumberOfVacancies() const
G4int StartShellId(G4int initIndex, G4int vacancyIndex) const
G4double StartShellProb(G4int initIndex, G4int vacancyIndex) const
const G4DataVector & TransitionProbabilities() const
Return the probabilities of the transitions.
G4int ShellId(G4int Z, G4int shellIndex) const
G4double BindingEnergy(G4int Z, G4int shellIndex) const
void LoadData(const G4String &fileName)
std::size_t NumberOfShells(G4int Z) const