71 fIsotopeTableList =
new std::vector<G4VIsotopeTable*>;
78 if (fIsotopeTableList != 0) {
79 for (
size_t i = 0; i< fIsotopeTableList->size(); ++i) {
83 fIsotopeTableList->clear();
84 delete fIsotopeTableList;
89 if (fIonList ==0)
return;
113 G4cerr <<
"G4IonTable::CreateIon() : can not create ion of "
114 <<
" Z =" << Z <<
" A = " << A
115 <<
" because the current state is PreInit !!" <<
G4endl;
119 JustWarning,
"Can not create ions in PreInit state");
125 if (
name(0) ==
'?') {
128 G4cerr <<
"G4IonTable::CreateIon() : can not create ions "
129 <<
" Z =" << Z <<
" A = " << A <<
G4endl;
157 ion =
new G4Ions( name, mass, 0.0*
MeV, charge,
160 "nucleus", 0, A, encoding,
161 stable, life, decayTable,
false,
171 G4cout <<
"G4IonTable::CreateIon() : create ion of " << name
172 <<
" " << Z <<
", " << A
173 <<
" encoding=" << encoding <<
G4endl;
199 G4cerr <<
"G4IonTable::CreateIon() : can not create ion of "
200 <<
" Z =" << Z <<
" A = " << A <<
" L = " <<L
201 <<
" because the current state is PreInit !!" <<
G4endl;
205 JustWarning,
"Can not create ions in PreInit state");
211 if (
name(L) ==
'?') {
214 G4cerr <<
"G4IonTable::CreateIon() : can not create ions "
215 <<
" Z =" << Z <<
" A = " << A <<
" L = " << L <<
G4endl;
233 ion =
new G4Ions( name, mass, 0.0*
MeV, charge,
236 "nucleus", 0, A, encoding,
237 stable, life, decayTable,
false,
247 G4cout <<
"G4IonTable::CreateIon() : create hyper ion of " << name
248 <<
" encoding=" << encoding <<
G4endl;
269 return GetIon( Z, A, 0.0, J);
280 G4cerr <<
"G4IonTable::GetIon() : illegal encoding"
281 <<
" CODE:" << encoding <<
G4endl;
289 return GetIon( Z, A, L, 0.0, J);
295 if ( (A<1) || (Z<=0) || (J<0) || (E<0.0) || (A>999) ) {
298 G4cerr <<
"G4IonTable::GetIon() : illegal atomic number/mass"
299 <<
" Z =" << Z <<
" A = " << A <<
" E = " << E/
keV <<
G4endl;
319 if (L==0)
return GetIon(Z,A,E,J);
321 if (A < 2 || Z < 0 || Z > A-L || L>A || A>999 ) {
324 G4cerr <<
"G4IonTable::GetIon() : illegal atomic number/mass"
325 <<
" Z =" << Z <<
" A = " << A <<
" L = " << L
333 G4cerr <<
"G4IonTable::GetIon() : No boud state for "
334 <<
" Z =" << Z <<
" A = " << A <<
" L = " << L
357 if ( (A<1) || (Z<=0) || (J<0) || (E<0.0) || (A>999) ) {
360 G4cerr <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
361 <<
" Z =" << Z <<
" A = " << A <<
" E = " << E/
keV <<
G4endl;
375 G4IonList::iterator i = fIonList->find(encoding);
376 for( ;i != fIonList->end() ; i++) {
381 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
382 if ( ( std::fabs(E - anExcitaionEnergy ) < EnergyTorelance ) ) {
399 if (L==0)
return FindIon(Z,A,E,J);
403 if (A < 2 || Z < 0 || Z > A-L || L>A || A>999 ) {
406 G4cerr <<
"G4IonTable::FindIon() : illegal atomic number/mass or excitation level "
407 <<
" Z =" << Z <<
" A = " << A <<
" L = " << L
422 G4IonList::iterator i = fIonList->find(encoding);
423 for( ;i != fIonList->end() ; i++) {
429 G4double anExcitaionEnergy = ((
const G4Ions*)(ion))->GetExcitationEnergy();
431 if ( ( std::fabs(E - anExcitaionEnergy ) < EnergyTorelance ) ) {
457 if ( Z==1 && A==1 && E< EnergyTorelance ) {
463 encoding += Z * 10000;
465 if (E>0.0) encoding += 1;
485 encoding += L* 10000000;
486 encoding += Z * 10000;
488 if (E>0.0) encoding += 1;
502 if (encoding == 2212) {
511 if (encoding % 10 != 0) {
516 encoding -= 1000000000;
536 if (encoding % 10 != 0) {
540 if (encoding < 1000000000) {
545 encoding -= 1000000000;
546 L = encoding/10000000;
547 encoding -= 10000000*L;
562 if ( (0< Z) && (Z <=numberOfElements) ) {
563 name = elementName[Z-1];
564 }
else if (Z > numberOfElements) {
565 std::ostringstream os1;
566 os1.setf(std::ios::fixed);
568 name =
"E" + os1.str() +
"-";
573 std::ostringstream os;
574 os.setf(std::ios::fixed);
575 os << A <<
'[' << std::setprecision(1) << E/
keV <<
']';
586 for (
int i =0; i<L; i++){
623 static G4String anti_nucleus(
"anti_nucleus");
624 static G4String anti_proton(
"anti_proton");
647 static const std::string names[] = {
"proton",
"alpha",
"deuteron",
651 return std::find(names, names+5, particle->
GetParticleName())!=names+5;
656 static const std::string names[] = {
"anti_proton",
"anti_alpha",
"anti_deuteron",
657 "anti_triton",
"anti_He3"};
660 return std::find(names, names+5, particle->
GetParticleName())!=names+5;
667 static G4bool isInitialized =
false;
674 if (!isInitialized) {
680 isInitialized =
true;
685 if ( (Z==1)&&(A==1) ) {
687 }
else if ( (Z==1)&&(A==2) ) {
689 }
else if ( (Z==1)&&(A==3) ) {
691 }
else if ( (Z==2)&&(A==4) ) {
693 }
else if ( (Z==2)&&(A==3) ) {
704 static G4bool isInitialized =
false;
711 if (!isInitialized) {
717 isInitialized =
true;
722 if ( (Z==1)&&(A==1) ) {
724 }
else if ( (Z==1)&&(A==2) ) {
726 }
else if ( (Z==1)&&(A==3) ) {
728 }
else if ( (Z==2)&&(A==4) ) {
730 }
else if ( (Z==2)&&(A==3) ) {
743 if ( (A<1) || (Z<0) || (L<0) ){
746 G4cerr <<
"G4IonTable::GetNucleusMass() : illegal atomic number/mass "
747 <<
" Z =" << Z <<
" A = " << A <<
G4endl;
750 G4Exception(
"G4IonTable::GetNucleusMass()",
"PART107",
789 "No effects because readyToUse is true.");
795 G4cout <<
"G4IonTable::Clear() : number of Ion regsitered = ";
804 if (!
IsIon(particle))
return;
812 fIonList->insert( std::pair<const G4int, const G4ParticleDefinition*>(encoding, particle) );
823 G4String msg =
"Request of removing ";
825 msg +=
" has No effects other than Pre_Init";
833 <<
" will be removed from the IonTable " <<
G4endl;
839 if (
IsIon(particle)) {
845 G4IonList::iterator i = fIonList->find(encoding);
846 for( ;i != fIonList->end() ; i++) {
847 if (particle == i->second) {
857 <<
" is not ions" <<
G4endl;
872 G4IonList::iterator idx;
873 for (idx = fIonList->begin(); idx!= fIonList->end(); ++idx) {
875 if (( particle_name ==
"ALL" ) || (particle_name ==
"all")){
884 const G4String G4IonTable::elementName[] = {
886 "Li",
"Be",
"B",
"C",
"N",
"O",
"F",
"Ne",
887 "Na",
"Mg",
"Al",
"Si",
"P",
"S",
"Cl",
"Ar",
888 "K",
"Ca",
"Sc",
"Ti",
"V",
"Cr",
"Mn",
"Fe",
"Co",
"Ni",
"Cu",
"Zn",
"Ga",
"Ge",
"As",
"Se",
"Br",
"Kr",
889 "Rb",
"Sr",
"Y",
"Zr",
"Nb",
"Mo",
"Tc",
"Ru",
"Rh",
"Pd",
"Ag",
"Cd",
"In",
"Sn",
"Sb",
"Te",
"I",
"Xe",
891 "La",
"Ce",
"Pr",
"Nd",
"Pm",
"Sm",
"Eu",
"Gd",
"Tb",
"Dy",
"Ho",
"Er",
"Tm",
"Yb",
"Lu",
892 "Hf",
"Ta",
"W",
"Re",
"Os",
"Ir",
"Pt",
"Au",
"Hg",
"Tl",
"Pb",
"Bi",
"Po",
"At",
"Rn",
894 "Ac",
"Th",
"Pa",
"U",
"Np",
"Pu",
"Am",
"Cm",
"Bk",
"Cf",
"Es",
"Fm",
"Md",
"No",
"Lr",
895 "Rf",
"Db",
"Sg",
"Bh",
"Hs",
"Mt",
"Ds",
"Rg",
896 "Uub",
"Uut",
"Uuq",
"Uup",
"Uuh",
"Uus",
"Uuo"
910 std::ostringstream osAdd;
911 osAdd <<
"/run/particle/addProcManager "<<
name;
930 fIsotopeTableList->push_back(table);
937 if ( index < fIsotopeTableList->
size() ) {
938 fIsotopeTable = (*fIsotopeTableList)[
index];
940 return fIsotopeTable;
947 if (fIsotopeTableList ==0)
return 0;
948 if (fIsotopeTableList->size()==0)
return 0;
954 for (
size_t i = 0; i< fIsotopeTableList->size(); ++i) {
961 G4cout <<
"G4IonTable::FindIsotope:";
971 if( property->GetiSpin() ==0) {
972 property->SetiSpin( tmp->
GetiSpin() );
974 if( property->GetMagneticMoment() <= 0.0) {
977 if( property->GetLifeTime() <= 0.0) {
979 if ( (property->GetLifeTime() > 0.0)
980 && (
property->GetDecayTable() ==0 ) ) {
1003 for (Z=1; Z<=120; Z++) {
1004 for (A=Z;A<999 && A<Z*3+10; A++) {
1015 if ( (index >=0) && (index <
Entries()) ) {
1016 G4IonList::iterator idx = fIonList->begin();
1018 while( idx != fIonList->end() ){
1019 if ( counter == index ) {
1028 G4cerr <<
" G4IonTable::GetParticle"
1029 <<
" invalid index (=" << index <<
")"