Geant4-11
Public Member Functions | Private Attributes | Static Private Attributes
G4ElementData Class Reference

#include <G4ElementData.hh>

Public Member Functions

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

Private Attributes

std::vector< G4PhysicsVector * > * compData [maxNumElm]
 
std::vector< G4int > * compID [maxNumElm]
 
G4int compLength [maxNumElm]
 
G4Physics2DVectorelm2Data [maxNumElm]
 
G4PhysicsVectorelmData [maxNumElm]
 
G4String name = ""
 

Static Private Attributes

static const G4int maxNumElm = 99
 

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
std::vector< G4int > * compID[maxNumElm]
G4PhysicsVector * elmData[maxNumElm]
static const G4int maxNumElm
G4Physics2DVector * elm2Data[maxNumElm]
G4int compLength[maxNumElm]
std::vector< G4PhysicsVector * > * compData[maxNumElm]

References compData, compID, compLength, elm2Data, elmData, and maxNumElm.

◆ ~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}

References compData, compID, elm2Data, elmData, and maxNumElm.

◆ 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:35
const G4int Z[17]
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout

References compData, compID, compLength, FatalException, G4cout, G4endl, G4Exception(), maxNumElm, name, and Z.

Referenced by G4GammaNuclearXS::Initialise(), G4NeutronCaptureXS::Initialise(), G4NeutronInelasticXS::Initialise(), G4ParticleInelasticXS::Initialise(), and G4LivermorePhotoElectricModel::ReadData().

◆ 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}

References compData, compID, compLength, and Z.

◆ 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}

References compID, and Z.

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}

References compID, and Z.

◆ 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}

References compData, and Z.

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

References elmData, G4PhysicsVector::Value(), and Z.

◆ 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}

References compData, compID, compLength, FatalException, G4cout, G4endl, G4Exception(), maxNumElm, name, and Z.

Referenced by G4GammaNuclearXS::Initialise(), G4NeutronCaptureXS::Initialise(), G4NeutronInelasticXS::Initialise(), G4ParticleInelasticXS::Initialise(), and G4LivermorePhotoElectricModel::ReadData().

◆ 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}

References elm2Data, FatalException, G4cout, G4endl, G4Exception(), maxNumElm, name, and Z.

◆ 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}

References elmData, FatalException, G4cout, G4endl, G4Exception(), maxNumElm, name, and Z.

Referenced by G4GammaNuclearXS::Initialise(), G4NeutronCaptureXS::Initialise(), G4NeutronInelasticXS::Initialise(), G4ParticleInelasticXS::Initialise(), G4MuonVDNuclearModel::MakeSamplingTable(), G4MuPairProductionModel::MakeSamplingTables(), and G4MuPairProductionModel::RetrieveTables().

◆ operator=()

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

◆ SetName()

void G4ElementData::SetName ( const G4String nam)
inline

Field Documentation

◆ compData

std::vector<G4PhysicsVector*>* G4ElementData::compData[maxNumElm]
private

◆ compID

std::vector<G4int>* G4ElementData::compID[maxNumElm]
private

◆ compLength

G4int G4ElementData::compLength[maxNumElm]
private

◆ elm2Data

G4Physics2DVector* G4ElementData::elm2Data[maxNumElm]
private

◆ elmData

G4PhysicsVector* G4ElementData::elmData[maxNumElm]
private

◆ maxNumElm

const G4int G4ElementData::maxNumElm = 99
staticprivate

◆ name

G4String G4ElementData::name = ""
private

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