Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4Element.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27//
28
29//---------------------------------------------------------------------------
30//
31// ClassName: G4Element
32//
33// Description: Contains element properties
34//
35// Class description:
36//
37// An element is a chemical element either directly defined in terms of
38// its characteristics: its name, symbol,
39// Z (effective atomic number)
40// N (effective number of nucleons)
41// A (effective mass of a mole)
42// or in terms of a collection of constituent isotopes with specified
43// relative abundance (i.e. fraction of nb of atoms per volume).
44//
45// Quantities, with physical meaning or not, which are constant in a given
46// element are computed and stored here as Derived data members.
47//
48// The class contains as a private static member the table of defined
49// elements (an ordered vector of elements).
50//
51// Elements can be assembled singly or in mixtures into materials used
52// in volume definitions via the G4Material class.
53//
54// It is strongly recommended do not delete G4Element instance in the
55// user code. All G4Elements will be automatically deleted at the end
56// of Geant4 session
57
58//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
59
60// 09-07-96, new data members added by L.Urban
61// 17-01-97, aesthetic rearrangement, M.Maire
62// 20-01-97, Tsai formula for the rad length, M.Maire
63// 21-01-97, remove mixture flag, M.Maire
64// 24-01-97, new data member: fTaul
65// new method: ComputeIonisationPara, M.Maire
66// 20-03-97, corrected initialization of pointers, M.Maire
67// 27-06-97, new function GetIsotope(int), M.Maire
68// 24-02-98, fWeightVector becomes fRelativeAbundanceVector
69// 27-04-98, atomic shell stuff, V. Grichine
70// 09-07-98, Ionisation parameters removed from the class, M.Maire
71// 04-08-98, new method GetElement(elementName), M.Maire
72// 16-11-98, Subshell -> Shell, mma
73// 30-03-01, suppression of the warning message in GetElement
74// 17-07-01, migration to STL, M. Verderi
75// 13-09-01, stl migration. Suppression of the data member fIndexInTable
76// 14-09-01, fCountUse: nb of materials which use this element
77// 26-02-02, fIndexInTable renewed
78// 01-04-05, new data member fIndexZ to count the number of elements with same Z
79// 17-10-06: Add Get/Set fNaturalAbundance (V.Ivanchenko)
80// 17.09.09, add fNbOfShellElectrons and methods (V. Grichine)
81//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
82
83#ifndef G4ELEMENT_HH
84#define G4ELEMENT_HH 1
85
86#include "globals.hh"
87#include <vector>
88#include "G4ios.hh"
89#include "G4Isotope.hh"
90#include "G4IonisParamElm.hh"
91#include "G4IsotopeVector.hh"
92#include "G4ElementTable.hh"
93#include "G4ElementVector.hh"
94
95//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
96
98{
99public: // with description
100
101 //
102 // Constructor to Build an element directly; no reference to isotopes
103 //
104 G4Element(const G4String& name, //its name
105 const G4String& symbol, //its symbol
106 G4double Zeff, //atomic number
107 G4double Aeff); //mass of mole
108
109 //
110 // Constructor to Build an element from isotopes via AddIsotope
111 //
112 G4Element(const G4String& name, //its name
113 const G4String& symbol, //its symbol
114 G4int nbIsotopes); //nb of isotopes
115
116 //
117 // Add an isotope to the element
118 //
119 void AddIsotope(G4Isotope* isotope, //isotope
120 G4double RelativeAbundance); //fraction of nb of
121 //atomes per volume
122 virtual ~G4Element();
123
124 //
125 // Retrieval methods
126 //
127 inline const G4String& GetName() const {return fName;}
128 inline const G4String& GetSymbol() const {return fSymbol;}
129
130 // Atomic number
131 inline G4double GetZ() const {return fZeff;}
132 inline G4int GetZasInt() const {return fZ;}
133
134 // Atomic weight in atomic units
135 inline G4double GetN() const {return fNeff;}
136 inline G4double GetAtomicMassAmu() const {return fNeff;}
137
138 // Mass of a mole in Geant4 units for atoms with atomic shell
139 inline G4double GetA() const {return fAeff;}
140
141 inline G4bool GetNaturalAbundanceFlag() const;
142
143 inline void SetNaturalAbundanceFlag(G4bool);
144
145 //the number of atomic shells in this element:
146 //
147 inline G4int GetNbOfAtomicShells() const {return fNbOfAtomicShells;}
148
149 //the binding energy of the shell, ground shell index=0
150 //
151 G4double GetAtomicShell(G4int index) const;
152
153 //the number of electrons at the shell, ground shell index=0
154 //
155 G4int GetNbOfShellElectrons(G4int index) const;
156
157 //number of isotopes constituing this element:
158 //
159 inline size_t GetNumberOfIsotopes() const {return fNumberOfIsotopes;}
160
161 //vector of pointers to isotopes constituing this element:
162 //
163 inline G4IsotopeVector* GetIsotopeVector() const {return theIsotopeVector;}
164
165 //vector of relative abundance of each isotope:
166 //
168 {return fRelativeAbundanceVector;}
169
170 inline const G4Isotope* GetIsotope(G4int iso) const
171 {return (*theIsotopeVector)[iso];}
172
173 //the (static) Table of Elements:
174 //
176
177 static
178 size_t GetNumberOfElements();
179
180 //the index of this element in the Table:
181 //
182 inline size_t GetIndex() const {return fIndexInTable;}
183
184 //return pointer to an element, given its name:
185 //
186 static G4Element* GetElement(const G4String& name, G4bool warning = true);
187
188 //Coulomb correction factor:
189 //
190 inline G4double GetfCoulomb() const {return fCoulomb;}
191
192 //Tsai formula for the radiation length:
193 //
194 inline G4double GetfRadTsai() const {return fRadTsai;}
195
196 //pointer to ionisation parameters:
197 //
198 inline G4IonisParamElm* GetIonisation() const {return fIonisation;}
199
200 // printing methods
201 //
202 friend std::ostream& operator<<(std::ostream&, const G4Element*);
203 friend std::ostream& operator<<(std::ostream&, const G4Element&);
204 friend std::ostream& operator<<(std::ostream&, const G4ElementTable&);
205 friend std::ostream& operator<<(std::ostream&, const G4ElementVector&);
206
207public: // without description
208
209 G4Element(__void__&);
210 // Fake default constructor for usage restricted to direct object
211 // persistency for clients requiring preallocation of memory for
212 // persistifiable objects.
213
214 inline void SetName(const G4String& name) {fName=name;}
215
217 const G4Element & operator=(const G4Element&) = delete;
218 G4bool operator==(const G4Element&) const = delete;
219 G4bool operator!=(const G4Element&) const = delete;
220
221private:
222
223 void InitializePointers();
224 void ComputeDerivedQuantities();
225 void ComputeCoulombFactor();
226 void ComputeLradTsaiFactor();
227 void AddNaturalIsotopes();
228
229 //
230 // Basic data members (which define an Element)
231 //
232 G4String fName; // name
233 G4String fSymbol; // symbol
234 G4double fZeff; // Effective atomic number
235 G4double fNeff; // Effective number of nucleons
236 G4double fAeff; // Effective mass of a mole
237 G4int fZ;
238
239 G4int fNbOfAtomicShells; // number of atomic shells
240 G4double* fAtomicShells ; // Pointer to atomic shell binding energies
241 G4int* fNbOfShellElectrons; // Pointer to the number of subshell electrons
242
243 // Isotope vector contains constituent isotopes of the element
244 G4int fNumberOfIsotopes; // Number of isotopes added to the element
245 G4IsotopeVector* theIsotopeVector;
246 G4double* fRelativeAbundanceVector; // Fraction nb of atomes per volume
247 // for each constituent
248
249 // Set up the static Table of Elements
250 static G4ElementTable theElementTable;
251 size_t fIndexInTable;
252 G4bool fNaturalAbundance;
253
254 //
255 // Derived data members (computed from the basic data members)
256 //
257 G4double fCoulomb; // Coulomb correction factor
258 G4double fRadTsai; // Tsai formula for the radiation length
259 G4IonisParamElm* fIonisation; // Pointer to ionisation parameters
260};
261
263{
264 return fNaturalAbundance;
265}
266
268{
269 fNaturalAbundance = val;
270}
271
272//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
273
274#endif
std::vector< G4Element * > G4ElementTable
std::vector< const G4Element * > G4ElementVector
std::vector< G4Isotope * > G4IsotopeVector
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:403
const G4String & GetSymbol() const
Definition: G4Element.hh:128
virtual ~G4Element()
Definition: G4Element.cc:256
G4double GetAtomicMassAmu() const
Definition: G4Element.hh:136
G4double * GetRelativeAbundanceVector() const
Definition: G4Element.hh:167
const G4Element & operator=(const G4Element &)=delete
G4double GetZ() const
Definition: G4Element.hh:131
G4int GetNbOfAtomicShells() const
Definition: G4Element.hh:147
G4bool operator==(const G4Element &) const =delete
static size_t GetNumberOfElements()
Definition: G4Element.cc:410
friend std::ostream & operator<<(std::ostream &, const G4Element *)
Definition: G4Element.cc:439
void SetName(const G4String &name)
Definition: G4Element.hh:214
G4bool GetNaturalAbundanceFlag() const
Definition: G4Element.hh:262
void AddIsotope(G4Isotope *isotope, G4double RelativeAbundance)
Definition: G4Element.cc:154
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:170
G4double GetA() const
Definition: G4Element.hh:139
size_t GetIndex() const
Definition: G4Element.hh:182
void SetNaturalAbundanceFlag(G4bool)
Definition: G4Element.hh:267
G4bool operator!=(const G4Element &) const =delete
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:159
const G4String & GetName() const
Definition: G4Element.hh:127
G4double GetfCoulomb() const
Definition: G4Element.hh:190
G4IonisParamElm * GetIonisation() const
Definition: G4Element.hh:198
G4int GetZasInt() const
Definition: G4Element.hh:132
G4int GetNbOfShellElectrons(G4int index) const
Definition: G4Element.cc:387
G4double GetfRadTsai() const
Definition: G4Element.hh:194
static G4Element * GetElement(const G4String &name, G4bool warning=true)
Definition: G4Element.cc:417
G4double GetN() const
Definition: G4Element.hh:135
G4double GetAtomicShell(G4int index) const
Definition: G4Element.cc:372
G4IsotopeVector * GetIsotopeVector() const
Definition: G4Element.hh:163
G4Element(G4Element &)=delete