Geant4 11.1.1
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 InitialiseForElement (G4int Z, G4Physics2DVector *v)
 
void InitialiseForComponent (G4int Z, G4int nComponents=0)
 
void AddComponent (G4int Z, G4int id, G4PhysicsVector *v)
 
void SetName (const G4String &nam)
 
G4PhysicsVectorGetElementData (G4int Z)
 
G4Physics2DVectorGetElement2DData (G4int Z)
 
size_t GetNumberOfComponents (G4int Z)
 
G4int GetComponentID (G4int Z, G4int idx)
 
G4PhysicsVectorGetComponentDataByIndex (G4int Z, G4int idx)
 
G4PhysicsVectorGetComponentDataByID (G4int Z, G4int id)
 
G4double GetValueForElement (G4int Z, G4double kinEnergy)
 
G4double GetValueForComponent (G4int Z, G4int idx, G4double kinEnergy)
 
G4ElementDataoperator= (const G4ElementData &right)=delete
 
 G4ElementData (const G4ElementData &)=delete
 

Detailed Description

Definition at line 54 of file G4ElementData.hh.

Constructor & Destructor Documentation

◆ G4ElementData() [1/2]

G4ElementData::G4ElementData ( )
explicit

Definition at line 47 of file G4ElementData.cc.

48{
49 for(G4int i=0; i<maxNumElm; ++i) {
50 elmData[i] = nullptr;
51 elm2Data[i] = nullptr;
52 compLength[i] = 0;
53 compData[i] = nullptr;
54 compID[i] = nullptr;
55 }
56}
int G4int
Definition: G4Types.hh:85

◆ ~G4ElementData()

G4ElementData::~G4ElementData ( )

Definition at line 60 of file G4ElementData.cc.

61{
62 for(G4int i=0; i<maxNumElm; ++i) {
63 delete elmData[i];
64 delete elm2Data[i];
65 if(nullptr != compID[i]) {
66 for(size_t j=0; j<compID[i]->size(); ++j) {
67 delete (*(compData[i]))[j];
68 }
69 delete compID[i];
70 delete compData[i];
71 }
72 }
73}

◆ G4ElementData() [2/2]

G4ElementData::G4ElementData ( const G4ElementData )
delete

Member Function Documentation

◆ AddComponent()

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

Definition at line 122 of file G4ElementData.cc.

123{
124 if(Z < 1 || Z >= maxNumElm ||
125 (G4int)compID[Z]->size() == compLength[Z]) {
126 G4cout << "G4ElementData::AddComponent ERROR for " << name
127 << " Z = " << Z << " is out of range!" << G4endl;
128 G4Exception("G4ElementData::AddComponent()", "mat603",
129 FatalException, "Wrong data handling");
130 return;
131 }
132 (*(compData[Z]))[compLength[Z]] = v;
133 (*(compID[Z]))[compLength[Z]] = id;
134 compLength[Z] = compLength[Z] + 1;
135}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
const G4int Z[17]
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout

◆ GetComponentDataByID()

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

Definition at line 163 of file G4ElementData.hh.

164{
165 G4PhysicsVector* v = nullptr;
166 for(G4int i=0; i<compLength[Z]; ++i) {
167 if(id == (*(compID[Z]))[i]) {
168 v = (*(compData[Z]))[i];
169 break;
170 }
171 }
172 return v;
173}

◆ GetComponentDataByIndex()

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

◆ GetComponentID()

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

Definition at line 151 of file G4ElementData.hh.

152{
153 return (*(compID[Z]))[idx];
154}

Referenced by G4LivermorePhotoElectricModel::SampleSecondaries().

◆ GetElement2DData()

G4Physics2DVector * G4ElementData::GetElement2DData ( G4int  Z)
inline

◆ GetElementData()

G4PhysicsVector * G4ElementData::GetElementData ( G4int  Z)
inline

◆ GetNumberOfComponents()

size_t G4ElementData::GetNumberOfComponents ( G4int  Z)
inline

Definition at line 146 of file G4ElementData.hh.

147{
148 return compID[Z]->size();
149}

◆ GetValueForComponent()

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

Definition at line 182 of file G4ElementData.hh.

183{
184 return (*(compData[Z]))[idx]->Value(kinEnergy);
185}

Referenced by G4LivermorePhotoElectricModel::SampleSecondaries().

◆ GetValueForElement()

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

Definition at line 176 of file G4ElementData.hh.

177{
178 return elmData[Z]->Value(kinEnergy);
179}
G4double Value(const G4double energy, std::size_t &lastidx) const

◆ InitialiseForComponent()

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

Definition at line 101 of file G4ElementData.cc.

102{
103 if(Z < 1 || Z >= maxNumElm || nComponents < 0) {
104 G4cout << "G4ElementData::InitialiseForComponent ERROR for " << name
105 << " Z= " << Z << " Ncomp= " << nComponents
106 << " is out of range!" << G4endl;
107 G4Exception("G4ElementData::InitialiseForComponent()", "mat602",
108 FatalException, "Wrong data handling");
109 return;
110 }
111
112 // reserve a new structure
113 if(nullptr == compID[Z]) {
114 compID[Z] = new std::vector<G4int>();
115 compData[Z] = new std::vector<G4PhysicsVector*>();
116 }
117 compID[Z]->resize(nComponents, -1);
118 compData[Z]->resize(nComponents, nullptr);
119 compLength[Z] = 0;
120}

◆ InitialiseForElement() [1/2]

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

Definition at line 88 of file G4ElementData.cc.

89{
90 if(Z < 1 || Z >= maxNumElm) {
91 G4cout << "G4ElementData::InitialiseForElement ERROR for " << name
92 << " Z = " << Z << " is out of range!" << G4endl;
93 G4Exception("G4ElementData::InitialiseForElement()", "mat601",
94 FatalException, "Wrong data handling");
95 return;
96 }
97 if(nullptr != elm2Data[Z]) { delete elm2Data[Z]; }
98 elm2Data[Z] = v;
99}

◆ InitialiseForElement() [2/2]

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

Definition at line 75 of file G4ElementData.cc.

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

Referenced by G4MuPairProductionModel::MakeSamplingTables(), and G4MuPairProductionModel::RetrieveTables().

◆ operator=()

G4ElementData & G4ElementData::operator= ( const G4ElementData right)
delete

◆ SetName()

void G4ElementData::SetName ( const G4String nam)
inline

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