G4IonTable Class Reference

#include <G4IonTable.hh>


Public Types

typedef std::multimap< G4int,
const G4ParticleDefinition * > 
G4IonList
typedef std::multimap< G4int,
const G4ParticleDefinition
* >::iterator 
G4IonListIterator

Public Member Functions

 G4IonTable ()
virtual ~G4IonTable ()
G4int GetNumberOfElements () const
void RegisterIsotopeTable (G4VIsotopeTable *table)
G4VIsotopeTableGetIsotopeTable (size_t idx=0) const
G4ParticleDefinitionGetIon (G4int Z, G4int A, G4int J=0)
G4ParticleDefinitionGetIon (G4int encoding)
void CreateAllIon ()
G4ParticleDefinitionFindIon (G4int Z, G4int A, G4double E, G4int J=0)
G4ParticleDefinitionGetIon (G4int Z, G4int A, G4double E, G4int J=0)
G4ParticleDefinitionFindIon (G4int Z, G4int A, G4int L, G4double E, G4int J=0)
G4ParticleDefinitionGetIon (G4int Z, G4int A, G4int L, G4double E, G4int J=0)
G4ParticleDefinitionGetIon (G4int Z, G4int A, G4int J, G4int Q)
const G4StringGetIonName (G4int Z, G4int A, G4double E) const
const G4StringGetIonName (G4int Z, G4int A, G4int L, G4double E) const
G4double GetIonMass (G4int Z, G4int A, G4int L=0) const
 !! Only ground states are supported now
G4double GetNucleusMass (G4int Z, G4int A, G4int L=0) const
G4int Entries () const
G4ParticleDefinitionGetParticle (G4int index) const
G4bool Contains (const G4ParticleDefinition *particle) const
void Insert (const G4ParticleDefinition *particle)
void Remove (const G4ParticleDefinition *particle)
void clear ()
G4int size () const
void DumpTable (const G4String &particle_name="ALL") const

Static Public Member Functions

static G4bool IsIon (const G4ParticleDefinition *)
static G4bool IsAntiIon (const G4ParticleDefinition *)
static G4int GetNucleusEncoding (G4int Z, G4int A, G4double E=0.0, G4int J=0)
static G4int GetNucleusEncoding (G4int Z, G4int A, G4int L, G4double E=0.0, G4int J=0)
 !! I = 1 is assigned fo all excitation states in Geant4
static G4bool GetNucleusByEncoding (G4int encoding, G4int &Z, G4int &A, G4double &E, G4int &J)
 !! I = 1 is assigned fo all excitation states in Geant4
static G4bool GetNucleusByEncoding (G4int encoding, G4int &Z, G4int &A, G4int &L, G4double &E, G4int &J)

Protected Member Functions

 G4IonTable (const G4IonTable &right)
G4IonTableoperator= (const G4IonTable &)
G4ParticleDefinitionCreateIon (G4int Z, G4int A, G4double E, G4int J)
G4ParticleDefinitionCreateIon (G4int Z, G4int A, G4int L, G4double E, G4int J)
G4IsotopePropertyFindIsotope (G4int Z, G4int A, G4double E, G4int J)
G4ParticleDefinitionGetLightIon (G4int Z, G4int A) const
G4ParticleDefinitionGetLightAntiIon (G4int Z, G4int A) const
G4bool IsLightIon (const G4ParticleDefinition *) const
G4bool IsLightAntiIon (const G4ParticleDefinition *) const
void AddProcessManager (const G4String &ionName)
G4int GetVerboseLevel () const


Detailed Description

Definition at line 63 of file G4IonTable.hh.


Member Typedef Documentation

typedef std::multimap<G4int, const G4ParticleDefinition*> G4IonTable::G4IonList

Definition at line 72 of file G4IonTable.hh.

typedef std::multimap<G4int, const G4ParticleDefinition*>::iterator G4IonTable::G4IonListIterator

Definition at line 73 of file G4IonTable.hh.


Constructor & Destructor Documentation

G4IonTable::G4IonTable (  ) 

Definition at line 68 of file G4IonTable.cc.

00069 {
00070   fIonList = new G4IonList();
00071   fIsotopeTableList = new std::vector<G4VIsotopeTable*>;
00072 }

G4IonTable::G4IonTable ( const G4IonTable right  )  [protected]

G4IonTable::~G4IonTable (  )  [virtual]

Definition at line 75 of file G4IonTable.cc.

00076 {
00077   // delete IsotopeTable if exists
00078   if (fIsotopeTableList != 0) {
00079     for (size_t i = 0; i< fIsotopeTableList->size(); ++i) {
00080       G4VIsotopeTable* fIsotopeTable= (*fIsotopeTableList)[i];
00081       delete fIsotopeTable;
00082     }
00083     fIsotopeTableList->clear();
00084     delete fIsotopeTableList;
00085   }
00086   fIsotopeTableList =0;
00087 
00088 
00089   if (fIonList ==0) return;
00090   // remove all contents in the Ion List 
00091   //  No need to delete here because all particles are dynamic objects
00092   fIonList->clear();
00093 
00094   delete fIonList;
00095   fIonList =0;
00096 }


Member Function Documentation

void G4IonTable::AddProcessManager ( const G4String ionName  )  [protected]

Definition at line 907 of file G4IonTable.cc.

References G4UImanager::ApplyCommand(), G4UImanager::GetUIpointer(), G4UImanager::GetVerboseLevel(), and G4UImanager::SetVerboseLevel().

Referenced by CreateIon().

00908 {
00909   // create command string for addProcManager
00910   std::ostringstream osAdd;
00911   osAdd << "/run/particle/addProcManager "<< name;
00912   G4String cmdAdd = osAdd.str();
00913 
00914   // set /control/verbose 0
00915   G4int tempVerboseLevel = G4UImanager::GetUIpointer()->GetVerboseLevel();
00916   G4UImanager::GetUIpointer()->SetVerboseLevel(0);
00917 
00918   // issue /run/particle/addProcManage
00919   G4UImanager::GetUIpointer()->ApplyCommand(cmdAdd);
00920 
00921   // retreive  /control/verbose 
00922   G4UImanager::GetUIpointer()->SetVerboseLevel(tempVerboseLevel);
00923 }

void G4IonTable::clear (  ) 

Definition at line 784 of file G4IonTable.cc.

References G4cout, G4endl, G4Exception(), G4ParticleTable::GetParticleTable(), GetVerboseLevel(), and JustWarning.

Referenced by G4ParticleTable::RemoveAllParticles().

00785 {
00786   if (G4ParticleTable::GetParticleTable()->GetReadiness()) {
00787     G4Exception("G4IonTable::clear()",
00788                 "PART116", JustWarning,
00789                 "No effects because readyToUse is true.");    
00790     return;
00791   }
00792 
00793 #ifdef G4VERBOSE
00794     if (GetVerboseLevel()>2) {
00795       G4cout << "G4IonTable::Clear() : number of Ion regsitered =  "; 
00796       G4cout << fIonList->size() <<  G4endl;
00797     }
00798 #endif
00799   fIonList->clear();
00800 }

G4bool G4IonTable::Contains ( const G4ParticleDefinition particle  )  const [inline]

Definition at line 251 of file G4IonTable.hh.

References encoding, G4ParticleDefinition::GetAtomicMass(), G4ParticleDefinition::GetAtomicNumber(), GetNucleusEncoding(), G4ParticleDefinition::GetQuarkContent(), and IsIon().

Referenced by Insert().

00252 {
00253   if (!IsIon(particle)) return false;
00254 
00255   G4int Z = particle->GetAtomicNumber();
00256   G4int A = particle->GetAtomicMass();  
00257   G4int L = particle->GetQuarkContent(3);  //strangeness 
00258   G4int encoding=GetNucleusEncoding(Z, A, L);
00259   G4bool found = false;
00260   if (encoding !=0 ) {
00261     G4IonList::iterator i = fIonList->find(encoding);
00262     for( ;i != fIonList->end() ; i++) {
00263       if (particle == i->second ) {
00264         found  = true;
00265         break;
00266       }
00267     }
00268   }
00269   return found;
00270 }

void G4IonTable::CreateAllIon (  ) 

Definition at line 996 of file G4IonTable.cc.

References GetIon(), and G4NucleiProperties::IsInStableTable().

Referenced by G4ParticleMessenger::SetNewValue().

00997 {
00998   G4int    Z; 
00999   G4int    A;
01000   G4double E=0.0; 
01001   G4int    J=0;
01002   
01003   for (Z=1; Z<=120; Z++) {
01004     for (A=Z;A<999 && A<Z*3+10; A++) {
01005       if (G4NucleiProperties::IsInStableTable(A,Z)){      
01006         GetIon(Z,A,E,J);
01007       }
01008     }
01009   }
01010 }

G4ParticleDefinition * G4IonTable::CreateIon ( G4int  Z,
G4int  A,
G4int  L,
G4double  E,
G4int  J 
) [protected]

Definition at line 185 of file G4IonTable.cc.

References AddProcessManager(), CreateIon(), encoding, G4cerr, G4cout, G4endl, G4Exception(), G4State_PreInit, G4StateManager::GetCurrentState(), GetIonName(), GetNucleusEncoding(), GetNucleusMass(), G4StateManager::GetStateManager(), GetVerboseLevel(), JustWarning, G4ParticleDefinition::SetAntiPDGEncoding(), and G4ParticleDefinition::SetPDGMagneticMoment().

00187 {
00188   if (L==0) return CreateIon(A,Z,E,J);
00189   
00190   // create hyper nucleus
00191   G4ParticleDefinition* ion=0;
00192 
00193   // check whether the cuurent state is not "PreInit" 
00194   //  to make sure that GenericIon has processes
00195   G4ApplicationState currentState = G4StateManager::GetStateManager()->GetCurrentState();
00196   if (currentState == G4State_PreInit){
00197 #ifdef G4VERBOSE
00198     if (GetVerboseLevel()>1) {
00199       G4cerr << "G4IonTable::CreateIon() : can not create ion of  " 
00200              << " Z =" << Z << "  A = " << A <<  " L = " <<L 
00201              << " because the current state is PreInit !!" <<   G4endl;
00202     }
00203 #endif
00204     G4Exception( "G4IonTable::CreateIon()","PART105",
00205                  JustWarning, "Can not create ions in PreInit state");
00206     return 0;
00207   }
00208   
00209   // get ion name
00210   G4String name = GetIonName(Z, A, L, E);
00211   if ( name(L) == '?') {
00212 #ifdef G4VERBOSE
00213     if (GetVerboseLevel()>0) {
00214       G4cerr << "G4IonTable::CreateIon() : can not create ions " 
00215              << " Z =" << Z << "  A = " << A << "  L = " << L <<  G4endl;
00216     }
00217 #endif
00218       return 0;
00219   } 
00220 
00221   G4double life = -1.0;
00222   G4DecayTable* decayTable =0;
00223   G4bool stable = true;
00224   G4double mu = 0.0;
00225   G4double mass =  GetNucleusMass(Z, A, L)+ E;
00226   G4double charge =  G4double(Z)*eplus;
00227  
00228   G4int encoding = GetNucleusEncoding(Z,A,L,E,J);
00229 
00230   // create an ion
00231   //   spin, parity, isospin values are fixed
00232   //
00233   ion = new G4Ions(   name,            mass,       0.0*MeV,     charge, 
00234                          J,              +1,             0,          
00235                          0,               0,             0,             
00236                  "nucleus",               0,             A,    encoding,
00237                     stable,            life,    decayTable,       false,
00238                   "generic",              0,
00239                       E                       );
00240   ion->SetPDGMagneticMoment(mu);
00241 
00242   //No Anti particle registered
00243   ion->SetAntiPDGEncoding(0);
00244   
00245 #ifdef G4VERBOSE
00246   if (GetVerboseLevel()>1) {
00247     G4cout << "G4IonTable::CreateIon() : create hyper ion of " << name 
00248            << " encoding=" << encoding << G4endl;
00249   } 
00250 #endif
00251   
00252   // Add process manager to the ion
00253   AddProcessManager(name);
00254       
00255   return ion;
00256 }

G4ParticleDefinition * G4IonTable::CreateIon ( G4int  Z,
G4int  A,
G4double  E,
G4int  J 
) [protected]

Definition at line 102 of file G4IonTable.cc.

