#include <G4ElementData.hh>
|
| | G4ElementData (G4int length=99) |
| | ~G4ElementData () |
| G4ElementData & | operator= (const G4ElementData &right)=delete |
| | G4ElementData (const G4ElementData &)=delete |
| void | Reserve1D (std::size_t) |
| void | Reserve2D (std::size_t) |
| 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) |
| G4PhysicsVector * | New1DVector (G4int Z, G4int ne) |
| G4Physics2DVector * | New2DVector (G4int Z, G4int ny, G4int ne) |
| void | SetName (const G4String &nam) |
| const G4String & | GetName () const |
| G4PhysicsVector * | GetElementData (G4int Z) const |
| G4Physics2DVector * | GetElement2DData (G4int Z) const |
| G4PhysicsVector * | GetComponentDataByID (G4int Z, G4int id) const |
| G4Physics2DVector * | Get2DComponentDataByID (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 |
| G4PhysicsVector * | GetComponentDataByIndex (G4int Z, std::size_t idx) const |
| G4Physics2DVector * | Get2DComponentDataByIndex (G4int Z, std::size_t idx) const |
| G4double | GetValueForComponent (G4int Z, std::size_t idx, G4double kinEnergy) const |
Definition at line 58 of file G4ElementData.hh.
◆ G4ElementData() [1/2]
| G4ElementData::G4ElementData |
( |
G4int | length = 99 | ) |
|
|
explicit |
Definition at line 43 of file G4ElementData.cc.
44 : maxNumElm(length)
45{
46 elmData.resize((std::size_t)maxNumElm, nullptr);
48 fRegistry->RegisterMe(this);
49}
static G4ElementDataRegistry * Instance()
Referenced by G4ElementData(), and operator=().
◆ ~G4ElementData()
| G4ElementData::~G4ElementData |
( |
| ) |
|
Definition at line 51 of file G4ElementData.cc.
52{
53 for (auto const & p : elmData) { delete p; }
54 elmData.clear();
55
56 for (auto const & p : elm2Data) {
57 delete p;
58 }
59 elm2Data.clear();
60
61 for (auto const & p : compData) {
62 if (nullptr != p ) {
63 for (auto const & q : *p) { delete q.second; }
64 delete p;
65 }
66 }
67 compData.clear();
68
69 for (auto const & p : comp2D) {
70 if (nullptr != p ) {
71 for (auto const & q : *p) { delete q.second; }
72 delete p;
73 }
74 }
75 comp2D.clear();
76 fRegistry->RemoveMe(this);
77}
◆ G4ElementData() [2/2]
◆ Add2DComponent()
Definition at line 159 of file G4ElementData.cc.
160{
161 if (Z < 0 || Z >= maxNumElm) {
162 DataError(Z, "Add2DComponent");
163 return;
164 }
165 if (comp2D.empty()) {
166 compData.resize((std::size_t)maxNumElm, nullptr);
167 }
168 if (nullptr == comp2D[Z]) {
169 comp2D[Z] = new std::vector<std::pair<G4int, G4Physics2DVector*> >;
170 }
171 comp2D[Z]->emplace_back(id, v);
172}
◆ AddComponent()
Definition at line 144 of file G4ElementData.cc.
145{
146 if (Z < 0 || Z >= maxNumElm) {
147 DataError(Z, "AddComponent");
148 return;
149 }
150 if (compData.empty()) {
151 compData.resize((std::size_t)maxNumElm, nullptr);
152 }
153 if (nullptr == compData[Z]) {
154 compData[Z] = new std::vector<std::pair<G4int, G4PhysicsVector*> >;
155 }
156 compData[Z]->emplace_back(id, v);
157}
◆ Get2DComponentDataByID()
Definition at line 205 of file G4ElementData.hh.
206{
207 G4Physics2DVector* v = nullptr;
208 for (auto const & p : *(comp2D[Z])) {
209 if (id == p.first) {
210 v = p.second;
211 break;
212 }
213 }
214 return v;
215}
◆ Get2DComponentDataByIndex()
Definition at line 250 of file G4ElementData.hh.
251{
252 return
254}
std::size_t GetNumberOf2DComponents(G4int Z) const
◆ GetComponentDataByID()
Definition at line 192 of file G4ElementData.hh.
193{
194 G4PhysicsVector* v = nullptr;
195 for (auto const & p : *(compData[Z])) {
196 if (id == p.first) {
197 v = p.second;
198 break;
199 }
200 }
201 return v;
202}
◆ GetComponentDataByIndex()
Definition at line 243 of file G4ElementData.hh.
244{
245 return
247}
std::size_t GetNumberOfComponents(G4int Z) const
◆ GetComponentID()
| G4int G4ElementData::GetComponentID |
( |
G4int | Z, |
|
|
std::size_t | idx ) const |
|
inline |
◆ GetElement2DData()
◆ GetElementData()
◆ GetName()
| const G4String & G4ElementData::GetName |
( |
| ) |
const |
|
inline |
◆ GetNumberOf2DComponents()
| std::size_t G4ElementData::GetNumberOf2DComponents |
( |
G4int | Z | ) |
const |
|
inline |
◆ GetNumberOfComponents()
| std::size_t G4ElementData::GetNumberOfComponents |
( |
G4int | Z | ) |
const |
|
inline |
◆ GetValueForComponent()
Definition at line 257 of file G4ElementData.hh.
258{
260 (*(compData[Z]))[idx].second->Value(e) : 0.0;
261}
◆ GetValueForElement()
Definition at line 218 of file G4ElementData.hh.
219{
220 return elmData[Z]->Value(kinEnergy);
221}
◆ InitialiseFor2DComponent()
| void G4ElementData::InitialiseFor2DComponent |
( |
G4int | Z, |
|
|
G4int | nComponents = 0 ) |
Definition at line 130 of file G4ElementData.cc.
131{
132 if (Z < 0 || Z >= maxNumElm) {
133 DataError(Z, "InitialiseFor2DComponent");
134 return;
135 }
136 if (comp2D.empty()) {
137 comp2D.resize((std::size_t)maxNumElm, nullptr);
138 }
139 delete comp2D[Z];
140 comp2D[Z] = new std::vector<std::pair<G4int, G4Physics2DVector*> >;
141 if (0 < nComponents) { comp2D[Z]->reserve((std::size_t)nComponents); }
142}
◆ InitialiseForComponent()
| void G4ElementData::InitialiseForComponent |
( |
G4int | Z, |
|
|
G4int | nComponents = 0 ) |
Definition at line 116 of file G4ElementData.cc.
117{
118 if (Z < 0 || Z >= maxNumElm) {
119 DataError(Z, "InitialiseForComponent");
120 return;
121 }
122 if (compData.empty()) {
123 compData.resize((std::size_t)maxNumElm, nullptr);
124 }
125 delete compData[Z];
126 compData[Z] = new std::vector<std::pair<G4int, G4PhysicsVector*> >;
127 if (0 < nComponents) { compData[Z]->reserve((std::size_t)nComponents); }
128}
◆ InitialiseForElement() [1/2]
Definition at line 103 of file G4ElementData.cc.
104{
105 if (Z < 0 || Z >= maxNumElm) {
106 DataError(Z, "InitialiseFor2DElement");
107 return;
108 }
109 if (elm2Data.empty()) {
110 elm2Data.resize((std::size_t)maxNumElm, nullptr);
111 }
112 delete elm2Data[Z];
113 elm2Data[Z] = v;
114}
◆ InitialiseForElement() [2/2]
Definition at line 93 of file G4ElementData.cc.
94{
95 if (Z < 0 || Z >= maxNumElm) {
96 DataError(Z, "InitialiseForElement");
97 return;
98 }
99 delete elmData[Z];
100 elmData[Z] = v;
101}
Referenced by New1DVector(), and New2DVector().
◆ New1DVector()
Definition at line 174 of file G4ElementData.cc.
175{
176 auto ptr = new G4PhysicsFreeVector(ne);
178 return ptr;
179}
void InitialiseForElement(G4int Z, G4PhysicsVector *v)
◆ New2DVector()
Definition at line 181 of file G4ElementData.cc.
182{
183 auto ptr = new G4Physics2DVector(ny, ne);
185 return ptr;
186}
◆ operator=()
◆ Reserve1D()
| void G4ElementData::Reserve1D |
( |
std::size_t | n | ) |
|
Definition at line 79 of file G4ElementData.cc.
80{
81 if (!elmData.empty()) { return; }
82 elmData.reserve(n);
83 compData.reserve(n);
84}
◆ Reserve2D()
| void G4ElementData::Reserve2D |
( |
std::size_t | n | ) |
|
Definition at line 86 of file G4ElementData.cc.
87{
88 if (!elm2Data.empty()) { return; }
89 elm2Data.reserve(n);
90 comp2D.reserve(n);
91}
◆ SetName()
| void G4ElementData::SetName |
( |
const G4String & | nam | ) |
|
|
inline |
The documentation for this class was generated from the following files: