Geant4 11.2.2
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 (G4int length=99)
 
 ~G4ElementData ()
 
G4ElementDataoperator= (const G4ElementData &right)=delete
 
 G4ElementData (const G4ElementData &)=delete
 
void InitialiseForElement (G4int Z, G4PhysicsVector *v)
 
void InitialiseForElement (G4int Z, G4Physics2DVector *v)
 
void InitialiseForComponent (G4int Z, G4int nComponents=0)
 
void InitialiseFor2DComponent (G4int Z, G4int nComponents=0)
 
void AddComponent (G4int Z, G4int id, G4PhysicsVector *v)
 
void Add2DComponent (G4int Z, G4int id, G4Physics2DVector *v)
 
void SetName (const G4String &nam)
 
const G4StringGetName () const
 
G4PhysicsVectorGetElementData (G4int Z) const
 
G4Physics2DVectorGetElement2DData (G4int Z) const
 
G4PhysicsVectorGetComponentDataByID (G4int Z, G4int id) const
 
G4Physics2DVectorGet2DComponentDataByID (G4int Z, G4int id) const
 
G4double GetValueForElement (G4int Z, G4double kinEnergy) const
 
std::size_t GetNumberOfComponents (G4int Z) const
 
std::size_t GetNumberOf2DComponents (G4int Z) const
 
G4int GetComponentID (G4int Z, std::size_t idx) const
 
G4PhysicsVectorGetComponentDataByIndex (G4int Z, std::size_t idx) const
 
G4Physics2DVectorGet2DComponentDataByIndex (G4int Z, std::size_t idx) const
 
G4double GetValueForComponent (G4int Z, std::size_t idx, G4double kinEnergy) const
 

Detailed Description

Definition at line 56 of file G4ElementData.hh.

Constructor & Destructor Documentation

◆ G4ElementData() [1/2]

G4ElementData::G4ElementData ( G4int length = 99)
explicit

Definition at line 42 of file G4ElementData.cc.

43 : maxNumElm(length)
44{
45 elmData.resize(maxNumElm, nullptr);
47}
static G4ElementDataRegistry * Instance()
void RegisterMe(G4ElementData *p)

◆ ~G4ElementData()

G4ElementData::~G4ElementData ( )

Definition at line 49 of file G4ElementData.cc.

50{
51 for (auto const & p : elmData) { delete p; }
52 for (auto const & p : elm2Data) { delete p; }
53 for (auto const & p : compData) {
54 if (nullptr != p ) {
55 for (auto const & q : *p) { delete q.second; }
56 delete p;
57 }
58 }
59 for (auto const & p : comp2D) {
60 if (nullptr != p ) {
61 for (auto const & q : *p) { delete q.second; }
62 delete p;
63 }
64 }
66}
void RemoveMe(G4ElementData *p)

◆ G4ElementData() [2/2]

G4ElementData::G4ElementData ( const G4ElementData & )
delete

Member Function Documentation

◆ Add2DComponent()

void G4ElementData::Add2DComponent ( G4int Z,
G4int id,
G4Physics2DVector * v )

Definition at line 134 of file G4ElementData.cc.

135{
136 if (Z < 0 || Z >= maxNumElm) {
137 DataError(Z, "Add2DComponent");
138 return;
139 }
140 if (0 == comp2D.size()) {
141 compData.resize(maxNumElm, nullptr);
142 }
143 if (nullptr == comp2D[Z]) {
144 comp2D[Z] = new std::vector<std::pair<G4int, G4Physics2DVector*> >;
145 }
146 comp2D[Z]->emplace_back(id, v);
147}

◆ AddComponent()

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

Definition at line 119 of file G4ElementData.cc.

120{
121 if (Z < 0 || Z >= maxNumElm) {
122 DataError(Z, "AddComponent");
123 return;
124 }
125 if (0 == compData.size()) {
126 compData.resize(maxNumElm, nullptr);
127 }
128 if (nullptr == compData[Z]) {
129 compData[Z] = new std::vector<std::pair<G4int, G4PhysicsVector*> >;
130 }
131 compData[Z]->emplace_back(id, v);
132}

◆ Get2DComponentDataByID()

G4Physics2DVector * G4ElementData::Get2DComponentDataByID ( G4int Z,
G4int id ) const
inline

Definition at line 190 of file G4ElementData.hh.

191{
192 G4Physics2DVector* v = nullptr;
193 for (auto const & p : *(comp2D[Z])) {
194 if (id == p.first) {
195 v = p.second;
196 break;
197 }
198 }
199 return v;
200}

◆ Get2DComponentDataByIndex()

G4Physics2DVector * G4ElementData::Get2DComponentDataByIndex ( G4int Z,
std::size_t idx ) const
inline

