Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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// ClassName: G4Element
29//
30// Description: Contains element properties
31//
32// Class description:
33//
34// An element is a chemical element either directly defined in terms of
35// its characteristics: its name, symbol,
36// Z (effective atomic number)
37// N (effective number of nucleons)
38// A (effective mass of a mole)
39// or in terms of a collection of constituent isotopes with specified
40// relative abundance (i.e. fraction of nb of atoms per volume).
41//
42// Quantities, with physical meaning or not, which are constant in a given
43// element are computed and stored here as Derived data members.
44//
45// The class contains as a private static member the table of defined
46// elements (an ordered vector of elements).
47//
48// Elements can be assembled singly or in mixtures into materials used
49// in volume definitions via the G4Material class.
50//
51// It is strongly recommended do not delete G4Element instance in the
52// user code. All G4Elements will be automatically deleted at the end
53// of Geant4 session
54
55// 09-07-96, new data members added by L.Urban
56// 17-01-97, aesthetic rearrangement, M.Maire
57// 20-01-97, Tsai formula for the rad length, M.Maire
58// 21-01-97, remove mixture flag, M.Maire
59// 24-01-97, new data member: fTaul
60// new method: ComputeIonisationPara, M.Maire
61// 20-03-97, corrected initialization of pointers, M.Maire
62// 27-06-97, new function GetIsotope(int), M.Maire
63// 24-02-98, fWeightVector becomes fRelativeAbundanceVector
64// 27-04-98, atomic shell stuff, V. Grichine
65// 09-07-98, Ionisation parameters removed from the class, M.Maire
66// 04-08-98, new method GetElement(elementName), M.Maire
67// 16-11-98, Subshell -> Shell, mma
68// 30-03-01, suppression of the warning message in GetElement
69// 17-07-01, migration to STL, M. Verderi
70// 13-09-01, stl migration. Suppression of the data member fIndexInTable
71// 14-09-01, fCountUse: nb of materials which use this element
72// 26-02-02, fIndexInTable renewed
73// 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.Ivanchenko)
75// 17.09.09, add fNbOfShellElectrons and methods (V. Grichine)
76
77#ifndef G4ELEMENT_HH
78#define G4ELEMENT_HH 1
79
80#include "G4ElementTable.hh"
81#include "G4ElementVector.hh"
82#include "G4IonisParamElm.hh"
83#include "G4Isotope.hh"
84#include "G4IsotopeVector.hh"
85#include "G4ios.hh"
86#include "globals.hh"
87
88#include <vector>
89
91{
92 public: // with description
93 // Constructor to Build an element directly; no reference to isotopes
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
99 // Constructor to Build an element from isotopes via AddIsotope
100 G4Element(const G4String& name, // its name
101 const G4String& symbol, // its symbol
102 G4int nbIsotopes); // nb of isotopes
103
104 virtual ~G4Element();
105
107 const G4Element& operator=(const G4Element&) = delete;
108
109 // Add an isotope to the element
110 void AddIsotope(G4Isotope* isotope, // isotope
111 G4double RelativeAbundance); // fraction of nb of
112 // atomes per volume
113
114 // Retrieval methods
115 inline const G4String& GetName() const { return fName; }
116 inline const G4String& GetSymbol() const { return fSymbol; }
117
118 // Atomic number
119 inline G4double GetZ() const { return fZeff; }
120 inline G4int GetZasInt() const { return fZ; }
121
122 // Atomic weight in atomic units
123 inline G4double GetN() const { return fNeff; }
124 inline G4double GetAtomicMassAmu() const { return fNeff; }
125
126 // Mass of a mole in Geant4 units for atoms with atomic shell
127 inline G4double GetA() const { return fAeff; }
128
129 inline G4bool GetNaturalAbundanceFlag() const;
130
131 inline void SetNaturalAbundanceFlag(G4bool);
132
133 // the number of atomic shells in this element:
134 inline G4int GetNbOfAtomicShells() const { return fNbOfAtomicShells; }
135
136 // the binding energy of the shell, ground shell index=0
137 G4double GetAtomicShell(G4int index) const;
138
139 // the number of electrons at the shell, ground shell index=0
140 G4int GetNbOfShellElectrons(G4int index) const;
141
142 // number of isotopes constituing this element:
143 inline size_t GetNumberOfIsotopes() const { return fNumberOfIsotopes; }
144
145 // vector of pointers to isotopes constituing this element:
146 inline G4IsotopeVector* GetIsotopeVector() const { return theIsotopeVector; }
147
148 // vector of relative abundance of each isotope:
149 inline G4double* GetRelativeAbundanceVector() const { return fRelativeAbundanceVector; }
150
151 inline const G4Isotope* GetIsotope(G4int iso) const { return (*theIsotopeVector)[iso]; }
152
153 // the (static) Table of Elements:
155
156 static size_t GetNumberOfElements();
157
158 // the index of this element in the Table:
159 inline size_t GetIndex() const { return fIndexInTable; }
160
161 // return pointer to an element, given its name:
162 static G4Element* GetElement(const G4String& name, G4bool warning = true);
163
164 // Coulomb correction factor:
165 inline G4double GetfCoulomb() const { return fCoulomb; }
166
167 // Tsai formula for the radiation length:
168 inline G4double GetfRadTsai() const { return fRadTsai; }
169
170 // pointer to ionisation parameters:
171 inline G4IonisParamElm* GetIonisation() const { return fIonisation; }
172
173 // printing methods
174 friend std::ostream& operator<<(std::ostream&, const G4Element*);
175 friend std::ostream& operator<<(std::ostream&, const G4Element&);
176 friend std::ostream& operator<<(std::ostream&, const G4ElementTable&);
177 friend std::ostream& operator<<(std::ostream&, const G4ElementVector&);
178
179 inline void SetName(const G4String& name) { fName = name; }
180
181 G4bool operator==(const G4Element&) const = delete;
182 G4bool operator!=(const G4Element&) const = delete;
183
184 private:
185 void InitializePointers();
186 void ComputeDerivedQuantities();
187 void ComputeCoulombFactor();
188 void ComputeLradTsaiFactor();
189 void AddNaturalIsotopes();
190
191 // Basic data members (which define an Element)
192
193 G4String fName; // name
194 G4String fSymbol; // symbol
195 G4double fZeff; // Effective atomic number
196 G4double fNeff; // Effective number of nucleons
197 G4double fAeff; // Effective mass of a mole
198 G4int fZ;
199
200 G4int fNbOfAtomicShells; // number of atomic shells
201 G4double* fAtomicShells; // Pointer to atomic shell binding energies
202 G4int* fNbOfShellElectrons; // Pointer to the number of subshell electrons
203
204 G4int fNumberOfIsotopes; // Number of isotopes added to the element
205 G4IsotopeVector* theIsotopeVector; // vector of constituent isotopes of the element
206 G4double* fRelativeAbundanceVector; // Fraction nb of atomes per volume
207 // for each constituent
208
209 // Set up the static Table of Elements
210 static G4ElementTable theElementTable;
211 size_t fIndexInTable;
212 G4bool fNaturalAbundance;
213
214 // Derived data members (computed from the basic data members)
215
216 G4double fCoulomb; // Coulomb correction factor
217 G4double fRadTsai; // Tsai formula for the radiation length
218 G4IonisParamElm* fIonisation; // Pointer to ionisation parameters
219};
220
221inline G4bool G4Element::GetNaturalAbundanceFlag() const { return fNaturalAbundance; }
222
223inline void G4Element::SetNaturalAbundanceFlag(G4bool val) { fNaturalAbundance = val; }
224
225#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:389
const G4String & GetSymbol() const
Definition G4Element.hh:116
virtual ~G4Element()
Definition G4Element.cc:234
G4double GetAtomicMassAmu() const
Definition G4Element.hh:124
G4double * GetRelativeAbundanceVector() const
Definition G4Element.hh:149
const G4Element & operator=(const G4Element &)=delete
G4double GetZ() const
Definition G4Element.hh:119
friend std::ostream & operator<<(std::ostream &, const G4Element *)
Definition G4Element.cc:416
G4int GetNbOfAtomicShells() const
Definition G4Element.hh:134
G4bool operator==(const G4Element &) const =delete
static size_t GetNumberOfElements()
Definition G4Element.cc:393
void SetName(const G4String &name)
Definition G4Element.hh:179
G4bool GetNaturalAbundanceFlag() const
Definition G4Element.hh:221
void AddIsotope(G4Isotope *isotope, G4double RelativeAbundance)
Definition G4Element.cc:141
const G4Isotope * GetIsotope(G4int iso) const
Definition G4Element.hh:151
G4double GetA() const
Definition G4Element.hh:127
size_t GetIndex() const
Definition G4Element.hh:159
void SetNaturalAbundanceFlag(G4bool)
Definition G4Element.hh:223
G4bool operator!=(const G4Element &) const =delete
G4Element(const G4String &name, const G4String &symbol, G4double Zeff, G4double Aeff)
Definition G4Element.cc:68
size_t GetNumberOfIsotopes() const
Definition G4Element.hh:143
const G4String & GetName() const
Definition G4Element.hh:115
G4double GetfCoulomb() const
Definition G4Element.hh:165
G4IonisParamElm * GetIonisation() const
Definition G4Element.hh:171
G4int GetZasInt() const
Definition G4Element.hh:120
G4int GetNbOfShellElectrons(G4int index) const
Definition G4Element.cc:375
G4double GetfRadTsai() const
Definition G4Element.hh:168
static G4Element * GetElement(const G4String &name, G4bool warning=true)
Definition G4Element.cc:397
G4double GetN() const
Definition G4Element.hh:123
G4double GetAtomicShell(G4int index) const
Definition G4Element.cc:361
G4IsotopeVector * GetIsotopeVector() const
Definition G4Element.hh:146
G4Element(G4Element &)=delete