Geant4 11.1.1
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 mlevel=0)
 
 ~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  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) {
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:59
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
const G4int Z[17]
const G4double A[17]
#define G4endl
Definition: G4ios.hh:57
G4double GetAtomicMass(G4int Z, G4int N) const
static G4NistManager * Instance()
#define N
Definition: crc32.c:56

◆ ~G4Isotope()

G4Isotope::~G4Isotope ( )

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 197 of file G4Isotope.cc.

198{
199 // search the isotope by its name
200 for(auto& J : theIsotopeTable)
201 {
202 if(J->GetName() == isotopeName)
203 {
204 return J;
205 }
206 }
207
208 // the isotope does not exist in the table
209 if (warning) {
210 G4cout << "\n---> warning from G4Isotope::GetIsotope(). The isotope: "
211 << isotopeName << " does not exist in the table. Return NULL pointer."
212 << G4endl;
213 }
214 return nullptr;
215}
G4GLOB_DLL std::ostream G4cout

Referenced by G4GDMLReadMaterials::GetIsotope().

◆ GetIsotopeTable()

const G4IsotopeTable * G4Isotope::GetIsotopeTable ( )
static

Definition at line 183 of file G4Isotope.cc.

184{
185 return &theIsotopeTable;
186}

Referenced by G4NistManager::~G4NistManager().

◆ Getm()

◆ GetN()

◆ GetName()

const G4String & G4Isotope::GetName ( ) const
inline

◆ GetNumberOfIsotopes()

size_t G4Isotope::GetNumberOfIsotopes ( )
static

Definition at line 190 of file G4Isotope.cc.

191{
192 return theIsotopeTable.size();
193}

◆ 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(auto& i : IsotopeTable)
174 {
175 flux << i << G4endl;
176 }
177
178 return flux;
179}

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