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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 4.0.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                    <<   3 // * DISCLAIMER                                                       *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th <<   5 // * The following disclaimer summarizes all the specific disclaimers *
  6 // * the Geant4 Collaboration.  It is provided <<   6 // * of contributors to this software. The specific disclaimers,which *
  7 // * conditions of the Geant4 Software License <<   7 // * govern, are listed with their locations in:                      *
  8 // * LICENSE and available at  http://cern.ch/ <<   8 // *   http://cern.ch/geant4/license                                  *
  9 // * include a list of copyright holders.      << 
 10 // *                                                9 // *                                                                  *
 11 // * Neither the authors of this software syst     10 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     11 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     12 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     13 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  <<  14 // * use.                                                             *
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                               15 // *                                                                  *
 18 // * This  code  implementation is the result  <<  16 // * This  code  implementation is the  intellectual property  of the *
 19 // * technical work of the GEANT4 collaboratio <<  17 // * GEANT4 collaboration.                                            *
 20 // * By using,  copying,  modifying or  distri <<  18 // * By copying,  distributing  or modifying the Program (or any work *
 21 // * any work based  on the software)  you  ag <<  19 // * based  on  the Program)  you indicate  your  acceptance of  this *
 22 // * use  in  resulting  scientific  publicati <<  20 // * statement, and all its terms.                                    *
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // *******************************************     21 // ********************************************************************
 25                                                << 
 26 //-------------------------------------------- << 
 27 //                                                 22 //
 28 // ClassName:   G4Element                      << 
 29 //                                                 23 //
 30 // Description: Contains element properties    <<  24 // $Id: G4Element.hh,v 1.15 2001/10/17 14:02:15 gcosmo Exp $
                                                   >>  25 // GEANT4 tag $Name: geant4-04-00 $
 31 //                                                 26 //
 32 // Class description:                          <<  27 
                                                   >>  28 // class description
 33 //                                                 29 //
 34 // An element is a chemical element either dir     30 // An element is a chemical element either directly defined in terms of
 35 // its characteristics: its name, symbol,      <<  31 // its charactaristics: its name, symbol,
 36 //                      Z (effective atomic nu     32 //                      Z (effective atomic number)
 37 //                      N (effective number of     33 //                      N (effective number of nucleons)
 38 //                      A (effective mass of a     34 //                      A (effective mass of a mole)
 39 // or in terms of a collection of constituent  <<  35 // or in terms of a collection of constituent isotopes with specified 
 40 // relative abundance (i.e. fraction of nb of  <<  36 // relative abundance (i.e. fraction of nb of atomes per volume).
 41 //                                                 37 //
 42 // Quantities, with physical meaning or not, w <<  38 // Quantities, with physical meaning or not, which are constant in a given 
 43 // element are computed and stored here as Der     39 // element are computed and stored here as Derived data members.
 44 //                                                 40 //
 45 // The class contains as a private static memb     41 // The class contains as a private static member the table of defined
 46 // elements (an ordered vector of elements).       42 // elements (an ordered vector of elements).
 47 //                                                 43 //
 48 // Elements can be assembled singly or in mixt     44 // Elements can be assembled singly or in mixtures into materials used
 49 // in volume definitions via the G4Material cl     45 // in volume definitions via the G4Material class.
 50 //                                                 46 //
 51 // It is strongly recommended do not delete G4 <<  47 
 52 // user code. All G4Elements will be automatic <<  48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 53 // of Geant4 session                           << 
 54                                                    49 
 55 // 09-07-96, new data members added by L.Urban     50 // 09-07-96, new data members added by L.Urban
 56 // 17-01-97, aesthetic rearrangement, M.Maire      51 // 17-01-97, aesthetic rearrangement, M.Maire
 57 // 20-01-97, Tsai formula for the rad length,      52 // 20-01-97, Tsai formula for the rad length, M.Maire
 58 // 21-01-97, remove mixture flag, M.Maire          53 // 21-01-97, remove mixture flag, M.Maire
 59 // 24-01-97, new data member: fTaul                54 // 24-01-97, new data member: fTaul
 60 //           new method: ComputeIonisationPara     55 //           new method: ComputeIonisationPara, M.Maire
 61 // 20-03-97, corrected initialization of point     56 // 20-03-97, corrected initialization of pointers, M.Maire
 62 // 27-06-97, new function GetIsotope(int), M.M     57 // 27-06-97, new function GetIsotope(int), M.Maire
 63 // 24-02-98, fWeightVector becomes fRelativeAb     58 // 24-02-98, fWeightVector becomes fRelativeAbundanceVector
 64 // 27-04-98, atomic shell stuff, V. Grichine       59 // 27-04-98, atomic shell stuff, V. Grichine
 65 // 09-07-98, Ionisation parameters removed fro     60 // 09-07-98, Ionisation parameters removed from the class, M.Maire
 66 // 04-08-98, new method GetElement(elementName     61 // 04-08-98, new method GetElement(elementName), M.Maire
 67 // 16-11-98, Subshell -> Shell, mma                62 // 16-11-98, Subshell -> Shell, mma
 68 // 30-03-01, suppression of the warning messag     63 // 30-03-01, suppression of the warning message in GetElement
 69 // 17-07-01, migration to STL, M. Verderi          64 // 17-07-01, migration to STL, M. Verderi
 70 // 13-09-01, stl migration. Suppression of the     65 // 13-09-01, stl migration. Suppression of the data member fIndexInTable
 71 // 14-09-01, fCountUse: nb of materials which  <<  66 // 14-09-01, fCountUse: nb of materials which use this element 
 72 // 26-02-02, fIndexInTable renewed             <<  67 
 73 // 01-04-05, new data member fIndexZ to count  <<  68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 74 // 17-10-06: Add Get/Set fNaturalAbundance (V. << 
 75 // 17.09.09, add fNbOfShellElectrons and metho << 
 76                                                    69 
 77 #ifndef G4ELEMENT_HH                               70 #ifndef G4ELEMENT_HH
 78 #define G4ELEMENT_HH 1                         <<  71 #define G4ELEMENT_HH
 79                                                    72 
 80 #include "G4ElementTable.hh"                   <<  73 #include "globals.hh"
 81 #include "G4ElementVector.hh"                  <<  74 #include "g4std/vector"
 82 #include "G4IonisParamElm.hh"                  <<  75 #include "G4ios.hh"
 83 #include "G4Isotope.hh"                            76 #include "G4Isotope.hh"
                                                   >>  77 #include "G4AtomicShells.hh"
                                                   >>  78 #include "G4IonisParamElm.hh"
 84 #include "G4IsotopeVector.hh"                      79 #include "G4IsotopeVector.hh"
 85 #include "G4ios.hh"                            <<  80 #include "G4ElementTable.hh"
 86 #include "globals.hh"                          << 
 87                                                    81 
 88 #include <vector>                              <<  82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 89                                                    83 
 90 class G4Element                                    84 class G4Element
 91 {                                                  85 {
 92  public:  // with description                  <<  86 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                                                    87 
                                                   >>  88   //
                                                   >>  89   // Constructor to Build an element directly; no reference to isotopes
                                                   >>  90   //
                                                   >>  91   G4Element(const G4String& name,   //its name
                                                   >>  92             const G4String& symbol,   //its symbol
                                                   >>  93                   G4double  Zeff,   //atomic number
                                                   >>  94                   G4double  Aeff);    //mass of mole
                                                   >>  95                   
                                                   >>  96   //
 99   // Constructor to Build an element from isot     97   // Constructor to Build an element from isotopes via AddIsotope
100   G4Element(const G4String& name,  // its name <<  98   //
101     const G4String& symbol,  // its symbol     <<  99   G4Element(const G4String& name,   //its name
102     G4int nbIsotopes);  // nb of isotopes      << 100             const G4String& symbol,   //its symbol
103                                                << 101             G4int nbIsotopes);      //nb of isotopes
104   virtual ~G4Element();                        << 
105                                                << 
106   G4Element(G4Element&) = delete;              << 
107   const G4Element& operator=(const G4Element&) << 
108                                                   102 
                                                   >> 103   //
109   // Add an isotope to the element                104   // Add an isotope to the element
110   void AddIsotope(G4Isotope* isotope,  // isot << 105   // 
111     G4double RelativeAbundance);  // fraction  << 106   void AddIsotope(G4Isotope* isotope,     //isotope 
112                                   // atomes pe << 107                   G4double   RelativeAbundance);  //fraction of nb of 
113                                                << 108                             //atomes per volume
114   // Retrieval methods                         << 109   virtual ~G4Element();
115   inline const G4String& GetName() const { ret << 110   
116   inline const G4String& GetSymbol() const { r << 111   //
117                                                << 112   // retrieval methods
118   // Atomic number                             << 113   //
119   inline G4double GetZ() const { return fZeff; << 114   G4String GetName()   const {return fName;};
120   inline G4int GetZasInt() const { return fZ;  << 115   G4String GetSymbol() const {return fSymbol;};
121                                                << 116   G4double GetZ()      const {return fZeff;};     //atomic number
122   // Atomic weight in atomic units             << 117   G4double GetN()      const {return fNeff;};     //number of nucleons
123   inline G4double GetN() const { return fNeff; << 118   G4double GetA()      const {return fAeff;};     //mass of a mole
124   inline G4double GetAtomicMassAmu() const { r << 119   
125                                                << 120   //the number of atomic shells in this element:
126   // Mass of a mole in Geant4 units for atoms  << 121   //
127   inline G4double GetA() const { return fAeff; << 122   G4int GetNbOfAtomicShells() const {return fNbOfAtomicShells;};
128                                                << 123   
129   inline G4bool GetNaturalAbundanceFlag() cons << 124   //the binding energy of the shell:
130                                                << 125   //
131   inline void SetNaturalAbundanceFlag(G4bool); << 126   G4double GetAtomicShell(G4int) const;
132                                                << 127     
133   // the number of atomic shells in this eleme << 128   //number of isotopes constituing this element:
134   inline G4int GetNbOfAtomicShells() const { r << 129   //
135                                                << 130   size_t GetNumberOfIsotopes() const {return fNumberOfIsotopes;};
136   // the binding energy of the shell, ground s << 131    
137   G4double GetAtomicShell(G4int index) const;  << 132   //vector of pointers to isotopes constituing this element:
138                                                << 133   //
139   // the number of electrons at the shell, gro << 134   G4IsotopeVector* GetIsotopeVector() const {return theIsotopeVector;};
140   G4int GetNbOfShellElectrons(G4int index) con << 135     
141                                                << 136   //vector of relative abundance of each isotope:
142   // number of isotopes constituing this eleme << 137   //
143   inline std::size_t GetNumberOfIsotopes() con << 138   G4double* GetRelativeAbundanceVector() const 
144                                                << 139                    {return fRelativeAbundanceVector;};
145   // vector of pointers to isotopes constituin << 140     
146   inline G4IsotopeVector* GetIsotopeVector() c << 141   const G4Isotope* GetIsotope(G4int iso) const 
147                                                << 142                    {return (*theIsotopeVector)[iso];};
148   // vector of relative abundance of each isot << 143 
149   inline G4double* GetRelativeAbundanceVector( << 144   //the (static) Table of Elements:
150                                                << 145   //
151   inline const G4Isotope* GetIsotope(G4int iso << 146   static 
152                                                << 147   const  G4ElementTable* GetElementTable();
153   // the (static) Table of Elements:           << 148   
154   static const G4ElementTable* GetElementTable << 149   static 
155                                                << 150   size_t GetNumberOfElements();
156   static std::size_t GetNumberOfElements();    << 151   
157                                                << 152   //the index of this element in the Table:
158   // the index of this element in the Table:   << 153   //
159   inline std::size_t GetIndex() const { return << 154   size_t GetIndex() const;
160                                                << 155     
161   // return pointer to an element, given its n << 156   //return pointer to an element, given its name:
162   static G4Element* GetElement(const G4String& << 157   //
163                                                << 158   static
164   // Coulomb correction factor:                << 159   G4Element* GetElement(G4String name);
165   inline G4double GetfCoulomb() const { return << 160   
166                                                << 161   //count number of materials which use this element
167   // Tsai formula for the radiation length:    << 162   //
168   inline G4double GetfRadTsai() const { return << 163   G4int GetCountUse() const {return fCountUse;};
169                                                << 164   void  increaseCountUse()  {fCountUse++;};
170   // pointer to ionisation parameters:         << 165   void  decreaseCountUse()  {fCountUse--;};
171   inline G4IonisParamElm* GetIonisation() cons << 166       
172                                                << 167   //Coulomb correction factor:
                                                   >> 168   //
                                                   >> 169   G4double GetfCoulomb() const {return fCoulomb;};
                                                   >> 170    
                                                   >> 171   //Tsai formula for the radiation length:
                                                   >> 172   //
                                                   >> 173   G4double GetfRadTsai() const {return fRadTsai;};
                                                   >> 174     
                                                   >> 175   //pointer to ionisation parameters:
                                                   >> 176   //
                                                   >> 177   G4IonisParamElm* GetIonisation() const {return fIonisation;};
                                                   >> 178     
173   // printing methods                             179   // printing methods
174   friend std::ostream& operator<<(std::ostream << 180   //    
175   friend std::ostream& operator<<(std::ostream << 181   friend G4std::ostream& operator<<(G4std::ostream&, G4Element*);    
176   friend std::ostream& operator<<(std::ostream << 182   friend G4std::ostream& operator<<(G4std::ostream&, G4Element&);    
177   friend std::ostream& operator<<(std::ostream << 183   friend G4std::ostream& operator<<(G4std::ostream&, G4ElementTable);
178                                                << 184 
179   inline void SetName(const G4String& name) {  << 185 public:  // without description
                                                   >> 186 
                                                   >> 187   G4int operator==(const G4Element&) const;
                                                   >> 188   G4int operator!=(const G4Element&) const;
                                                   >> 189 
                                                   >> 190 private:
                                                   >> 191 
                                                   >> 192   G4Element(G4Element&);
                                                   >> 193   const G4Element & operator=(const G4Element&);
                                                   >> 194        
                                                   >> 195 private:
180                                                   196 
181   G4bool operator==(const G4Element&) const =  << 
182   G4bool operator!=(const G4Element&) const =  << 
183                                                << 
184  private:                                      << 
185   void InitializePointers();                      197   void InitializePointers();
186   void ComputeDerivedQuantities();                198   void ComputeDerivedQuantities();
187   void ComputeCoulombFactor();                    199   void ComputeCoulombFactor();
188   void ComputeLradTsaiFactor();                   200   void ComputeLradTsaiFactor();
189   void AddNaturalIsotopes();                   << 
190                                                   201 
191   // Mutable access to the element table.      << 202 private:
192   static G4ElementTable& GetElementTableRef(); << 
193                                                   203 
                                                   >> 204   //
194   // Basic data members (which define an Eleme    205   // Basic data members (which define an Element)
195                                                << 206   //
196   G4String fName;  // name                     << 207   G4String fName;              // name
197   G4String fSymbol;  // symbol                 << 208   G4String fSymbol;            // symbol
198   G4double fZeff;  // Effective atomic number  << 209   G4double fZeff;              // Effective atomic number
199   G4double fNeff;  // Effective number of nucl << 210   G4double fNeff;              // Effective number of nucleons
200   G4double fAeff;  // Effective mass of a mole << 211   G4double fAeff;              // Effective mass of a mole
201   G4int fZ;                                    << 212     
202                                                << 213   G4int fNbOfAtomicShells;     // number  of atomic shells
203   G4int fNbOfAtomicShells;  // number  of atom << 214   G4double* fAtomicShells ;    // Pointer to atomic shell binding energies
204   G4double* fAtomicShells;  // Pointer to atom << 215     
205   G4int* fNbOfShellElectrons;  // Pointer to t << 216   // Isotope vector contains constituent isotopes of the element   
206                                                << 217   size_t fNumberOfIsotopes;    // Number of isotopes added to the element
207   G4int fNumberOfIsotopes;  // Number of isoto << 218   G4IsotopeVector* theIsotopeVector;
208   G4IsotopeVector* theIsotopeVector;  // vecto << 219   G4double* fRelativeAbundanceVector;     // Fraction nb of atomes per volume
209   G4double* fRelativeAbundanceVector;  // Frac << 220                                           // for each constituent
210                                        // for  << 221   G4int fCountUse;          // nb of materials which use this element
211                                                << 222   
212   // Set up the static Table of Elements          223   // Set up the static Table of Elements
213   std::size_t fIndexInTable;                   << 224   static G4ElementTable theElementTable;
214   G4bool fNaturalAbundance;                    << 
215                                                   225 
                                                   >> 226   //
216   // Derived data members (computed from the b    227   // Derived data members (computed from the basic data members)
217                                                << 228   //
218   G4double fCoulomb;  // Coulomb correction fa << 229   G4double fCoulomb;             // Coulomb correction factor
219   G4double fRadTsai;  // Tsai formula for the  << 230   G4double fRadTsai;             // Tsai formula for the radiation length
220   G4IonisParamElm* fIonisation;  // Pointer to    231   G4IonisParamElm* fIonisation;  // Pointer to ionisation parameters
221 };                                                232 };
222                                                   233 
223 inline G4bool G4Element::GetNaturalAbundanceFl << 234 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 235 
                                                   >> 236 inline
                                                   >> 237 size_t G4Element::GetIndex() const
                                                   >> 238 {  
                                                   >> 239   // return the index of this Element in theElementTable
                                                   >> 240   //
                                                   >> 241   size_t J=0, Jmax=theElementTable.size();
                                                   >> 242   while ((J<Jmax)&&(theElementTable[J] != this)) J++;  
                                                   >> 243 
                                                   >> 244   if (J==Jmax) G4Exception("G4Element::GetIndex() Element not in ElementTable");
                                                   >> 245   
                                                   >> 246   return J;        
                                                   >> 247 }
224                                                   248 
225 inline void G4Element::SetNaturalAbundanceFlag << 249 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
226                                                   250 
227 #endif                                            251 #endif
228                                                   252