91 if ( p_proton )
return;
107 if ( p_proton )
return;
116 #ifdef G4MULTITHREADED
123 isIsomerCreated(false),
260 G4cout <<
"G4IonTable::CreateIon() : can not create ion of "
261 <<
" Z =" << Z <<
" A = " << A
262 <<
" because GenericIon is not ready !!" <<
G4endl;
267 "Can not create ions because GenericIon is not ready");
287 stable = (life <= 0.) || (decayTable ==0);
294 ed <<
"G4IonTable::CreateIon() : G4IsotopeProperty object was not found for"
295 <<
" Z = " << Z <<
" A = " << A <<
" E = " << E/
keV <<
" (keV)";
299 <<
" Physics quantities such as life are not set for this ion.";
334 ion =
new G4Ions( name, mass, 0.0*
MeV, charge,
337 "nucleus", 0, A, encoding,
338 stable, life, decayTable,
false,
346 static_cast<G4Ions*
>(ion)->SetFloatLevelBase(flb);
353 G4cout <<
"G4IonTable::CreateIon() : create ion of " << name
354 <<
" " << Z <<
", " << A
357 G4cout <<
" IsomerLVL=" << lvl
358 <<
" excited energy=" << Eex/
keV <<
"[keV]";
367 #ifdef G4MULTITHREADED
371 if(!stable && decayTable)
374 for(
G4int iCh=0;iCh<nCh;iCh++)
401 G4cout <<
"G4IonTable::CreateIon() : can not create ion of "
402 <<
" Z =" << Z <<
" A = " << A
403 <<
" because GenericIon is not ready !!" <<
G4endl;
407 "Can not create ions because GenericIon is not ready");
436 ion =
new G4Ions( name, mass, 0.0*
MeV, charge,
439 "nucleus", 0, A, encoding,
440 stable, life, decayTable,
false,
449 static_cast<G4Ions*
>(ion)->SetFloatLevelBase(flb);
456 G4cout <<
"G4IonTable::CreateIon() : create hyper ion of " << name
457 <<
" " << Z <<
", " << A <<
", " << LL
460 G4cout <<
" IsomerLVL=" << lvl
461 <<
" excited energy=" << Eex/
keV <<
"[keV]";
478 "Ion cannot be created by an isomer level. Use excitation energy.");
491 ed <<
"Isomer level " << lvl <<
" is unknown for the isotope (Z="
492 << Z <<
", A=" << A <<
", L=" << LL <<
"). Null pointer is returned.";
505 if ( (A<1) || (Z<=0) || (lvl<0) || (A>999) ) {
508 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
509 <<
" Z =" << Z <<
" A = " << A <<
" Lvl = " << lvl <<
G4endl;
514 if ( lvl == 0 )
return GetIon(Z,A,0.0);
520 #ifdef G4MULTITHREADED
532 "Ion cannot be created by an isomer level. Use excitation energy.");
545 if (LL==0)
return GetIon(Z,A,lvl);
547 if (A < 2 || Z < 0 || Z > A-LL || LL>A || A>999 ) {
550 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
551 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
552 <<
" IsomerLvl = " << lvl <<
G4endl;
559 G4cout <<
"G4IonTable::GetIon() : No boud state for "
560 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
561 <<
" IsomerLvl = " << lvl <<
G4endl;
573 #ifdef G4MULTITHREADED
577 if(ion == 0) ion =
CreateIon(Z, A, LL, lvl);
605 char flbChar,
G4int J)
612 if ( (A<1) || (Z<=0) || (E<0.0) || (A>999) || (J<0) ) {
615 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
616 <<
" Z =" << Z <<
" A = " << A <<
" E = " << E/
keV <<
G4endl;
626 #ifdef G4MULTITHREADED
641 if (ion == 0) ion =
CreateIon(Z,A,E,flb);
653 char flbChar,
G4int J)
660 if (LL==0)
return GetIon(Z,A,E,flb,J);
662 if (A < 2 || Z < 0 || Z > A-LL || LL>A || A>999 ) {
665 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
666 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
674 G4cout <<
"G4IonTable::GetIon() : No boud state for "
675 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
686 #ifdef G4MULTITHREADED
693 if(ion == 0) ion =
CreateIon(Z,A,LL,E,flb);
701 if(ion == 0) ion =
CreateIon(Z,A,LL,E,flb);
715 G4cout <<
"G4IonTable::GetIon() : illegal encoding"
716 <<
" CODE:" << encoding <<
G4endl;
724 return GetIon( Z, A, LL, IsoLvl);
735 char flbChar,
G4int J)
742 if ( (A<1) || (Z<=0) || (J<0) || (E<0.0) || (A>999) ) {
745 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
746 <<
" Z =" << Z <<
" A = " << A <<
" E = " << E/
keV <<
G4endl;
760 if (ion!=0 && E==0.0) {
766 G4IonList::iterator i =
fIonList->find(encoding);
771 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
773 if(((
const G4Ions*)(ion))->GetFloatLevelBase()==flb)
796 char flbChar,
G4int J)
803 if (LL==0)
return FindIon(Z,A,E,flb,J);
805 if (A < 2 || Z < 0 || Z > A-LL || LL>A || A>999 ) {
808 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
809 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
824 G4IonList::iterator i =
fIonList->find(encoding);
830 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
832 if(((
const G4Ions*)(ion))->GetFloatLevelBase()==flb)
851 if ( (A<1) || (Z<=0) || (lvl<0) || (A>999) ) {
854 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
855 <<
" Z =" << Z <<
" A = " << A <<
" IsoLvl = " << lvl <<
G4endl;
869 if (ion!=0 && lvl==0) {
875 G4IonList::iterator i =
fIonList->find(encoding);
880 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
891 "Isomer level 9 may be ambiguous.");
903 if (LL==0)
return FindIon(Z,A,lvl);
905 if (A < 2 || Z < 0 || Z > A-LL || LL>A || A>999 ) {
908 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
909 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
910 <<
" IsomerLvl = " << lvl <<
G4endl;
923 G4IonList::iterator i =
fIonList->find(encoding);
929 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
939 "Isomer level 9 may be ambiguous.");
958 if ( Z==1 && A==1 && E==0.0 )
return 2212;
961 encoding += Z * 10000;
963 if (lvl>0&&lvl<10) encoding +=lvl;
964 else if (E>0.0) encoding += 9;
983 encoding += LL* 10000000;
984 if ( Z==1 && A==1 && E==0.0 ) encoding = 3122;
994 if (encoding <= 0)
return false;
996 if (encoding == 2212) {
1002 encoding -= 1000000000;
1004 encoding -= 10000*Z;
1006 lvl = encoding % 10;
1016 if (encoding <= 0)
return false;
1018 if (encoding == 3122) {
1019 Z = 1; A = 1; LL = 1;
1024 if (encoding % 10 != 0) {
1028 if (encoding < 1000000000) {
1033 encoding -= 1000000000;
1034 LL = encoding/10000000;
1035 encoding -= 10000000*
LL;
1037 encoding -= 10000*Z;
1039 lvl = encoding % 10;
1054 os =
new std::ostringstream();
1056 os->setf(std::ios::fixed);
1065 std::ostringstream& oo = *os;
1086 for (
int i =0; i<
LL; i++){
1102 os =
new std::ostringstream();
1104 os->setf(std::ios::fixed);
1112 name =
"E" + os->str() +
"-";
1122 std::ostringstream& oo = *os;
1124 oo<<
'['<<lvl <<
']';
1138 for (
int i =0; i<
LL; i++){
1151 static const G4String nucleus(
"nucleus");
1176 static const G4String anti_nucleus(
"anti_nucleus");
1177 static const G4String anti_proton(
"anti_proton");
1196 #include <algorithm>
1200 static const std::string names[] = {
"proton",
"alpha",
"deuteron",
1204 return std::find(names, names+5, particle->
GetParticleName())!=names+5;
1209 static const std::string names[] = {
"anti_proton",
"anti_alpha",
"anti_deuteron",
1210 "anti_triton",
"anti_He3"};
1213 return std::find(names, names+5, particle->
GetParticleName())!=names+5;
1222 #ifndef G4MULTITHREADED
1226 if ( (Z==1)&&(A==1) ) {
1228 }
else if ( (Z==1)&&(A==2) ) {
1230 }
else if ( (Z==1)&&(A==3) ) {
1232 }
else if ( (Z==2)&&(A==4) ) {
1234 }
else if ( (Z==2)&&(A==3) ) {
1247 #ifndef G4MULTITHREADED
1251 if ( (Z==1)&&(A==1) ) {
1253 }
else if ( (Z==1)&&(A==2) ) {
1255 }
else if ( (Z==1)&&(A==3) ) {
1257 }
else if ( (Z==2)&&(A==4) ) {
1259 }
else if ( (Z==2)&&(A==3) ) {
1272 if ( (A<1) || (Z<0) || (LL<0) || (lvl<0) || (lvl>9) ){
1275 G4cout <<
"G4IonTable::GetNucleusMass() : illegal atomic number/mass "
1276 <<
" Z =" << Z <<
" A = " << A
1277 <<
" L = " << LL <<
" lvl = " << lvl <<
G4endl;
1280 G4Exception(
"G4IonTable::GetNucleusMass()",
"PART107",
1301 G4IonList::iterator i =
fIonList->find(encoding);
1303 for( ;i !=
fIonList->end() ; i++) {
1307 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
1318 if (fProperty !=0 ) mass += fProperty->
GetEnergy();
1350 "No effects because readyToUse is true.");
1356 G4cout <<
"G4IonTable::Clear() : number of Ion regsitered = ";
1365 if (!
IsIon(particle))
return;
1374 fIonListShadow->insert( std::pair<const G4int, const G4ParticleDefinition*>(encoding, particle) );
1380 if(!particle)
return;
1387 if (encoding !=0 ) {
1388 G4IonList::iterator i =
fIonList->find(encoding);
1389 for( ;i !=
fIonList->end() ; i++) {
1390 if (particle == i->second ) {
1399 fIonList->insert( std::pair<const G4int, const G4ParticleDefinition*>(encoding, particle) );
1406 if(!particle)
return;
1407 #ifdef G4MULTITHREADED
1411 <<
" is ignored as it is invoked from a worker thread.";
1420 G4String msg =
"Request of removing ";
1422 msg +=
" has No effects other than Pre_Init";
1430 <<
" will be removed from the IonTable " <<
G4endl;
1436 if (
IsIon(particle)) {
1441 if (encoding !=0 ) {
1444 if (particle == i->second) {
1454 <<
" is not ions" <<
G4endl;
1469 G4IonList::iterator idx;
1472 if (( particle_name ==
"ALL" ) || (particle_name ==
"all")){
1483 "Li",
"Be",
"B",
"C",
"N",
"O",
"F",
"Ne",
1484 "Na",
"Mg",
"Al",
"Si",
"P",
"S",
"Cl",
"Ar",
1485 "K",
"Ca",
"Sc",
"Ti",
"V",
"Cr",
"Mn",
"Fe",
"Co",
"Ni",
"Cu",
"Zn",
"Ga",
"Ge",
"As",
"Se",
"Br",
"Kr",
1486 "Rb",
"Sr",
"Y",
"Zr",
"Nb",
"Mo",
"Tc",
"Ru",
"Rh",
"Pd",
"Ag",
"Cd",
"In",
"Sn",
"Sb",
"Te",
"I",
"Xe",
1488 "La",
"Ce",
"Pr",
"Nd",
"Pm",
"Sm",
"Eu",
"Gd",
"Tb",
"Dy",
"Ho",
"Er",
"Tm",
"Yb",
"Lu",
1489 "Hf",
"Ta",
"W",
"Re",
"Os",
"Ir",
"Pt",
"Au",
"Hg",
"Tl",
"Pb",
"Bi",
"Po",
"At",
"Rn",
1491 "Ac",
"Th",
"Pa",
"U",
"Np",
"Pu",
"Am",
"Cm",
"Bk",
"Cf",
"Es",
"Fm",
"Md",
"No",
"Lr",
1492 "Rf",
"Db",
"Sg",
"Bh",
"Hs",
"Mt",
"Ds",
"Rg",
1493 "Cp",
"Uut",
"Fl",
"Uup",
"Lv",
"Uus",
"Uuo"
1528 G4cout <<
"G4IonTable::AddProcessManager() : can not create ion of "
1530 <<
" because GenericIon is not available!!" <<
G4endl;
1532 "Can not create ions because GenericIon is not available");
1549 if (name == fIsotopeTable->
GetName())
return;
1560 if ( index < fIsotopeTableList->
size() ) {
1561 fIsotopeTable = (*fIsotopeTableList)[index];
1563 return fIsotopeTable;
1579 property = fIsotopeTable->
GetIsotope(Z,A,E,flb);
1597 property = fIsotopeTable->
GetIsotope(Z,A,lvl);
1645 if ( (index >=0) && (index <
Entries()) ) {
1646 G4IonList::iterator idx =
fIonList->begin();
1649 if ( counter == index ) {
1658 G4cout <<
" G4IonTable::GetParticle"
1659 <<
" invalid index (=" << index <<
")"
1669 if (!
IsIon(particle))
return false;
1676 if (encoding !=0 ) {
1679 if (particle == i->second ) {
1717 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
1719 if(((
const G4Ions*)(ion))->GetFloatLevelBase()==flb)
1739 if (LL==0)
return FindIon(Z,A,E,flb,J);
1754 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
1756 if(((
const G4Ions*)(ion))->GetFloatLevelBase()==flb)
1787 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
1804 if (LL==0)
return FindIon(Z,A,lvl);
1818 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
1845 "Method is invoked before G4IonTable is initialized.");
1865 if( fProperty !=0 ) life = fProperty->
GetLifeTime();
1873 if (base==0 || !
IsIon(base))
1883 auto const encoding = baseenc+1000000000;
1897 #ifdef G4MULTITHREADED
1924 #ifdef G4MULTITHREADED
1954 auto base =
static_cast<G4Ions const*
>(
GetIon(Z,A, 0.0));
G4int GetParticleDefinitionID() const
void InitializeLightIons()
G4double GetMagneticMoment() const
static const G4ParticleDefinition * p_triton
void RegisterIsotopeTable(G4VIsotopeTable *table)
static char FloatLevelBaseChar(G4Ions::G4FloatLevelBase flb)
static std::vector< G4VIsotopeTable * > * fIsotopeTableListShadow
G4double GetLevelTolerance()
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4DecayTable * GetDecayTable() const
void SetParticleDefinitionID(G4int id=-1)
static G4MuonicAtom * ConstructMuonicAtom(G4String name, G4int encoding, G4Ions const *baseion)
std::ostringstream G4ExceptionDescription
void SetAntiPDGEncoding(G4int aEncoding)
const G4String & GetName() const
G4int GetAtomicNumber() const
void PrepareNuclideTable()
void DumpTable(const G4String &particle_name="ALL") const
static const G4ParticleDefinition * p_alpha
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
G4ParticleDefinition * GetDaughter(G4int anIndex)
void Remove(const G4ParticleDefinition *particle)
G4double GetIsomerMass(G4int Z, G4int A, G4int lvl=0) const
static G4bool IsIon(const G4ParticleDefinition *)
G4bool IsLightAntiIon(const G4ParticleDefinition *) const
G4VIsotopeTable * GetIsotopeTable(size_t idx=0) const
void InsertWorker(const G4ParticleDefinition *particle)
static G4bool IsAntiIon(const G4ParticleDefinition *)
static G4int GetNucleusEncoding(G4int Z, G4int A, G4double E=0.0, G4int lvl=0)
G4int GetVerboseLevel() const
G4int GetIsomerLevel() const
G4VDecayChannel * GetDecayChannel(G4int index) const
static G4ThreadLocal std::vector< G4VIsotopeTable * > * fIsotopeTableList
const char * name(G4int ptype)
static const G4ParticleDefinition * p_proton
G4IsotopeProperty * GetIsotopeByIndex(size_t idx) const
G4ParticleDefinition * GetGenericIon() const
#define G4MUTEX_INITIALIZER
static G4bool GetNucleusByEncoding(G4int encoding, G4int &Z, G4int &A, G4double &E, G4int &lvl)
const G4String & GetParticleName() const
const G4String & GetIonName(G4int Z, G4int A, G4int lvl=0) const
G4int GetAtomicNumber() const
G4IsotopeProperty * FindIsotope(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb) const
G4bool IsGeneralIon() const
void Insert(const G4ParticleDefinition *particle)
G4ParticleDefinition * CreateIon(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb)
static G4IonList * fIonListShadow
static G4StateManager * GetStateManager()
static G4Ions::G4FloatLevelBase FloatLevelBase(char flbChar)
virtual G4IsotopeProperty * GetIsotope(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb=G4Ions::G4FloatLevelBase::no_Float)=0
G4GLOB_DLL std::ostream G4cout
double A(double temperature)
std::multimap< G4int, const G4ParticleDefinition * > G4IonList
G4double GetEnergy() const
static const G4ParticleDefinition * p_He3
G4double GetIonMass(G4int Z, G4int A, G4int L=0, G4int lvl=0) const
static constexpr double eplus
G4int GetQuarkContent(G4int flavor) const
const G4String & GetParticleType() const
G4ApplicationState GetCurrentState() const
G4bool IsMultithreadedApplication()
void AddProcessManager(G4ParticleDefinition *)
static const G4ParticleDefinition * p_triton
G4int GetAtomicMass() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4bool Contains(const G4ParticleDefinition *particle) const
static G4NuclideTable * GetNuclideTable()
G4ParticleDefinition * FindIon(G4int Z, G4int A, G4int lvl=0)
G4NuclideTable * pNuclideTable
G4double GetPDGMass() const
static G4ParticleTable * GetParticleTable()
static const G4ParticleDefinition * p_deuteron
G4ProcessManager * GetProcessManager() const
static const G4ParticleDefinition * p_alpha
G4ParticleDefinition * GetMuonicAtom(G4Ions const *)
static const G4ParticleDefinition * p_He3
void DestroyWorkerG4IonTable()
static const G4int LL[nN]
static G4ThreadLocal G4IonList * fIonList
G4double GetPDGLifeTime() const
static constexpr double MeV
G4double GetLifeTime(const G4ParticleDefinition *) const
G4double GetNucleusMass(G4int Z, G4int A, G4int L=0, G4int lvl=0) const
G4ParticleDefinition * GetLightAntiIon(G4int Z, G4int A) const
static const G4ParticleDefinition * p_proton
G4ParticleDefinition * GetLightIon(G4int Z, G4int A) const
G4ParticleDefinition * FindIonInMaster(G4int Z, G4int A, G4int lvl=0)
G4bool IsLightIon(const G4ParticleDefinition *) const
static constexpr double keV
G4int GetVerboseLevel() const
std::multimap< G4int, const G4ParticleDefinition * >::iterator G4IonListIterator
G4int GetAtomicMass() const
G4double GetLifeTime() const
void SetPDGMagneticMoment(G4double mageticMoment)
G4int GetBaryonNumber() const
static const G4String elementName[numberOfElements]
static G4double GetNuclearMass(G4int A, G4int Z, G4int L)
static const G4ParticleDefinition * p_deuteron
G4ParticleDefinition * GetParticle(G4int index) const