References AddProcessManager(), encoding, FindIsotope(), G4cerr, G4cout, G4endl, G4Exception(), G4State_PreInit, G4StateManager::GetCurrentState(), G4IsotopeProperty::GetDecayTable(), G4IsotopeProperty::GetEnergy(), GetIonName(), G4IsotopeProperty::GetiSpin(), G4IsotopeProperty::GetLifeTime(), G4IsotopeProperty::GetMagneticMoment(), GetNucleusEncoding(), GetNucleusMass(), G4StateManager::GetStateManager(), GetVerboseLevel(), JustWarning, G4ParticleDefinition::SetAntiPDGEncoding(), and G4ParticleDefinition::SetPDGMagneticMoment().

Referenced by CreateIon(), and GetIon().

00104 {
00105   G4ParticleDefinition* ion=0;
00106 
00107   // check whether the cuurent state is not "PreInit" 
00108   //  to make sure that GenericIon has processes
00109   G4ApplicationState currentState = G4StateManager::GetStateManager()->GetCurrentState();
00110   if (currentState == G4State_PreInit){
00111 #ifdef G4VERBOSE
00112     if (GetVerboseLevel()>1) {
00113       G4cerr << "G4IonTable::CreateIon() : can not create ion of  " 
00114              << " Z =" << Z << "  A = " << A 
00115              << "  because the current state is PreInit !!" <<   G4endl;
00116     }
00117 #endif
00118     G4Exception( "G4IonTable::CreateIon()","PART105",
00119                  JustWarning, "Can not create ions in PreInit state");
00120     return 0;
00121   }
00122   
00123   // get ion name
00124   G4String name = GetIonName(Z, A, E);
00125   if ( name(0) == '?') {
00126 #ifdef G4VERBOSE
00127     if (GetVerboseLevel()>0) {
00128       G4cerr << "G4IonTable::CreateIon() : can not create ions " 
00129              << " Z =" << Z << "  A = " << A <<  G4endl;
00130     }
00131 #endif
00132     return 0;
00133   } 
00134 
00135   G4double life = -1.0;
00136   G4DecayTable* decayTable =0;
00137   G4bool stable = true;
00138   G4double mu = 0.0;
00139 
00140   const G4IsotopeProperty*  fProperty = FindIsotope(Z, A, E, J);
00141   if (fProperty !=0 ){
00142     E    = fProperty->GetEnergy();
00143     J    = fProperty->GetiSpin();
00144     life = fProperty->GetLifeTime();
00145     mu   = fProperty->GetMagneticMoment();    
00146     decayTable = fProperty->GetDecayTable();
00147   }
00148   stable = life <= 0.;
00149   G4double mass =  GetNucleusMass(Z, A)+ E;
00150   G4double charge =  G4double(Z)*eplus;
00151  
00152   G4int encoding = GetNucleusEncoding(Z,A,E,J);
00153 
00154   // create an ion
00155   //   spin, parity, isospin values are fixed
00156   //
00157   ion = new G4Ions(   name,            mass,       0.0*MeV,     charge, 
00158                          J,              +1,             0,          
00159                          0,               0,             0,             
00160                  "nucleus",               0,             A,    encoding,
00161                     stable,            life,    decayTable,       false,
00162                   "generic",              0,
00163                       E                       );
00164   ion->SetPDGMagneticMoment(mu);
00165 
00166   //No Anti particle registered
00167   ion->SetAntiPDGEncoding(0);
00168   
00169 #ifdef G4VERBOSE
00170    if (GetVerboseLevel()>1) {
00171     G4cout << "G4IonTable::CreateIon() : create ion of " << name
00172            << "  " << Z << ", " << A
00173            << " encoding=" << encoding << G4endl;
00174   } 
00175 #endif
00176   
00177   // Add process manager to the ion
00178   AddProcessManager(name);
00179  
00180   return ion;
00181 }

void G4IonTable::DumpTable ( const G4String particle_name = "ALL"  )  const

Definition at line 869 of file G4IonTable.cc.

References G4ParticleDefinition::DumpTable(), and G4ParticleDefinition::GetParticleName().

00870 {
00871   const G4ParticleDefinition* ion;
00872   G4IonList::iterator idx;
00873   for (idx = fIonList->begin(); idx!= fIonList->end(); ++idx) {
00874     ion = idx->second;
00875     if (( particle_name == "ALL" ) || (particle_name == "all")){
00876       ion->DumpTable();
00877     } else if ( particle_name == ion->GetParticleName() ) {
00878       ion->DumpTable();
00879     }
00880   }
00881 }

G4int G4IonTable::Entries (  )  const [inline]

Definition at line 272 of file G4IonTable.hh.

Referenced by TLBE< T >::ConstructGeneral(), and GetParticle().

00273 {
00274   return fIonList->size();
00275 }

G4ParticleDefinition * G4IonTable::FindIon ( G4int  Z,
G4int  A,
G4int  L,
G4double  E,
G4int  J = 0 
)

Definition at line 397 of file G4IonTable.cc.

References encoding, FindIon(), G4cerr, G4endl, G4Exception(), G4ParticleDefinition::GetAtomicMass(), G4ParticleDefinition::GetAtomicNumber(), GetNucleusEncoding(), G4ParticleDefinition::GetQuarkContent(), GetVerboseLevel(), and JustWarning.

00398 {
00399   if (L==0) return FindIon(Z,A,E,J);
00400   
00401   const G4double EnergyTorelance = 0.1 * keV;
00402 
00403   if (A < 2 || Z < 0 || Z > A-L || L>A || A>999 ) {
00404 #ifdef G4VERBOSE
00405     if (GetVerboseLevel()>0) {
00406       G4cerr << "G4IonTable::FindIon() : illegal atomic number/mass or excitation level " 
00407              << " Z =" << Z << "  A = " << A << " L = " << L 
00408              <<"  E = " << E/keV << G4endl;
00409     }    
00410 #endif
00411     G4Exception( "G4IonTable::FindIon()","PART107",
00412                  JustWarning, "illegal atomic number/mass");
00413     return 0;
00414   }
00415   // Search ions with A, Z ,E
00416   //  !! J is omitted now !!
00417   const G4ParticleDefinition* ion=0;
00418   G4bool isFound = false;
00419 
00420   // -- loop over all particles in Ion table
00421   G4int encoding=GetNucleusEncoding(Z, A, L);
00422   G4IonList::iterator i = fIonList->find(encoding);
00423   for( ;i != fIonList->end() ; i++) {
00424     ion = i->second;
00425     if ( ( ion->GetAtomicNumber() != Z) || (ion->GetAtomicMass()!=A) ) break;
00426     if(  ion->GetQuarkContent(3) != L) break;
00427 
00428      // excitation level
00429     G4double anExcitaionEnergy = ((const G4Ions*)(ion))->GetExcitationEnergy();
00430 
00431     if ( ( std::fabs(E - anExcitaionEnergy ) < EnergyTorelance ) ) {
00432       isFound = true;
00433       break;
00434     }
00435   }
00436 
00437   if ( isFound ){ 
00438     return const_cast<G4ParticleDefinition*>(ion);
00439   } else {
00440     return 0;
00441   }
00442 }

