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

#include <G4ElementData.hh>

Public Member Functions

 G4ElementData ()
 
 ~G4ElementData ()
 
void InitialiseForElement (G4int Z, G4PhysicsVector *v)
 
void InitialiseForComponent (G4int Z, G4int nComponents=0)
 
void AddComponent (G4int Z, G4int id, G4PhysicsVector *v)
 
void SetName (const G4String &nam)
 
G4PhysicsVectorGetElementData (G4int Z)
 
size_t GetNumberOfComponents (G4int Z)
 
G4int GetComponentID (G4int Z, size_t idx)
 
G4PhysicsVectorGetComponentDataByIndex (G4int Z, size_t idx)
 
G4PhysicsVectorGetComponentDataByID (G4int Z, G4int id)
 
G4double GetValueForElement (G4int Z, G4double kinEnergy)
 
G4double GetValueForComponent (G4int Z, size_t idx, G4double kinEnergy)
 

Detailed Description

Definition at line 55 of file G4ElementData.hh.

Constructor & Destructor Documentation

◆ G4ElementData()

G4ElementData::G4ElementData ( )

Definition at line 48 of file G4ElementData.cc.

49{
50 name = "";
51 for(G4int i=0; i<maxNumElements; ++i) {
52 elmData[i] = 0;
53 compLength[i] = 0;
54 }
55}
const G4int maxNumElements
int G4int
Definition: G4Types.hh:66

◆ ~G4ElementData()

G4ElementData::~G4ElementData ( )

Definition at line 59 of file G4ElementData.cc.

60{
61 for(G4int i=0; i<maxNumElements; ++i) {
62 delete elmData[i];
63 if(compLength[i] > 0) {
64 for(size_t j=0; j<compLength[i]; ++j) {
65 delete (compData[i])[j];
66 }
67 }
68 }
69}

Member Function Documentation

◆ AddComponent()

void G4ElementData::AddComponent ( G4int  Z,
G4int  id,
G4PhysicsVector v 
)

Definition at line 103 of file G4ElementData.cc.

104{
105 if(Z < 1 || Z >= maxNumElements) {
106 G4cout << "G4ElementData::AddComponent ERROR for " << name
107 << " Z = " << Z << " is out of range!" << G4endl;
108 G4Exception("G4ElementData::AddComponent()", "mat603",
109 FatalException, "Wrong data handling");
110 return;
111 }
112 (compData[Z]).push_back(v);
113 (compID[Z]).push_back(id);
114 ++compLength[Z];
115}
@ FatalException
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

◆ GetComponentDataByID()

G4PhysicsVector * G4ElementData::GetComponentDataByID ( G4int  Z,
G4int  id 
)
inline

Definition at line 141 of file G4ElementData.hh.

142{
143 G4PhysicsVector* v = 0;
144 for(size_t i=0; i<compLength[Z]; ++i) {
145 if(id == (compID[Z])[i]) {
146 v = (compData[Z])[i];
147 break;
148 }
149 }
150 return v;
151}

Referenced by G4NeutronCaptureXS::GetIsoCrossSection(), and G4NeutronCaptureXS::SelectIsotope().

◆ GetComponentDataByIndex()

G4PhysicsVector * G4ElementData::GetComponentDataByIndex ( G4int  Z,
size_t  idx 
)
inline

Definition at line 135 of file G4ElementData.hh.

136{
137 return (compData[Z])[idx];
138}

◆ GetComponentID()

G4int G4ElementData::GetComponentID ( G4int  Z,
size_t  idx 
)
inline

Definition at line 129 of file G4ElementData.hh.

130{
131 return (compID[Z])[idx];
132}

Referenced by G4LivermorePhotoElectricModel::SampleSecondaries().

◆ GetElementData()

G4PhysicsVector * G4ElementData::GetElementData ( G4int  Z)
inline

◆ GetNumberOfComponents()

size_t G4ElementData::GetNumberOfComponents ( G4int  Z)
inline

Definition at line 124 of file G4ElementData.hh.

125{
126 return compLength[Z];
127}

Referenced by G4NeutronCaptureXS::SelectIsotope().

◆ GetValueForComponent()

G4double G4ElementData::GetValueForComponent ( G4int  Z,
size_t  idx,
G4double  kinEnergy 
)
inline

Definition at line 160 of file G4ElementData.hh.

161{
162 return ((compData[Z])[idx])->Value(kinEnergy);
163}

Referenced by G4LivermorePhotoElectricModel::SampleSecondaries().

◆ GetValueForElement()

G4double G4ElementData::GetValueForElement ( G4int  Z,
G4double  kinEnergy 
)
inline

Definition at line 154 of file G4ElementData.hh.

155{
156 return elmData[Z]->Value(kinEnergy);
157}
G4double Value(G4double theEnergy)

◆ InitialiseForComponent()

void G4ElementData::InitialiseForComponent ( G4int  Z,
G4int  nComponents = 0 
)

Definition at line 84 of file G4ElementData.cc.

85{
86 if(Z < 1 || Z >= maxNumElements) {
87 G4cout << "G4ElementData::InitialiseForComponent ERROR for " << name
88 << " Z = " << Z << " is out of range!" << G4endl;
89 G4Exception("G4ElementData::InitialiseForComponent()", "mat602",
90 FatalException, "Wrong data handling");
91 return;
92 }
93
94 // only one initialisation is allowed
95 if(0 != compLength[Z]) { return; }
96
97 // reserve a new structure
98 (compData[Z]).reserve(nComponents);
99 (compID[Z]).reserve(nComponents);
100}

◆ InitialiseForElement()

void G4ElementData::InitialiseForElement ( G4int  Z,
G4PhysicsVector v 
)

Definition at line 71 of file G4ElementData.cc.

72{
73 if(Z < 1 || Z >= maxNumElements) {
74 G4cout << "G4ElementData::InitialiseForElement ERROR for " << name
75 << " Z = " << Z << " is out of range!" << G4endl;
76 G4Exception("G4ElementData::InitialiseForElement()", "mat601",
77 FatalException, "Wrong data handling");
78 return;
79 }
80 if(elmData[Z]) { delete elmData[Z]; }
81 elmData[Z] = v;
82}

◆ SetName()

void G4ElementData::SetName ( const G4String nam)
inline

Definition at line 112 of file G4ElementData.hh.

113{
114 name = nam;
115}

Referenced by G4NeutronCaptureXS::G4NeutronCaptureXS().


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