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,
161 stable, life, decayTable,
false,
171 G4cout <<
"G4IonTable::CreateIon() : create ion of " << name
172 <<
" " << Z <<
", " << A
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,
237 stable, life, decayTable,
false,
247 G4cout <<
"G4IonTable::CreateIon() : create hyper ion of " << name
269 return GetIon( Z, A, 0.0, J);
280 G4cerr <<
"G4IonTable::GetIon() : illegal encoding"
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
326 <<
" E = " << E/keV <<
G4endl;
333 G4cerr <<
"G4IonTable::GetIon() : No boud state for "
334 <<
" Z =" << Z <<
" A = " << A <<
" L = " << L
335 <<
" E = " << E/keV <<
G4endl;
355 const G4double EnergyTorelance = 0.1 * keV;
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);
401 const G4double EnergyTorelance = 0.1 * keV;
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
408 <<
" E = " << E/keV <<
G4endl;
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 ) ) {
456 const G4double EnergyTorelance = 0.1 * keV;
457 if ( Z==1 && A==1 && E< EnergyTorelance ) {
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")){
884const 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 <<
")"
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
static G4double GetNuclearMass(G4int A, G4int Z, G4int L)
G4bool Contains(const G4ParticleDefinition *particle) const
void Remove(const G4ParticleDefinition *particle)
G4double GetNucleusMass(G4int Z, G4int A, G4int L=0) const
static G4int GetNucleusEncoding(G4int Z, G4int A, G4double E=0.0, G4int J=0)
static G4bool GetNucleusByEncoding(G4int encoding, G4int &Z, G4int &A, G4double &E, G4int &J)
!! I = 1 is assigned fo all excitation states in Geant4
G4bool IsLightAntiIon(const G4ParticleDefinition *) const
G4ParticleDefinition * GetParticle(G4int index) const
G4bool IsLightIon(const G4ParticleDefinition *) const
const G4String & GetIonName(G4int Z, G4int A, G4double E) const
void DumpTable(const G4String &particle_name="ALL") const
G4ParticleDefinition * GetLightIon(G4int Z, G4int A) const
void RegisterIsotopeTable(G4VIsotopeTable *table)
static G4bool IsIon(const G4ParticleDefinition *)
G4ParticleDefinition * FindIon(G4int Z, G4int A, G4double E, G4int J=0)
G4double GetIonMass(G4int Z, G4int A, G4int L=0) const
!! Only ground states are supported now
void AddProcessManager(const G4String &ionName)
void Insert(const G4ParticleDefinition *particle)
G4int GetVerboseLevel() const
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int J=0)
static G4bool IsAntiIon(const G4ParticleDefinition *)
G4ParticleDefinition * GetLightAntiIon(G4int Z, G4int A) const
G4IsotopeProperty * FindIsotope(G4int Z, G4int A, G4double E, G4int J)
G4VIsotopeTable * GetIsotopeTable(size_t idx=0) const
std::multimap< G4int, const G4ParticleDefinition * > G4IonList
G4ParticleDefinition * CreateIon(G4int Z, G4int A, G4double E, G4int J)
void SetDecayTable(G4DecayTable *table)
G4DecayTable * GetDecayTable() const
G4double GetEnergy() const
G4double GetLifeTime() const
G4double GetMagneticMoment() const
static bool IsInStableTable(const G4double A, const G4double Z)
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4int GetAtomicNumber() const
const G4String & GetParticleType() const
void SetPDGMagneticMoment(G4double mageticMoment)
G4double GetPDGMass() const
G4int GetAtomicMass() const
G4int GetQuarkContent(G4int flavor) const
G4int GetBaryonNumber() const
void SetAntiPDGEncoding(G4int aEncoding)
const G4String & GetParticleName() const
G4int GetVerboseLevel() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
G4ApplicationState GetCurrentState() const
static G4StateManager * GetStateManager()
G4int ApplyCommand(const char *aCommand)
G4int GetVerboseLevel() const
static G4UImanager * GetUIpointer()
void SetVerboseLevel(G4int val)
virtual G4IsotopeProperty * GetIsotope(G4int Z, G4int A, G4double E)=0
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)