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]";
330 #ifdef G4MULTITHREADED
334 if(!stable && decayTable)
337 for(
G4int iCh=0;iCh<nCh;iCh++)
363 G4cout <<
"G4IonTable::CreateIon() : can not create ion of "
364 <<
" Z =" << Z <<
" A = " << A
365 <<
" because GenericIon is not ready !!" <<
G4endl;
369 "Can not create ions because GenericIon is not ready");
397 ion =
new G4Ions( name, mass, 0.0*
MeV, charge,
400 "nucleus", 0, A, encoding,
401 stable, life, decayTable,
false,
416 G4cout <<
"G4IonTable::CreateIon() : create hyper ion of " << name
417 <<
" " << Z <<
", " << A <<
", " << L
420 G4cout <<
" IsomerLVL=" << lvl
421 <<
" excited energy=" << Eex/
keV <<
"[keV]";
438 "Ion cannot be created by an isomer level. Use excitation energy.");
450 ed <<
"Isomer level " << lvl <<
" is unknown for the isotope (Z="
451 << Z <<
", A=" << A <<
", L=" << L <<
"). Null pointer is returned.";
464 if ( (A<1) || (Z<=0) || (lvl<0) || (A>999) ) {
467 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
468 <<
" Z =" << Z <<
" A = " << A <<
" Lvl = " << lvl <<
G4endl;
478 #ifdef G4MULTITHREADED
485 if(ion == 0 && lvl == 0) ion =
CreateIon(Z,A,lvl);
490 {
if(lvl == 0) ion =
CreateIon(Z,A,lvl); }
493 if(ion == 0 && lvl == 0) ion =
CreateIon(Z, A, lvl);
510 if (L==0)
return GetIon(Z,A,lvl);
512 if (A < 2 || Z < 0 || Z > A-L || L>A || A>999 ) {
515 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
516 <<
" Z =" << Z <<
" A = " << A <<
" L = " << L
517 <<
" IsomerLvl = " << lvl <<
G4endl;
524 G4cout <<
"G4IonTable::GetIon() : No boud state for "
525 <<
" Z =" << Z <<
" A = " << A <<
" L = " << L
526 <<
" IsomerLvl = " << lvl <<
G4endl;
538 #ifdef G4MULTITHREADED
543 if(ion == 0) ion =
CreateIon(Z, A, L, lvl);
568 if ( (A<1) || (Z<=0) || (E<0.0) || (A>999) || (J<0) ) {
571 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
572 <<
" Z =" << Z <<
" A = " << A <<
" E = " << E/
keV <<
G4endl;
582 #ifdef G4MULTITHREADED
606 if (L==0)
return GetIon(Z,A,E,J);
608 if (A < 2 || Z < 0 || Z > A-L || L>A || A>999 ) {
611 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
612 <<
" Z =" << Z <<
" A = " << A <<
" L = " << L
620 G4cout <<
"G4IonTable::GetIon() : No boud state for "
621 <<
" Z =" << Z <<
" A = " << A <<
" L = " << L
632 #ifdef G4MULTITHREADED
647 if(ion == 0) ion =
CreateIon(Z, A, L, E);
661 G4cout <<
"G4IonTable::GetIon() : illegal encoding"
662 <<
" CODE:" << encoding <<
G4endl;
670 return GetIon( Z, A, L, IsoLvl);
676 if ( (A<1) || (Z<=0) || (J<0) || (E<0.0) || (A>999) ) {
679 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
680 <<
" Z =" << Z <<
" A = " << A <<
" E = " << E/
keV <<
G4endl;
694 if (ion!=0 && E==0.0) {
700 G4IonList::iterator i =
fIonList->find(encoding);
705 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
706 if ( std::fabs( E - anExcitaionEnergy )<
tolerance) {
724 if (L==0)
return FindIon(Z,A,E,J);
726 if (A < 2 || Z < 0 || Z > A-L || L>A || A>999 ) {
729 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
730 <<
" Z =" << Z <<
" A = " << A <<
" L = " << L
745 G4IonList::iterator i =
fIonList->find(encoding);
751 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
752 if ( std::fabs( E - anExcitaionEnergy )<
tolerance) {
769 if ( (A<1) || (Z<=0) || (lvl<0) || (A>999) ) {
772 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
773 <<
" Z =" << Z <<
" A = " << A <<
" IsoLvl = " << lvl <<
G4endl;
787 if (ion!=0 && lvl==0) {
793 G4IonList::iterator i =
fIonList->find(encoding);
798 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
809 "Isomer level 9 may be ambiguous.");
821 if (L==0)
return FindIon(Z,A,lvl);
823 if (A < 2 || Z < 0 || Z > A-L || L>A || A>999 ) {
826 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
827 <<
" Z =" << Z <<
" A = " << A <<
" L = " << L
828 <<
" IsomerLvl = " << lvl <<
G4endl;
841 G4IonList::iterator i =
fIonList->find(encoding);
847 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
857 "Isomer level 9 may be ambiguous.");
876 if ( Z==1 && A==1 && E==0.0 )
return 2212;
879 encoding += Z * 10000;
881 if (lvl>0&&lvl<10) encoding +=lvl;
882 else if (E>0.0) encoding += 9;
901 encoding += L* 10000000;
902 if ( Z==1 && A==1 && E==0.0 ) encoding = 3122;
912 if (encoding <= 0)
return false;
914 if (encoding == 2212) {
920 encoding -= 1000000000;
934 if (encoding <= 0)
return false;
936 if (encoding == 3122) {
942 if (encoding % 10 != 0) {
946 if (encoding < 1000000000) {
951 encoding -= 1000000000;
952 L = encoding/10000000;
953 encoding -= 10000000*
L;
965 if (!pname) { pname =
new G4String(
""); }
970 os =
new std::ostringstream();
971 os->setf(std::ios::fixed);
980 std::ostringstream& oo = *os;
982 oo<<
'['<<E/
keV <<
']';
994 if (!pname) { pname =
new G4String(
""); }
997 for (
int i =0; i<
L; i++){
1008 if (!pname) { pname =
new G4String(
""); }
1013 os =
new std::ostringstream();
1014 os->setf(std::ios::fixed);
1022 name =
"E" + os->str() +
"-";
1032 std::ostringstream& oo = *os;
1034 oo<<
'['<<lvl <<
']';
1046 if (!pname) { pname =
new G4String(
""); }
1048 for (
int i =0; i<
L; i++){
1061 static const G4String nucleus(
"nucleus");
1086 static const G4String anti_nucleus(
"anti_nucleus");
1087 static const G4String anti_proton(
"anti_proton");
1106 #include <algorithm>
1110 static const std::string names[] = {
"proton",
"alpha",
"deuteron",
1114 return std::find(names, names+5, particle->
GetParticleName())!=names+5;
1119 static const std::string names[] = {
"anti_proton",
"anti_alpha",
"anti_deuteron",
1120 "anti_triton",
"anti_He3"};
1123 return std::find(names, names+5, particle->
GetParticleName())!=names+5;
1132 #ifndef G4MULTITHREADED
1136 if ( (Z==1)&&(A==1) ) {
1138 }
else if ( (Z==1)&&(A==2) ) {
1140 }
else if ( (Z==1)&&(A==3) ) {
1142 }
else if ( (Z==2)&&(A==4) ) {
1144 }
else if ( (Z==2)&&(A==3) ) {
1157 #ifndef G4MULTITHREADED
1161 if ( (Z==1)&&(A==1) ) {
1163 }
else if ( (Z==1)&&(A==2) ) {
1165 }
else if ( (Z==1)&&(A==3) ) {
1167 }
else if ( (Z==2)&&(A==4) ) {
1169 }
else if ( (Z==2)&&(A==3) ) {
1182 if ( (A<1) || (Z<0) || (L<0) || (lvl<0) || (lvl>9) ){
1185 G4cout <<
"G4IonTable::GetNucleusMass() : illegal atomic number/mass "
1186 <<
" Z =" << Z <<
" A = " << A
1187 <<
" L = " << L <<
" lvl = " << lvl <<
G4endl;
1190 G4Exception(
"G4IonTable::GetNucleusMass()",
"PART107",
1211 G4IonList::iterator i =
fIonList->find(encoding);
1213 for( ;i !=
fIonList->end() ; i++) {
1217 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
1228 if (fProperty !=0 ) mass += fProperty->
GetEnergy();
1260 "No effects because readyToUse is true.");
1266 G4cout <<
"G4IonTable::Clear() : number of Ion regsitered = ";
1275 if (!
IsIon(particle))
return;
1284 fIonListShadow->insert( std::pair<const G4int, const G4ParticleDefinition*>(encoding, particle) );
1290 if(!particle)
return;
1297 if (encoding !=0 ) {
1298 G4IonList::iterator i =
fIonList->find(encoding);
1299 for( ;i !=
fIonList->end() ; i++) {
1300 if (particle == i->second ) {
1309 fIonList->insert( std::pair<const G4int, const G4ParticleDefinition*>(encoding, particle) );
1316 if(!particle)
return;
1317 #ifdef G4MULTITHREADED
1321 <<
" is ignored as it is invoked from a worker thread.";
1330 G4String msg =
"Request of removing ";
1332 msg +=
" has No effects other than Pre_Init";
1340 <<
" will be removed from the IonTable " <<
G4endl;
1346 if (
IsIon(particle)) {
1351 if (encoding !=0 ) {
1354 if (particle == i->second) {
1364 <<
" is not ions" <<
G4endl;
1379 G4IonList::iterator idx;
1382 if (( particle_name ==
"ALL" ) || (particle_name ==
"all")){
1393 "Li",
"Be",
"B",
"C",
"N",
"O",
"F",
"Ne",
1394 "Na",
"Mg",
"Al",
"Si",
"P",
"S",
"Cl",
"Ar",
1395 "K",
"Ca",
"Sc",
"Ti",
"V",
"Cr",
"Mn",
"Fe",
"Co",
"Ni",
"Cu",
"Zn",
"Ga",
"Ge",
"As",
"Se",
"Br",
"Kr",
1396 "Rb",
"Sr",
"Y",
"Zr",
"Nb",
"Mo",
"Tc",
"Ru",
"Rh",
"Pd",
"Ag",
"Cd",
"In",
"Sn",
"Sb",
"Te",
"I",
"Xe",
1398 "La",
"Ce",
"Pr",
"Nd",
"Pm",
"Sm",
"Eu",
"Gd",
"Tb",
"Dy",
"Ho",
"Er",
"Tm",
"Yb",
"Lu",
1399 "Hf",
"Ta",
"W",
"Re",
"Os",
"Ir",
"Pt",
"Au",
"Hg",
"Tl",
"Pb",
"Bi",
"Po",
"At",
"Rn",
1401 "Ac",
"Th",
"Pa",
"U",
"Np",
"Pu",
"Am",
"Cm",
"Bk",
"Cf",
"Es",
"Fm",
"Md",
"No",
"Lr",
1402 "Rf",
"Db",
"Sg",
"Bh",
"Hs",
"Mt",
"Ds",
"Rg",
1403 "Cn",
"Uut",
"Fl",
"Uup",
"Lv",
"Uus",
"Uuo"
1438 G4cout <<
"G4IonTable::AddProcessManager() : can not create ion of "
1440 <<
" because GenericIon is not available!!" <<
G4endl;
1442 "Can not create ions because GenericIon is not available");
1459 if (name == fIsotopeTable->
GetName())
return;
1470 if ( index < fIsotopeTableList->
size() ) {
1471 fIsotopeTable = (*fIsotopeTableList)[index];
1473 return fIsotopeTable;
1506 property = fIsotopeTable->
GetIsotope(Z,A,lvl);
1553 if ( (index >=0) && (index <
Entries()) ) {
1554 G4IonList::iterator idx =
fIonList->begin();
1557 if ( counter == index ) {
1566 G4cout <<
" G4IonTable::GetParticle"
1567 <<
" invalid index (=" << index <<
")"
1577 if (!
IsIon(particle))
return false;
1584 if (encoding !=0 ) {
1587 if (particle == i->second ) {
1624 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
1625 if ( std::fabs( E - anExcitaionEnergy )<
tolerance) {
1642 if (L==0)
return FindIon(Z,A,E,J);
1657 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
1658 if ( std::fabs( E - anExcitaionEnergy )<
tolerance) {
1687 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
1704 if (L==0)
return FindIon(Z,A,lvl);
1718 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
1745 "Method is invoked before G4IonTable is initialized.");
1748 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)
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
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