Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Isotope Class Reference

#include <G4Isotope.hh>

Public Member Functions

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

Static Public Member Functions

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

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/2]

G4Isotope::G4Isotope ( const G4String name,
G4int  z,
G4int  n,
G4double  a = 0.,
G4int  m = 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) {
73 *CLHEP::g/(CLHEP::mole*CLHEP::amu_c2);
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
#define G4endl
Definition: G4ios.hh:57
G4double GetAtomicMass(G4int Z, G4int N) const
static G4NistManager * Instance()

◆ ~G4Isotope()

G4Isotope::~G4Isotope ( )
virtual

Definition at line 91 of file G4Isotope.cc.

92{
93 theIsotopeTable[fIndexInTable] = nullptr;
94}

◆ G4Isotope() [2/2]

G4Isotope::G4Isotope ( __void__ &  )

Definition at line 84 of file G4Isotope.cc.

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

Member Function Documentation

◆ GetA()

G4double G4Isotope::GetA ( ) const
inline

Definition at line 96 of file G4Isotope.hh.

96{return fA;}

Referenced by G4tgbGeometryDumper::DumpIsotope(), and G4GDMLWriteMaterials::IsotopeWrite().

◆ GetIndex()

size_t G4Isotope::GetIndex ( ) const
inline

Definition at line 110 of file G4Isotope.hh.

110{return fIndexInTable;}

◆ 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

Referenced by G4GDMLReadMaterials::GetIsotope().

◆ GetIsotopeTable()

const G4IsotopeTable * G4Isotope::GetIsotopeTable ( )
static

Definition at line 181 of file G4Isotope.cc.

182{
183 return &theIsotopeTable;
184}

Referenced by G4NistManager::~G4NistManager().

◆ Getm()

◆ GetN()

◆ 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}

◆ GetZ()

◆ operator!=()

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

Definition at line 131 of file G4Isotope.cc.

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

◆ 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)

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}
long G4long
Definition: G4Types.hh:87

◆ 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}

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