00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id: G4Isotope.hh 67044 2013-01-30 08:50:06Z gcosmo $ 00028 // 00029 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 00030 00031 // class description 00032 // 00033 // An isotope is a chemical isotope defined by its name, 00034 // Z: atomic number 00035 // N: number of nucleons 00036 // A: mass of a mole (optional) 00037 // m: isomer state (optional) 00038 // If A is not defined it is taken from Geant4 database 00039 // 00040 // The class contains as a private static member the table of defined 00041 // isotopes (an ordered vector of isotopes). 00042 // 00043 // Isotopes can be assembled into elements via the G4Element class. 00044 // 00045 00046 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 00047 00048 // 20.08.11: Add flag fm for isomer level (mma) 00049 // 15.11.05: GetIsotope(isotopeName, G4bool warning=false) 00050 // 31.03.05: A becomes optional. Taken from Nist data base by default (mma) 00051 // 26.02.02: fIndexInTable renewed 00052 // 14.09.01: fCountUse: nb of elements which use this isotope 00053 // 13.09.01: stl migration. Suppression of the data member fIndexInTable 00054 // 30.03.01: suppression of the warning message in GetIsotope 00055 // 04.08.98: new method GetIsotope(isotopeName) (mma) 00056 // 17.01.97: aesthetic rearrangement (mma) 00057 00058 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 00059 00060 #ifndef G4ISOTOPE_HH 00061 #define G4ISOTOPE_HH 00062 00063 #include "globals.hh" 00064 #include "G4ios.hh" 00065 #include <vector> 00066 00067 class G4Isotope; 00068 typedef std::vector<G4Isotope*> G4IsotopeTable; 00069 00070 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 00071 00072 class G4Isotope 00073 { 00074 public: // with description 00075 00076 // Make an isotope 00077 // 00078 G4Isotope(const G4String& name, //its name 00079 G4int z, //atomic number 00080 G4int n, //number of nucleons 00081 G4double a = 0., //mass of mole 00082 G4int m = 0); //isomer level 00083 00084 virtual ~G4Isotope(); 00085 00086 // Retrieval methods 00087 // 00088 const G4String& GetName() const {return fName;} 00089 00090 // Atomic number 00091 G4int GetZ() const {return fZ;} 00092 00093 // Number of nucleous 00094 G4int GetN() const {return fN;} 00095 00096 // Atomic mass of mole in Geant4 units with electron shell 00097 G4double GetA() const {return fA;} 00098 00099 // Isomer level 00100 G4int Getm() const {return fm;} 00101 00102 G4int GetCountUse() const {return fCountUse;} 00103 00104 static 00105 G4Isotope* GetIsotope(const G4String& name, G4bool warning=false); 00106 00107 static const 00108 G4IsotopeTable* GetIsotopeTable(); 00109 00110 static 00111 size_t GetNumberOfIsotopes(); 00112 00113 size_t GetIndex() const {return fIndexInTable;} 00114 00115 friend 00116 std::ostream& operator<<(std::ostream&, G4Isotope*); 00117 00118 friend 00119 std::ostream& operator<<(std::ostream&, G4Isotope&); 00120 00121 friend 00122 std::ostream& operator<<(std::ostream&, G4IsotopeTable); 00123 00124 public: // without description 00125 00126 G4int operator==(const G4Isotope&) const; 00127 G4int operator!=(const G4Isotope&) const; 00128 00129 G4Isotope(__void__&); 00130 // Fake default constructor for usage restricted to direct object 00131 // persistency for clients requiring preallocation of memory for 00132 // persistifiable objects. 00133 00134 void SetName(const G4String& name) {fName=name;} 00135 void increaseCountUse() {fCountUse++;} 00136 void decreaseCountUse() {fCountUse--;} 00137 00138 private: 00139 00140 G4Isotope(G4Isotope&); 00141 G4Isotope& operator=(const G4Isotope&); 00142 00143 private: 00144 00145 G4String fName; // name of the Isotope 00146 G4int fZ; // atomic number 00147 G4int fN; // number of nucleons 00148 G4double fA; // atomic mass of a mole 00149 G4int fm; // isomer level 00150 00151 G4int fCountUse; // nb of elements which use this isotope 00152 00153 static 00154 G4IsotopeTable theIsotopeTable; 00155 00156 size_t fIndexInTable; // index in the Isotope table 00157 }; 00158 00159 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00160 00161 00162 #endif