Geant4-11
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 //
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 //
164
165 //vector of relative abundance of each isotope:
166 //
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
187 G4Element* GetElement(G4String name, G4bool warning=true);
188
189 //Coulomb correction factor:
190 //
191 inline G4double GetfCoulomb() const {return fCoulomb;}
192
193 //Tsai formula for the radiation length:
194 //
195 inline G4double GetfRadTsai() const {return fRadTsai;}
196
197 //pointer to ionisation parameters:
198 //
199 inline G4IonisParamElm* GetIonisation() const {return fIonisation;}
200
201 // printing methods
202 //
203 friend std::ostream& operator<<(std::ostream&, const G4Element*);
204 friend std::ostream& operator<<(std::ostream&, const G4Element&);
205 friend std::ostream& operator<<(std::ostream&, const G4ElementTable&);
206 friend std::ostream& operator<<(std::ostream&, const G4ElementVector&);
207
208public: // without description
209
210 G4Element(__void__&);
211 // Fake default constructor for usage restricted to direct object
212 // persistency for clients requiring preallocation of memory for
213 // persistifiable objects.
214
215 inline void SetName(const G4String& name) {fName=name;}
216
218 const G4Element & operator=(const G4Element&) = delete;
219 G4bool operator==(const G4Element&) const = delete;
220 G4bool operator!=(const G4Element&) const = delete;
221
222private:
223
224 void InitializePointers();
228 void AddNaturalIsotopes();
229
230 //
231 // Basic data members (which define an Element)
232 //
234 G4String fSymbol; // symbol
235 G4double fZeff; // Effective atomic number
236 G4double fNeff; // Effective number of nucleons
237 G4double fAeff; // Effective mass of a mole
239
240 G4int fNbOfAtomicShells; // number of atomic shells
241 G4double* fAtomicShells ; // Pointer to atomic shell binding energies
242 G4int* fNbOfShellElectrons; // Pointer to the number of subshell electrons
243
244 // Isotope vector contains constituent isotopes of the element
245 G4int fNumberOfIsotopes; // Number of isotopes added to the element
247 G4double* fRelativeAbundanceVector; // Fraction nb of atomes per volume
248 // for each constituent
249
250 // Set up the static Table of Elements
254
255 //
256 // Derived data members (computed from the basic data members)
257 //
258 G4double fCoulomb; // Coulomb correction factor
259 G4double fRadTsai; // Tsai formula for the radiation length
260 G4IonisParamElm* fIonisation; // Pointer to ionisation parameters
261};
262
264{
265 return fNaturalAbundance;
266}
267
269{
270 fNaturalAbundance = val;
271}
272
273//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
274
275#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:397
const G4String & GetSymbol() const
Definition: G4Element.hh:128
G4int * fNbOfShellElectrons
Definition: G4Element.hh:242
virtual ~G4Element()
Definition: G4Element.cc:252
G4double GetAtomicMassAmu() const
Definition: G4Element.hh:136
G4double fCoulomb
Definition: G4Element.hh:258
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
G4String fSymbol
Definition: G4Element.hh:234
G4String fName
Definition: G4Element.hh:233
G4bool operator==(const G4Element &) const =delete
static size_t GetNumberOfElements()
Definition: G4Element.cc:404
G4IonisParamElm * fIonisation
Definition: G4Element.hh:260
friend std::ostream & operator<<(std::ostream &, const G4Element *)
Definition: G4Element.cc:431
G4IsotopeVector * theIsotopeVector
Definition: G4Element.hh:246
G4double fZeff
Definition: G4Element.hh:235
G4double * fRelativeAbundanceVector
Definition: G4Element.hh:247
void SetName(const G4String &name)
Definition: G4Element.hh:215
G4bool fNaturalAbundance
Definition: G4Element.hh:253
G4bool GetNaturalAbundanceFlag() const
Definition: G4Element.hh:263
void AddIsotope(G4Isotope *isotope, G4double RelativeAbundance)
Definition: G4Element.cc:151
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:170
void ComputeLradTsaiFactor()
Definition: G4Element.cc:301
G4double GetA() const
Definition: G4Element.hh:139
size_t GetIndex() const
Definition: G4Element.hh:182
void SetNaturalAbundanceFlag(G4bool)
Definition: G4Element.hh:268
G4bool operator!=(const G4Element &) const =delete
G4int fNumberOfIsotopes
Definition: G4Element.hh:245
G4Element(const G4String &name, const G4String &symbol, G4double Zeff, G4double Aeff)
Definition: G4Element.cc:74
void ComputeCoulombFactor()
Definition: G4Element.cc:286
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:159
const G4String & GetName() const
Definition: G4Element.hh:127
size_t fIndexInTable
Definition: G4Element.hh:252
G4double GetfCoulomb() const
Definition: G4Element.hh:191
void ComputeDerivedQuantities()
Definition: G4Element.cc:266
G4double fRadTsai
Definition: G4Element.hh:259
void InitializePointers()
Definition: G4Element.cc:218
G4IonisParamElm * GetIonisation() const
Definition: G4Element.hh:199
G4double fAeff
Definition: G4Element.hh:237
G4int GetZasInt() const
Definition: G4Element.hh:132
G4int GetNbOfShellElectrons(G4int index) const
Definition: G4Element.cc:381
G4double GetfRadTsai() const
Definition: G4Element.hh:195
G4double fNeff
Definition: G4Element.hh:236
static G4ElementTable theElementTable
Definition: G4Element.hh:251
G4double * fAtomicShells
Definition: G4Element.hh:241
void AddNaturalIsotopes()
Definition: G4Element.cc:324
G4double GetN() const
Definition: G4Element.hh:135
G4int fZ
Definition: G4Element.hh:238
G4int fNbOfAtomicShells
Definition: G4Element.hh:240
G4double GetAtomicShell(G4int index) const
Definition: G4Element.cc:366
static G4Element * GetElement(G4String name, G4bool warning=true)
Definition: G4Element.cc:411
G4IsotopeVector * GetIsotopeVector() const
Definition: G4Element.hh:163
G4Element(G4Element &)=delete
const char * name(G4int ptype)