G4ParticleDefinition * G4IonTable::FindIon ( G4int  Z,
G4int  A,
G4double  E,
G4int  J = 0 
)

Definition at line 353 of file G4IonTable.cc.

References encoding, G4cerr, G4endl, G4Exception(), G4ParticleDefinition::GetAtomicMass(), G4ParticleDefinition::GetAtomicNumber(), GetNucleusEncoding(), GetVerboseLevel(), and JustWarning.

Referenced by G4ParticleTable::FindIon(), FindIon(), and GetIon().

00354 {
00355   const G4double EnergyTorelance = 0.1 * keV;
00356 
00357   if ( (A<1) || (Z<=0) || (J<0) || (E<0.0) || (A>999) ) {
00358 #ifdef G4VERBOSE
00359     if (GetVerboseLevel()>0) {
00360       G4cerr << "G4IonTable::FindIon() : illegal atomic number/mass or excitation level " 
00361              << " Z =" << Z << "  A = " << A <<  "  E = " << E/keV << G4endl;
00362     }
00363 #endif
00364     G4Exception( "G4IonTable::FindIon()","PART107",
00365                  JustWarning, "illegal atomic number/mass");
00366     return 0;
00367   }
00368   // Search ions with A, Z ,E
00369   //  !! J is omitted now !!
00370   const G4ParticleDefinition* ion=0;
00371   G4bool isFound = false;
00372 
00373   // -- loop over all particles in Ion table
00374   G4int encoding=GetNucleusEncoding(Z, A, 0);
00375   G4IonList::iterator i = fIonList->find(encoding);
00376   for( ;i != fIonList->end() ; i++) {
00377     ion = i->second;
00378     if ( ( ion->GetAtomicNumber() != Z) || (ion->GetAtomicMass()!=A) ) break;
00379 
00380      // excitation level
00381     G4double anExcitaionEnergy = ((const G4Ions*)(ion))->GetExcitationEnergy();
00382     if ( ( std::fabs(E - anExcitaionEnergy ) < EnergyTorelance ) ) {
00383       isFound = true;
00384       break;
00385     }
00386   }
00387 
00388   if ( isFound ){ 
00389     return const_cast<G4ParticleDefinition*>(ion);
00390   } else {
00391     return 0;
00392   }
00393 }

G4IsotopeProperty * G4IonTable::FindIsotope ( G4int  Z,
G4int  A,
G4double  E,
G4int  J 
) [protected]

Definition at line 945 of file G4IonTable.cc.

References G4IsotopeProperty::DumpInfo(), G4cout, G4endl, G4IsotopeProperty::GetDecayTable(), G4IsotopeProperty::GetiSpin(), G4IsotopeProperty::GetLifeTime(), G4IsotopeProperty::GetMagneticMoment(), GetVerboseLevel(), G4IsotopeProperty::SetDecayTable(), G4IsotopeProperty::SetiSpin(), G4IsotopeProperty::SetLifeTime(), and G4IsotopeProperty::SetMagneticMoment().

Referenced by CreateIon().

00946 {
00947   if (fIsotopeTableList ==0) return 0;
00948   if (fIsotopeTableList->size()==0) return 0;
00949   
00950   // ask IsotopeTable 
00951   G4IsotopeProperty* property =0;
00952 
00953   // iterate 
00954   for (size_t i = 0; i< fIsotopeTableList->size(); ++i) {
00955     G4VIsotopeTable* fIsotopeTable= (*fIsotopeTableList)[i];
00956     G4IsotopeProperty* tmp = fIsotopeTable->GetIsotope(Z,A,E);
00957     if ( tmp !=0) {
00958       
00959 #ifdef G4VERBOSE
00960       if (GetVerboseLevel()>1) {
00961         G4cout << "G4IonTable::FindIsotope:"; 
00962         G4cout << " Z: " << Z;
00963         G4cout << " A: " << A;
00964         G4cout << " E: " << E;
00965         G4cout << G4endl; 
00966         tmp->DumpInfo();
00967       }
00968 #endif
00969       if (property !=0) {
00970         // overwrite spin/magnetic moment/decay table if not defined
00971         if( property->GetiSpin() ==0) {
00972           property->SetiSpin( tmp->GetiSpin() );
00973         }
00974         if( property->GetMagneticMoment() <= 0.0) {
00975           property->SetMagneticMoment( tmp->GetMagneticMoment() );
00976         }
00977         if( property->GetLifeTime() <= 0.0) {
00978           property->SetLifeTime( tmp->GetLifeTime() );
00979           if (    (property->GetLifeTime() > 0.0)
00980                && (property->GetDecayTable() ==0 ) ) {
00981             property->SetDecayTable( tmp->GetDecayTable() );
00982             tmp->SetDecayTable( 0 );
00983           }
00984         }
00985       } else {
00986         property = tmp;
00987       }
00988     }
00989   }
00990   
00991   return property;
00992 }

G4ParticleDefinition * G4IonTable::GetIon ( G4int  Z,
G4int  A,
G4int  J,
G4int  Q 
)

Definition at line 261 of file G4IonTable.cc.

References GetIon().

00262 {
00263   return GetIon(Z, A);
00264 }

G4ParticleDefinition * G4IonTable::GetIon ( G4int  Z,
G4int  A,
G4int  L,
G4double  E,
G4int  J = 0 
)

Definition at line 317 of file G4IonTable.cc.

References CreateIon(), FindIon(), G4cerr, G4endl, GetIon(), and GetVerboseLevel().

