Geant4  10.02.p03
G4Isotope Class Reference

#include <G4Isotope.hh>

Collaboration diagram for G4Isotope:

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
 
G4int operator== (const G4Isotope &) const
 
G4int 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 ()
 

Private Member Functions

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

Private Attributes

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

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 72 of file G4Isotope.hh.

Constructor & Destructor Documentation

◆ G4Isotope() [1/3]

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

Definition at line 59 of file G4Isotope.cc.

60  : fName(Name), fZ(Z), fN(N), fA(A), fm(il)//, fCountUse(0)
61 {
62  if (Z<1) {
64  ed << "Wrong Isotope " << Name << " Z= " << Z << G4endl;
65  G4Exception ("G4Isotope::G4Isotope()", "mat001", FatalException, ed);
66  }
67  if (N<Z) {
69  ed << "Wrong Isotope " << Name << " Z= " << Z << " > N= " << N << G4endl;
70  G4Exception ("G4Isotope::G4Isotope()", "mat002", FatalException, ed);
71  }
72  if (A<=0.0) {
74  }
75  theIsotopeTable.push_back(this);
76  fIndexInTable = theIsotopeTable.size() - 1;
77 }
static G4IsotopeTable theIsotopeTable
Definition: G4Isotope.hh:154
G4String fName
Definition: G4Isotope.hh:145
G4int fm
Definition: G4Isotope.hh:149
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4int fN
Definition: G4Isotope.hh:147
static G4NistManager * Instance()
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5206
double A(double temperature)
Float_t Z
G4double fA
Definition: G4Isotope.hh:148
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static const double mole
Definition: G4SIunits.hh:283
#define G4endl
Definition: G4ios.hh:61
**D E S C R I P T I O N
G4double GetAtomicMass(G4int Z, G4int N) const
size_t fIndexInTable
Definition: G4Isotope.hh:156
float amu_c2
Definition: hepunit.py:277
G4int fZ
Definition: G4Isotope.hh:146
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~G4Isotope()

G4Isotope::~G4Isotope ( )
virtual

Definition at line 91 of file G4Isotope.cc.

92 {
94 }
static G4IsotopeTable theIsotopeTable
Definition: G4Isotope.hh:154
size_t fIndexInTable
Definition: G4Isotope.hh:156

◆ G4Isotope() [2/3]

G4Isotope::G4Isotope ( __void__ &  )

Definition at line 84 of file G4Isotope.cc.

85  : fZ(0), fN(0), fA(0), fm(0), /*fCountUse(0),*/ fIndexInTable(0)
86 {
87 }
G4int fm
Definition: G4Isotope.hh:149
G4int fN
Definition: G4Isotope.hh:147
G4double fA
Definition: G4Isotope.hh:148
size_t fIndexInTable
Definition: G4Isotope.hh:156
G4int fZ
Definition: G4Isotope.hh:146

◆ 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 }
static G4IsotopeTable theIsotopeTable
Definition: G4Isotope.hh:154
size_t fIndexInTable
Definition: G4Isotope.hh:156

Member Function Documentation

◆ GetA()

G4double G4Isotope::GetA ( ) const
inline

Definition at line 97 of file G4Isotope.hh.

97 {return fA;}
G4double fA
Definition: G4Isotope.hh:148
Here is the caller graph for this function:

◆ GetIndex()

size_t G4Isotope::GetIndex ( ) const
inline

Definition at line 113 of file G4Isotope.hh.

113 {return fIndexInTable;}
size_t fIndexInTable
Definition: G4Isotope.hh:156
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIsotope()

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

Definition at line 196 of file G4Isotope.cc.

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

◆ GetIsotopeTable()

const G4IsotopeTable * G4Isotope::GetIsotopeTable ( )
static

Definition at line 182 of file G4Isotope.cc.

183 {
184  return &theIsotopeTable;
185 }
static G4IsotopeTable theIsotopeTable
Definition: G4Isotope.hh:154
Here is the caller graph for this function:

◆ Getm()

G4int G4Isotope::Getm ( ) const
inline

Definition at line 100 of file G4Isotope.hh.

100 {return fm;}
G4int fm
Definition: G4Isotope.hh:149
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetN()

G4int G4Isotope::GetN ( ) const
inline

