46 elmData.resize((std::size_t)maxNumElm,
nullptr);
48 fRegistry->RegisterMe(
this);
53 for (
auto const & p : elmData) {
delete p; }
56 for (
auto const & p : elm2Data) {
61 for (
auto const & p : compData) {
63 for (
auto const & q : *p) {
delete q.second; }
69 for (
auto const & p : comp2D) {
71 for (
auto const & q : *p) {
delete q.second; }
76 fRegistry->RemoveMe(
this);
81 if (!elmData.empty()) {
return; }
88 if (!elm2Data.empty()) {
return; }
95 if (Z < 0 || Z >= maxNumElm) {
96 DataError(Z,
"InitialiseForElement");
105 if (Z < 0 || Z >= maxNumElm) {
106 DataError(Z,
"InitialiseFor2DElement");
109 if (elm2Data.empty()) {
110 elm2Data.resize((std::size_t)maxNumElm,
nullptr);
118 if (Z < 0 || Z >= maxNumElm) {
119 DataError(Z,
"InitialiseForComponent");
122 if (compData.empty()) {
123 compData.resize((std::size_t)maxNumElm,
nullptr);
126 compData[Z] =
new std::vector<std::pair<G4int, G4PhysicsVector*> >;
127 if (0 < nComponents) { compData[Z]->reserve((std::size_t)nComponents); }
132 if (Z < 0 || Z >= maxNumElm) {
133 DataError(Z,
"InitialiseFor2DComponent");
136 if (comp2D.empty()) {
137 comp2D.resize((std::size_t)maxNumElm,
nullptr);
140 comp2D[Z] =
new std::vector<std::pair<G4int, G4Physics2DVector*> >;
141 if (0 < nComponents) { comp2D[Z]->reserve((std::size_t)nComponents); }
146 if (Z < 0 || Z >= maxNumElm) {
147 DataError(Z,
"AddComponent");
150 if (compData.empty()) {
151 compData.resize((std::size_t)maxNumElm,
nullptr);
153 if (
nullptr == compData[Z]) {
154 compData[Z] =
new std::vector<std::pair<G4int, G4PhysicsVector*> >;
156 compData[Z]->emplace_back(
id, v);
161 if (Z < 0 || Z >= maxNumElm) {
162 DataError(Z,
"Add2DComponent");
165 if (comp2D.empty()) {
166 compData.resize((std::size_t)maxNumElm,
nullptr);
168 if (
nullptr == comp2D[Z]) {
169 comp2D[Z] =
new std::vector<std::pair<G4int, G4Physics2DVector*> >;
171 comp2D[Z]->emplace_back(
id, v);
190 G4cout <<
"G4ElementData::" << type <<
" ERROR for G4ElementData <"
191 << 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 InitialiseFor2DComponent(G4int Z, G4int nComponents=0)
void Reserve2D(std::size_t)
void Reserve1D(std::size_t)
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)
G4Physics2DVector * New2DVector(G4int Z, G4int ny, G4int ne)
G4PhysicsVector * New1DVector(G4int Z, G4int ne)