00318 {
00319   if (L==0) return GetIon(Z,A,E,J);
00320 
00321   if (A < 2 || Z < 0 || Z > A-L || L>A || A>999 ) {
00322 #ifdef G4VERBOSE
00323     if (GetVerboseLevel()>0) {
00324       G4cerr << "G4IonTable::GetIon() : illegal atomic number/mass" 
00325              << " Z =" << Z << "  A = " << A << " L = " << L 
00326              <<"  E = " << E/keV << G4endl;
00327     }
00328 #endif
00329     return 0;
00330   } else if( A==2 ) {
00331 #ifdef G4VERBOSE
00332     if (GetVerboseLevel()>0) {
00333       G4cerr << "G4IonTable::GetIon() : No boud state for " 
00334              << " Z =" << Z << "  A = " << A << " L = " << L 
00335              <<  "  E = " << E/keV << G4endl;
00336     }
00337 #endif
00338     return 0;
00339    }
00340 
00341   // Search ions with A, Z 
00342   G4ParticleDefinition* ion = FindIon(Z,A,L,E,J);
00343 
00344   // create ion
00345   if (ion == 0) {
00346     ion = CreateIon(Z, A, L, E, J);
00347   }
00348 
00349   return ion;  
00350 }

G4ParticleDefinition * G4IonTable::GetIon ( G4int  Z,
G4int  A,
G4double  E,
G4int  J = 0 
)

Definition at line 293 of file G4IonTable.cc.

References CreateIon(), FindIon(), G4cerr, G4endl, and GetVerboseLevel().

00294 {
00295   if ( (A<1) || (Z<=0) || (J<0) || (E<0.0) || (A>999) ) {
00296 #ifdef G4VERBOSE
00297     if (GetVerboseLevel()>0) {
00298       G4cerr << "G4IonTable::GetIon() : illegal atomic number/mass" 
00299              << " Z =" << Z << "  A = " << A <<  "  E = " << E/keV << G4endl;
00300     }
00301 #endif
00302     return 0;
00303    }
00304 
00305   // Search ions with A, Z 
00306   G4ParticleDefinition* ion = FindIon(Z,A,E,J);
00307 
00308   // create ion
00309   if (ion == 0) {
00310     ion = CreateIon(Z, A, E, J);
00311   }
00312 
00313   return ion;  
00314 }

G4ParticleDefinition * G4IonTable::GetIon ( G4int  encoding  ) 

Definition at line 273 of file G4IonTable.cc.

References G4cerr, G4endl, G4Exception(), GetIon(), GetNucleusByEncoding(), GetVerboseLevel(), and JustWarning.

00274 {
00275   G4int Z, A, L, J;
00276   G4double E;
00277   if (!GetNucleusByEncoding(encoding,Z,A,L,E,J) ){
00278 #ifdef G4VERBOSE
00279     if (GetVerboseLevel()>0) {
00280       G4cerr << "G4IonTable::GetIon() : illegal encoding" 
00281              << " CODE:" << encoding << G4endl;
00282     }
00283 #endif
00284     G4Exception( "G4IonTable::GetIon()","PART106",
00285                  JustWarning, "illegal encoding for an ion");
00286     return 0;
00287   }
00288   // Only ground state is supported
00289   return GetIon( Z, A, L, 0.0, J);
00290 }

G4ParticleDefinition * G4IonTable::GetIon ( G4int  Z,
G4int  A,
G4int  J = 0 
)

Definition at line 267 of file G4IonTable.cc.

Referenced by G4RadioactiveDecay::AddDecayRateTable(), G4NeutronRadCapture::ApplyYourself(), G4HadronElastic::ApplyYourself(), G4ChargeExchange::ApplyYourself(), G4ExcitationHandler::BreakItUp(), CreateAllIon(), G4RadioactiveDecay::DecayIt(), G4NuclearDecayChannel::DecayIt(), G4ParticleTable::FindIon(), G4ParticleTable::GetIon(), GetIon(), and G4GeneratorPrecompoundInterface::Propagate().

00268 {
00269   return GetIon( Z, A, 0.0, J);
00270 }

G4double G4IonTable::GetIonMass ( G4int  Z,
G4int  A,
G4int  L = 0 
) const

!! Only ground states are supported now

Definition at line 774 of file G4IonTable.cc.

References GetNucleusMass().

Referenced by G4TheoFSGenerator::ApplyYourself(), G4QMDReaction::ApplyYourself(), G4INCLXXInterface::ApplyYourself(), G4ChiralInvariantPhaseSpace::ApplyYourself(), G4BinaryLightIonReaction::ApplyYourself(), G4CompetitiveFission::BreakUp(), G4GGNuclNuclCrossSection::GetCoulombBarier(), G4ComponentGGNuclNuclXsc::GetCoulombBarier(), G4TripathiCrossSection::GetElementCrossSection(), G4StatMFFragment::GetNuclearMass(), and G4VPartonStringModel::Scatter().

00775 {
00776    return GetNucleusMass(Z,A,L);
00777 }

const G4String & G4IonTable::GetIonName ( G4int  Z,
G4int  A,
G4int  L,
G4double  E 
) const

Definition at line 581 of file G4IonTable.cc.

References GetIonName().

00582 {
00583   if (L==0) return GetIonName(Z, A, E); 
00584   static G4String name;
00585   name ="";
00586   for (int i =0; i<L; i++){
00587     name +="L";
00588   }
00589   name += GetIonName(Z, A, E);
00590   return name;
00591 }

const G4String & G4IonTable::GetIonName ( G4int  Z,
G4int  A,
G4double  E 
) const

Definition at line 558 of file G4IonTable.cc.

Referenced by CreateIon(), GetIonName(), and G4LENDManager::GetLENDTarget().

00559 {
00560   static G4String name;
00561   name ="";
00562   if ( (0< Z) && (Z <=numberOfElements) ) {
00563     name = elementName[Z-1];
00564   } else if (Z > numberOfElements) {
00565     std::ostringstream os1;
00566     os1.setf(std::ios::fixed);
00567     os1 << Z ;
00568     name = "E" + os1.str() + "-";
00569   } else {
00570     name = "?";
00571     return name;
00572   }
00573   std::ostringstream os;
00574   os.setf(std::ios::fixed);
00575   os << A << '[' << std::setprecision(1) << E/keV << ']';
00576   name += os.str();
00577   return name;
00578 }

G4VIsotopeTable * G4IonTable::GetIsotopeTable ( size_t  idx = 0  )  const

Definition at line 934 of file G4IonTable.cc.

References size().

00935 {
00936    G4VIsotopeTable* fIsotopeTable=0;
00937    if ( index < fIsotopeTableList->size() ) {
00938      fIsotopeTable = (*fIsotopeTableList)[index];
00939    }
00940    return fIsotopeTable;
00941 }

G4ParticleDefinition * G4IonTable::GetLightAntiIon ( G4int  Z,
G4int  A 
) const [protected]

Definition at line 701 of file G4IonTable.cc.

References G4ParticleTable::FindParticle(), and G4ParticleTable::GetParticleTable().

00702 {
00703   // returns pointer to pre-defined ions 
00704   static G4bool isInitialized = false;
00705   static const G4ParticleDefinition* p_proton=0;
00706   static const G4ParticleDefinition* p_deuteron=0;
00707   static const G4ParticleDefinition* p_triton=0;
00708   static const G4ParticleDefinition* p_alpha=0;
00709   static const G4ParticleDefinition* p_He3=0;
00710   
00711   if (!isInitialized) {
00712     p_proton   = G4ParticleTable::GetParticleTable()->FindParticle("anti_proton"); // proton 
00713     p_deuteron = G4ParticleTable::GetParticleTable()->FindParticle("anti_deuteron"); // deuteron 
00714     p_triton   = G4ParticleTable::GetParticleTable()->FindParticle("anti_triton"); // tritoon 
00715     p_alpha    = G4ParticleTable::GetParticleTable()->FindParticle("anti_alpha"); // alpha 
00716     p_He3      = G4ParticleTable::GetParticleTable()->FindParticle("anti_He3"); // He3 
00717     isInitialized = true;
00718   }
00719 
00720   const G4ParticleDefinition* ion=0;
00721   if ( (Z<=2) ) {
00722     if ( (Z==1)&&(A==1) ) {
00723       ion = p_proton;
00724     } else if ( (Z==1)&&(A==2) ) {
00725       ion = p_deuteron;
00726     } else if ( (Z==1)&&(A==3) ) {
00727       ion = p_triton;
00728     } else if ( (Z==2)&&(A==4) ) {
00729       ion = p_alpha;
00730     } else if ( (Z==2)&&(A==3) ) {
00731       ion = p_He3;
00732     }
00733   }
00734   return const_cast<G4ParticleDefinition*>(ion);
00735 }

G4ParticleDefinition * G4IonTable::GetLightIon ( G4int  Z,
G4int  A 
) const [protected]

Definition at line 664 of file G4IonTable.cc.

References G4ParticleTable::FindParticle(), and G4ParticleTable::GetParticleTable().

Referenced by GetNucleusMass().

00665 {
00666   // returns pointer to pre-defined ions 
00667   static G4bool isInitialized = false;
00668   static const G4ParticleDefinition* p_proton=0;
00669   static const G4ParticleDefinition* p_deuteron=0;
00670   static const G4ParticleDefinition* p_triton=0;
00671   static const G4ParticleDefinition* p_alpha=0;
00672   static const G4ParticleDefinition* p_He3=0;
00673   
00674   if (!isInitialized) {
00675     p_proton   = G4ParticleTable::GetParticleTable()->FindParticle("proton"); // proton 
00676     p_deuteron = G4ParticleTable::GetParticleTable()->FindParticle("deuteron"); // deuteron 
00677     p_triton   = G4ParticleTable::GetParticleTable()->FindParticle("triton"); // tritoon 
00678     p_alpha    = G4ParticleTable::GetParticleTable()->FindParticle("alpha"); // alpha 
00679     p_He3      = G4ParticleTable::GetParticleTable()->FindParticle("He3"); // He3 
00680     isInitialized = true;
00681   }
00682 
00683   const G4ParticleDefinition* ion=0;
00684   if ( (Z<=2) ) {
00685     if ( (Z==1)&&(A==1) ) {
00686       ion = p_proton;
00687     } else if ( (Z==1)&&(A==2) ) {
00688       ion = p_deuteron;
00689     } else if ( (Z==1)&&(A==3) ) {
00690       ion = p_triton;
00691     } else if ( (Z==2)&&(A==4) ) {
00692       ion = p_alpha;
00693     } else if ( (Z==2)&&(A==3) ) {
00694       ion = p_He3;
00695     }
00696   }
00697   return const_cast<G4ParticleDefinition*>(ion);
00698 }

G4bool G4IonTable::GetNucleusByEncoding ( G4int  encoding,
G4int Z,
G4int A,
G4int L,
G4double E,
G4int J 
) [static]

Definition at line 527 of file G4IonTable.cc.

00531 {
00532   if (encoding <= 0) {
00533     // anti particle   
00534     return false;
00535   }
00536   if (encoding % 10 != 0) {
00538     return false;
00539   }
00540   if (encoding < 1000000000) {
00541     // anti particle   
00542     return false;
00543   }
00544 
00545   encoding -= 1000000000;
00546   L = encoding/10000000;
00547   encoding -= 10000000*L;
00548   Z = encoding/10000;
00549   encoding -= 10000*Z;
00550   A = encoding/10;
00551   
00552   E=0.0;
00553   J=0; 
00554  
00555   return true;
00556 }

G4bool G4IonTable::GetNucleusByEncoding ( G4int  encoding,
G4int Z,
G4int A,
G4double E,
G4int J 
) [static]

!! I = 1 is assigned fo all excitation states in Geant4

!!not supported for excitation states !!!

Definition at line 494 of file G4IonTable.cc.

Referenced by GetIon().

00497 {
00498   if (encoding <= 0) {
00499     // anti particle   
00500     return false;
00501   } 
00502   if (encoding == 2212) {
00503     // proton
00504     Z = 1;
00505     A = 1;
00506     E=0.0;
00507     J=0; 
00508     return true;
00509   }
00510 
00511   if (encoding % 10 != 0) {
00513     return false;
00514   }
00515 
00516   encoding -= 1000000000;
00517   Z = encoding/10000;
00518   encoding -= 10000*Z;
00519   A = encoding/10;
00520   
00521   E=0.0;
00522   J=0; 
00523  
00524   return true;
00525 }

G4int G4IonTable::GetNucleusEncoding ( G4int  Z,
G4int  A,
G4int  L,
G4double  E = 0.0,
G4int  J = 0 
) [static]

!! I = 1 is assigned fo all excitation states in Geant4

!! I = 1 is assigned fo all excitation states in Geant4

Definition at line 471 of file G4IonTable.cc.

References encoding.

00473 {
00474   //  get PDG code for Hyper-Nucleus Ions 
00475   // Nuclear codes are given as 10-digit numbers +-10LZZZAAAI.
00476   //For a nucleus consisting of np protons and nn neutrons
00477   // A = np + nn +nlambda and Z = np.
00478   // L = nlambda
00479   // I gives the isomer level, with I = 0 corresponding 
00480   // to the ground state and I >0 to excitations
00481   //
00483 
00484   G4int encoding = 1000000000;
00485   encoding += L*  10000000;
00486   encoding += Z * 10000;
00487   encoding += A *10;
00488   if (E>0.0) encoding += 1;
00489   
00490   return encoding;
00491 }

G4int G4IonTable::GetNucleusEncoding ( G4int  Z,
G4int  A,
G4double  E = 0.0,
G4int  J = 0 
) [static]

Definition at line 446 of file G4IonTable.cc.

References encoding.

Referenced by Contains(), CreateIon(), FindIon(), G4LENDManager::GetLENDTarget(), G4LENDManager::GetNucleusEncoding(), Insert(), G4InuclNuclei::makeNuclearFragment(), and Remove().

00447 {
00448   // PDG code for Ions
00449   // Nuclear codes are given as 10-digit numbers +-100ZZZAAAI.
00450   //For a nucleus consisting of np protons and nn neutrons
00451   // A = np + nn and Z = np.
00452   // I gives the isomer level, with I = 0 corresponding 
00453   // to the ground state and I >0 to excitations
00454   
00456   const G4double EnergyTorelance = 0.1 * keV;
00457   if ( Z==1 && A==1 && E< EnergyTorelance ) {
00458     //proton
00459     return 2212;
00460   }
00461   
00462   G4int encoding = 1000000000;
00463   encoding += Z * 10000;
00464   encoding += A *10;
00465   if (E>0.0) encoding += 1;
00466   
00467   return encoding;
00468 }

G4double G4IonTable::GetNucleusMass ( G4int  Z,
G4int  A,
G4int  L = 0 
) const

Definition at line 741 of file G4IonTable.cc.

References EventMustBeAborted, G4cerr, G4endl, G4Exception(), GetLightIon(), G4HyperNucleiProperties::GetNuclearMass(), G4NucleiProperties::GetNuclearMass(), G4ParticleDefinition::GetPDGMass(), and GetVerboseLevel().

Referenced by CreateIon(), GetIonMass(), and G4INCL::ParticleTable::getRealMass().

00742 {
00743   if ( (A<1)  || (Z<0) || (L<0) ){
00744 #ifdef G4VERBOSE
00745     if (GetVerboseLevel()>0) {
00746       G4cerr << "G4IonTable::GetNucleusMass() : illegal atomic number/mass " 
00747              << " Z =" << Z << "  A = " << A  << G4endl;
00748     }
00749 #endif
00750     G4Exception( "G4IonTable::GetNucleusMass()","PART107",
00751                  EventMustBeAborted, "illegal atomic number/mass");
00752     return -1.0;
00753   }
00754 
00755   G4double mass;
00756   if (L == 0) {
00757     // calculate nucleus mass
00758     const G4ParticleDefinition* ion=GetLightIon(Z, A);
00759     
00760     if (ion!=0) {
00761       mass = ion->GetPDGMass();
00762     } else {
00763       // use G4NucleiProperties::GetNuclearMass
00764       mass = G4NucleiProperties::GetNuclearMass(A, Z);
00765     }
00766 
00767   } else {
00768     mass = G4HyperNucleiProperties::GetNuclearMass(A, Z, L);
00769   }
00770   return mass;
00771 }

G4int G4IonTable::GetNumberOfElements (  )  const [inline]

Definition at line 246 of file G4IonTable.hh.

00247 {
00248   return numberOfElements;
00249 }

G4ParticleDefinition * G4IonTable::GetParticle ( G4int  index  )  const

Definition at line 1013 of file G4IonTable.cc.

References Entries(), G4cerr, G4endl, and GetVerboseLevel().

Referenced by TLBE< T >::ConstructGeneral().

01014 {
01015   if ( (index >=0) && (index < Entries()) ) {
01016     G4IonList::iterator idx = fIonList->begin();
01017     G4int counter = 0;
01018     while( idx != fIonList->end() ){
01019       if ( counter == index ) {
01020         return const_cast<G4ParticleDefinition*>(idx->second);
01021       }
01022       counter++;
01023       idx++;
01024     }
01025   } 
01026 #ifdef G4VERBOSE
01027   if (GetVerboseLevel()>1){
01028     G4cerr << " G4IonTable::GetParticle"
01029            << " invalid index (=" << index << ")" 
01030            << " entries = " << Entries() << G4endl;
01031   }
01032 #endif
01033   return 0;
01034 }

G4int G4IonTable::GetVerboseLevel (  )  const [protected]

Definition at line 901 of file G4IonTable.cc.

References G4ParticleTable::GetParticleTable(), and G4ParticleTable::GetVerboseLevel().

Referenced by clear(), CreateIon(), FindIon(), FindIsotope(), GetIon(), GetNucleusMass(), GetParticle(), and Remove().

00902 {
00903   return G4ParticleTable::GetParticleTable()->GetVerboseLevel();
00904 }

void G4IonTable::Insert ( const G4ParticleDefinition particle  ) 

Definition at line 802 of file G4IonTable.cc.

References Contains(), encoding, G4ParticleDefinition::GetAtomicMass(), G4ParticleDefinition::GetAtomicNumber(), GetNucleusEncoding(), G4ParticleDefinition::GetQuarkContent(), and IsIon().

Referenced by G4ParticleTable::Insert().

00803 {
00804   if (!IsIon(particle)) return;
00805   if (Contains(particle)) return;
00806  
00807   G4int Z = particle->GetAtomicNumber();
00808   G4int A = particle->GetAtomicMass();  
00809   G4int L = particle->GetQuarkContent(3);  //strangeness 
00810   G4int encoding=GetNucleusEncoding(Z, A, L);
00811 
00812   fIonList->insert( std::pair<const G4int, const G4ParticleDefinition*>(encoding, particle) );
00813 
00814 }

G4bool G4IonTable::IsAntiIon ( const G4ParticleDefinition  )  [static]

Definition at line 619 of file G4IonTable.cc.

References G4ParticleDefinition::GetAtomicMass(), G4ParticleDefinition::GetAtomicNumber(), G4ParticleDefinition::GetBaryonNumber(), G4ParticleDefinition::GetParticleName(), and G4ParticleDefinition::GetParticleType().

