77 if (p_proton !=
nullptr)
return;
95 if (p_proton !=
nullptr)
return;
104#ifdef G4MULTITHREADED
138 delete fIsotopeTable;
196 delete fIsotopeTable;
221 if (genericIon !=
nullptr) {
227 G4cout <<
"G4IonTable::CreateIon() : can not create ion of "
228 <<
" Z =" << Z <<
" A = " <<
A <<
" because GenericIon is not ready !!" <<
G4endl;
232 "Can not create ions because GenericIon is not ready");
245 if (fProperty !=
nullptr) {
252 stable = (life <= 0.) || (decayTable ==
nullptr);
254 if (lvl < 0) lvl = 9;
260 ed <<
"G4IonTable::CreateIon(): G4IsotopeProperty object is not found for"
261 <<
" Z = " << Z <<
" A = " <<
A <<
" E = " << E / keV <<
" (keV)";
266 <<
" Physics quantities such as life are not set for this ion.";
273 if (Eex > 0.0) lvl = 9;
277 if (Eex == 0.0) lvl = 0;
302 ion =
new G4Ions( name, mass, 0.0*MeV, charge,
306 stable, life, decayTable,
false,
314 static_cast<G4Ions*
>(ion)->SetFloatLevelBase(flb);
321 G4cout <<
"G4IonTable::CreateIon() : create ion of " << name <<
" " << Z <<
", " <<
A
324 G4cout <<
" IsomerLVL=" << lvl <<
" excited energy=" << Eex / keV <<
"[keV]";
333#ifdef G4MULTITHREADED
336 if (!stable && (decayTable !=
nullptr)) {
338 for (
G4int iCh = 0; iCh < nCh; ++iCh) {
363 G4cout <<
"G4IonTable::CreateIon() : can not create ion of "
364 <<
" Z =" << Z <<
" A = " <<
A <<
" because GenericIon is not ready !!" <<
G4endl;
368 "Can not create ions because GenericIon is not ready");
383 if (Eex > 0.0) lvl = 9;
398 ion =
new G4Ions( name, mass, 0.0*MeV, charge,
402 stable, life, decayTable,
false,
411 static_cast<G4Ions*
>(ion)->SetFloatLevelBase(flb);
418 G4cout <<
"G4IonTable::CreateIon() : create hyper ion of " << name <<
" " << Z <<
", " <<
A
419 <<
", " << LL <<
" encoding=" <<
encoding;
421 G4cout <<
" IsomerLVL=" << lvl <<
" excited energy=" << Eex / keV <<
"[keV]";
469 if ((
A < 1) || (Z <= 0) || (E < 0.0) || (
A > 999) || (J < 0)) {
472 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
473 <<
" Z =" << Z <<
" A = " <<
A <<
" E = " << E / keV <<
G4endl;
484 if (ion ==
nullptr && E == 0.0) {
486 if (
nullptr != fProperty) {
495#ifdef G4MULTITHREADED
496 if (ion ==
nullptr) {
500 if (ion ==
nullptr) ion =
CreateIon(Z,
A, E, flb1);
509 if (ion ==
nullptr) ion =
CreateIon(Z,
A, E, flb1);
529 if (LL == 0)
return GetIon(Z,
A, E, flb, J);
531 if (
A < 2 || Z < 0 || Z >
A - LL || LL >
A ||
A > 999) {
534 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
535 <<
" Z =" << Z <<
" A = " <<
A <<
" L = " << LL <<
" E = " << E / keV <<
G4endl;
543 G4cout <<
"G4IonTable::GetIon() : No boud state for "
544 <<
" Z =" << Z <<
" A = " <<
A <<
" L = " << LL <<
" E = " << E / keV <<
G4endl;
554#ifdef G4MULTITHREADED
555 if (ion ==
nullptr) {
559 if (ion ==
nullptr) ion =
CreateIon(Z,
A, LL, E, flb);
568 if (ion ==
nullptr) ion =
CreateIon(Z,
A, LL, E, flb);
581 G4cout <<
"G4IonTable::GetIon() : illegal encoding"
588 return GetIon(Z,
A, LL, IsoLvl);
604 if ((
A < 1) || (Z <= 0) || (J < 0) || (E < 0.0) || (
A > 999)) {
607 G4cout <<
"G4IonTable::FindIon(): illegal atomic number/mass"
608 <<
" or excitation level:" <<
G4endl <<
" Z =" << Z <<
" A = " <<
A
609 <<
" E = " << E / keV <<
G4endl;
622 if (ion !=
nullptr && E == 0.0) {
634 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
637 if (
nullptr == ion1) ion1 = ion;
638 if (((
const G4Ions*)(ion))->GetFloatLevelBase() == flb) {
645 if (!isFound && E == 0.0 &&
nullptr != ion1) {
673 if (LL == 0)
return FindIon(Z,
A, E, flb, J);
675 if (
A < 2 || Z < 0 || Z >
A - LL || LL >
A ||
A > 999) {
678 G4cout <<
"G4IonTable::FindIon(): illegal atomic number/mass"
679 <<
" or excitation level:" <<
G4endl <<
" Z =" << Z <<
" A = " <<
A <<
" L = " << LL
680 <<
" E = " << E / keV <<
G4endl;
698 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
700 if (((
const G4Ions*)(ion))->GetFloatLevelBase() == flb) {
734 if (Z == 1 &&
A == 1 && E == 0.0)
return 2212;
739 if (lvl > 0 && lvl < 10)
760 if (Z == 1 &&
A == 1 && E == 0.0)
encoding = 3122;
827 std::ostringstream os;
828 os.setf(std::ios::fixed);
831 os <<
'[' << E / keV;
847 for (
G4int i = 0; i < LL; ++i) {
856 std::ostringstream os;
863 os <<
"E" << Z <<
"-";
870 os <<
'[' << lvl <<
']';
880 for (
G4int i = 0; i < LL; ++i) {
890 static const G4String nucleus(
"nucleus");
891 static const G4String proton(
"proton");
910 static const G4String anti_nucleus(
"anti_nucleus");
911 static const G4String anti_proton(
"anti_proton");
929 static const std::string names[] = {
"proton",
"alpha",
"deuteron",
"triton",
"He3"};
932 return std::find(names, names + 5, (particle->
GetParticleName()).c_str()) != names + 5;
937 static const std::string names[] = {
"anti_proton",
"anti_alpha",
"anti_deuteron",
"anti_triton",
941 return std::find(names, names + 5, (particle->
GetParticleName()).c_str()) != names + 5;
949#ifndef G4MULTITHREADED
953 if ((Z == 1) && (
A == 1)) {
954 ion = lightions::p_proton;
956 else if ((Z == 1) && (
A == 2)) {
957 ion = lightions::p_deuteron;
959 else if ((Z == 1) && (
A == 3)) {
960 ion = lightions::p_triton;
962 else if ((Z == 2) && (
A == 4)) {
963 ion = lightions::p_alpha;
965 else if ((Z == 2) && (
A == 3)) {
966 ion = lightions::p_He3;
977#ifndef G4MULTITHREADED
981 if ((Z == 1) && (
A == 1)) {
982 ion = antilightions::p_proton;
984 else if ((Z == 1) && (
A == 2)) {
985 ion = antilightions::p_deuteron;
987 else if ((Z == 1) && (
A == 3)) {
988 ion = antilightions::p_triton;
990 else if ((Z == 2) && (
A == 4)) {
991 ion = antilightions::p_alpha;
993 else if ((Z == 2) && (
A == 3)) {
994 ion = antilightions::p_He3;
1002 if ((
A < 1) || (Z < 0) || (LL < 0) || (lvl < 0) || (lvl > 9)) {
1005 G4cout <<
"G4IonTable::GetNucleusMass() : illegal atomic number/mass:" <<
G4endl
1006 <<
" Z =" << Z <<
" A = " <<
A <<
" L = " << LL <<
" lvl = " << lvl <<
G4endl;
1010 "illegal atomic number/mass");
1019 if (ion !=
nullptr) {
1036 if (((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
1048 if (fProperty !=
nullptr) mass += fProperty->
GetEnergy();
1072 "No effects because readyToUse is true.");
1078 G4cout <<
"G4IonTable::Clear() : number of Ion registered = ";
1087 if (!
IsIon(particle))
return;
1101 if (particle ==
nullptr)
return;
1110 if (particle == i->second) {
1119 fIonList->insert(std::pair<const G4int, const G4ParticleDefinition*>(
encoding, particle));
1124 if (particle ==
nullptr)
return;
1125#ifdef G4MULTITHREADED
1129 <<
" is ignored as it is invoked from a worker thread.";
1138 G4String msg =
"Request of removing ";
1140 msg +=
" has No effects other than Pre_Init";
1152 if (
IsIon(particle)) {
1159 if (particle == i->second) {
1178 for (
const auto& idx : *
fIonList) {
1180 if ((particle_name ==
"ALL") || (particle_name ==
"all")) {
1195 "Li",
"Be",
"B",
"C",
"N",
"O",
"F",
"Ne",
1196 "Na",
"Mg",
"Al",
"Si",
"P",
"S",
"Cl",
"Ar",
1197 "K",
"Ca",
"Sc",
"Ti",
"V",
"Cr",
"Mn",
"Fe",
"Co",
"Ni",
"Cu",
"Zn",
"Ga",
"Ge",
"As",
"Se",
"Br",
"Kr",
1198 "Rb",
"Sr",
"Y",
"Zr",
"Nb",
"Mo",
"Tc",
"Ru",
"Rh",
"Pd",
"Ag",
"Cd",
"In",
"Sn",
"Sb",
"Te",
"I",
"Xe",
1200 "La",
"Ce",
"Pr",
"Nd",
"Pm",
"Sm",
"Eu",
"Gd",
"Tb",
"Dy",
"Ho",
"Er",
"Tm",
"Yb",
"Lu",
1201 "Hf",
"Ta",
"W",
"Re",
"Os",
"Ir",
"Pt",
"Au",
"Hg",
"Tl",
"Pb",
"Bi",
"Po",
"At",
"Rn",
1203 "Ac",
"Th",
"Pa",
"U",
"Np",
"Pu",
"Am",
"Cm",
"Bk",
"Cf",
"Es",
"Fm",
"Md",
"No",
"Lr",
1204 "Rf",
"Db",
"Sg",
"Bh",
"Hs",
"Mt",
"Ds",
"Rg",
"Cn",
"Nh",
"Fl",
"Mc",
"Lv",
"Ts",
"Og"
1223 G4String msg =
"G4IonTable::AddProcessManager(): cannot create ion of ";
1225 msg +=
"\n because GenericIon is not available!!";
1236 if (muatom !=
nullptr) {
1239 G4cout <<
"G4IonTable::AddProcessManager(): "
1250 G4String msg =
"G4IonTable::AddProcessManager(): cannot create MuonicAtom ";
1252 msg +=
"\n because GenericMuonicAtom is not available!!";
1260 G4String msg =
"G4IonTable::AddProcessManager(): cannot create ";
1262 msg +=
"\n because of unsupported particle type !!";
1275 if (name == fIsotopeTable->GetName())
return;
1284 if (index < fIsotopeTableList->
size()) {
1285 fIsotopeTable = (*fIsotopeTableList)[index];
1287 return fIsotopeTable;
1300 property = fIsotopeTable->
GetIsotope(Z,
A, E, flb);
1301 if (property !=
nullptr)
break;
1318 if (property !=
nullptr)
break;
1345 for (std::size_t i = 0; i != pNuclideTable->
entries(); ++i) {
1353 isIsomerCreated =
true;
1358 if ((index >= 0) && (index <
Entries())) {
1363 if (counter == index) {
1372 G4cout <<
" G4IonTable::GetParticle"
1373 <<
" invalid index (=" << index <<
")"
1382 if (!
IsIon(particle))
return false;
1391 if (particle == i->second) {
1424 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
1426 if (((
const G4Ions*)(ion))->GetFloatLevelBase() == flb) {
1443 if (LL == 0)
return FindIon(Z,
A, E, flb, J);
1457 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
1459 if (((
const G4Ions*)(ion))->GetFloatLevelBase() == flb) {
1486 if (((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
1501 if (LL == 0)
return FindIon(Z,
A, lvl);
1514 if (((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
1529 if ((particle->
IsGeneralIon()) && (pNuclideTable ==
nullptr)) {
1531 "Method is invoked before G4IonTable is initialized.");
1546 if (fProperty !=
nullptr) life = fProperty->
GetLifeTime();
1552 if (base ==
nullptr || !
IsIon(base)) {
1554 "Constructor argument is not a G4Ions");
1565 auto const encoding = baseenc + 1000000000;
1579#ifdef G4MULTITHREADED
1606#ifdef G4MULTITHREADED
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
#define G4MUTEX_INITIALIZER
#define G4MUTEXLOCK(mutex)
#define G4MUTEXUNLOCK(mutex)
G4GLOB_DLL std::ostream G4cout
G4VDecayChannel * GetDecayChannel(G4int index) const
static G4double GetNuclearMass(G4int A, G4int Z, G4int L)
G4bool Contains(const G4ParticleDefinition *particle) const
void Remove(const G4ParticleDefinition *particle)
static G4ThreadLocal std::vector< G4VIsotopeTable * > * fIsotopeTableList
void PrepareNuclideTable()
static G4IonList * fIonListShadow
G4bool IsLightAntiIon(const G4ParticleDefinition *) const
G4double GetNucleusMass(G4int Z, G4int A, G4int nL=0, G4int lvl=0) const
static G4bool GetNucleusByEncoding(G4int encoding, G4int &Z, G4int &A, G4double &E, G4int &lvl)
G4ParticleDefinition * GetMuonicAtom(G4Ions const *)
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
G4ParticleDefinition * GetParticle(G4int index) const
G4bool IsLightIon(const G4ParticleDefinition *) const
std::multimap< G4int, const G4ParticleDefinition * > G4IonList
void DestroyWorkerG4IonTable()
static std::vector< G4VIsotopeTable * > * fIsotopeTableListShadow
void DumpTable(const G4String &particle_name="ALL") const
G4String GetIonName(G4int Z, G4int A, G4int lvl=0) const
static G4ThreadLocal G4IonList * fIonList
G4ParticleDefinition * GetLightIon(G4int Z, G4int A) const
static G4IonTable * GetIonTable()
G4double GetLifeTime(const G4ParticleDefinition *) const
void RegisterIsotopeTable(G4VIsotopeTable *table)
static G4bool IsIon(const G4ParticleDefinition *)
G4ParticleDefinition * FindIon(G4int Z, G4int A, G4int lvl=0)
static G4int GetNucleusEncoding(G4int Z, G4int A, G4double E=0.0, G4int lvl=0)
void InsertWorker(const G4ParticleDefinition *particle)
void AddProcessManager(G4ParticleDefinition *)
void Insert(const G4ParticleDefinition *particle)
G4double GetIonMass(G4int Z, G4int A, G4int nL=0, G4int lvl=0) const
G4int GetVerboseLevel() const
static const G4String elementName[numberOfElements]
G4double GetIsomerMass(G4int Z, G4int A, G4int lvl=0) const
static G4bool IsAntiIon(const G4ParticleDefinition *)
G4IsotopeProperty * FindIsotope(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb) const
G4VIsotopeTable * GetIsotopeTable(std::size_t idx=0) const
void InitializeLightIons()
G4ParticleDefinition * GetLightAntiIon(G4int Z, G4int A) const
G4ParticleDefinition * FindIonInMaster(G4int Z, G4int A, G4int lvl=0)
G4ParticleDefinition * CreateIon(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb)
static char FloatLevelBaseChar(G4Ions::G4FloatLevelBase flb)
static G4Ions::G4FloatLevelBase FloatLevelBase(char flbChar)
G4DecayTable * GetDecayTable() const
G4double GetEnergy() const
G4int GetAtomicMass() const
G4int GetAtomicNumber() const
G4int GetIsomerLevel() const
G4double GetLifeTime() const
G4Ions::G4FloatLevelBase GetFloatLevelBase() const
G4double GetMagneticMoment() const
static G4MuonicAtom * ConstructMuonicAtom(const G4String &name, G4int encoding, G4Ions const *baseion)
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4IsotopeProperty * GetIsotopeByIndex(std::size_t idx) const
static G4NuclideTable * GetNuclideTable()
G4double GetLevelTolerance()
std::size_t entries() const
G4ProcessManager * GetProcessManager() const
G4int GetAtomicNumber() const
G4bool IsGeneralIon() const
const G4String & GetParticleType() const
void SetPDGMagneticMoment(G4double mageticMoment)
void SetParticleDefinitionID(G4int id=-1)
G4double GetPDGMass() const
G4int GetAtomicMass() const
G4int GetQuarkContent(G4int flavor) const
G4int GetBaryonNumber() const
void SetAntiPDGEncoding(G4int aEncoding)
G4double GetPDGLifeTime() const
G4int GetParticleDefinitionID() const
const G4String & GetParticleName() const
G4IonTable * GetIonTable() const
G4int GetVerboseLevel() const
G4ParticleDefinition * GetGenericMuonicAtom() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
G4ParticleDefinition * GetGenericIon() const
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()
G4ParticleDefinition * GetDaughter(G4int anIndex)
const G4String & GetName() const
virtual G4IsotopeProperty * GetIsotope(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb=G4Ions::G4FloatLevelBase::no_Float)=0
G4bool IsMultithreadedApplication()