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