Geant4-11
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends
G4Isotope Class Reference

#include <G4Isotope.hh>

Public Member Functions

 G4Isotope (__void__ &)
 
 G4Isotope (const G4String &name, G4int z, G4int n, G4double a=0., G4int mlevel=0)
 
G4double GetA () const
 
size_t GetIndex () const
 
G4int Getm () const
 
G4int GetN () const
 
const G4StringGetName () const
 
G4int GetZ () const
 
G4bool operator!= (const G4Isotope &) const
 
G4bool operator== (const G4Isotope &) const
 
void SetName (const G4String &name)
 
 ~G4Isotope ()
 

Static Public Member Functions

static G4IsotopeGetIsotope (const G4String &name, G4bool warning=false)
 
static const G4IsotopeTableGetIsotopeTable ()
 
static size_t GetNumberOfIsotopes ()
 

Private Member Functions

 G4Isotope (G4Isotope &)
 
G4Isotopeoperator= (const G4Isotope &)
 

Private Attributes

G4double fA
 
size_t fIndexInTable
 
G4int fm
 
G4int fN
 
G4String fName
 
G4int fZ
 

Static Private Attributes

static G4IsotopeTable theIsotopeTable
 

Friends

std::ostream & operator<< (std::ostream &, const G4Isotope &)
 
std::ostream & operator<< (std::ostream &, const G4Isotope *)
 
std::ostream & operator<< (std::ostream &, G4IsotopeTable)
 

Detailed Description

Definition at line 71 of file G4Isotope.hh.

Constructor & Destructor Documentation

◆ G4Isotope() [1/3]

G4Isotope::G4Isotope ( const G4String name,
G4int  z,
G4int  n,
G4double  a = 0.,
G4int  mlevel = 0 
)

Definition at line 58 of file G4Isotope.cc.

59 : fName(Name), fZ(Z), fN(N), fA(A), fm(il)
60{
61 if (Z<1) {
63 ed << "Wrong Isotope " << Name << " Z= " << Z << G4endl;
64 G4Exception ("G4Isotope::G4Isotope()", "mat001", FatalException, ed);
65 }
66 if (N<Z) {
68 ed << "Wrong Isotope " << Name << " Z= " << Z << " > N= " << N << G4endl;
69 G4Exception ("G4Isotope::G4Isotope()", "mat002", FatalException, ed);
70 }
71 if (A<=0.0) {
74 }
75 theIsotopeTable.push_back(this);
76 fIndexInTable = theIsotopeTable.size() - 1;
77}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
const G4int Z[17]
const G4double A[17]
#define G4endl
Definition: G4ios.hh:57
G4String fName
Definition: G4Isotope.hh:140
static G4IsotopeTable theIsotopeTable
Definition: G4Isotope.hh:147
G4double fA
Definition: G4Isotope.hh:143
G4int fm
Definition: G4Isotope.hh:144
G4int fN
Definition: G4Isotope.hh:142
size_t fIndexInTable
Definition: G4Isotope.hh:149
G4int fZ
Definition: G4Isotope.hh:141
G4double GetAtomicMass(G4int Z, G4int N) const
static G4NistManager * Instance()
static constexpr double amu_c2
static constexpr double g
static constexpr double mole

References A, CLHEP::amu_c2, fA, FatalException, fIndexInTable, CLHEP::g, G4endl, G4Exception(), G4NistManager::GetAtomicMass(), G4NistManager::Instance(), CLHEP::mole, theIsotopeTable, and Z.

◆ ~G4Isotope()

G4Isotope::~G4Isotope ( )

Definition at line 91 of file G4Isotope.cc.

92{
94}

References fIndexInTable, and theIsotopeTable.

◆ G4Isotope() [2/3]

G4Isotope::G4Isotope ( __void__ &  )

Definition at line 84 of file G4Isotope.cc.

85 : fZ(0), fN(0), fA(0), fm(0), fIndexInTable(0)
86{
87}

◆ G4Isotope() [3/3]

G4Isotope::G4Isotope ( G4Isotope right)
private

Definition at line 98 of file G4Isotope.cc.

99{
100 *this = right;
101
102 //insert this new isotope in table
103 theIsotopeTable.push_back(this);
104 fIndexInTable = theIsotopeTable.size() - 1;
105}

References fIndexInTable, and theIsotopeTable.

Member Function Documentation

◆ GetA()

G4double G4Isotope::GetA ( ) const
inline

◆ GetIndex()

size_t G4Isotope::GetIndex ( ) const
inline

Definition at line 110 of file G4Isotope.hh.

110{return fIndexInTable;}

References fIndexInTable.

Referenced by export_G4Isotope().

◆ GetIsotope()

G4Isotope * G4Isotope::GetIsotope ( const G4String name,
G4bool  warning = false 
)
static

Definition at line 195 of file G4Isotope.cc.

196{
197 // search the isotope by its name
198 for (size_t J=0 ; J<theIsotopeTable.size() ; J++)
199 {
200 if (theIsotopeTable[J]->GetName() == isotopeName)
201 { return theIsotopeTable[J]; }
202 }
203
204 // the isotope does not exist in the table
205 if (warning) {
206 G4cout << "\n---> warning from G4Isotope::GetIsotope(). The isotope: "
207 << isotopeName << " does not exist in the table. Return NULL pointer."
208 << G4endl;
209 }
210 return 0;
211}
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
Definition: G4Isotope.hh:87