Referenced by G4ParticleDefinition::DumpTable(), and G4ParticleDefinition::G4ParticleDefinition().

00620 {
00621   // return true if the particle is ion
00622 
00623   static G4String anti_nucleus("anti_nucleus");
00624   static G4String anti_proton("anti_proton");
00625 
00626   // anti_neutron is not ion
00627   if ((particle->GetAtomicMass()>0)   && 
00628       (particle->GetAtomicNumber()>0) ){
00629    if (particle->GetBaryonNumber()<0)  return true;
00630    else return false;
00631   }
00632 
00633   //  particles derived from G4Ions
00634   if (particle->GetParticleType() == anti_nucleus) return true;
00635 
00636   // anti_proton (Anti_Hydrogen nucleus)
00637   if (particle->GetParticleName() == anti_proton) return true;
00638 
00639   return false;
00640 }

G4bool G4IonTable::IsIon ( const G4ParticleDefinition  )  [static]

Definition at line 594 of file G4IonTable.cc.

References G4ParticleDefinition::GetAtomicMass(), G4ParticleDefinition::GetAtomicNumber(), G4ParticleDefinition::GetBaryonNumber(), G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetParticleType(), and G4InuclParticleNames::proton.

Referenced by G4DynamicParticle::AllocateElectronOccupancy(), Contains(), G4ParticleDefinition::DumpTable(), G4ParticleDefinition::G4ParticleDefinition(), G4ParticleTable::Insert(), Insert(), G4ParticleTable::Remove(), and Remove().

00595 {
00596   // return true if the particle is ion
00597 
00598   static G4String nucleus("nucleus");
00599   static G4String proton("proton");
00600 
00601   // neutron is not ion
00602   if ((particle->GetAtomicMass()>0)   && 
00603       (particle->GetAtomicNumber()>0) ){
00604    if (particle->GetBaryonNumber()>0)  return true;
00605    else return false;
00606   }
00607 
00608    
00609   //  particles derived from G4Ions
00610   if (particle->GetParticleType() == nucleus) return true;
00611 
00612   // proton (Hydrogen nucleus)
00613   if (particle->GetParticleName() == proton) return true;
00614 
00615   return false;
00616 }

G4bool G4IonTable::IsLightAntiIon ( const G4ParticleDefinition  )  const [protected]

Definition at line 654 of file G4IonTable.cc.

References G4ParticleDefinition::GetParticleName().

00655 {
00656   static const std::string names[] = { "anti_proton", "anti_alpha", "anti_deuteron",
00657                            "anti_triton", "anti_He3"};
00658 
00659    // return true if the particle is pre-defined ion
00660   return std::find(names, names+5, particle->GetParticleName())!=names+5;
00661 } 

G4bool G4IonTable::IsLightIon ( const G4ParticleDefinition  )  const [protected]

Definition at line 645 of file G4IonTable.cc.

References G4ParticleDefinition::GetParticleName().

00646 {
00647   static const std::string names[] = { "proton", "alpha", "deuteron",
00648                            "triton", "He3"};
00649 
00650    // return true if the particle is pre-defined ion
00651   return std::find(names, names+5, particle->GetParticleName())!=names+5;
00652 } 

G4IonTable& G4IonTable::operator= ( const G4IonTable  )  [inline, protected]

Definition at line 82 of file G4IonTable.hh.

00082 {return *this;}

void G4IonTable::RegisterIsotopeTable ( G4VIsotopeTable table  ) 

Definition at line 928 of file G4IonTable.cc.

Referenced by G4RadioactiveDecay::G4RadioactiveDecay().

00929 {
00930   fIsotopeTableList->push_back(table);
00931 }

void G4IonTable::Remove ( const G4ParticleDefinition particle  ) 

Definition at line 817 of file G4IonTable.cc.

References encoding, G4cerr, G4cout, G4endl, G4Exception(), G4State_PreInit, G4ParticleDefinition::GetAtomicMass(), G4ParticleDefinition::GetAtomicNumber(), G4StateManager::GetCurrentState(), GetNucleusEncoding(), G4ParticleDefinition::GetParticleName(), G4ParticleTable::GetParticleTable(), G4ParticleDefinition::GetQuarkContent(), G4StateManager::GetStateManager(), GetVerboseLevel(), IsIon(), and JustWarning.

Referenced by G4ParticleTable::Remove().

00818 {
00819   if (G4ParticleTable::GetParticleTable()->GetReadiness()) {
00820     G4StateManager* pStateManager = G4StateManager::GetStateManager();
00821     G4ApplicationState currentState = pStateManager->GetCurrentState();
00822     if (currentState != G4State_PreInit) {
00823       G4String msg = "Request of removing ";
00824       msg += particle->GetParticleName();  
00825       msg += " has No effects other than Pre_Init";
00826       G4Exception("G4IonTable::Remove()",
00827                   "PART117", JustWarning, msg);
00828       return;
00829     } else {
00830 #ifdef G4VERBOSE
00831       if (GetVerboseLevel()>0){
00832         G4cout << particle->GetParticleName()
00833                << " will be removed from the IonTable " << G4endl;
00834       }
00835 #endif
00836     }
00837   }
00838 
00839   if (IsIon(particle)) {
00840     G4int Z = particle->GetAtomicNumber();
00841     G4int A = particle->GetAtomicMass();  
00842     G4int L = particle->GetQuarkContent(3);  //strangeness 
00843     G4int encoding=GetNucleusEncoding(Z, A, L);
00844     if (encoding !=0 ) {
00845       G4IonList::iterator i = fIonList->find(encoding);
00846       for( ;i != fIonList->end() ; i++) {
00847         if (particle == i->second) {
00848           fIonList->erase(i);
00849           break;
00850         }
00851       }
00852     }
00853   } else {
00854 #ifdef G4VERBOSE
00855     if (GetVerboseLevel()>1) {
00856       G4cerr << "G4IonTable::Remove :" << particle->GetParticleName() 
00857              << " is not ions" << G4endl; 
00858     }
00859 #endif
00860   }
00861   
00862 }

G4int G4IonTable::size (  )  const [inline]

Definition at line 277 of file G4IonTable.hh.

Referenced by GetIsotopeTable().

00278 {
00279   return fIonList->size();
00280 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:18 2013 for Geant4 by  doxygen 1.4.7