51 if (instance ==
nullptr) {
70 for (
auto const & pos : shellTable) {
71 std::vector<G4AtomicShell*> vec = pos.second;
72 for (
auto const & p : vec) {
delete p; }
75 for (
auto const & ppos : transitionTable) {
76 std::vector<G4FluoTransition*> vec = ppos.second;
77 for (
auto const & p : vec) {
delete p; }
85 auto pos = shellTable.find(Z);
87 if (pos!= shellTable.end())
89 std::vector<G4AtomicShell*> v = (*pos).second;
90 if (shellIndex < v.size()) {
return v[shellIndex]; }
94 std::size_t lastShell = v.size();
96 ed <<
"No de-excitation for Z= " << Z
97 <<
" shellIndex= " << shellIndex
98 <<
">= numberOfShells= " << lastShell;
100 G4Exception(
"G4AtomicTransitionManager::Shell()",
"de0001",
102 if (lastShell > 0) {
return v[lastShell - 1]; }
108 ed <<
"No de-excitation for Z= " << Z
109 <<
" shellIndex= " << shellIndex
110 <<
". AtomicShell not found - check if data are uploaded";
111 G4Exception(
"G4AtomicTransitionManager::Shell()",
"de0001",
125 auto pos = transitionTable.find(Z);
126 if (pos!= transitionTable.end())
128 std::vector<G4FluoTransition*> v = (*pos).second;
129 if (shellIndex < v.size()) {
return(v[shellIndex]); }
133 ed <<
"No fluo transition for Z= " << Z
134 <<
" shellIndex= " << shellIndex;
135 G4Exception(
"G4AtomicTransitionManager::ReachebleShell()",
"de0002",
142 ed <<
"No transition table for Z= " << Z
143 <<
" shellIndex= " << shellIndex;
144 G4Exception(
"G4AtomicTransitionManager::ReachableShell()",
"de0001",
153 G4int vacancyShellIndex)
const
155 return augerData->GetAugerTransition(Z,vacancyShellIndex);
161 auto pos = shellTable.find(Z);
164 if (pos != shellTable.cend()){
166 res = ((*pos).second).size();
170 ed <<
"No deexcitation for Z= " << Z;
171 G4Exception(
"G4AtomicTransitionManager::NumberOfShells()",
"de0001",
183 auto pos = transitionTable.find(Z);
185 if (pos!= transitionTable.cend())
187 res = ((*pos).second).size();
192 ed <<
"No deexcitation for Z= " << Z
193 <<
", so energy deposited locally";
194 G4Exception(
"G4AtomicTransitionManager::NumberOfReachebleShells()",
206 return (
G4int)augerData->NumberOfVacancies(Z);
211 G4int Z, std::size_t shellIndex)
const
213 auto pos = transitionTable.find(Z);
216 if (pos!= transitionTable.end())
218 std::vector<G4FluoTransition*> v = (*pos).second;
220 if (shellIndex < v.size())
225 for (std::size_t j=0; j<transProb.size(); ++j)
227 totalRadTransProb += transProb[j];
233 ed <<
"Zero transition probability for Z=" << Z
234 <<
" shellIndex= " << shellIndex;
236 "G4AtomicTransitionManager::TotalRadiativeTransitionProbability()",
243 ed <<
"No deexcitation for Z=" << Z
244 <<
" shellIndex= " << shellIndex;
246 "G4AtomicTransitionManager::TotalRadiativeTransitionProbability()",
247 "de0001",
FatalException,ed,
"Cannot compute transition probability");
249 return totalRadTransProb;
254 G4int Z, std::size_t shellIndex)
const
257 if(prob > 1.0 || prob < 0.0) {
259 ed <<
"Total probability mismatch Z= " << Z
260 <<
" shellIndex= " << shellIndex
261 <<
" prob= " << prob;
263 "G4AtomicTransitionManager::TotalNonRadiativeTransitionProbability()",
264 "de0003",
FatalException,ed,
"Cannot compute non-radiative probability");
273 if(isInitialized) {
return; }
276 if(isInitialized) {
return; }
277 isInitialized =
true;
281 const G4String& defaultDirectory =
"/fluor";
282 G4String fluoDirectory = defaultDirectory;
283 G4String bindingDirectory = defaultDirectory;
285 G4int zLim = zMax + 1;
289 bindingDirectory = fluoDirectory =
"/fluor_Bearden";
292 fluoDirectory =
"/fluor_ANSTO";
296 bindingDirectory = fluoDirectory =
"/fluor_XDB_EADL";
301 shellManager->
LoadData(bindingDirectory +
"/binding");
308 for (
G4int Z = zMin; Z <= zMax; ++Z)
310 std::vector<G4AtomicShell*> vectorOfShells;
311 G4int shellIndex = 0;
314 for (shellIndex = 0; shellIndex<numberOfShells; ++shellIndex)
319 vectorOfShells.push_back(shell);
321 shellTable[Z] = std::move(vectorOfShells);
326 G4String dir = std::move(fluoDirectory);
327 for (
G4int Znum= infTableLimit; Znum<=supTableLimit; ++Znum)
329 if (Znum == zLim) { dir = defaultDirectory; }
331 std::vector<G4FluoTransition*> vectorOfTransitions;
335 for(
G4int vacancyIndex = 0; vacancyIndex<numberOfVacancies;
338 std::vector<G4int> vectorOfIds;
345 for (
G4int origShellIndex = 0; origShellIndex < numberOfTransitions;
348 G4int originatingShellId =
350 vectorOfIds.push_back(originatingShellId);
354 vectorOfEnergies.push_back(transitionEnergy);
357 vectorOfProbabilities.push_back(transitionProbability);
361 vectorOfEnergies,vectorOfProbabilities);
362 vectorOfTransitions.push_back(transition);
364 transitionTable[Znum] = std::move(vectorOfTransitions);
G4TemplateAutoLock< G4Mutex > G4AutoLock
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
#define G4MUTEX_INITIALIZER
G4int NumberOfReachableShells(G4int Z) const
G4AtomicShell * Shell(G4int Z, std::size_t shellIndex) const
const G4AugerTransition * ReachableAugerShell(G4int Z, G4int shellIndex) const
G4double TotalRadiativeTransitionProbability(G4int Z, std::size_t shellIndex) const
const G4FluoTransition * ReachableShell(G4int Z, std::size_t shellIndex) const
G4double TotalNonRadiativeTransitionProbability(G4int Z, std::size_t shellIndex) const
G4AtomicTransitionManager(const G4AtomicTransitionManager &)=delete
void Initialise()
needs to be called once from other code before start of run
G4int NumberOfShells(G4int Z) const
static G4AtomicTransitionManager * Instance()
~G4AtomicTransitionManager()
G4int NumberOfReachableAugerShells(G4int Z) const
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