References G4cout, G4endl, GetName(), and theIsotopeTable.

Referenced by export_G4Isotope(), and G4GDMLReadMaterials::GetIsotope().

◆ GetIsotopeTable()

const G4IsotopeTable * G4Isotope::GetIsotopeTable ( )
static

Definition at line 181 of file G4Isotope.cc.

182{
183 return &theIsotopeTable;
184}

References theIsotopeTable.

Referenced by export_G4Isotope(), and G4NistManager::~G4NistManager().

◆ Getm()

G4int G4Isotope::Getm ( ) const
inline

◆ GetN()

G4int G4Isotope::GetN ( ) const
inline

◆ GetName()

const G4String & G4Isotope::GetName ( ) const
inline

◆ GetNumberOfIsotopes()

size_t G4Isotope::GetNumberOfIsotopes ( )
static

Definition at line 188 of file G4Isotope.cc.

189{
190 return theIsotopeTable.size();
191}

References theIsotopeTable.

Referenced by export_G4Isotope().

◆ GetZ()

G4int G4Isotope::GetZ ( ) const
inline

◆ operator!=()

G4bool G4Isotope::operator!= ( const G4Isotope right) const

Definition at line 131 of file G4Isotope.cc.

132{
133 return (this != (G4Isotope *) &right);
134}

◆ operator=()

G4Isotope & G4Isotope::operator= ( const G4Isotope right)
private

Definition at line 109 of file G4Isotope.cc.

110{
111 if (this != &right)
112 {
113 fName = right.fName;
114 fZ = right.fZ;
115 fN = right.fN;
116 fA = right.fA;
117 fm = right.fm;
118 }
119 return *this;
120}

References fA, fm, fN, fName, and fZ.

◆ operator==()

G4bool G4Isotope::operator== ( const G4Isotope right) const

Definition at line 124 of file G4Isotope.cc.

125{
126 return (this == (G4Isotope *) &right);
127}

◆ SetName()

void G4Isotope::SetName ( const G4String name)
inline

Definition at line 131 of file G4Isotope.hh.

131{fName=name;}
const char * name(G4int ptype)

References fName, and G4InuclParticleNames::name().

Referenced by export_G4Isotope().

Friends And Related Function Documentation

◆ operator<< [1/3]

std::ostream & operator<< ( std::ostream &  flux,
const G4Isotope isotope 
)
friend

Definition at line 158 of file G4Isotope.cc.

159{
160 flux << &isotope;
161 return flux;
162}

◆ operator<< [2/3]

std::ostream & operator<< ( std::ostream &  flux,
const G4Isotope isotope 
)
friend

Definition at line 138 of file G4Isotope.cc.

139{
140 std::ios::fmtflags mode = flux.flags();
141 flux.setf(std::ios::fixed,std::ios::floatfield);
142 G4long prec = flux.precision(3);
143
144 flux
145 << " Isotope: " << std::setw(5) << isotope->fName
146 << " Z = " << std::setw(2) << isotope->fZ
147 << " N = " << std::setw(3) << isotope->fN
148 << " A = " << std::setw(6) << std::setprecision(2)
149 << (isotope->fA)/(g/mole) << " g/mole";
150
151 flux.precision(prec);
152 flux.setf(mode,std::ios::floatfield);
153 return flux;
154}
static constexpr double mole
Definition: G4SIunits.hh:279
static constexpr double g
Definition: G4SIunits.hh:168
long G4long
Definition: G4Types.hh:87
static const double prec
Definition: RanecuEngine.cc:61

◆ operator<< [3/3]

std::ostream & operator<< ( std::ostream &  flux,
G4IsotopeTable  IsotopeTable 
)
friend

Definition at line 166 of file G4Isotope.cc.

167{
168 //Dump info for all known isotopes
169 flux
170 << "\n***** Table : Nb of isotopes = " << IsotopeTable.size()
171 << " *****\n" << G4endl;
172
173 for (size_t i=0; i<IsotopeTable.size(); i++)
174 flux << IsotopeTable[i] << G4endl;
175
176 return flux;
177}

Field Documentation

◆ fA

G4double G4Isotope::fA
private

Definition at line 143 of file G4Isotope.hh.

Referenced by G4Isotope(), GetA(), and operator=().

◆ fIndexInTable

size_t G4Isotope::fIndexInTable
private

Definition at line 149 of file G4Isotope.hh.

Referenced by G4Isotope(), GetIndex(), and ~G4Isotope().

◆ fm

G4int G4Isotope::fm
private

Definition at line 144 of file G4Isotope.hh.

Referenced by Getm(), and operator=().

◆ fN

G4int G4Isotope::fN
private

Definition at line 142 of file G4Isotope.hh.

Referenced by GetN(), and operator=().

◆ fName

G4String G4Isotope::fName
private

Definition at line 140 of file G4Isotope.hh.

Referenced by GetName(), operator=(), and SetName().

◆ fZ

G4int G4Isotope::fZ
private

Definition at line 141 of file G4Isotope.hh.

Referenced by GetZ(), and operator=().

◆ theIsotopeTable

G4IsotopeTable G4Isotope::theIsotopeTable
staticprivate

Definition at line 147 of file G4Isotope.hh.

Referenced by G4Isotope(), GetIsotope(), GetIsotopeTable(), GetNumberOfIsotopes(), and ~G4Isotope().


The documentation for this class was generated from the following files: