45 elmData.resize(maxNumElm,
nullptr);
51 for (
auto const & p : elmData) {
delete p; }
52 for (
auto const & p : elm2Data) {
delete p; }
53 for (
auto const & p : compData) {
55 for (
auto const & q : *p) {
delete q.second; }
59 for (
auto const & p : comp2D) {
61 for (
auto const & q : *p) {
delete q.second; }
70 if (Z < 0 || Z >= maxNumElm) {
71 DataError(Z,
"InitialiseForElement");
80 if (Z < 0 || Z >= maxNumElm) {
81 DataError(Z,
"InitialiseForElement");
84 if (0 == elm2Data.size()) {
85 elm2Data.resize(maxNumElm,
nullptr);
93 if (Z < 0 || Z >= maxNumElm) {
94 DataError(Z,
"InitialiseForComponent");
97 if (0 == compData.size()) {
98 compData.resize(maxNumElm,
nullptr);
101 compData[Z] =
new std::vector<std::pair<G4int, G4PhysicsVector*> >;
102 if (0 < nComponents) { compData[Z]->reserve(nComponents); }
107 if (Z < 0 || Z >= maxNumElm) {
108 DataError(Z,
"InitialiseFor2DComponent");
111 if (0 == comp2D.size()) {
112 comp2D.resize(maxNumElm,
nullptr);
115 comp2D[Z] =
new std::vector<std::pair<G4int, G4Physics2DVector*> >;
116 if (0 < nComponents) { comp2D[Z]->reserve(nComponents); }
121 if (Z < 0 || Z >= maxNumElm) {
122 DataError(Z,
"AddComponent");
125 if (0 == compData.size()) {
126 compData.resize(maxNumElm,
nullptr);
128 if (
nullptr == compData[Z]) {
129 compData[Z] =
new std::vector<std::pair<G4int, G4PhysicsVector*> >;
131 compData[Z]->emplace_back(
id, v);
136 if (Z < 0 || Z >= maxNumElm) {
137 DataError(Z,
"Add2DComponent");
140 if (0 == comp2D.size()) {
141 compData.resize(maxNumElm,
nullptr);
143 if (
nullptr == comp2D[Z]) {
144 comp2D[Z] =
new std::vector<std::pair<G4int, G4Physics2DVector*> >;
146 comp2D[Z]->emplace_back(
id, v);
151 G4cout <<
"G4ElementData::" << type <<
" ERROR for G4ElementData <"
152 << name <<
"> Z = " << Z <<
" is out of range!" <<
G4endl;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
static G4ElementDataRegistry * Instance()
void RegisterMe(G4ElementData *p)
void RemoveMe(G4ElementData *p)
void InitialiseFor2DComponent(G4int Z, G4int nComponents=0)
void Add2DComponent(G4int Z, G4int id, G4Physics2DVector *v)
void InitialiseForComponent(G4int Z, G4int nComponents=0)
void InitialiseForElement(G4int Z, G4PhysicsVector *v)
G4ElementData(G4int length=99)
void AddComponent(G4int Z, G4int id, G4PhysicsVector *v)