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1 ] [ 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 /materials/include/G4Element.hh (Version 11.3.0) and /materials/include/G4Element.hh (Version 9.5.p2)


  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 //
                                                   >>  26 //
                                                   >>  27 // $Id: G4Element.hh,v 1.28 2010-04-30 13:19:26 vnivanch Exp $
                                                   >>  28 // GEANT4 tag $Name: not supported by cvs2svn $
                                                   >>  29 //
 25                                                    30 
 26 //--------------------------------------------     31 //---------------------------------------------------------------------------
 27 //                                                 32 //
 28 // ClassName:   G4Element                          33 // ClassName:   G4Element
 29 //                                                 34 //
 30 // Description: Contains element properties        35 // Description: Contains element properties
 31 //                                                 36 //
 32 // Class description:                              37 // Class description:
 33 //                                                 38 //
 34 // An element is a chemical element either dir     39 // An element is a chemical element either directly defined in terms of
 35 // its characteristics: its name, symbol,          40 // its characteristics: its name, symbol,
 36 //                      Z (effective atomic nu     41 //                      Z (effective atomic number)
 37 //                      N (effective number of     42 //                      N (effective number of nucleons)
 38 //                      A (effective mass of a     43 //                      A (effective mass of a mole)
 39 // or in terms of a collection of constituent  <<  44 // or in terms of a collection of constituent isotopes with specified 
 40 // relative abundance (i.e. fraction of nb of      45 // relative abundance (i.e. fraction of nb of atoms per volume).
 41 //                                                 46 //
 42 // Quantities, with physical meaning or not, w <<  47 // Quantities, with physical meaning or not, which are constant in a given 
 43 // element are computed and stored here as Der     48 // element are computed and stored here as Derived data members.
 44 //                                                 49 //
 45 // The class contains as a private static memb     50 // The class contains as a private static member the table of defined
 46 // elements (an ordered vector of elements).       51 // elements (an ordered vector of elements).
 47 //                                                 52 //
 48 // Elements can be assembled singly or in mixt     53 // Elements can be assembled singly or in mixtures into materials used
 49 // in volume definitions via the G4Material cl     54 // in volume definitions via the G4Material class.
 50 //                                                 55 //
 51 // It is strongly recommended do not delete G4     56 // It is strongly recommended do not delete G4Element instance in the
 52 // user code. All G4Elements will be automatic <<  57 // user code. All G4Elements will be automatically deleted at the end 
 53 // of Geant4 session                               58 // of Geant4 session
 54                                                    59 
                                                   >>  60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >>  61 
 55 // 09-07-96, new data members added by L.Urban     62 // 09-07-96, new data members added by L.Urban
 56 // 17-01-97, aesthetic rearrangement, M.Maire      63 // 17-01-97, aesthetic rearrangement, M.Maire
 57 // 20-01-97, Tsai formula for the rad length,      64 // 20-01-97, Tsai formula for the rad length, M.Maire
 58 // 21-01-97, remove mixture flag, M.Maire          65 // 21-01-97, remove mixture flag, M.Maire
 59 // 24-01-97, new data member: fTaul                66 // 24-01-97, new data member: fTaul
 60 //           new method: ComputeIonisationPara     67 //           new method: ComputeIonisationPara, M.Maire
 61 // 20-03-97, corrected initialization of point     68 // 20-03-97, corrected initialization of pointers, M.Maire
 62 // 27-06-97, new function GetIsotope(int), M.M     69 // 27-06-97, new function GetIsotope(int), M.Maire
 63 // 24-02-98, fWeightVector becomes fRelativeAb     70 // 24-02-98, fWeightVector becomes fRelativeAbundanceVector
 64 // 27-04-98, atomic shell stuff, V. Grichine       71 // 27-04-98, atomic shell stuff, V. Grichine
 65 // 09-07-98, Ionisation parameters removed fro     72 // 09-07-98, Ionisation parameters removed from the class, M.Maire
 66 // 04-08-98, new method GetElement(elementName     73 // 04-08-98, new method GetElement(elementName), M.Maire
 67 // 16-11-98, Subshell -> Shell, mma                74 // 16-11-98, Subshell -> Shell, mma
 68 // 30-03-01, suppression of the warning messag     75 // 30-03-01, suppression of the warning message in GetElement
 69 // 17-07-01, migration to STL, M. Verderi          76 // 17-07-01, migration to STL, M. Verderi
 70 // 13-09-01, stl migration. Suppression of the     77 // 13-09-01, stl migration. Suppression of the data member fIndexInTable
 71 // 14-09-01, fCountUse: nb of materials which      78 // 14-09-01, fCountUse: nb of materials which use this element
 72 // 26-02-02, fIndexInTable renewed             <<  79 // 26-02-02, fIndexInTable renewed 
 73 // 01-04-05, new data member fIndexZ to count      80 // 01-04-05, new data member fIndexZ to count the number of elements with same Z
 74 // 17-10-06: Add Get/Set fNaturalAbundance (V. <<  81 // 17-10-06: Add Get/Set fNaturalAbandances (V.Ivanchenko)
 75 // 17.09.09, add fNbOfShellElectrons and metho     82 // 17.09.09, add fNbOfShellElectrons and methods (V. Grichine)
                                                   >>  83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 76                                                    84 
 77 #ifndef G4ELEMENT_HH                               85 #ifndef G4ELEMENT_HH
 78 #define G4ELEMENT_HH 1                             86 #define G4ELEMENT_HH 1
 79                                                    87 
 80 #include "G4ElementTable.hh"                   <<  88 #include "globals.hh"
 81 #include "G4ElementVector.hh"                  <<  89 #include <vector>
 82 #include "G4IonisParamElm.hh"                  <<  90 #include "G4ios.hh"
 83 #include "G4Isotope.hh"                            91 #include "G4Isotope.hh"
                                                   >>  92 #include "G4IonisParamElm.hh"
 84 #include "G4IsotopeVector.hh"                      93 #include "G4IsotopeVector.hh"
 85 #include "G4ios.hh"                            <<  94 #include "G4ElementTable.hh"
 86 #include "globals.hh"                          << 
 87                                                    95 
 88 #include <vector>                              <<  96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 89                                                    97 
 90 class G4Element                                    98 class G4Element
 91 {                                                  99 {
 92  public:  // with description                  << 100 public:  // with description
 93   // Constructor to Build an element directly; << 
 94   G4Element(const G4String& name,  // its name << 
 95     const G4String& symbol,  // its symbol     << 
 96     G4double Zeff,  // atomic number           << 
 97     G4double Aeff);  // mass of mole           << 
 98                                                   101 
                                                   >> 102   //
                                                   >> 103   // Constructor to Build an element directly; no reference to isotopes
                                                   >> 104   //
                                                   >> 105   G4Element(const G4String& name,   //its name
                                                   >> 106             const G4String& symbol,   //its symbol
                                                   >> 107                   G4double  Zeff,   //atomic number
                                                   >> 108                   G4double  Aeff);    //mass of mole
                                                   >> 109                   
                                                   >> 110   //
 99   // Constructor to Build an element from isot    111   // Constructor to Build an element from isotopes via AddIsotope
100   G4Element(const G4String& name,  // its name << 112   //
101     const G4String& symbol,  // its symbol     << 113   G4Element(const G4String& name,   //its name
102     G4int nbIsotopes);  // nb of isotopes      << 114             const G4String& symbol,   //its symbol
103                                                << 115             G4int nbIsotopes);      //nb of isotopes
104   virtual ~G4Element();                        << 
105                                                << 
106   G4Element(G4Element&) = delete;              << 
107   const G4Element& operator=(const G4Element&) << 
108                                                   116 
                                                   >> 117   //
109   // Add an isotope to the element                118   // Add an isotope to the element
110   void AddIsotope(G4Isotope* isotope,  // isot << 119   // 
111     G4double RelativeAbundance);  // fraction  << 120   void AddIsotope(G4Isotope* isotope,     //isotope 
112                                   // atomes pe << 121                   G4double   RelativeAbundance);  //fraction of nb of 
113                                                << 122                             //atomes per volume
114   // Retrieval methods                         << 123   virtual ~G4Element();
115   inline const G4String& GetName() const { ret << 124   
116   inline const G4String& GetSymbol() const { r << 125   //
117                                                << 126   // retrieval methods
118   // Atomic number                             << 127   //
119   inline G4double GetZ() const { return fZeff; << 128   inline const G4String& GetName()   const {return fName;}
120   inline G4int GetZasInt() const { return fZ;  << 129   inline const G4String& GetSymbol() const {return fSymbol;}
121                                                << 130   inline G4double GetZ()      const {return fZeff;}     //atomic number
122   // Atomic weight in atomic units             << 131   inline G4double GetN()      const {return fNeff;}     //number of nucleons
123   inline G4double GetN() const { return fNeff; << 132   inline G4double GetA()      const {return fAeff;}     //mass of a mole
124   inline G4double GetAtomicMassAmu() const { r << 133 
125                                                << 134   inline G4bool   GetNaturalAbandancesFlag();
126   // Mass of a mole in Geant4 units for atoms  << 135 
127   inline G4double GetA() const { return fAeff; << 136   inline void     SetNaturalAbandancesFlag(G4bool);
128                                                << 137   
129   inline G4bool GetNaturalAbundanceFlag() cons << 138   //the number of atomic shells in this element:
130                                                << 139   //
131   inline void SetNaturalAbundanceFlag(G4bool); << 140   inline G4int GetNbOfAtomicShells() const {return fNbOfAtomicShells;}
132                                                << 141   
133   // the number of atomic shells in this eleme << 142   //the binding energy of the shell, ground shell index=0
134   inline G4int GetNbOfAtomicShells() const { r << 143   //
135                                                << 
136   // the binding energy of the shell, ground s << 
137   G4double GetAtomicShell(G4int index) const;     144   G4double GetAtomicShell(G4int index) const;
138                                                   145 
139   // the number of electrons at the shell, gro << 146   //the number of electrons at the shell, ground shell index=0
                                                   >> 147   //
140   G4int GetNbOfShellElectrons(G4int index) con    148   G4int GetNbOfShellElectrons(G4int index) const;
                                                   >> 149     
                                                   >> 150   //number of isotopes constituing this element:
                                                   >> 151   //
                                                   >> 152   inline size_t GetNumberOfIsotopes() const {return fNumberOfIsotopes;}
                                                   >> 153    
                                                   >> 154   //vector of pointers to isotopes constituing this element:
                                                   >> 155   //
                                                   >> 156   inline G4IsotopeVector* GetIsotopeVector() const {return theIsotopeVector;}
                                                   >> 157     
                                                   >> 158   //vector of relative abundance of each isotope:
                                                   >> 159   //
                                                   >> 160   inline G4double* GetRelativeAbundanceVector() const 
                                                   >> 161                    {return fRelativeAbundanceVector;}
                                                   >> 162     
                                                   >> 163   inline const G4Isotope* GetIsotope(G4int iso) const 
                                                   >> 164                    {return (*theIsotopeVector)[iso];}
                                                   >> 165 
                                                   >> 166   //the (static) Table of Elements:
                                                   >> 167   //
                                                   >> 168   static 
                                                   >> 169   const  G4ElementTable* GetElementTable();
                                                   >> 170   
                                                   >> 171   static 
                                                   >> 172   size_t GetNumberOfElements();
                                                   >> 173   
                                                   >> 174   //the index of this element in the Table:
                                                   >> 175   //
                                                   >> 176   inline size_t GetIndex() const {return fIndexInTable;}
                                                   >> 177     
                                                   >> 178   //return pointer to an element, given its name:
                                                   >> 179   //
                                                   >> 180   static
                                                   >> 181   G4Element* GetElement(G4String name, G4bool warning=true);
                                                   >> 182   
                                                   >> 183   //count number of materials which use this element
                                                   >> 184   //
                                                   >> 185   inline G4int GetCountUse() const {return fCountUse;}
                                                   >> 186   inline void  increaseCountUse()  {fCountUse++;}
                                                   >> 187   inline void  decreaseCountUse()  {fCountUse--;}
                                                   >> 188   
                                                   >> 189   //count elements with same Z
                                                   >> 190   //
                                                   >> 191   inline G4int GetIndexZ() const {return fIndexZ;}
                                                   >> 192         
                                                   >> 193   //Coulomb correction factor:
                                                   >> 194   //
                                                   >> 195   inline G4double GetfCoulomb() const {return fCoulomb;}
                                                   >> 196    
                                                   >> 197   //Tsai formula for the radiation length:
                                                   >> 198   //
                                                   >> 199   inline G4double GetfRadTsai() const {return fRadTsai;}
                                                   >> 200     
                                                   >> 201   //pointer to ionisation parameters:
                                                   >> 202   //
                                                   >> 203   inline G4IonisParamElm* GetIonisation() const {return fIonisation;}
                                                   >> 204     
                                                   >> 205   // printing methods
                                                   >> 206   //    
                                                   >> 207   friend std::ostream& operator<<(std::ostream&, G4Element*);    
                                                   >> 208   friend std::ostream& operator<<(std::ostream&, G4Element&);    
                                                   >> 209   friend std::ostream& operator<<(std::ostream&, G4ElementTable);
141                                                   210 
142   // number of isotopes constituing this eleme << 211 public:  // without description
143   inline std::size_t GetNumberOfIsotopes() con << 
144                                                << 
145   // vector of pointers to isotopes constituin << 
146   inline G4IsotopeVector* GetIsotopeVector() c << 
147                                                << 
148   // vector of relative abundance of each isot << 
149   inline G4double* GetRelativeAbundanceVector( << 
150                                                << 
151   inline const G4Isotope* GetIsotope(G4int iso << 
152                                                << 
153   // the (static) Table of Elements:           << 
154   static const G4ElementTable* GetElementTable << 
155                                                << 
156   static std::size_t GetNumberOfElements();    << 
157                                                << 
158   // the index of this element in the Table:   << 
159   inline std::size_t GetIndex() const { return << 
160                                                << 
161   // return pointer to an element, given its n << 
162   static G4Element* GetElement(const G4String& << 
163                                                << 
164   // Coulomb correction factor:                << 
165   inline G4double GetfCoulomb() const { return << 
166                                                   212 
167   // Tsai formula for the radiation length:    << 213   G4int operator==(const G4Element&) const;
168   inline G4double GetfRadTsai() const { return << 214   G4int operator!=(const G4Element&) const;
169                                                   215 
170   // pointer to ionisation parameters:         << 216   G4Element(__void__&);
171   inline G4IonisParamElm* GetIonisation() cons << 217     // Fake default constructor for usage restricted to direct object
                                                   >> 218     // persistency for clients requiring preallocation of memory for
                                                   >> 219     // persistifiable objects.
172                                                   220 
173   // printing methods                          << 221   inline void SetName(const G4String& name)  {fName=name;}
174   friend std::ostream& operator<<(std::ostream << 
175   friend std::ostream& operator<<(std::ostream << 
176   friend std::ostream& operator<<(std::ostream << 
177   friend std::ostream& operator<<(std::ostream << 
178                                                   222 
179   inline void SetName(const G4String& name) {  << 223 private:
180                                                   224 
181   G4bool operator==(const G4Element&) const =  << 225   G4Element(G4Element&);
182   G4bool operator!=(const G4Element&) const =  << 226   const G4Element & operator=(const G4Element&);
                                                   >> 227        
                                                   >> 228 private:
183                                                   229 
184  private:                                      << 
185   void InitializePointers();                      230   void InitializePointers();
186   void ComputeDerivedQuantities();                231   void ComputeDerivedQuantities();
187   void ComputeCoulombFactor();                    232   void ComputeCoulombFactor();
188   void ComputeLradTsaiFactor();                   233   void ComputeLradTsaiFactor();
189   void AddNaturalIsotopes();                   << 
190                                                   234 
191   // Mutable access to the element table.      << 235 private:
192   static G4ElementTable& GetElementTableRef(); << 
193                                                   236 
                                                   >> 237   //
194   // Basic data members (which define an Eleme    238   // Basic data members (which define an Element)
195                                                << 239   //
196   G4String fName;  // name                     << 240   G4String fName;              // name
197   G4String fSymbol;  // symbol                 << 241   G4String fSymbol;            // symbol
198   G4double fZeff;  // Effective atomic number  << 242   G4double fZeff;              // Effective atomic number
199   G4double fNeff;  // Effective number of nucl << 243   G4double fNeff;              // Effective number of nucleons
200   G4double fAeff;  // Effective mass of a mole << 244   G4double fAeff;              // Effective mass of a mole
201   G4int fZ;                                    << 245     
202                                                << 246   G4int fNbOfAtomicShells;     // number  of atomic shells
203   G4int fNbOfAtomicShells;  // number  of atom << 247   G4double* fAtomicShells ;    // Pointer to atomic shell binding energies
204   G4double* fAtomicShells;  // Pointer to atom << 248   G4int* fNbOfShellElectrons; // pointer to the number of subshell electrons
205   G4int* fNbOfShellElectrons;  // Pointer to t << 249     
206                                                << 250   // Isotope vector contains constituent isotopes of the element   
207   G4int fNumberOfIsotopes;  // Number of isoto << 251   size_t fNumberOfIsotopes;    // Number of isotopes added to the element
208   G4IsotopeVector* theIsotopeVector;  // vecto << 252   G4IsotopeVector* theIsotopeVector;
209   G4double* fRelativeAbundanceVector;  // Frac << 253   G4double* fRelativeAbundanceVector;     // Fraction nb of atomes per volume
210                                        // for  << 254                                           // for each constituent
211                                                << 255   G4int fCountUse;          // nb of materials which use this element
                                                   >> 256   G4int fIndexZ;            // index for elements with same Z
                                                   >> 257     
212   // Set up the static Table of Elements          258   // Set up the static Table of Elements
213   std::size_t fIndexInTable;                   << 259   static G4ElementTable theElementTable;
214   G4bool fNaturalAbundance;                    << 260   size_t fIndexInTable;
                                                   >> 261   G4bool fNaturalAbandances;
215                                                   262 
                                                   >> 263   //
216   // Derived data members (computed from the b    264   // Derived data members (computed from the basic data members)
217                                                << 265   //
218   G4double fCoulomb;  // Coulomb correction fa << 266   G4double fCoulomb;             // Coulomb correction factor
219   G4double fRadTsai;  // Tsai formula for the  << 267   G4double fRadTsai;             // Tsai formula for the radiation length
220   G4IonisParamElm* fIonisation;  // Pointer to    268   G4IonisParamElm* fIonisation;  // Pointer to ionisation parameters
221 };                                                269 };
222                                                   270 
223 inline G4bool G4Element::GetNaturalAbundanceFl << 271 inline G4bool G4Element::GetNaturalAbandancesFlag()
                                                   >> 272 {
                                                   >> 273   return fNaturalAbandances;
                                                   >> 274 }
                                                   >> 275 
                                                   >> 276 inline void G4Element::SetNaturalAbandancesFlag(G4bool val)
                                                   >> 277 {
                                                   >> 278   fNaturalAbandances = val;
                                                   >> 279 }
224                                                   280 
225 inline void G4Element::SetNaturalAbundanceFlag << 281 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
226                                                   282 
227 #endif                                            283 #endif
228                                                   284