79 if ( p_proton !=
nullptr )
return;
97 if ( p_proton !=
nullptr )
return;
106#ifdef G4MULTITHREADED
150 delete fIsotopeTable;
224 delete fIsotopeTable;
261 G4cout <<
"G4IonTable::CreateIon() : can not create ion of "
262 <<
" Z =" << Z <<
" A = " <<
A
263 <<
" because GenericIon is not ready !!" <<
G4endl;
267 "Can not create ions because GenericIon is not ready");
280 if (fProperty !=
nullptr )
288 stable = (life <= 0.) || (decayTable ==
nullptr);
298 ed <<
"G4IonTable::CreateIon(): G4IsotopeProperty object is not found for"
299 <<
" Z = " << Z <<
" A = " <<
A <<
" E = " << E/keV <<
" (keV)";
305 <<
" Physics quantities such as life are not set for this ion.";
340 ion =
new G4Ions( name, mass, 0.0*MeV, charge,
344 stable, life, decayTable,
false,
351 static_cast<G4Ions*
>(ion)->SetFloatLevelBase(flb);
359 G4cout <<
"G4IonTable::CreateIon() : create ion of " << name
360 <<
" " << Z <<
", " <<
A
364 G4cout <<
" IsomerLVL=" << lvl
365 <<
" excited energy=" << Eex/keV <<
"[keV]";
374#ifdef G4MULTITHREADED
378 if(!stable && decayTable)
381 for(
G4int iCh=0; iCh<nCh; ++iCh)
415 G4cout <<
"G4IonTable::CreateIon() : can not create ion of "
416 <<
" Z =" << Z <<
" A = " <<
A
417 <<
" because GenericIon is not ready !!" <<
G4endl;
421 "Can not create ions because GenericIon is not ready");
450 ion =
new G4Ions( name, mass, 0.0*MeV, charge,
454 stable, life, decayTable,
false,
462 static_cast<G4Ions*
>(ion)->SetFloatLevelBase(flb);
470 G4cout <<
"G4IonTable::CreateIon() : create hyper ion of " << name
471 <<
" " << Z <<
", " <<
A <<
", " << LL
475 G4cout <<
" IsomerLVL=" << lvl
476 <<
" excited energy=" << Eex/keV <<
"[keV]";
495 "Ion cannot be created by an isomer level. Use excitation energy.");
511 ed <<
"Isomer level " << lvl <<
" is unknown for the isotope (Z="
512 << Z <<
", A=" <<
A <<
", L=" << LL <<
"). Null pointer is returned.";
524 if ( (
A<1) || (Z<=0) || (lvl<0) || (
A>999) )
529 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
530 <<
" Z =" << Z <<
" A = " <<
A <<
" Lvl = " << lvl <<
G4endl;
535 if ( lvl == 0 )
return GetIon(Z,
A,0.0);
541#ifdef G4MULTITHREADED
556 "Ion cannot be created by an isomer level. Use excitation energy.");
565 if (LL==0)
return GetIon(Z,
A,lvl);
567 if (
A < 2 || Z < 0 || Z >
A-LL || LL>
A ||
A>999 )
572 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
573 <<
" Z =" << Z <<
" A = " <<
A <<
" L = " << LL
574 <<
" IsomerLvl = " << lvl <<
G4endl;
584 G4cout <<
"G4IonTable::GetIon() : No boud state for "
585 <<
" Z =" << Z <<
" A = " <<
A <<
" L = " << LL
586 <<
" IsomerLvl = " << lvl <<
G4endl;
600#ifdef G4MULTITHREADED
605 if(ion ==
nullptr) ion =
CreateIon(Z,
A, LL, lvl);
642 if ( (
A<1) || (Z<=0) || (E<0.0) || (
A>999) || (J<0) )
647 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
648 <<
" Z =" << Z <<
" A = " <<
A <<
" E = " << E/keV <<
G4endl;
658#ifdef G4MULTITHREADED
665 if(ion ==
nullptr) ion =
CreateIon(Z,
A,E,flb);
675 if (ion ==
nullptr) ion =
CreateIon(Z,
A,E,flb);
693 char flbChar,
G4int J)
704 if (LL==0)
return GetIon(Z,
A,E,flb,J);
706 if (
A < 2 || Z < 0 || Z >
A-LL || LL>
A ||
A>999 )
711 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
712 <<
" Z =" << Z <<
" A = " <<
A <<
" L = " << LL
713 <<
" E = " << E/keV <<
G4endl;
723 G4cout <<
"G4IonTable::GetIon() : No boud state for "
724 <<
" Z =" << Z <<
" A = " <<
A <<
" L = " << LL
725 <<
" E = " << E/keV <<
G4endl;
735#ifdef G4MULTITHREADED
741 if(ion ==
nullptr) ion =
CreateIon(Z,
A,LL,E,flb);
751 if(ion ==
nullptr) ion =
CreateIon(Z,
A,LL,E,flb);
768 G4cout <<
"G4IonTable::GetIon() : illegal encoding"
776 return GetIon( Z,
A, LL, IsoLvl);
802 if ( (
A<1) || (Z<=0) || (J<0) || (E<0.0) || (
A>999) )
807 G4cout <<
"G4IonTable::FindIon(): illegal atomic number/mass"
808 <<
" or excitation level:" <<
G4endl
809 <<
" Z =" << Z <<
" A = " <<
A <<
" E = " << E/keV <<
G4endl;
823 if (ion!=
nullptr && E == 0.0)
837 G4double anExcitaionEnergy= ((
const G4Ions*)(ion))->GetExcitationEnergy();
840 if(((
const G4Ions*)(ion))->GetFloatLevelBase()==flb)
871 char flbChar,
G4int J)
882 if (LL==0)
return FindIon(Z,
A,E,flb,J);
884 if (
A < 2 || Z < 0 || Z >
A-LL || LL>
A ||
A>999 )
889 G4cout <<
"G4IonTable::FindIon(): illegal atomic number/mass"
890 <<
" or excitation level:" <<
G4endl
891 <<
" Z =" << Z <<
" A = " <<
A <<
" L = " << LL
892 <<
" E = " << E/keV <<
G4endl;
912 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
915 if(((
const G4Ions*)(ion))->GetFloatLevelBase()==flb)
937 if ( (
A<1) || (Z<=0) || (lvl<0) || (
A>999) )
942 G4cout <<
"G4IonTable::FindIon(): illegal atomic number/mass"
943 <<
" or excitation level:" <<
G4endl
944 <<
" Z =" << Z <<
" A = " <<
A <<
" IsoLvl = " << lvl <<
G4endl;
958 if (ion !=
nullptr && lvl==0)
972 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl)
985 "Isomer level 9 may be ambiguous.");
1000 if (LL==0)
return FindIon(Z,
A,lvl);
1002 if (
A < 2 || Z < 0 || Z >
A-LL || LL>
A ||
A>999 )
1007 G4cout <<
"G4IonTable::FindIon(): illegal atomic number/mass"
1008 <<
" or excitation level:" <<
G4endl
1009 <<
" Z =" << Z <<
" A = " <<
A <<
" L = " << LL
1010 <<
" IsomerLvl = " << lvl <<
G4endl;
1030 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl)
1042 "Isomer level 9 may be ambiguous.");
1064 if ( Z==1 &&
A==1 && E==0.0 )
return 2212;
1092 if ( Z==1 &&
A==1 && E==0.0 )
encoding = 3122;
1133 Z = 1;
A = 1; LL = 1;
1166 if ( pname ==
nullptr )
1174 if ( os ==
nullptr )
1176 os =
new std::ostringstream();
1178 os->setf(std::ios::fixed);
1188 std::ostringstream& oo = *os;
1211 if (pname ==
nullptr)
1218 for (
G4int i=0; i<LL; ++i)
1232 if ( pname ==
nullptr )
1240 if ( os ==
nullptr )
1242 os =
new std::ostringstream();
1244 os->setf(std::ios::fixed);
1255 name =
"E" + os->str() +
"-";
1268 std::ostringstream& oo = *os;
1270 oo<<
'['<<lvl <<
']';
1285 if ( pname ==
nullptr )
1291 for (
G4int i=0; i<LL; ++i)
1305 static const G4String nucleus(
"nucleus");
1306 static const G4String proton(
"proton");
1331 static const G4String anti_nucleus(
"anti_nucleus");
1332 static const G4String anti_proton(
"anti_proton");
1356 static const std::string names[]
1357 = {
"proton",
"alpha",
"deuteron",
"triton",
"He3"};
1360 return std::find(names, names+5, particle->
GetParticleName())!=names+5;
1368 static const std::string names[]
1369 = {
"anti_proton",
"anti_alpha",
"anti_deuteron",
"anti_triton",
"anti_He3"};
1372 return std::find(names, names+5, particle->
GetParticleName())!=names+5;
1384#ifndef G4MULTITHREADED
1388 if ( (Z==1)&&(
A==1) ) {
1389 ion = lightions::p_proton;
1390 }
else if ( (Z==1)&&(
A==2) ) {
1391 ion = lightions::p_deuteron;
1392 }
else if ( (Z==1)&&(
A==3) ) {
1393 ion = lightions::p_triton;
1394 }
else if ( (Z==2)&&(
A==4) ) {
1395 ion = lightions::p_alpha;
1396 }
else if ( (Z==2)&&(
A==3) ) {
1397 ion = lightions::p_He3;
1412#ifndef G4MULTITHREADED
1416 if ( (Z==1)&&(
A==1) ) {
1417 ion = antilightions::p_proton;
1418 }
else if ( (Z==1)&&(
A==2) ) {
1419 ion = antilightions::p_deuteron;
1420 }
else if ( (Z==1)&&(
A==3) ) {
1421 ion = antilightions::p_triton;
1422 }
else if ( (Z==2)&&(
A==4) ) {
1423 ion = antilightions::p_alpha;
1424 }
else if ( (Z==2)&&(
A==3) ) {
1425 ion = antilightions::p_He3;
1437 if ( (
A<1) || (Z<0) || (LL<0) || (lvl<0) || (lvl>9) )
1442 G4cout <<
"G4IonTable::GetNucleusMass() : illegal atomic number/mass:"
1444 <<
" Z =" << Z <<
" A = " <<
A
1445 <<
" L = " << LL <<
" lvl = " << lvl <<
G4endl;
1448 G4Exception(
"G4IonTable::GetNucleusMass()",
"PART107",
1480 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl)
1495 if (fProperty !=
nullptr ) mass += fProperty->
GetEnergy();
1532 "No effects because readyToUse is true.");
1539 G4cout <<
"G4IonTable::Clear() : number of Ion registered = ";
1550 if (!
IsIon(particle))
return;
1567 if(!particle)
return;
1578 if (particle == i->second)
1596 if(particle ==
nullptr)
return;
1597#ifdef G4MULTITHREADED
1602 <<
" is ignored as it is invoked from a worker thread.";
1613 G4String msg =
"Request of removing ";
1615 msg +=
" has No effects other than Pre_Init";
1626 <<
" will be removed from the IonTable " <<
G4endl;
1632 if (
IsIon(particle))
1643 if (particle == i->second)
1657 <<
" is not ions" <<
G4endl;
1672 if (( particle_name ==
"ALL" ) || (particle_name ==
"all"))
1688 "Li",
"Be",
"B",
"C",
"N",
"O",
"F",
"Ne",
1689 "Na",
"Mg",
"Al",
"Si",
"P",
"S",
"Cl",
"Ar",
1690 "K",
"Ca",
"Sc",
"Ti",
"V",
"Cr",
"Mn",
"Fe",
"Co",
"Ni",
"Cu",
"Zn",
"Ga",
"Ge",
"As",
"Se",
"Br",
"Kr",
1691 "Rb",
"Sr",
"Y",
"Zr",
"Nb",
"Mo",
"Tc",
"Ru",
"Rh",
"Pd",
"Ag",
"Cd",
"In",
"Sn",
"Sb",
"Te",
"I",
"Xe",
1693 "La",
"Ce",
"Pr",
"Nd",
"Pm",
"Sm",
"Eu",
"Gd",
"Tb",
"Dy",
"Ho",
"Er",
"Tm",
"Yb",
"Lu",
1694 "Hf",
"Ta",
"W",
"Re",
"Os",
"Ir",
"Pt",
"Au",
"Hg",
"Tl",
"Pb",
"Bi",
"Po",
"At",
"Rn",
1696 "Ac",
"Th",
"Pa",
"U",
"Np",
"Pu",
"Am",
"Cm",
"Bk",
"Cf",
"Es",
"Fm",
"Md",
"No",
"Lr",
1697 "Rf",
"Db",
"Sg",
"Bh",
"Hs",
"Mt",
"Ds",
"Rg",
"Cn",
"Nh",
"Fl",
"Mc",
"Lv",
"Ts",
"Og"
1724 G4String msg =
"G4IonTable::AddProcessManager(): cannot create ion of ";
1726 msg +=
"\n because GenericIon is not available!!";
1727 G4Exception(
"G4IonTable::AddProcessManager()",
"PART105",
1739 if ( muatom !=
nullptr )
1744 G4cout <<
"G4IonTable::AddProcessManager(): "
1745 <<
"MuonicAtom dynamic_cast succeeded for "
1759 "G4IonTable::AddProcessManager(): cannot create MuonicAtom ";
1761 msg +=
"\n because GenericMuonicAtom is not available!!";
1772 "G4IonTable::AddProcessManager(): cannot create ";
1774 msg +=
"\n because of unsupported particle type !!";
1775 G4Exception(
"G4IonTable::AddProcessManager()",
"PART107",
1793 if (name == fIsotopeTable->
GetName())
return;
1805 if ( index < fIsotopeTableList->
size() )
1807 fIsotopeTable = (*fIsotopeTableList)[index];
1809 return fIsotopeTable;
1877 if (pNuclideTable ==
nullptr)
1890 for ( std::size_t i=0 ; i!=pNuclideTable->
entries(); ++i )
1899 isIsomerCreated =
true;
1907 if ( (index >=0) && (index <
Entries()) )
1913 if ( counter == index )
1924 G4cout <<
" G4IonTable::GetParticle"
1925 <<
" invalid index (=" << index <<
")"
1937 if (!
IsIon(particle))
return false;
1949 if (particle == i->second )
1994 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
1997 if(((
const G4Ions*)(ion))->GetFloatLevelBase()==flb)
2022 if (LL==0)
return FindIon(Z,
A,E,flb,J);
2037 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
2040 if(((
const G4Ions*)(ion))->GetFloatLevelBase()==flb)
2075 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl)
2098 if (LL==0)
return FindIon(Z,
A,lvl);
2112 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl)
2134 if((particle->
IsGeneralIon()) && (pNuclideTable ==
nullptr))
2137 "Method is invoked before G4IonTable is initialized.");
2160 if( fProperty !=
nullptr ) life = fProperty->
GetLifeTime();
2169 if (base==
nullptr || !
IsIon(base))
2171 G4Exception(
"G4IonTable::GetMuonicAtom()",
"PART987654321",
2183 auto const encoding = baseenc+1000000000;
2198#ifdef G4MULTITHREADED
2228#ifdef G4MULTITHREADED
double A(double temperature)
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
const G4String & GetIonName(G4int Z, G4int A, G4int lvl=0) const
void Remove(const G4ParticleDefinition *particle)
static G4ThreadLocal std::vector< G4VIsotopeTable * > * fIsotopeTableList
void PrepareNuclideTable()
static G4IonList * fIonListShadow
G4bool IsLightAntiIon(const G4ParticleDefinition *) 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()
G4double GetIonMass(G4int Z, G4int A, G4int L=0, G4int lvl=0) const
static std::vector< G4VIsotopeTable * > * fIsotopeTableListShadow
void DumpTable(const G4String &particle_name="ALL") 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)
G4double GetNucleusMass(G4int Z, G4int A, G4int L=0, G4int lvl=0) const
void InsertWorker(const G4ParticleDefinition *particle)
void AddProcessManager(G4ParticleDefinition *)
void Insert(const G4ParticleDefinition *particle)
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
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()