Geant4  10.01.p02
G4Isotope.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 // $Id: G4Isotope.hh 88957 2015-03-16 16:46:05Z gcosmo $
28 //
29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
30 
31 // class description
32 //
33 // An isotope is a chemical isotope defined by its name,
34 // Z: atomic number
35 // N: number of nucleons
36 // A: mass of a mole (optional)
37 // m: isomer state (optional)
38 // If A is not defined it is taken from Geant4 database
39 //
40 // The class contains as a private static member the table of defined
41 // isotopes (an ordered vector of isotopes).
42 //
43 // Isotopes can be assembled into elements via the G4Element class.
44 //
45 
46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
47 
48 // 20.08.11: Add flag fm for isomer level (mma)
49 // 15.11.05: GetIsotope(isotopeName, G4bool warning=false)
50 // 31.03.05: A becomes optional. Taken from Nist data base by default (mma)
51 // 26.02.02: fIndexInTable renewed
52 // 14.09.01: fCountUse: nb of elements which use this isotope
53 // 13.09.01: stl migration. Suppression of the data member fIndexInTable
54 // 30.03.01: suppression of the warning message in GetIsotope
55 // 04.08.98: new method GetIsotope(isotopeName) (mma)
56 // 17.01.97: aesthetic rearrangement (mma)
57 
58 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
59 
60 #ifndef G4ISOTOPE_HH
61 #define G4ISOTOPE_HH
62 
63 #include "globals.hh"
64 #include "G4ios.hh"
65 #include <vector>
66 
67 class G4Isotope;
68 typedef std::vector<G4Isotope*> G4IsotopeTable;
69 
70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
71 
72 class G4Isotope
73 {
74  public: // with description
75 
76  // Make an isotope
77  //
78  G4Isotope(const G4String& name, //its name
79  G4int z, //atomic number
80  G4int n, //number of nucleons
81  G4double a = 0., //mass of mole
82  G4int m = 0); //isomer level
83 
84  virtual ~G4Isotope();
85 
86  // Retrieval methods
87  //
88  const G4String& GetName() const {return fName;}
89 
90  // Atomic number
91  G4int GetZ() const {return fZ;}
92 
93  // Number of nucleous
94  G4int GetN() const {return fN;}
95 
96  // Atomic mass of mole in Geant4 units with electron shell
97  G4double GetA() const {return fA;}
98 
99  // Isomer level
100  G4int Getm() const {return fm;}
101 
102  // G4int GetCountUse() const {return fCountUse;}
103 
104  static
105  G4Isotope* GetIsotope(const G4String& name, G4bool warning=false);
106 
107  static const
109 
110  static
111  size_t GetNumberOfIsotopes();
112 
113  size_t GetIndex() const {return fIndexInTable;}
114 
115  friend
116  std::ostream& operator<<(std::ostream&, const G4Isotope*);
117 
118  friend
119  std::ostream& operator<<(std::ostream&, const G4Isotope&);
120 
121  friend
122  std::ostream& operator<<(std::ostream&, G4IsotopeTable);
123 
124  public: // without description
125 
126  G4int operator==(const G4Isotope&) const;
127  G4int operator!=(const G4Isotope&) const;
128 
129  G4Isotope(__void__&);
130  // Fake default constructor for usage restricted to direct object
131  // persistency for clients requiring preallocation of memory for
132  // persistifiable objects.
133 
134  void SetName(const G4String& name) {fName=name;}
135  // void increaseCountUse() {fCountUse++;}
136  // void decreaseCountUse() {fCountUse--;}
137 
138  private:
139 
141  G4Isotope& operator=(const G4Isotope&);
142 
143  private:
144 
145  G4String fName; // name of the Isotope
146  G4int fZ; // atomic number
147  G4int fN; // number of nucleons
148  G4double fA; // atomic mass of a mole
149  G4int fm; // isomer level
150 
151  // G4int fCountUse; // nb of elements which use this isotope
152 
153  static
155 
156  size_t fIndexInTable; // index in the Isotope table
157 };
158 
159 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
160 
161 
162 #endif
static G4IsotopeTable theIsotopeTable
Definition: G4Isotope.hh:154
G4int operator==(const G4Isotope &) const
Definition: G4Isotope.cc:125
G4double GetA() const
Definition: G4Isotope.hh:97
G4String fName
Definition: G4Isotope.hh:145
G4int fm
Definition: G4Isotope.hh:149
const G4String & GetName() const
Definition: G4Isotope.hh:88
G4Isotope & operator=(const G4Isotope &)
Definition: G4Isotope.cc:109
G4double z
Definition: TRTMaterials.hh:39
G4String name
Definition: TRTMaterials.hh:40
G4int fN
Definition: G4Isotope.hh:147
G4double a
Definition: TRTMaterials.hh:39
void SetName(const G4String &name)
Definition: G4Isotope.hh:134
virtual ~G4Isotope()
Definition: G4Isotope.cc:91
static const G4IsotopeTable * GetIsotopeTable()
Definition: G4Isotope.cc:182
int G4int
Definition: G4Types.hh:78
static G4Isotope * GetIsotope(const G4String &name, G4bool warning=false)
Definition: G4Isotope.cc:196
std::vector< G4Isotope * > G4IsotopeTable
Definition: G4Isotope.hh:67
G4int GetN() const
Definition: G4Isotope.hh:94
G4int Getm() const
Definition: G4Isotope.hh:100
bool G4bool
Definition: G4Types.hh:79
G4int operator!=(const G4Isotope &) const
Definition: G4Isotope.cc:132
G4double fA
Definition: G4Isotope.hh:148
friend std::ostream & operator<<(std::ostream &, const G4Isotope *)
Definition: G4Isotope.cc:139
size_t GetIndex() const
Definition: G4Isotope.hh:113
G4Isotope(const G4String &name, G4int z, G4int n, G4double a=0., G4int m=0)
Definition: G4Isotope.cc:59
const G4int n
G4int GetZ() const
Definition: G4Isotope.hh:91
static size_t GetNumberOfIsotopes()
Definition: G4Isotope.cc:189
static const double m
Definition: G4SIunits.hh:110
double G4double
Definition: G4Types.hh:76
size_t fIndexInTable
Definition: G4Isotope.hh:156
G4int fZ
Definition: G4Isotope.hh:146