Definition at line 235 of file G4ElementData.hh.

236{
237 return
238 (idx < GetNumberOf2DComponents(Z)) ? (*(comp2D[Z]))[idx].second : nullptr;
239}
std::size_t GetNumberOf2DComponents(G4int Z) const

◆ GetComponentDataByID()

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

Definition at line 177 of file G4ElementData.hh.

178{
179 G4PhysicsVector* v = nullptr;
180 for (auto const & p : *(compData[Z])) {
181 if (id == p.first) {
182 v = p.second;
183 break;
184 }
185 }
186 return v;
187}

Referenced by G4NeutronCaptureXS::IsoCrossSection(), G4NeutronInelasticXS::IsoCrossSection(), and G4ParticleInelasticXS::IsoCrossSection().

◆ GetComponentDataByIndex()

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

Definition at line 228 of file G4ElementData.hh.

229{
230 return
231 (idx < GetNumberOfComponents(Z)) ? (*(compData[Z]))[idx].second : nullptr;
232}
std::size_t GetNumberOfComponents(G4int Z) const

Referenced by G4CrossSectionHP::DumpPhysicsTable(), and G4LivermorePhotoElectricModel::GetBindingEnergy().

◆ GetComponentID()

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

Definition at line 222 of file G4ElementData.hh.

223{
224 return (idx < GetNumberOfComponents(Z)) ? (*(compData[Z]))[idx].first : 0;
225}

Referenced by G4CrossSectionHP::DumpPhysicsTable(), and G4LivermorePhotoElectricModel::SampleSecondaries().

◆ GetElement2DData()

G4Physics2DVector * G4ElementData::GetElement2DData ( G4int Z) const
inline

◆ GetElementData()

◆ GetName()

const G4String & G4ElementData::GetName ( ) const
inline

Definition at line 161 of file G4ElementData.hh.

162{
163 return name;
164}

◆ GetNumberOf2DComponents()

std::size_t G4ElementData::GetNumberOf2DComponents ( G4int Z) const
inline

Definition at line 217 of file G4ElementData.hh.

218{
219 return (nullptr != comp2D[Z]) ? comp2D[Z]->size() : 0;
220}

Referenced by Get2DComponentDataByIndex().

◆ GetNumberOfComponents()

std::size_t G4ElementData::GetNumberOfComponents ( G4int Z) const
inline

◆ GetValueForComponent()

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

Definition at line 242 of file G4ElementData.hh.

243{
244 return (idx < GetNumberOfComponents(Z)) ?
245 (*(compData[Z]))[idx].second->Value(e) : 0.0;
246}

Referenced by G4LivermorePhotoElectricModel::SampleSecondaries().

◆ GetValueForElement()

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

Definition at line 203 of file G4ElementData.hh.

204{
205 return elmData[Z]->Value(kinEnergy);
206}

◆ InitialiseFor2DComponent()

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

Definition at line 105 of file G4ElementData.cc.

106{
107 if (Z < 0 || Z >= maxNumElm) {
108 DataError(Z, "InitialiseFor2DComponent");
109 return;
110 }
111 if (0 == comp2D.size()) {
112 comp2D.resize(maxNumElm, nullptr);
113 }
114 delete comp2D[Z];
115 comp2D[Z] = new std::vector<std::pair<G4int, G4Physics2DVector*> >;
116 if (0 < nComponents) { comp2D[Z]->reserve(nComponents); }
117}

◆ InitialiseForComponent()

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

Definition at line 91 of file G4ElementData.cc.

92{
93 if (Z < 0 || Z >= maxNumElm) {
94 DataError(Z, "InitialiseForComponent");
95 return;
96 }
97 if (0 == compData.size()) {
98 compData.resize(maxNumElm, nullptr);
99 }
100 delete compData[Z];
101 compData[Z] = new std::vector<std::pair<G4int, G4PhysicsVector*> >;
102 if (0 < nComponents) { compData[Z]->reserve(nComponents); }
103}

◆ InitialiseForElement() [1/2]

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

Definition at line 78 of file G4ElementData.cc.

79{
80 if (Z < 0 || Z >= maxNumElm) {
81 DataError(Z, "InitialiseForElement");
82 return;
83 }
84 if (0 == elm2Data.size()) {
85 elm2Data.resize(maxNumElm, nullptr);
86 }
87 delete elm2Data[Z];
88 elm2Data[Z] = v;
89}

◆ InitialiseForElement() [2/2]

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

Definition at line 68 of file G4ElementData.cc.

69{
70 if (Z < 0 || Z >= maxNumElm) {
71 DataError(Z, "InitialiseForElement");
72 return;
73 }
74 delete elmData[Z];
75 elmData[Z] = v;
76}

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

◆ operator=()

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

◆ SetName()


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