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

#include <G3EleTable.hh>

Public Member Functions

 G3EleTable ()
 
virtual ~G3EleTable ()
 
G4ElementGetEle (G4double Z)
 

Detailed Description

Definition at line 47 of file G3EleTable.hh.

Constructor & Destructor Documentation

◆ G3EleTable()

G3EleTable::G3EleTable ( )

Definition at line 38 of file G3EleTable.cc.

39{
40 // create an array of pointers to elements
41 _Ele = new G4Element*[_MaxEle];
42 LoadUp();
43}

◆ ~G3EleTable()

G3EleTable::~G3EleTable ( )
virtual

Definition at line 45 of file G3EleTable.cc.

46{
47 delete [] _Ele;
48}

Member Function Documentation

◆ GetEle()

G4Element * G3EleTable::GetEle ( G4double  Z)

Definition at line 51 of file G3EleTable.cc.

52{
53 G4double A = 0.;
54 char name[20], sym[3];
55 G4int index = (G4int) Z-1;
56 if (!parse(Z, name, sym, A))
57 {
58 G4String na(name);
59 G4String sy(sym);
60 if (_Ele[index] == nullptr)
61 {
62 if ( A == 0. )
63 {
64 // Cannot create element with A = 0.
65 G4String text = "Failed to get element Z = " + std::to_string(Z);
66 G4Exception("G3EleTable::GetEle", "G3toG40016", FatalException, text);
67 }
68 // add an element to the element table here
69 _Ele[index] = new G4Element(na, sy, Z, A*g/mole);
70 }
71 }
72 return _Ele[index];
73}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
const G4int Z[17]
const G4double A[17]
const char * name(G4int ptype)

Referenced by G4gsmate(), and G4gsmixt().


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