90 if ( p_proton )
return;
106 if ( p_proton )
return;
115 #ifdef G4MULTITHREADED
121 : pIsomerTable(0),pNuclideTable(0),
122 isIsomerCreated(false),
227 G4cout <<
"G4IonTable::CreateIon() : can not create ion of "
228 <<
" Z =" << Z <<
" A = " << A
229 <<
" because GenericIon is not ready !!" <<
G4endl;
234 "Can not create ions because GenericIon is not ready");
254 stable = (life <= 0.) || (decayTable ==0);
261 ed <<
"G4IonTable::CreateIon() : G4IsotopeProperty object was not found for"
262 <<
" Z = " << Z <<
" A = " << A <<
" E = " << E/
keV <<
" (keV).\n"
263 <<
" Physics quantities such as life are not set for this ion.";
298 ion =
new G4Ions( name, mass, 0.0*
MeV, charge,
301 "nucleus", 0, A, encoding,
302 stable, life, decayTable,
false,
316 G4cout <<
"G4IonTable::CreateIon() : create ion of " << name
317 <<
" " << Z <<
", " << A
320 G4cout <<
" IsomerLVL=" << lvl
321 <<
" excited energy=" << Eex/
keV <<
"[keV]";
350 G4cout <<
"G4IonTable::CreateIon() : can not create ion of "
351 <<
" Z =" << Z <<
" A = " << A
352 <<
" because GenericIon is not ready !!" <<
G4endl;
356 "Can not create ions because GenericIon is not ready");
384 ion =
new G4Ions( name, mass, 0.0*
MeV, charge,
387 "nucleus", 0, A, encoding,
388 stable, life, decayTable,
false,
403 G4cout <<
"G4IonTable::CreateIon() : create hyper ion of " << name
404 <<
" " << Z <<
", " << A <<
", " << L
407 G4cout <<
" IsomerLVL=" << lvl
408 <<
" excited energy=" << Eex/
keV <<
"[keV]";
425 "Ion cannot be created by an isomer level. Use excitation energy.");
437 ed <<
"Isomer level " << lvl <<
" is unknown for the isotope (Z="
438 << Z <<
", A=" << A <<
", L=" << L <<
"). Null pointer is returned.";
451 if ( (A<1) || (Z<=0) || (lvl<0) || (A>999) ) {
454 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
455 <<
" Z =" << Z <<
" A = " << A <<
" Lvl = " << lvl <<
G4endl;
465 #ifdef G4MULTITHREADED
472 if(ion == 0 && lvl == 0) ion =
CreateIon(Z,A,lvl);
477 {
if(lvl == 0) ion =
CreateIon(Z,A,lvl); }
480 if(ion == 0 && lvl == 0) ion =
CreateIon(Z, A, lvl);
497 if (L==0)
return GetIon(Z,A,lvl);
499 if (A < 2 || Z < 0 || Z > A-L || L>A || A>999 ) {
502 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
503 <<
" Z =" << Z <<
" A = " << A <<
" L = " << L
504 <<
" IsomerLvl = " << lvl <<
G4endl;
511 G4cout <<
"G4IonTable::GetIon() : No boud state for "
512 <<
" Z =" << Z <<
" A = " << A <<
" L = " << L
513 <<
" IsomerLvl = " << lvl <<
G4endl;
525 #ifdef G4MULTITHREADED
530 if(ion == 0) ion =
CreateIon(Z, A, L, lvl);
555 if ( (A<1) || (Z<=0) || (E<0.0) || (A>999) || (J<0) ) {
558 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
559 <<
" Z =" << Z <<
" A = " << A <<
" E = " << E/
keV <<
G4endl;
569 #ifdef G4MULTITHREADED
593 if (L==0)
return GetIon(Z,A,E,J);
595 if (A < 2 || Z < 0 || Z > A-L || L>A || A>999 ) {
598 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
599 <<
" Z =" << Z <<
" A = " << A <<
" L = " << L
607 G4cout <<
"G4IonTable::GetIon() : No boud state for "
608 <<
" Z =" << Z <<
" A = " << A <<
" L = " << L
619 #ifdef G4MULTITHREADED
634 if(ion == 0) ion =
CreateIon(Z, A, L, E);
648 G4cout <<
"G4IonTable::GetIon() : illegal encoding"
649 <<
" CODE:" << encoding <<
G4endl;
657 return GetIon( Z, A, L, IsoLvl);
663 if ( (A<1) || (Z<=0) || (J<0) || (E<0.0) || (A>999) ) {
666 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
667 <<
" Z =" << Z <<
" A = " << A <<
" E = " << E/
keV <<
G4endl;
681 if (ion!=0 && E==0.0) {
687 G4IonList::iterator i =
fIonList->find(encoding);
692 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
693 if ( std::fabs( E - anExcitaionEnergy )<
tolerance) {
711 if (L==0)
return FindIon(Z,A,E,J);
713 if (A < 2 || Z < 0 || Z > A-L || L>A || A>999 ) {
716 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
717 <<
" Z =" << Z <<
" A = " << A <<
" L = " << L
732 G4IonList::iterator i =
fIonList->find(encoding);
738 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
739 if ( std::fabs( E - anExcitaionEnergy )<
tolerance) {
756 if ( (A<1) || (Z<=0) || (lvl<0) || (A>999) ) {
759 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
760 <<
" Z =" << Z <<
" A = " << A <<
" IsoLvl = " << lvl <<
G4endl;
774 if (ion!=0 && lvl==0) {
780 G4IonList::iterator i =
fIonList->find(encoding);
785 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
796 "Isomer level 9 may be ambiguous.");
808 if (L==0)
return FindIon(Z,A,lvl);
810 if (A < 2 || Z < 0 || Z > A-L || L>A || A>999 ) {
813 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
814 <<
" Z =" << Z <<
" A = " << A <<
" L = " << L
815 <<
" IsomerLvl = " << lvl <<
G4endl;
828 G4IonList::iterator i =
fIonList->find(encoding);
834 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
844 "Isomer level 9 may be ambiguous.");
863 if ( Z==1 && A==1 && E==0.0 )
return 2212;
866 encoding += Z * 10000;
868 if (lvl>0&&lvl<10) encoding +=lvl;
869 else if (E>0.0) encoding += 9;
888 encoding += L* 10000000;
889 if ( Z==1 && A==1 && E==0.0 ) encoding = 3122;
899 if (encoding <= 0)
return false;
901 if (encoding == 2212) {
907 encoding -= 1000000000;
921 if (encoding <= 0)
return false;
923 if (encoding == 3122) {
929 if (encoding % 10 != 0) {
933 if (encoding < 1000000000) {
938 encoding -= 1000000000;
939 L = encoding/10000000;
940 encoding -= 10000000*
L;
952 if (!pname) { pname =
new G4String(
""); }
957 os =
new std::ostringstream();
958 os->setf(std::ios::fixed);
967 std::ostringstream& oo = *os;
969 oo<<
'['<<E/
keV <<
']';
981 if (!pname) { pname =
new G4String(
""); }
984 for (
int i =0; i<
L; i++){
995 if (!pname) { pname =
new G4String(
""); }
1000 os =
new std::ostringstream();
1001 os->setf(std::ios::fixed);
1009 name =
"E" + os->str() +
"-";
1019 std::ostringstream& oo = *os;
1021 oo<<
'['<<lvl <<
']';
1033 if (!pname) { pname =
new G4String(
""); }
1035 for (
int i =0; i<
L; i++){
1048 static const G4String nucleus(
"nucleus");
1073 static const G4String anti_nucleus(
"anti_nucleus");
1074 static const G4String anti_proton(
"anti_proton");
1093 #include <algorithm>
1097 static const std::string names[] = {
"proton",
"alpha",
"deuteron",
1101 return std::find(names, names+5, particle->
GetParticleName())!=names+5;
1106 static const std::string names[] = {
"anti_proton",
"anti_alpha",
"anti_deuteron",
1107 "anti_triton",
"anti_He3"};
1110 return std::find(names, names+5, particle->
GetParticleName())!=names+5;
1119 #ifndef G4MULTITHREADED
1123 if ( (Z==1)&&(A==1) ) {
1125 }
else if ( (Z==1)&&(A==2) ) {
1127 }
else if ( (Z==1)&&(A==3) ) {
1129 }
else if ( (Z==2)&&(A==4) ) {
1131 }
else if ( (Z==2)&&(A==3) ) {
1144 #ifndef G4MULTITHREADED
1148 if ( (Z==1)&&(A==1) ) {
1150 }
else if ( (Z==1)&&(A==2) ) {
1152 }
else if ( (Z==1)&&(A==3) ) {
1154 }
else if ( (Z==2)&&(A==4) ) {
1156 }
else if ( (Z==2)&&(A==3) ) {
1169 if ( (A<1) || (Z<0) || (L<0) || (lvl<0) || (lvl>9) ){
1172 G4cout <<
"G4IonTable::GetNucleusMass() : illegal atomic number/mass "
1173 <<
" Z =" << Z <<
" A = " << A
1174 <<
" L = " << L <<
" lvl = " << lvl <<
G4endl;
1177 G4Exception(
"G4IonTable::GetNucleusMass()",
"PART107",
1198 G4IonList::iterator i =
fIonList->find(encoding);
1200 for( ;i !=
fIonList->end() ; i++) {
1204 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
1215 if (fProperty !=0 ) mass += fProperty->
GetEnergy();
1247 "No effects because readyToUse is true.");
1253 G4cout <<
"G4IonTable::Clear() : number of Ion regsitered = ";
1262 if (!
IsIon(particle))
return;
1271 fIonListShadow->insert( std::pair<const G4int, const G4ParticleDefinition*>(encoding, particle) );
1277 if(!particle)
return;
1284 if (encoding !=0 ) {
1285 G4IonList::iterator i =
fIonList->find(encoding);
1286 for( ;i !=
fIonList->end() ; i++) {
1287 if (particle == i->second ) {
1296 fIonList->insert( std::pair<const G4int, const G4ParticleDefinition*>(encoding, particle) );
1303 if(!particle)
return;
1304 #ifdef G4MULTITHREADED
1308 <<
" is ignored as it is invoked from a worker thread.";
1317 G4String msg =
"Request of removing ";
1319 msg +=
" has No effects other than Pre_Init";
1327 <<
" will be removed from the IonTable " <<
G4endl;
1333 if (
IsIon(particle)) {
1338 if (encoding !=0 ) {
1341 if (particle == i->second) {
1351 <<
" is not ions" <<
G4endl;
1366 G4IonList::iterator idx;
1369 if (( particle_name ==
"ALL" ) || (particle_name ==
"all")){
1380 "Li",
"Be",
"B",
"C",
"N",
"O",
"F",
"Ne",
1381 "Na",
"Mg",
"Al",
"Si",
"P",
"S",
"Cl",
"Ar",
1382 "K",
"Ca",
"Sc",
"Ti",
"V",
"Cr",
"Mn",
"Fe",
"Co",
"Ni",
"Cu",
"Zn",
"Ga",
"Ge",
"As",
"Se",
"Br",
"Kr",
1383 "Rb",
"Sr",
"Y",
"Zr",
"Nb",
"Mo",
"Tc",
"Ru",
"Rh",
"Pd",
"Ag",
"Cd",
"In",
"Sn",
"Sb",
"Te",
"I",
"Xe",
1385 "La",
"Ce",
"Pr",
"Nd",
"Pm",
"Sm",
"Eu",
"Gd",
"Tb",
"Dy",
"Ho",
"Er",
"Tm",
"Yb",
"Lu",
1386 "Hf",
"Ta",
"W",
"Re",
"Os",
"Ir",
"Pt",
"Au",
"Hg",
"Tl",
"Pb",
"Bi",
"Po",
"At",
"Rn",
1388 "Ac",
"Th",
"Pa",
"U",
"Np",
"Pu",
"Am",
"Cm",
"Bk",
"Cf",
"Es",
"Fm",
"Md",
"No",
"Lr",
1389 "Rf",
"Db",
"Sg",
"Bh",
"Hs",
"Mt",
"Ds",
"Rg",
1390 "Cn",
"Uut",
"Fl",
"Uup",
"Lv",
"Uus",
"Uuo"
1425 G4cout <<
"G4IonTable::AddProcessManager() : can not create ion of "
1427 <<
" because GenericIon is not available!!" <<
G4endl;
1429 "Can not create ions because GenericIon is not available");
1446 if (name == fIsotopeTable->
GetName())
return;
1457 if ( index < fIsotopeTableList->
size() ) {
1458 fIsotopeTable = (*fIsotopeTableList)[index];
1460 return fIsotopeTable;
1493 property = fIsotopeTable->
GetIsotope(Z,A,lvl);
1540 if ( (index >=0) && (index <
Entries()) ) {
1541 G4IonList::iterator idx =
fIonList->begin();
1544 if ( counter == index ) {
1553 G4cout <<
" G4IonTable::GetParticle"
1554 <<
" invalid index (=" << index <<
")"
1564 if (!
IsIon(particle))
return false;
1571 if (encoding !=0 ) {
1574 if (particle == i->second ) {
1611 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
1612 if ( std::fabs( E - anExcitaionEnergy )<
tolerance) {
1629 if (L==0)
return FindIon(Z,A,E,J);
1644 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
1645 if ( std::fabs( E - anExcitaionEnergy )<
tolerance) {
1674 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
1691 if (L==0)
return FindIon(Z,A,lvl);
1705 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
1732 "Method is invoked before G4IonTable is initialized.");
1735 if(!isoP)
return -1001.0;
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)
G4double GetExcitationEnergy() const
std::ostringstream G4ExceptionDescription
void SetAntiPDGEncoding(G4int aEncoding)
const G4String & GetName() const
G4int GetAtomicNumber() const
void DumpTable(const G4String &particle_name="ALL") const
static const G4ParticleDefinition * p_alpha
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
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
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
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
virtual G4IsotopeProperty * GetIsotope(G4int Z, G4int A, G4double E)
static const G4double A[nN]
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
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