Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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, 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 56 of file G4ElementData.hh.

Constructor & Destructor Documentation

G4ElementData::G4ElementData ( )
explicit

Definition at line 48 of file G4ElementData.cc.

49 {
50  name = "";
51  for(G4int i=0; i<maxNumElements; ++i) {
52  elmData[i] = nullptr;
53  elm2Data[i] = nullptr;
54  compLength[i] = 0;
55  }
56 }
const XML_Char * name
Definition: expat.h:151
int G4int
Definition: G4Types.hh:78
const G4int maxNumElements
G4ElementData::~G4ElementData ( )

Definition at line 60 of file G4ElementData.cc.

61 {
62  for(G4int i=0; i<maxNumElements; ++i) {
63  delete elmData[i];
64  delete elm2Data[i];
65  size_t n = compLength[i];
66  //G4cout << "Z= " << i << " L= " << n << G4endl;
67  for(size_t j=0; j<n; ++j) {
68  //G4cout << "j= " << j << " " << (compData[i])[j] << G4endl;
69  delete (compData[i])[j];
70  }
71  }
72 }
int G4int
Definition: G4Types.hh:78
const G4int maxNumElements

Member Function Documentation

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

Definition at line 122 of file G4ElementData.cc.

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

Here is the call graph for this function:

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

Definition at line 155 of file G4ElementData.hh.

156 {
157  G4PhysicsVector* v = 0;
158  for(size_t i=0; i<compLength[Z]; ++i) {
159  if(id == (compID[Z])[i]) {
160  v = (compData[Z])[i];
161  break;
162  }
163  }
164  return v;
165 }
G4PhysicsVector * G4ElementData::GetComponentDataByIndex ( G4int  Z,
size_t  idx 
)
inline

Definition at line 149 of file G4ElementData.hh.

150 {
151  return (compData[Z])[idx];
152 }
G4int G4ElementData::GetComponentID ( G4int  Z,
size_t  idx 
)
inline

Definition at line 143 of file G4ElementData.hh.

144 {
145  return (compID[Z])[idx];
146 }

Here is the caller graph for this function:

G4Physics2DVector * G4ElementData::GetElement2DData ( G4int  Z)
inline

Definition at line 132 of file G4ElementData.hh.

133 {
134  return elm2Data[Z];
135 }

Here is the caller graph for this function:

G4PhysicsVector * G4ElementData::GetElementData ( G4int  Z)
inline

Definition at line 126 of file G4ElementData.hh.

127 {
128  return elmData[Z];
129 }
size_t G4ElementData::GetNumberOfComponents ( G4int  Z)
inline

Definition at line 138 of file G4ElementData.hh.

139 {
140  return compLength[Z];
141 }
G4double G4ElementData::GetValueForComponent ( G4int  Z,
size_t  idx,
G4double  kinEnergy 
)
inline

Definition at line 174 of file G4ElementData.hh.

175 {
176  return ((compData[Z])[idx])->Value(kinEnergy);
177 }

Here is the caller graph for this function:

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

Definition at line 168 of file G4ElementData.hh.

169 {
170  return elmData[Z]->Value(kinEnergy);
171 }
G4double Value(G4double theEnergy, size_t &lastidx) const

Here is the call graph for this function:

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

Definition at line 100 of file G4ElementData.cc.

101 {
102  if(Z < 1 || Z >= maxNumElements) {
103  G4cout << "G4ElementData::InitialiseForComponent ERROR for " << name
104  << " Z = " << Z << " is out of range!" << G4endl;
105  G4Exception("G4ElementData::InitialiseForComponent()", "mat602",
106  FatalException, "Wrong data handling");
107  return;
108  }
109 
110  // reserve a new structure
111  size_t n = compLength[Z];
112  if(0 < n) {
113  for(size_t i=0; i<n; ++i) { delete (compData[Z])[i]; }
114  (compData[Z]).clear();
115  (compID[Z]).clear();
116  }
117  (compData[Z]).reserve(nComponents);
118  (compID[Z]).reserve(nComponents);
119 }
const XML_Char * name
Definition: expat.h:151
const G4int maxNumElements
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

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

Definition at line 74 of file G4ElementData.cc.

75 {
76  if(Z < 1 || Z >= maxNumElements) {
77  G4cout << "G4ElementData::InitialiseForElement ERROR for " << name
78  << " Z = " << Z << " is out of range!" << G4endl;
79  G4Exception("G4ElementData::InitialiseForElement()", "mat601",
80  FatalException, "Wrong data handling");
81  return;
82  }
83  if(elmData[Z]) { delete elmData[Z]; }
84  elmData[Z] = v;
85 }
const XML_Char * name
Definition: expat.h:151
const G4int maxNumElements
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

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

Definition at line 87 of file G4ElementData.cc.

88 {
89  if(Z < 1 || Z >= maxNumElements) {
90  G4cout << "G4ElementData::InitialiseForElement ERROR for " << name
91  << " Z = " << Z << " is out of range!" << G4endl;
92  G4Exception("G4ElementData::InitialiseForElement()", "mat601",
93  FatalException, "Wrong data handling");
94  return;
95  }
96  if(elm2Data[Z]) { delete elm2Data[Z]; }
97  elm2Data[Z] = v;
98 }
const XML_Char * name
Definition: expat.h:151
const G4int maxNumElements
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4ElementData::SetName ( const G4String nam)
inline

Definition at line 120 of file G4ElementData.hh.

121 {
122  name = nam;
123 }
const XML_Char * name
Definition: expat.h:151

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