Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/particles/management/include/G4IonTable.hh

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /particles/management/include/G4IonTable.hh (Version 11.3.0) and /particles/management/include/G4IonTable.hh (Version 10.2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 // G4IonTable                                  << 
 27 //                                                 26 //
 28 // Class description:                          <<  27 // $Id: G4IonTable.hh 94421 2015-11-16 08:22:56Z gcosmo $
 29 //                                                 28 //
 30 // G4IonTable stores all pointers to G4Particl <<  29 // 
 31                                                <<  30 // ------------------------------------------------------------
 32 // Author: H.Kurashige, 27 June 1998           <<  31 //  GEANT 4 class header file 
 33 // ------------------------------------------- <<  32 //
 34 #ifndef G4IonTable_hh                          <<  33 //  History: first implementation, 
 35 #define G4IonTable_hh 1                        <<  34 //      based on object model of June 27, 98 H.Kurashige
                                                   >>  35 // ------------------------------------------------------------
                                                   >>  36 //      added clear()     20 Mar., 08 H.Kurashige
                                                   >>  37 //      modified GetIon                 02 Aug., 98 H.Kurashige
                                                   >>  38 //      added Remove()                  06 Nov.,98 H.Kurashige
                                                   >>  39 //      add GetNucleusMass              15 Mar. 99  H.Kurashige
                                                   >>  40 //          -----
                                                   >>  41 //      Modified GetIon methods                  17 Aug. 99 H.Kurashige
                                                   >>  42 //      New design using G4VIsotopeTable          5 Oct. 99 H.Kurashige
                                                   >>  43 //      Add GetNucleusEncoding according PDG 2006 9 Oct. 2006 H.Kurashige
                                                   >>  44 //      Use STL map                              30 Jul. 2009 H.Kurashige
                                                   >>  45 //      Add GetIsomerMass                       25 July 2013  H.Kurashige
                                                   >>  46 //
                                                   >>  47 #ifndef G4IonTable_h
                                                   >>  48 #define G4IonTable_h 1
 36                                                    49 
 37 #include "G4Ions.hh"                           << 
 38 #include "G4ParticleDefinition.hh"             << 
 39 #include "G4ParticleTable.hh"                  << 
 40 #include "G4ios.hh"                                50 #include "G4ios.hh"
 41 #include "globals.hh"                              51 #include "globals.hh"
                                                   >>  52 #include "G4ParticleDefinition.hh"
                                                   >>  53 #include "G4ParticleTable.hh"
                                                   >>  54 #include "G4Ions.hh"
 42                                                    55 
 43 #include <cmath>                                   56 #include <cmath>
 44 #include <map>                                 << 
 45 #include <vector>                                  57 #include <vector>
                                                   >>  58 #include <map>
 46                                                    59 
 47 class G4ParticleTable;                             60 class G4ParticleTable;
 48 class G4VIsotopeTable;                         <<  61 class G4VIsotopeTable; 
 49 class G4IsotopeProperty;                           62 class G4IsotopeProperty;
 50 class G4NuclideTable;                          <<  63 class G4NuclideTable; 
 51                                                    64 
 52 class G4IonTable                                   65 class G4IonTable
 53 {                                                  66 {
 54   public:                                      <<  67  // Class Description
 55     using G4IonList = std::multimap<G4int, con <<  68  //   G4IonTable is the table of pointer to G4ParticleDefinition
 56     using G4IonListIterator = std::multimap<G4 <<  69  //   In G4IonTable, each G4ParticleDefinition pointer is stored
 57                                                <<  70  //
 58     // Constructor, destructor                 <<  71 
 59     G4IonTable();                              <<  72  public:
 60     ~G4IonTable();                             <<  73    // Use STL map as list of ions
 61                                                <<  74    typedef  std::multimap<G4int, const G4ParticleDefinition*> G4IonList;
 62     // Forbidden copy constructor and assignme <<  75    typedef  std::multimap<G4int, const G4ParticleDefinition*>::iterator G4IonListIterator;
 63     G4IonTable(const G4IonTable&) = delete;    <<  76 
 64     G4IonTable& operator=(const G4IonTable&) = <<  77  public:
 65                                                <<  78    static G4IonTable* GetIonTable()
 66     static G4IonTable* GetIonTable();          <<  79    { return G4ParticleTable::GetParticleTable()->GetIonTable(); }
 67                                                <<  80 
 68     // Method is used by each worker thread to <<  81  public:
 69     // from the master thread.                 <<  82   // constructor
 70     void WorkerG4IonTable();                   <<  83    G4IonTable();
 71                                                <<  84 
 72     // Destructor for worker                   <<  85    void SlaveG4IonTable();
 73     void DestroyWorkerG4IonTable();            <<  86    void WorkerG4IonTable();
 74                                                <<  87    // Method is used by each worker thread to copy the content from the master
 75     // Get number of elements defined in the I <<  88    // thread.
 76     G4int GetNumberOfElements() const;         <<  89 
 77                                                <<  90  protected:
 78     // Register Isotope table                  <<  91    // hide copy construictor as protected 
 79     void RegisterIsotopeTable(G4VIsotopeTable* <<  92    G4IonTable(const  G4IonTable &right);
 80                                                <<  93    G4IonTable & operator = (const G4IonTable &) {return *this;}
 81     // G4IonTable asks properties of isotopes  <<  94 
 82     // by using FindIsotope(G4IsotopeProperty* <<  95  public:
 83     G4VIsotopeTable* GetIsotopeTable(std::size <<  96   // destructor
 84                                                <<  97    virtual ~G4IonTable();
 85     // All ground state ions are created.      <<  98    void DestroyWorkerG4IonTable();
 86     // Stable ground states are defined in G4N <<  99 
 87     void CreateAllIon();                       << 100  public: // With Description
 88                                                << 101    G4int GetNumberOfElements() const;
 89     // All excited ions with long life time (> << 102    // Get number of elements defined in the IonTable
 90     // Isomers are defined in G4VIsotopeTable  << 103 
 91     void CreateAllIsomer();                    << 104    // Register Isotope table
 92                                                << 105    void RegisterIsotopeTable(G4VIsotopeTable* table);
 93     // All nuclide with a life time longer tha << 106    G4VIsotopeTable* GetIsotopeTable(size_t idx=0) const;
 94     // prior to the event loop                 << 107    // G4IonTable asks properties of isotopes to this G4VIsotopeTable 
 95     void PrepareNuclideTable();                << 108    // by using FindIsotope(G4IsotopeProperty* property) method.
 96     void PreloadNuclide();                     << 109    
 97                                                << 110    // ---------------------------  
 98     // --------------------------------------- << 111    // FindIon/GetIon
 99     // FindIon/GetIon                          << 112    //   FindIon methods return pointer of ion if it exists       
100     //   FindIon() methods return pointer of i << 113    //   GetIon methods also return pointer of ion. In GetIon 
101     //   GetIon() methods also return pointer  << 114    //   methods the designated ion will be created if it does not exist.
102     //   ion is created if it does not exist.  << 115    //
103     //                                         << 116    // !! PDGCharge inG4ParticleDefinition of ions is           !!
104     // !! PDGCharge in G4ParticleDefinition of << 117    // !! electric charge of nucleus (i.e. fully ionized ions)  !!
105     // !! electric charge of nucleus (i.e. ful << 118    // -----------------------------
106     // --------------------------------------- << 119 
107                                                << 120    void CreateAllIon();
108     // Find/Get "ground state" and "excited st << 121    // All ground state ions will be created
109     //                                         << 122    //   stabele ground states are defined in G4NuclearProperty 
110     G4ParticleDefinition* GetIon(G4int Z, G4in << 123  
111     G4ParticleDefinition* GetIon(G4int Z, G4in << 124    void CreateAllIsomer();
112     G4ParticleDefinition* GetIon(G4int Z, G4in << 125    // All excited ions with long life time (>1.0*ns) will be created
113     G4ParticleDefinition* GetIon(G4int Z, G4in << 126    //  isomers are defined in G4VIsotopeTable
114                                  G4int J = 0); << 127    
115     G4ParticleDefinition* GetIon(G4int Z, G4in << 128    void PrepareNuclideTable();
116     G4ParticleDefinition* GetIon(G4int Z, G4in << 129    void PreloadNuclide();
117     G4ParticleDefinition* GetIon(G4int Z, G4in << 130    // All nuclide with a life time longer than certain value will be created
118                                  G4Ions::G4Flo << 131    // prior to the event loop.
119     G4ParticleDefinition* GetIon(G4int Z, G4in << 132 
120     // Z: Atomic Number                        << 133    // Find/Get "ground state" and "excited state" 
121     // A: Atomic Mass (nn + np +nlambda)       << 134    G4ParticleDefinition* GetIon(G4int Z, G4int A, G4int lvl=0);
122     // nL: Number of Lambda                    << 135    G4ParticleDefinition* GetIon(G4int Z, G4int A, G4int L, G4int lvl);
123     // E: Excitation energy                    << 136    G4ParticleDefinition* GetIon(G4int Z, G4int A, G4double E, G4int J=0);
124     // lvl:  Isomer Level 0: ground state)     << 137    G4ParticleDefinition* GetIon(G4int Z, G4int A, G4int L,
125     // flb:  Floating level base (enum defined << 138         G4double E, G4int J=0);
126     // flbChar:  Floating level base denoted b << 139    //   Z: Atomic Number
127     //           (<null>,X,Y,Z,U,V,W,R,S,T,A,B << 140    //   A: Atomic Mass (nn + np +nlambda)
128     // J: Total Angular momentum (in unit of 1 << 141    //   L: Number of Lmabda
129                                                << 142    //   E: Excitaion energy
130     // The ion can be retrieved by using PDG e << 143    //   lvl:  Isomer Level 0: ground state)
131     // !! Only ground state can be obtained .i << 144    //   J: Total Angular momentum (in unit of 1/2) : not used
132     G4ParticleDefinition* GetIon(G4int encodin << 145 
133                                                << 146    G4ParticleDefinition* GetIon(G4int encoding);
134     // Find/Get "excited state"                << 147    // The ion can be get by using PDG encoding 
135     //                                         << 148    // !! Only ground state can be obtained .i.e. Isomer = 0
136     G4ParticleDefinition* FindIon(G4int Z, G4i << 149    
137     G4ParticleDefinition* FindIon(G4int Z, G4i << 150    // Find/Get "excited state" 
138     G4ParticleDefinition* FindIon(G4int Z, G4i << 151    G4ParticleDefinition* FindIon(G4int Z, G4int A, G4int lvl=0);
139     G4ParticleDefinition* FindIon(G4int Z, G4i << 152    G4ParticleDefinition* FindIon(G4int Z, G4int A, G4int L, G4int lvl);
140                                   G4int J = 0) << 153    G4ParticleDefinition* FindIon(G4int Z, G4int A, G4double E, G4int J=0);
141     G4ParticleDefinition* FindIon(G4int Z, G4i << 154    G4ParticleDefinition* FindIon(G4int Z, G4int A, G4int L,
142     G4ParticleDefinition* FindIon(G4int Z, G4i << 155          G4double E, G4int J=0);
143     G4ParticleDefinition* FindIon(G4int Z, G4i << 156    //   Z: Atomic Number
144                                   G4Ions::G4Fl << 157    //   A: Atomic Mass (nn + np +nlambda)
145     G4ParticleDefinition* FindIon(G4int Z, G4i << 158    //   L: Number of Lmabda
146                                   G4int J = 0) << 159    //   E: Excitaion energy
147     // Z: Atomic Number                        << 160    //   lvl:  Isomer Level 0: ground state)
148     // A: Atomic Mass (nn + np +nlambda)       << 161    //   J: Total Angular momentum (in unit of 1/2) : not used
149     // nL: Number of Lambda                    << 162 
150     // E: Excitaion energy                     << 163    static G4bool        IsIon(const G4ParticleDefinition*);
151     // lvl:  Isomer Level 0: ground state)     << 164    // return true if the particle is ion
152     // flb:  Floating level base (enum defined << 165 
153     // flbChar:  Floating level base denoted b << 166    static G4bool        IsAntiIon(const G4ParticleDefinition*);
154     //           (<null>,X,Y,Z,U,V,W,R,S,T,A,B << 167    // return true if the particle is anti_ion
155     // J: Total Angular momentum (in unit of 1 << 168 
156                                                << 169 
157     // Return true if the particle is ion      << 170    const G4String&  GetIonName(G4int Z, G4int A, G4int lvl=0) const;
158     static G4bool IsIon(const G4ParticleDefini << 171    const G4String&  GetIonName(G4int Z, G4int A, G4double E) const;
159                                                << 172    const G4String&  GetIonName(G4int Z, G4int A, G4int L, G4double E) const;
160     // Return true if the particle is anti_ion << 173    const G4String&  GetIonName(G4int Z, G4int A, G4int L, G4int  lvl) const;
161     static G4bool IsAntiIon(const G4ParticleDe << 174    // get ion name
162                                                << 175   
163     // Get ion name                            << 176    static G4int GetNucleusEncoding(G4int Z,        G4int A, 
164     G4String GetIonName(G4int Z, G4int A, G4in << 177            G4double E=0.0, G4int lvl=0);
165     G4String GetIonName(G4int Z, G4int A, G4do << 178   //  get PDG code for Ions 
166                         G4Ions::G4FloatLevelBa << 179   // Nuclear codes are given as 10-digit numbers +-100ZZZAAAI.
167     G4String GetIonName(G4int Z, G4int A, G4in << 180   //For a nucleus consisting of np protons and nn neutrons
168                         G4Ions::G4FloatLevelBa << 181   // A = np + nn and Z = np.
169     G4String GetIonName(G4int Z, G4int A, G4in << 182   // I gives the isomer level, with I = 0 corresponding 
170                                                << 183   // to the ground state and I >0 to excitations
171     // Get PDG code for Ions.                  << 184   
172     // Nuclear codes are given as 10-digit num << 185    static G4int GetNucleusEncoding(G4int Z,   G4int A,  G4int L,        
173     // For a nucleus consisting of np protons  << 186            G4double E=0.0, G4int lvl=0);
174     // A = np + nn and Z = np.                 << 187   //  get PDG code for Hyper-Nucleus Ions 
175     // I gives the isomer level, with I = 0 co << 188   // Nuclear codes are given as 10-digit numbers +-10LZZZAAAI.
176     // to the ground state and I >0 to excitat << 189   //For a nucleus consisting of np protons and nn neutrons
177     static G4int GetNucleusEncoding(G4int Z, G << 190   // A = np + nn +nlambda and Z = np.
178                                                << 191   // L = nlambda
179     // Get PDG code for Hyper-Nucleus Ions.    << 192   // I gives the isomer level, with I = 0 corresponding 
180     // Nuclear codes are given as 10-digit num << 193   // to the ground state and I >0 to excitations
181     // For a nucleus consisting of np protons  << 194 
182     // A = np + nn +nlambda and Z = np.        << 195    static G4bool GetNucleusByEncoding(G4int encoding,
183     // nL = nlambda                            << 196              G4int &Z,      G4int &A, 
184     // I gives the isomer level, with I = 0 co << 197              G4double &E,   G4int &lvl);
185     // to the ground state and I >0 to excitat << 198    static G4bool GetNucleusByEncoding(G4int encoding,
186     static G4int GetNucleusEncoding(G4int Z, G << 199               G4int &Z,      G4int &A,  G4int &L,    
187                                                << 200               G4double &E,   G4int &lvl);
188     static G4bool GetNucleusByEncoding(G4int e << 201    // Energy will not be given even for excited state!!  
189     static G4bool GetNucleusByEncoding(G4int e << 202  
190                                        G4int&  << 203    G4double   GetIonMass(G4int Z, G4int A, G4int L=0, G4int lvl=0) const;
191     // Energy will not be given even for excit << 204    G4double   GetNucleusMass(G4int Z, G4int A, G4int L=0, G4int lvl=0) const;
192                                                << 205    G4double   GetIsomerMass(G4int Z, G4int A, G4int lvl=0) const;
193     // These methods returns Nucleus (i.e. ful << 206     // These methods returns Nucleus (i.e. full ionized atom) mass 
194     //  Z is Atomic Number (number of protons) << 207    // ,where Z is Atomic Number (number of protons) and
195     //  A is Atomic Number (number of nucleons << 208    //  A is Atomic Number (number of nucleons and hyperons)
196     //  nL is number of lambda (A= nn + np + n << 209    //  L is number of lambda (A= nn + np + nlambda)
197     //  lvl is isomer level                    << 210    //  lvl is isomer level
198     G4double GetIonMass(G4int Z, G4int A, G4in << 211  
199     G4double GetNucleusMass(G4int Z, G4int A,  << 212    G4double   GetLifeTime(const G4ParticleDefinition*) const;
200     G4double GetIsomerMass(G4int Z, G4int A, G << 213    G4double   GetLifeTime(G4int Z, G4int A, G4double E) const;
201                                                << 214    // Returns a life time of an ion. -1 for stable ion, and -1001 for ion
202     // Returns a life time of an ion. -1 for s << 215    // that is not listed in G4NuclideTable.
203     // that is not listed in G4NuclideTable    << 216    
204     G4double GetLifeTime(const G4ParticleDefin << 217    G4int                 Entries() const;
205     G4double GetLifeTime(G4int Z, G4int A, G4d << 218    // Return number of ions in the table
206                          G4Ions::G4FloatLevelB << 219 
207     G4double GetLifeTime(G4int Z, G4int A, G4d << 220    G4ParticleDefinition* GetParticle(G4int index) const;
208                                                << 221    // Return the pointer of index-th ion in the table
209     G4ParticleDefinition* GetMuonicAtom(G4Ions << 222  
210     G4ParticleDefinition* GetMuonicAtom(G4int  << 223    G4bool                Contains(const G4ParticleDefinition *particle) const;
211                                                << 224    // Return 'true' if the ion exists
212     // Return number of ions in the table      << 225 
213     G4int Entries() const;                     << 226    void                  Insert(const G4ParticleDefinition* particle);
214                                                << 227    void                  Remove(const G4ParticleDefinition* particle);
215     // Return the pointer of index-th ion in t << 228    // Insert/Remove an ion in the table
216     G4ParticleDefinition* GetParticle(G4int in << 229 
217                                                << 230    void                  clear();
218     // Return 'true' if the ion exists         << 231    // erase all contents in the list (not delete just remove)
219     G4bool Contains(const G4ParticleDefinition << 232 
220                                                << 233    G4int                 size() const;
221     // Insert/Remove an ion in the table       << 234    //  Return number of ions in the table
222     void Insert(const G4ParticleDefinition* pa << 235 
223     void Remove(const G4ParticleDefinition* pa << 236    void DumpTable(const G4String &particle_name = "ALL") const;
224                                                << 237    // dump information of particles specified by name 
225     // Erase all contents in the list (not del << 238 
226     void clear();                              << 239 
227                                                << 240  protected:
228     // Return number of ions in the table      << 241    G4ParticleDefinition* FindIonInMaster(G4int Z, G4int A, G4int lvl=0);
229     G4int size() const;                        << 242    G4ParticleDefinition* FindIonInMaster(G4int Z, G4int A, G4int L, G4int lvl);
230                                                << 243    G4ParticleDefinition* FindIonInMaster(G4int Z, G4int A, G4double E, G4int J=0);
231     // Dump information of particles specified << 244    G4ParticleDefinition* FindIonInMaster(G4int Z, G4int A, G4int L,
232     void DumpTable(const G4String& particle_na << 245          G4double E, G4int J=0);
233                                                << 246 
234   public:                                      << 247    G4ParticleDefinition* CreateIon(G4int Z, G4int A, G4double E);
235     // Needed for MT                           << 248    G4ParticleDefinition* CreateIon(G4int Z, G4int A, G4int L, G4double E);
236     void InitializeLightIons();                << 249    G4ParticleDefinition* CreateIon(G4int Z, G4int A, G4int lvl=0);
237                                                << 250    G4ParticleDefinition* CreateIon(G4int Z, G4int A, G4int L, G4int lvl);
238     // It is very important for multithreaded  << 251 
239     // the particle table pointer and the ion  << 252    void                  InsertWorker(const G4ParticleDefinition* particle);
240     // to let each worker thread hold its own  << 253 
241     // and the ion list. This implementation i << 254    // Obsolete
242     // table thread private. The two shadow po << 255    // G4ParticleDefinition* SlaveCreateIon(G4ParticleDefinition* ion, G4int Z, G4int A, G4double E);
243     // thread to copy the content from the mas << 256    // All threads share the particle table and particles including ions. This method
244     static G4ThreadLocal G4IonList* fIonList;  << 257    // is invoked by any work thread for ions that have been created by other threads
245     static G4ThreadLocal std::vector<G4VIsotop << 258    // to achieve the partial effect when ions are created by other threads.
246     static G4IonList* fIonListShadow;          << 259    // G4ParticleDefinition* SlaveCreateIon(G4ParticleDefinition* ion, G4int Z, G4int A, G4int L, G4double E);
247     static std::vector<G4VIsotopeTable*>* fIso << 260    // All threads share the particle table and particles including ions. This method
248                                                << 261    // is invoked by any work thread for ions that have been created by other threads
249     enum                                       << 262    // to achieve the partial effect when ions are created by other threads.
250     {                                          << 263 
251       numberOfElements = 118                   << 264    // Create Ion 
252     };                                         << 265    
253     static const G4String elementName[numberOf << 266    G4IsotopeProperty* FindIsotope(G4int Z, G4int A, G4double E) const;
                                                   >> 267    G4IsotopeProperty* FindIsotope(G4int Z, G4int A, G4int  lvl) const; 
                                                   >> 268    // Ask properties of isotopes to this G4VIsotopeTable 
                                                   >> 269    
                                                   >> 270    G4ParticleDefinition* GetLightIon(G4int Z, G4int A) const;
                                                   >> 271    G4ParticleDefinition* GetLightAntiIon(G4int Z, G4int A) const;
                                                   >> 272    
                                                   >> 273    G4bool                IsLightIon(const G4ParticleDefinition*) const;
                                                   >> 274    G4bool                IsLightAntiIon(const G4ParticleDefinition*) const;
                                                   >> 275    // return true if the particle is pre-defined ion
                                                   >> 276  
                                                   >> 277    void                  AddProcessManager(G4ParticleDefinition*);
                                                   >> 278    // Add process manager to ions with name of 'ionName'
                                                   >> 279 
                                                   >> 280    G4int                GetVerboseLevel() const;
                                                   >> 281    // get Verbose Level defined in G4ParticleTable
                                                   >> 282 
                                                   >> 283  private:
                                                   >> 284    G4NuclideTable* pNuclideTable;
                                                   >> 285    G4bool         isIsomerCreated;
                                                   >> 286    // Isomer table and flag of creation    
                                                   >> 287  
                                                   >> 288  public:
                                                   >> 289    static G4ThreadLocal G4IonList* fIonList; 
                                                   >> 290    static G4ThreadLocal std::vector<G4VIsotopeTable*> *fIsotopeTableList;
                                                   >> 291    static G4IonList* fIonListShadow; 
                                                   >> 292    static std::vector<G4VIsotopeTable*> *fIsotopeTableListShadow;
                                                   >> 293    // It is very important for multithreaded Geant4 to keep only one copy of the
                                                   >> 294    // particle table pointer and the ion table pointer. However, we try to let 
                                                   >> 295    // each worker thread hold its own copy of the particle dictionary and the 
                                                   >> 296    // ion list. This implementation is equivalent to make the ion table thread
                                                   >> 297    // private. The two shadow ponters are used by each worker thread to copy the
                                                   >> 298    // content from the master thread.
                                                   >> 299    static const G4double tolerance;
                                                   >> 300  
                                                   >> 301    enum { numberOfElements = 118};
                                                   >> 302    static const G4String       elementName[numberOfElements];
                                                   >> 303     
                                                   >> 304    //needed for MT
                                                   >> 305    void InitializeLightIons();
                                                   >> 306 
                                                   >> 307  private:
                                                   >> 308    G4int n_error;
254                                                   309 
255 #ifdef G4MULTITHREADED                            310 #ifdef G4MULTITHREADED
256     static G4Mutex ionTableMutex;              << 311  public:
                                                   >> 312    static G4Mutex ionTableMutex;
257 #endif                                            313 #endif
258                                                << 
259   protected:                                   << 
260     G4ParticleDefinition* FindIonInMaster(G4in << 
261     G4ParticleDefinition* FindIonInMaster(G4in << 
262     G4ParticleDefinition* FindIonInMaster(G4in << 
263                                           G4Io << 
264     G4ParticleDefinition* FindIonInMaster(G4in << 
265                                           G4Io << 
266                                                << 
267     G4ParticleDefinition* CreateIon(G4int Z, G << 
268     G4ParticleDefinition* CreateIon(G4int Z, G << 
269                                     G4Ions::G4 << 
270     G4ParticleDefinition* CreateIon(G4int Z, G << 
271     G4ParticleDefinition* CreateIon(G4int Z, G << 
272                                                << 
273     void InsertWorker(const G4ParticleDefiniti << 
274                                                << 
275     // Create Ion                              << 
276                                                << 
277     G4IsotopeProperty* FindIsotope(G4int Z, G4 << 
278                                    G4Ions::G4F << 
279     G4IsotopeProperty* FindIsotope(G4int Z, G4 << 
280     // Ask properties of isotopes              << 
281                                                << 
282     G4ParticleDefinition* GetLightIon(G4int Z, << 
283     G4ParticleDefinition* GetLightAntiIon(G4in << 
284                                                << 
285     // Return true if the particle is pre-defi << 
286     G4bool IsLightIon(const G4ParticleDefiniti << 
287     G4bool IsLightAntiIon(const G4ParticleDefi << 
288                                                << 
289     // Add process manager to ions with name o << 
290     void AddProcessManager(G4ParticleDefinitio << 
291                                                << 
292     // Get Verbose Level defined in G4Particle << 
293     G4int GetVerboseLevel() const;             << 
294                                                << 
295   private:                                     << 
296     G4NuclideTable* pNuclideTable = nullptr;   << 
297                                                << 
298     // Isomer table and flag of creation       << 
299     G4bool isIsomerCreated = false;            << 
300 };                                                314 };
301                                                   315 
302 // ------------------------                    << 316 inline G4int  G4IonTable::GetNumberOfElements() const
303 // Inline methods                              << 
304 // ------------------------                    << 
305                                                << 
306 inline G4int G4IonTable::GetNumberOfElements() << 
307 {                                                 317 {
308   return numberOfElements;                        318   return numberOfElements;
309 }                                                 319 }
310                                                   320 
311 #endif                                            321 #endif
312                                                   322