Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
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 ( )

Definition at line 48 of file G4ElementData.cc.

References maxNumElements.

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

Definition at line 60 of file G4ElementData.cc.

References maxNumElements.

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

Member Function Documentation

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

Definition at line 120 of file G4ElementData.cc.

References FatalException, G4cout, G4endl, G4Exception(), and maxNumElements.

121 {
122  if(Z < 1 || Z >= maxNumElements) {
123  G4cout << "G4ElementData::AddComponent ERROR for " << name
124  << " Z = " << Z << " is out of range!" << G4endl;
125  G4Exception("G4ElementData::AddComponent()", "mat603",
126  FatalException, "Wrong data handling");
127  return;
128  }
129  (compData[Z]).push_back(v);
130  (compID[Z]).push_back(id);
131  ++compLength[Z];
132 }
const XML_Char * name
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
G4PhysicsVector * G4ElementData::GetComponentDataByID ( G4int  Z,
G4int  id 
)
inline

Definition at line 155 of file G4ElementData.hh.

References test::v.

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.

Referenced by G4LivermorePhotoElectricModel::SampleSecondaries().

144 {
145  return (compID[Z])[idx];
146 }
G4Physics2DVector * G4ElementData::GetElement2DData ( G4int  Z)
inline

Definition at line 132 of file G4ElementData.hh.

Referenced by G4MuPairProduction::PrintInfo().

133 {
134  return elm2Data[Z];
135 }
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.

Referenced by G4LivermorePhotoElectricModel::SampleSecondaries().

175 {
176  return ((compData[Z])[idx])->Value(kinEnergy);
177 }
G4double G4ElementData::GetValueForElement ( G4int  Z,
G4double  kinEnergy 
)
inline

Definition at line 168 of file G4ElementData.hh.

References G4PhysicsVector::Value().

169 {
170  return elmData[Z]->Value(kinEnergy);
171 }
G4double Value(G4double theEnergy, size_t &lastidx) const
void G4ElementData::InitialiseForComponent ( G4int  Z,
G4int  nComponents = 0 
)

Definition at line 101 of file G4ElementData.cc.

References FatalException, G4cout, G4endl, G4Exception(), and maxNumElements.

102 {
103  if(Z < 1 || Z >= maxNumElements) {
104  G4cout << "G4ElementData::InitialiseForComponent ERROR for " << name
105  << " Z = " << Z << " is out of range!" << G4endl;
106  G4Exception("G4ElementData::InitialiseForComponent()", "mat602",
107  FatalException, "Wrong data handling");
108  return;
109  }
110 
111  // only one initialisation is allowed
112  if(0 != compLength[Z]) { return; }
113 
114  // reserve a new structure
115  (compData[Z]).reserve(nComponents);
116  (compID[Z]).reserve(nComponents);
117 }
const XML_Char * name
G4int nComponents
Definition: TRTMaterials.hh:41
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
void G4ElementData::InitialiseForElement ( G4int  Z,
G4PhysicsVector v 
)

Definition at line 75 of file G4ElementData.cc.

References FatalException, G4cout, G4endl, G4Exception(), maxNumElements, and test::v.

76 {
77  if(Z < 1 || Z >= maxNumElements) {
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(elmData[Z]) { delete elmData[Z]; }
85  elmData[Z] = v;
86 }
const XML_Char * name
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
void G4ElementData::InitialiseForElement ( G4int  Z,
G4Physics2DVector v 
)

Definition at line 88 of file G4ElementData.cc.

References FatalException, G4cout, G4endl, G4Exception(), maxNumElements, and test::v.

89 {
90  if(Z < 1 || Z >= maxNumElements) {
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(elm2Data[Z]) { delete elm2Data[Z]; }
98  elm2Data[Z] = v;
99 }
const XML_Char * name
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
void G4ElementData::SetName ( const G4String nam)
inline

Definition at line 120 of file G4ElementData.hh.

121 {
122  name = nam;
123 }
const XML_Char * name

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