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