101 namespace antilightions {
117 #ifdef G4MULTITHREADED
124 isIsomerCreated(false),
261 G4cout <<
"G4IonTable::CreateIon() : can not create ion of "
262 <<
" Z =" << Z <<
" A = " << A
263 <<
" because GenericIon is not ready !!" <<
G4endl;
268 "Can not create ions because GenericIon is not ready");
288 stable = (life <= 0.) || (decayTable ==0);
295 ed <<
"G4IonTable::CreateIon() : G4IsotopeProperty object was not found for"
296 <<
" Z = " << Z <<
" A = " << A <<
" E = " << E/
keV <<
" (keV)";
300 <<
" Physics quantities such as life are not set for this ion.";
335 ion =
new G4Ions( name, mass, 0.0*
MeV, charge,
338 "nucleus", 0, A, encoding,
339 stable, life, decayTable,
false,
347 static_cast<G4Ions*
>(
ion)->SetFloatLevelBase(flb);
354 G4cout <<
"G4IonTable::CreateIon() : create ion of " << name
355 <<
" " << Z <<
", " << A
358 G4cout <<
" IsomerLVL=" << lvl
359 <<
" excited energy=" << Eex/
keV <<
"[keV]";
368 #ifdef G4MULTITHREADED
372 if(!stable && decayTable)
375 for(
G4int iCh=0;iCh<nCh;iCh++)
402 G4cout <<
"G4IonTable::CreateIon() : can not create ion of "
403 <<
" Z =" << Z <<
" A = " << A
404 <<
" because GenericIon is not ready !!" <<
G4endl;
408 "Can not create ions because GenericIon is not ready");
437 ion =
new G4Ions( name, mass, 0.0*
MeV, charge,
440 "nucleus", 0, A, encoding,
441 stable, life, decayTable,
false,
450 static_cast<G4Ions*
>(
ion)->SetFloatLevelBase(flb);
457 G4cout <<
"G4IonTable::CreateIon() : create hyper ion of " << name
458 <<
" " << Z <<
", " << A <<
", " << LL
461 G4cout <<
" IsomerLVL=" << lvl
462 <<
" excited energy=" << Eex/
keV <<
"[keV]";
479 "Ion cannot be created by an isomer level. Use excitation energy.");
492 ed <<
"Isomer level " << lvl <<
" is unknown for the isotope (Z="
493 << Z <<
", A=" << A <<
", L=" << LL <<
"). Null pointer is returned.";
506 if ( (A<1) || (Z<=0) || (lvl<0) || (A>999) ) {
509 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
510 <<
" Z =" << Z <<
" A = " << A <<
" Lvl = " << lvl <<
G4endl;
515 if ( lvl == 0 )
return GetIon(Z,A,0.0);
521 #ifdef G4MULTITHREADED
533 "Ion cannot be created by an isomer level. Use excitation energy.");
546 if (LL==0)
return GetIon(Z,A,lvl);
548 if (A < 2 || Z < 0 || Z > A-LL || LL>A || A>999 ) {
551 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
552 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
553 <<
" IsomerLvl = " << lvl <<
G4endl;
560 G4cout <<
"G4IonTable::GetIon() : No boud state for "
561 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
562 <<
" IsomerLvl = " << lvl <<
G4endl;
574 #ifdef G4MULTITHREADED
578 if(ion == 0) ion =
CreateIon(Z, A, LL, lvl);
606 char flbChar,
G4int J)
613 if ( (A<1) || (Z<=0) || (E<0.0) || (A>999) || (J<0) ) {
616 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
617 <<
" Z =" << Z <<
" A = " << A <<
" E = " << E/
keV <<
G4endl;
627 #ifdef G4MULTITHREADED
642 if (ion == 0) ion =
CreateIon(Z,A,E,flb);
654 char flbChar,
G4int J)
661 if (LL==0)
return GetIon(Z,A,E,flb,J);
663 if (A < 2 || Z < 0 || Z > A-LL || LL>A || A>999 ) {
666 G4cout <<
"G4IonTable::GetIon() : illegal atomic number/mass"
667 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
675 G4cout <<
"G4IonTable::GetIon() : No boud state for "
676 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
687 #ifdef G4MULTITHREADED
694 if(ion == 0) ion =
CreateIon(Z,A,LL,E,flb);
702 if(ion == 0) ion =
CreateIon(Z,A,LL,E,flb);
716 G4cout <<
"G4IonTable::GetIon() : illegal encoding"
717 <<
" CODE:" << encoding <<
G4endl;
725 return GetIon( Z, A, LL, IsoLvl);
736 char flbChar,
G4int J)
743 if ( (A<1) || (Z<=0) || (J<0) || (E<0.0) || (A>999) ) {
746 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
747 <<
" Z =" << Z <<
" A = " << A <<
" E = " << E/
keV <<
G4endl;
761 if (ion!=0 && E==0.0) {
767 G4IonList::iterator i =
fIonList->find(encoding);
772 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
774 if(((
const G4Ions*)(ion))->GetFloatLevelBase()==flb)
797 char flbChar,
G4int J)
804 if (LL==0)
return FindIon(Z,A,E,flb,J);
806 if (A < 2 || Z < 0 || Z > A-LL || LL>A || A>999 ) {
809 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
810 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
825 G4IonList::iterator i =
fIonList->find(encoding);
831 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
833 if(((
const G4Ions*)(ion))->GetFloatLevelBase()==flb)
852 if ( (A<1) || (Z<=0) || (lvl<0) || (A>999) ) {
855 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
856 <<
" Z =" << Z <<
" A = " << A <<
" IsoLvl = " << lvl <<
G4endl;
870 if (ion!=0 && lvl==0) {
876 G4IonList::iterator i =
fIonList->find(encoding);
881 if ( ((
const G4Ions*)(
ion))->GetIsomerLevel() == lvl) {
892 "Isomer level 9 may be ambiguous.");
904 if (LL==0)
return FindIon(Z,A,lvl);
906 if (A < 2 || Z < 0 || Z > A-LL || LL>A || A>999 ) {
909 G4cout <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
910 <<
" Z =" << Z <<
" A = " << A <<
" L = " << LL
911 <<
" IsomerLvl = " << lvl <<
G4endl;
924 G4IonList::iterator i =
fIonList->find(encoding);
930 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
940 "Isomer level 9 may be ambiguous.");
959 if ( Z==1 && A==1 && E==0.0 )
return 2212;
962 encoding += Z * 10000;
964 if (lvl>0&&lvl<10) encoding +=lvl;
965 else if (E>0.0) encoding += 9;
984 encoding += LL* 10000000;
985 if ( Z==1 && A==1 && E==0.0 ) encoding = 3122;
995 if (encoding <= 0)
return false;
997 if (encoding == 2212) {
1003 encoding -= 1000000000;
1005 encoding -= 10000*
Z;
1007 lvl = encoding % 10;
1017 if (encoding <= 0)
return false;
1019 if (encoding == 3122) {
1020 Z = 1; A = 1; LL = 1;
1025 if (encoding % 10 != 0) {
1029 if (encoding < 1000000000) {
1034 encoding -= 1000000000;
1035 LL = encoding/10000000;
1036 encoding -= 10000000*
LL;
1038 encoding -= 10000*
Z;
1040 lvl = encoding % 10;
1055 os =
new std::ostringstream();
1057 os->setf(std::ios::fixed);
1066 std::ostringstream& oo = *os;
1087 for (
int i =0; i<
LL; i++){
1103 os =
new std::ostringstream();
1105 os->setf(std::ios::fixed);
1113 name =
"E" + os->str() +
"-";
1123 std::ostringstream& oo = *os;
1125 oo<<
'['<<lvl <<
']';
1139 for (
int i =0; i<
LL; i++){
1152 static const G4String nucleus(
"nucleus");
1177 static const G4String anti_nucleus(
"anti_nucleus");
1178 static const G4String anti_proton(
"anti_proton");
1197 #include <algorithm>
1201 static const std::string names[] = {
"proton",
"alpha",
"deuteron",
1205 return std::find(names, names+5, particle->
GetParticleName())!=names+5;
1210 static const std::string names[] = {
"anti_proton",
"anti_alpha",
"anti_deuteron",
1211 "anti_triton",
"anti_He3"};
1214 return std::find(names, names+5, particle->
GetParticleName())!=names+5;
1223 #ifndef G4MULTITHREADED
1227 if ( (Z==1)&&(A==1) ) {
1229 }
else if ( (Z==1)&&(A==2) ) {
1231 }
else if ( (Z==1)&&(A==3) ) {
1233 }
else if ( (Z==2)&&(A==4) ) {
1235 }
else if ( (Z==2)&&(A==3) ) {
1248 #ifndef G4MULTITHREADED
1252 if ( (Z==1)&&(A==1) ) {
1254 }
else if ( (Z==1)&&(A==2) ) {
1256 }
else if ( (Z==1)&&(A==3) ) {
1258 }
else if ( (Z==2)&&(A==4) ) {
1260 }
else if ( (Z==2)&&(A==3) ) {
1273 if ( (A<1) || (Z<0) || (LL<0) || (lvl<0) || (lvl>9) ){
1276 G4cout <<
"G4IonTable::GetNucleusMass() : illegal atomic number/mass "
1277 <<
" Z =" << Z <<
" A = " << A
1278 <<
" L = " << LL <<
" lvl = " << lvl <<
G4endl;
1281 G4Exception(
"G4IonTable::GetNucleusMass()",
"PART107",
1302 G4IonList::iterator i =
fIonList->find(encoding);
1304 for( ;i !=
fIonList->end() ; i++) {
1308 if ( ((
const G4Ions*)(
ion))->GetIsomerLevel() == lvl) {
1319 if (fProperty !=0 ) mass += fProperty->
GetEnergy();
1351 "No effects because readyToUse is true.");
1357 G4cout <<
"G4IonTable::Clear() : number of Ion regsitered = ";
1366 if (!
IsIon(particle))
return;
1375 fIonListShadow->insert( std::pair<const G4int, const G4ParticleDefinition*>(encoding, particle) );
1381 if(!particle)
return;
1388 if (encoding !=0 ) {
1389 G4IonList::iterator i =
fIonList->find(encoding);
1390 for( ;i !=
fIonList->end() ; i++) {
1391 if (particle == i->second ) {
1400 fIonList->insert( std::pair<const G4int, const G4ParticleDefinition*>(encoding, particle) );
1407 if(!particle)
return;
1408 #ifdef G4MULTITHREADED
1412 <<
" is ignored as it is invoked from a worker thread.";
1421 G4String msg =
"Request of removing ";
1423 msg +=
" has No effects other than Pre_Init";
1431 <<
" will be removed from the IonTable " <<
G4endl;
1437 if (
IsIon(particle)) {
1442 if (encoding !=0 ) {
1445 if (particle == i->second) {
1455 <<
" is not ions" <<
G4endl;
1470 G4IonList::iterator idx;
1473 if (( particle_name ==
"ALL" ) || (particle_name ==
"all")){
1484 "Li",
"Be",
"B",
"C",
"N",
"O",
"F",
"Ne",
1485 "Na",
"Mg",
"Al",
"Si",
"P",
"S",
"Cl",
"Ar",
1486 "K",
"Ca",
"Sc",
"Ti",
"V",
"Cr",
"Mn",
"Fe",
"Co",
"Ni",
"Cu",
"Zn",
"Ga",
"Ge",
"As",
"Se",
"Br",
"Kr",
1487 "Rb",
"Sr",
"Y",
"Zr",
"Nb",
"Mo",
"Tc",
"Ru",
"Rh",
"Pd",
"Ag",
"Cd",
"In",
"Sn",
"Sb",
"Te",
"I",
"Xe",
1489 "La",
"Ce",
"Pr",
"Nd",
"Pm",
"Sm",
"Eu",
"Gd",
"Tb",
"Dy",
"Ho",
"Er",
"Tm",
"Yb",
"Lu",
1490 "Hf",
"Ta",
"W",
"Re",
"Os",
"Ir",
"Pt",
"Au",
"Hg",
"Tl",
"Pb",
"Bi",
"Po",
"At",
"Rn",
1492 "Ac",
"Th",
"Pa",
"U",
"Np",
"Pu",
"Am",
"Cm",
"Bk",
"Cf",
"Es",
"Fm",
"Md",
"No",
"Lr",
1493 "Rf",
"Db",
"Sg",
"Bh",
"Hs",
"Mt",
"Ds",
"Rg",
1494 "Cp",
"Uut",
"Fl",
"Uup",
"Lv",
"Uus",
"Uuo"
1531 G4cout <<
"G4IonTable::AddProcessManager() : can not create ion of "
1533 <<
" because GenericIon is not available!!" <<
G4endl;
1535 "Can not create ions because GenericIon is not available");
1548 if ( muatom !=
nullptr ) {
1551 G4cout <<
"G4IonTable::AddProcessManager() : MuonicAtom dynamic_cast succeeded for "
1562 G4cout <<
"G4IonTable::AddProcessManager() : can not create MuonicAtom "
1564 <<
" because GenericMuonicAtom is not available!!" <<
G4endl;
1566 "Can not create MuonicAtoms because GenericMuonicAtom is not available");
1575 G4cout <<
"G4IonTable::AddProcessManager() : can not create "
1577 <<
" because of unsupported particle type !!" <<
G4endl;
1579 "Can not create particle");
1595 if (name == fIsotopeTable->
GetName())
return;
1606 if ( index < fIsotopeTableList->
size() ) {
1607 fIsotopeTable = (*fIsotopeTableList)[index];
1609 return fIsotopeTable;
1625 property = fIsotopeTable->
GetIsotope(Z,A,E,flb);
1643 property = fIsotopeTable->
GetIsotope(Z,A,lvl);
1691 if ( (index >=0) && (index <
Entries()) ) {
1692 G4IonList::iterator idx =
fIonList->begin();
1695 if ( counter == index ) {
1704 G4cout <<
" G4IonTable::GetParticle"
1705 <<
" invalid index (=" << index <<
")"
1715 if (!
IsIon(particle))
return false;
1722 if (encoding !=0 ) {
1725 if (particle == i->second ) {
1763 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
1765 if(((
const G4Ions*)(ion))->GetFloatLevelBase()==flb)
1785 if (LL==0)
return FindIon(Z,A,E,flb,J);
1800 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
1802 if(((
const G4Ions*)(ion))->GetFloatLevelBase()==flb)
1833 if ( ((
const G4Ions*)(
ion))->GetIsomerLevel() == lvl) {
1850 if (LL==0)
return FindIon(Z,A,lvl);
1864 if ( ((
const G4Ions*)(ion))->GetIsomerLevel() == lvl) {
1891 "Method is invoked before G4IonTable is initialized.");
1911 if( fProperty !=0 ) life = fProperty->
GetLifeTime();
1919 if (base==0 || !
IsIon(base)){
1930 auto const encoding = baseenc+1000000000;
1944 #ifdef G4MULTITHREADED
1971 #ifdef G4MULTITHREADED
static char FloatLevelBaseChar(G4Ions::G4FloatLevelBase flb)
G4bool Contains(const G4ParticleDefinition *particle) const
G4ParticleDefinition * GetGenericMuonicAtom() const
static G4bool IsIon(const G4ParticleDefinition *)
G4ParticleDefinition * GetParticle(G4int index) const
G4ParticleDefinition * CreateIon(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb)
static const G4ParticleDefinition * p_triton
G4double GetNucleusMass(G4int Z, G4int A, G4int L=0, G4int lvl=0) const
static G4bool GetNucleusByEncoding(G4int encoding, G4int &Z, G4int &A, G4double &E, G4int &lvl)
G4int GetAtomicNumber() const
std::ostringstream G4ExceptionDescription
G4bool IsGeneralIon() const
static G4ParticleTable * GetParticleTable()
static constexpr double MeV
G4double GetPDGLifeTime() const
G4ParticleDefinition * GetLightIon(G4int Z, G4int A) const
static const G4int LL[nN]
static constexpr double keV
G4int GetVerboseLevel() const
const XML_Char const XML_Char * encoding
static const G4ParticleDefinition * p_alpha
static G4MuonicAtom * ConstructMuonicAtom(G4String name, G4int encoding, G4Ions const *baseion)
void SetParticleDefinitionID(G4int id=-1)
const G4String & GetParticleName() const
G4ParticleDefinition * FindIon(G4int Z, G4int A, G4int lvl=0)
const G4String & GetParticleType() const
void RegisterIsotopeTable(G4VIsotopeTable *table)
G4double GetLifeTime() const
static const G4ParticleDefinition * p_proton
static G4ThreadLocal G4IonList * fIonList
G4bool IsLightIon(const G4ParticleDefinition *) const
G4double GetPDGMass() const
const XML_Char int const XML_Char int const XML_Char * base
G4double GetIsomerMass(G4int Z, G4int A, G4int lvl=0) const
G4double GetIonMass(G4int Z, G4int A, G4int L=0, G4int lvl=0) const
static G4NuclideTable * GetNuclideTable()
G4IsotopeProperty * FindIsotope(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb) const
void AddProcessManager(G4ParticleDefinition *)
virtual G4IsotopeProperty * GetIsotope(G4int Z, G4int A, G4double E, G4Ions::G4FloatLevelBase flb=G4Ions::G4FloatLevelBase::no_Float)=0
G4int GetParticleDefinitionID() const
#define G4MUTEX_INITIALIZER
G4int GetIsomerLevel() const
G4int GetBaryonNumber() const
G4int GetAtomicMass() const
G4IsotopeProperty * GetIsotopeByIndex(size_t idx) const
static const G4ParticleDefinition * p_He3
static G4bool IsAntiIon(const G4ParticleDefinition *)
G4int GetVerboseLevel() const
G4VDecayChannel * GetDecayChannel(G4int index) const
void DestroyWorkerG4IonTable()
G4int GetQuarkContent(G4int flavor) const
std::multimap< G4int, const G4ParticleDefinition * > G4IonList
G4double GetMagneticMoment() const
double A(double temperature)
G4ParticleDefinition * GetGenericIon() const
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4ParticleDefinition * GetDaughter(G4int anIndex)
const G4ThreeVector const G4double const
static const G4ParticleDefinition * p_triton
void SetAntiPDGEncoding(G4int aEncoding)
#define G4MUTEXUNLOCK(mutex)
std::multimap< G4int, const G4ParticleDefinition * >::iterator G4IonListIterator
static G4double GetNuclearMass(G4int A, G4int Z, G4int L)
void InitializeLightIons()
G4ParticleDefinition * GetLightAntiIon(G4int Z, G4int A) const
static constexpr double eplus
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4int GetAtomicNumber() const
G4bool IsMultithreadedApplication()
static const G4ParticleDefinition * p_deuteron
static const G4ParticleDefinition * p_alpha
G4ApplicationState GetCurrentState() const
G4DecayTable * GetDecayTable() const
G4ProcessManager * GetProcessManager() const
void Remove(const G4ParticleDefinition *particle)
static std::vector< G4VIsotopeTable * > * fIsotopeTableListShadow
static const G4ParticleDefinition * p_He3
G4int GetAtomicMass() const
#define G4MUTEXLOCK(mutex)
G4ParticleDefinition * GetMuonicAtom(G4Ions const *)
G4GLOB_DLL std::ostream G4cout
G4double GetLevelTolerance()
static const G4String elementName[numberOfElements]
G4double GetEnergy() const
const G4String & GetIonName(G4int Z, G4int A, G4int lvl=0) const
static const G4ParticleDefinition * p_proton
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
G4ParticleDefinition * FindIonInMaster(G4int Z, G4int A, G4int lvl=0)
void SetPDGMagneticMoment(G4double mageticMoment)
void DumpTable(const G4String &particle_name="ALL") const
static G4Ions::G4FloatLevelBase FloatLevelBase(char flbChar)
G4bool IsLightAntiIon(const G4ParticleDefinition *) const
G4double GetLifeTime(const G4ParticleDefinition *) const
void PrepareNuclideTable()
const G4String & GetName() const
void InsertWorker(const G4ParticleDefinition *particle)
G4NuclideTable * pNuclideTable
void Insert(const G4ParticleDefinition *particle)
static G4ThreadLocal std::vector< G4VIsotopeTable * > * fIsotopeTableList
static G4int GetNucleusEncoding(G4int Z, G4int A, G4double E=0.0, G4int lvl=0)
static const G4ParticleDefinition * p_deuteron
G4VIsotopeTable * GetIsotopeTable(size_t idx=0) const
static G4StateManager * GetStateManager()
static G4IonList * fIonListShadow