Definition at line 94 of file G4Isotope.hh.

94 {return fN;}
G4int fN
Definition: G4Isotope.hh:147
Here is the caller graph for this function:

◆ GetName()

const G4String& G4Isotope::GetName ( void  ) const
inline

Definition at line 88 of file G4Isotope.hh.

88 {return fName;}
G4String fName
Definition: G4Isotope.hh:145
Here is the caller graph for this function:

◆ GetNumberOfIsotopes()

size_t G4Isotope::GetNumberOfIsotopes ( )
static

Definition at line 189 of file G4Isotope.cc.

190 {
191  return theIsotopeTable.size();
192 }
static G4IsotopeTable theIsotopeTable
Definition: G4Isotope.hh:154
Here is the caller graph for this function:

◆ GetZ()

G4int G4Isotope::GetZ ( ) const
inline

Definition at line 91 of file G4Isotope.hh.

91 {return fZ;}
G4int fZ
Definition: G4Isotope.hh:146
Here is the caller graph for this function:

◆ operator!=()

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

Definition at line 132 of file G4Isotope.cc.

133 {
134  return (this != (G4Isotope *) &right);
135 }
Here is the caller graph for this function:

◆ 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  // fCountUse = right.fCountUse;
119  }
120  return *this;
121 }
G4String fName
Definition: G4Isotope.hh:145
G4int fm
Definition: G4Isotope.hh:149
G4int fN
Definition: G4Isotope.hh:147
G4double fA
Definition: G4Isotope.hh:148
G4int fZ
Definition: G4Isotope.hh:146
Here is the caller graph for this function:

◆ operator==()

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

Definition at line 125 of file G4Isotope.cc.

126 {
127  return (this == (G4Isotope *) &right);
128 }
Here is the caller graph for this function:

◆ SetName()

void G4Isotope::SetName ( const G4String name)
inline

Definition at line 134 of file G4Isotope.hh.

134 {fName=name;}
G4String fName
Definition: G4Isotope.hh:145
G4String name
Definition: TRTMaterials.hh:40
Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<< [1/3]

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

Definition at line 139 of file G4Isotope.cc.

140 {
141  std::ios::fmtflags mode = flux.flags();
142  flux.setf(std::ios::fixed,std::ios::floatfield);
143  G4long prec = flux.precision(3);
144 
145  flux
146  << " Isotope: " << std::setw(5) << isotope->fName
147  << " Z = " << std::setw(2) << isotope->fZ
148  << " N = " << std::setw(3) << isotope->fN
149  << " A = " << std::setw(6) << std::setprecision(2)
150  << (isotope->fA)/(g/mole) << " g/mole";
151 
152  flux.precision(prec);
153  flux.setf(mode,std::ios::floatfield);
154  return flux;
155 }
G4String fName
Definition: G4Isotope.hh:145
G4int fN
Definition: G4Isotope.hh:147
long G4long
Definition: G4Types.hh:80
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5206
static const double prec
Definition: RanecuEngine.cc:58
G4double fA
Definition: G4Isotope.hh:148
static const double mole
Definition: G4SIunits.hh:283
G4int fZ
Definition: G4Isotope.hh:146

◆ operator<< [2/3]

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

Definition at line 159 of file G4Isotope.cc.

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

◆ operator<< [3/3]

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

Definition at line 167 of file G4Isotope.cc.

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

Member Data Documentation

◆ fA

G4double G4Isotope::fA
private

Definition at line 148 of file G4Isotope.hh.

◆ fIndexInTable

size_t G4Isotope::fIndexInTable
private

Definition at line 156 of file G4Isotope.hh.

◆ fm

G4int G4Isotope::fm
private

Definition at line 149 of file G4Isotope.hh.

◆ fN

G4int G4Isotope::fN
private

Definition at line 147 of file G4Isotope.hh.

◆ fName

G4String G4Isotope::fName
private

Definition at line 145 of file G4Isotope.hh.

◆ fZ

G4int G4Isotope::fZ
private

Definition at line 146 of file G4Isotope.hh.

◆ theIsotopeTable

G4IsotopeTable G4Isotope::theIsotopeTable
staticprivate

Definition at line 154 of file G4Isotope.hh.


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