88 if ( p_proton )
return;
104 if ( p_proton )
return;
113 #ifdef G4MULTITHREADED
120 isIsomerCreated(false),
256 G4cout <<
"G4IonTable::CreateIon() : can not create ion of "
257 <<
" Z =" << Z <<
" A = " << A
258 <<
" because GenericIon is not ready !!" <<
G4endl;
263 "Can not create ions because GenericIon is not ready");
283 stable = (life <= 0.) || (decayTable ==0);
290 ed <<
"G4IonTable::CreateIon() : G4IsotopeProperty object was not found for"
291 <<
" Z = " << Z <<
" A = " << A <<
" E = " << E/
keV <<
" (keV).\n"
292 <<
" Physics quantities such as life are not set for this ion.";
327 ion =
new G4Ions( name, mass, 0.0*
MeV, charge,
330 "nucleus", 0, A, encoding,
331 stable, life, decayTable,
false,
345 G4cout <<
"G4IonTable::CreateIon() : create ion of " << name
346 <<
" " << Z <<
", " << A
349 G4cout <<
" IsomerLVL=" << lvl
350 <<
" excited energy=" << Eex/
keV <<
"[keV]";
359 #ifdef G4MULTITHREADED
363 if(!stable && decayTable)
366 for(
G4int iCh=0;iCh<nCh;iCh++)
392 G4cout <<
"G4IonTable::CreateIon() : can not create ion of "
393 <<
" Z =" << Z <<
" A = " << A
394 <<
" because GenericIon is not ready !!" <<
G4endl;
398 "Can not create ions because GenericIon is not ready");
426 ion =
new G4Ions( name, mass, 0.0*
MeV, charge,
429 "nucleus", 0, A, encoding,
430 stable, life, decayTable,
false,
445 G4cout <<
"G4IonTable::CreateIon() : create hyper ion of " << name
446 <<
" " << Z <<
", " << A <<
", " << LL
449 G4cout <<
" IsomerLVL=" << lvl
450 <<
" excited energy=" << Eex/
keV <<
"[keV]";
467 "Ion cannot be created by an isomer level. Use excitation energy.");
479 ed <<
"Isomer level " << lvl <<
" is unknown for the isotope (Z="
480 << Z <<
", A=" << A <<
", L=" << LL <<
"). Null pointer is returned.";
493 if ( (A<1) || (Z<=0) || (lvl<0) || (A>999) ) {
496 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
497 <<
" Z =" << Z <<
" A = " << A <<
" Lvl = " << lvl <<
G4endl;
507 #ifdef G4MULTITHREADED
514 if(ion == 0 && lvl == 0) ion =
CreateIon(Z,A,lvl);
519 {
if(lvl == 0) ion =
CreateIon(Z,A,lvl); }
522 if(ion == 0 && lvl == 0) ion =
CreateIon(Z, A, lvl);
539 if (LL==0)
return GetIon(Z,A,lvl);
541 if (A < 2 || Z < 0 || Z > A-LL || LL>A || A>999 ) {
544 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
545 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
546 <<
" IsomerLvl = " << lvl <<
G4endl;
553 G4cout <<
"G4IonTable::GetIon() : No boud state for "
554 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
555 <<
" IsomerLvl = " << lvl <<
G4endl;
567 #ifdef G4MULTITHREADED
572 if(ion == 0) ion =
CreateIon(Z, A, LL, lvl);
597 if ( (A<1) || (Z<=0) || (E<0.0) || (A>999) || (J<0) ) {
600 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
601 <<
" Z =" << Z <<
" A = " << A <<
" E = " << E/
keV <<
G4endl;
611 #ifdef G4MULTITHREADED
635 if (LL==0)
return GetIon(Z,A,E,J);
637 if (A < 2 || Z < 0 || Z > A-LL || LL>A || A>999 ) {
640 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
641 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
649 G4cout <<
"G4IonTable::GetIon() : No boud state for "
650 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
661 #ifdef G4MULTITHREADED
676 if(ion == 0) ion =
CreateIon(Z, A, LL, E);
690 G4cout <<
"G4IonTable::GetIon() : illegal encoding"
691 <<
" CODE:" << encoding <<
G4endl;
699 return GetIon( Z, A, LL, IsoLvl);
705 if ( (A<1) || (Z<=0) || (J<0) || (E<0.0) || (A>999) ) {
708 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
709 <<
" Z =" << Z <<
" A = " << A <<
" E = " << E/
keV <<
G4endl;
723 if (ion!=0 && E==0.0) {
729 G4IonList::iterator i =
fIonList->find(encoding);
734 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
735 if ( std::fabs( E - anExcitaionEnergy )<
tolerance) {
753 if (LL==0)
return FindIon(Z,A,E,J);
755 if (A < 2 || Z < 0 || Z > A-LL || LL>A || A>999 ) {
758 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
759 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
774 G4IonList::iterator i =
fIonList->find(encoding);
780 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
781 if ( std::fabs( E - anExcitaionEnergy )<
tolerance) {
798 if ( (A<1) || (Z<=0) || (lvl<0) || (A>999) ) {
801 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
802 <<
" Z =" << Z <<
" A = " << A <<
" IsoLvl = " << lvl <<
G4endl;
816 if (ion!=0 && lvl==0) {
822 G4IonList::iterator i =
fIonList->find(encoding);
827 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
838 "Isomer level 9 may be ambiguous.");
850 if (LL==0)
return FindIon(Z,A,lvl);
852 if (A < 2 || Z < 0 || Z > A-LL || LL>A || A>999 ) {
855 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
856 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
857 <<
" IsomerLvl = " << lvl <<
G4endl;
870 G4IonList::iterator i =
fIonList->find(encoding);
876 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
886 "Isomer level 9 may be ambiguous.");
905 if ( Z==1 && A==1 && E==0.0 )
return 2212;
908 encoding += Z * 10000;
910 if (lvl>0&&lvl<10) encoding +=lvl;
911 else if (E>0.0) encoding += 9;
930 encoding += LL* 10000000;
931 if ( Z==1 && A==1 && E==0.0 ) encoding = 3122;
941 if (encoding <= 0)
return false;
943 if (encoding == 2212) {
949 encoding -= 1000000000;
963 if (encoding <= 0)
return false;
965 if (encoding == 3122) {
966 Z = 1; A = 1; LL = 1;
971 if (encoding % 10 != 0) {
975 if (encoding < 1000000000) {
980 encoding -= 1000000000;
981 LL = encoding/10000000;
982 encoding -= 10000000*
LL;
1000 os =
new std::ostringstream();
1002 os->setf(std::ios::fixed);
1011 std::ostringstream& oo = *os;
1013 oo<<
'['<<E/
keV <<
']';
1028 for (
int i =0; i<
LL; i++){
1044 os =
new std::ostringstream();
1046 os->setf(std::ios::fixed);
1054 name =
"E" + os->str() +
"-";
1064 std::ostringstream& oo = *os;
1066 oo<<
'['<<lvl <<
']';
1080 for (
int i =0; i<
LL; i++){
1093 static const G4String nucleus(
"nucleus");
1118 static const G4String anti_nucleus(
"anti_nucleus");
1119 static const G4String anti_proton(
"anti_proton");
1138 #include <algorithm>
1142 static const std::string names[] = {
"proton",
"alpha",
"deuteron",
1146 return std::find(names, names+5, particle->
GetParticleName())!=names+5;
1151 static const std::string names[] = {
"anti_proton",
"anti_alpha",
"anti_deuteron",
1152 "anti_triton",
"anti_He3"};
1155 return std::find(names, names+5, particle->
GetParticleName())!=names+5;
1164 #ifndef G4MULTITHREADED
1168 if ( (Z==1)&&(A==1) ) {
1170 }
else if ( (Z==1)&&(A==2) ) {
1172 }
else if ( (Z==1)&&(A==3) ) {
1174 }
else if ( (Z==2)&&(A==4) ) {
1176 }
else if ( (Z==2)&&(A==3) ) {
1189 #ifndef G4MULTITHREADED
1193 if ( (Z==1)&&(A==1) ) {
1195 }
else if ( (Z==1)&&(A==2) ) {
1197 }
else if ( (Z==1)&&(A==3) ) {
1199 }
else if ( (Z==2)&&(A==4) ) {
1201 }
else if ( (Z==2)&&(A==3) ) {
1214 if ( (A<1) || (Z<0) || (LL<0) || (lvl<0) || (lvl>9) ){
1217 G4cout <<
"G4IonTable::GetNucleusMass() : illegal atomic number/mass "
1218 <<
" Z =" << Z <<
" A = " << A
1219 <<
" L = " << LL <<
" lvl = " << lvl <<
G4endl;
1222 G4Exception(
"G4IonTable::GetNucleusMass()",
"PART107",
1243 G4IonList::iterator i =
fIonList->find(encoding);
1245 for( ;i !=
fIonList->end() ; i++) {
1249 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
1260 if (fProperty !=0 ) mass += fProperty->
GetEnergy();
1292 "No effects because readyToUse is true.");
1298 G4cout <<
"G4IonTable::Clear() : number of Ion regsitered = ";
1307 if (!
IsIon(particle))
return;
1316 fIonListShadow->insert( std::pair<const G4int, const G4ParticleDefinition*>(encoding, particle) );
1322 if(!particle)
return;
1329 if (encoding !=0 ) {
1330 G4IonList::iterator i =
fIonList->find(encoding);
1331 for( ;i !=
fIonList->end() ; i++) {
1332 if (particle == i->second ) {
1341 fIonList->insert( std::pair<const G4int, const G4ParticleDefinition*>(encoding, particle) );
1348 if(!particle)
return;
1349 #ifdef G4MULTITHREADED
1353 <<
" is ignored as it is invoked from a worker thread.";
1362 G4String msg =
"Request of removing ";
1364 msg +=
" has No effects other than Pre_Init";
1372 <<
" will be removed from the IonTable " <<
G4endl;
1378 if (
IsIon(particle)) {
1383 if (encoding !=0 ) {
1386 if (particle == i->second) {
1396 <<
" is not ions" <<
G4endl;
1411 G4IonList::iterator idx;
1414 if (( particle_name ==
"ALL" ) || (particle_name ==
"all")){
1425 "Li",
"Be",
"B",
"C",
"N",
"O",
"F",
"Ne",
1426 "Na",
"Mg",
"Al",
"Si",
"P",
"S",
"Cl",
"Ar",
1427 "K",
"Ca",
"Sc",
"Ti",
"V",
"Cr",
"Mn",
"Fe",
"Co",
"Ni",
"Cu",
"Zn",
"Ga",
"Ge",
"As",
"Se",
"Br",
"Kr",
1428 "Rb",
"Sr",
"Y",
"Zr",
"Nb",
"Mo",
"Tc",
"Ru",
"Rh",
"Pd",
"Ag",
"Cd",
"In",
"Sn",
"Sb",
"Te",
"I",
"Xe",
1430 "La",
"Ce",
"Pr",
"Nd",
"Pm",
"Sm",
"Eu",
"Gd",
"Tb",
"Dy",
"Ho",
"Er",
"Tm",
"Yb",
"Lu",
1431 "Hf",
"Ta",
"W",
"Re",
"Os",
"Ir",
"Pt",
"Au",
"Hg",
"Tl",
"Pb",
"Bi",
"Po",
"At",
"Rn",
1433 "Ac",
"Th",
"Pa",
"U",
"Np",
"Pu",
"Am",
"Cm",
"Bk",
"Cf",
"Es",
"Fm",
"Md",
"No",
"Lr",
1434 "Rf",
"Db",
"Sg",
"Bh",
"Hs",
"Mt",
"Ds",
"Rg",
1435 "Cp",
"Uut",
"Fl",
"Uup",
"Lv",
"Uus",
"Uuo"
1470 G4cout <<
"G4IonTable::AddProcessManager() : can not create ion of "
1472 <<
" because GenericIon is not available!!" <<
G4endl;
1474 "Can not create ions because GenericIon is not available");
1491 if (name == fIsotopeTable->
GetName())
return;
1502 if ( index < fIsotopeTableList->
size() ) {
1503 fIsotopeTable = (*fIsotopeTableList)[index];
1505 return fIsotopeTable;
1538 property = fIsotopeTable->
GetIsotope(Z,A,lvl);
1586 if ( (index >=0) && (index <
Entries()) ) {
1587 G4IonList::iterator idx =
fIonList->begin();
1590 if ( counter == index ) {
1599 G4cout <<
" G4IonTable::GetParticle"
1600 <<
" invalid index (=" << index <<
")"
1610 if (!
IsIon(particle))
return false;
1617 if (encoding !=0 ) {
1620 if (particle == i->second ) {
1657 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
1658 if ( std::fabs( E - anExcitaionEnergy )<
tolerance) {
1675 if (LL==0)
return FindIon(Z,A,E,J);
1690 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
1691 if ( std::fabs( E - anExcitaionEnergy )<
tolerance) {
1720 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
1737 if (LL==0)
return FindIon(Z,A,lvl);
1751 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
1778 "Method is invoked before G4IonTable is initialized.");
1792 if( fProperty !=0 ) life = fProperty->
GetLifeTime();
G4int GetParticleDefinitionID() const
void InitializeLightIons()
G4double GetMagneticMoment() const
static const G4ParticleDefinition * p_triton
void RegisterIsotopeTable(G4VIsotopeTable *table)
static std::vector< G4VIsotopeTable * > * fIsotopeTableListShadow
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4DecayTable * GetDecayTable() const
void SetParticleDefinitionID(G4int id=-1)
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
static const G4ParticleDefinition * p_proton
G4IsotopeProperty * GetIsotopeByIndex(size_t idx) const
G4ParticleDefinition * GetGenericIon() const
G4ProcessManager * GetProcessManager() const
G4IsotopeProperty * FindIsotope(G4int Z, G4int A, G4double E) 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
G4bool IsGeneralIon() const
void Insert(const G4ParticleDefinition *particle)
static G4IonList * fIonListShadow
static G4StateManager * GetStateManager()
G4ParticleDefinition * CreateIon(G4int Z, G4int A, G4double E)
G4GLOB_DLL std::ostream G4cout
double A(double temperature)
virtual G4IsotopeProperty * GetIsotope(G4int Z, G4int A, G4double E)=0
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
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
static const G4ParticleDefinition * p_alpha
static const G4ParticleDefinition * p_He3
void DestroyWorkerG4IonTable()
static const G4int LL[nN]
static const G4double tolerance
static G4ThreadLocal G4IonList * fIonList
G4double GetPDGLifeTime() const
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
static const double eplus
G4ParticleDefinition * GetLightIon(G4int Z, G4int A) const
G4ParticleDefinition * FindIonInMaster(G4int Z, G4int A, G4int lvl=0)
G4bool IsLightIon(const G4ParticleDefinition *) const
static G4double Round(G4double eex)
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