149{
150
151 if(fDataDirectory.empty()) {
153 if (nullptr != path) {
154 std::ostringstream ost;
155 ost << path << "/ion_stopping_data/";
156 fDataDirectory = ost.str();
157 } else {
158 G4Exception(
"G4IonICRU73Data::Initialise(..)",
"em013",
160 "Environment variable G4LEDATA is not defined");
161 }
162 }
163
165 if(nmat == fMatIndex.size()) { return; }
166
167 if(0 < fVerbose) {
168 G4cout <<
"### G4IonICRU73Data::Initialise() for " << nmat
169 <<
" materials" <<
G4endl;
170 }
171 fMatIndex.resize(nmat, -1);
172 for(
G4int j=0; j<81; ++j) {
173 fMatData[j]->resize(nmat, nullptr);
174 }
177
179 fNmat = i;
182 if(1 < fVerbose) {
184 <<
" idx=" << idx <<
G4endl;
185 }
186 if(fMatIndex[idx] == -1) {
187 fMatIndex[idx] = i;
191 ReadElementData(mat, useICRU90);
192 isOK = true;
193 if(1 < fVerbose) {
195 }
196 }
197 if(!isOK && useICRU90) {
198 for(
G4int j=0; j<3; ++j) {
199 if(matname == namesICRU90[j]) {
200 ReadMaterialData(mat, densityCoef[j], true);
201 isOK = true;
202 if(1 < fVerbose) {
204 }
205 break;
206 }
207 }
208 }
209 if(!isOK) {
210 for(
G4int j=0; j<31; ++j) {
211 if(matname == namesICRU73[j]) {
212 ReadMaterialData(mat, 1.0, false);
213 isOK = true;
214 if(1 < fVerbose) {
216 }
217 break;
218 }
219 }
220 }
221 if(!isOK) {
222 ReadElementData(mat, useICRU90);
223 if(1 < fVerbose) {
225 }
226 }
227 }
228 }
229}
const char * G4FindDataDir(const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
static G4EmParameters * Instance()
G4bool UseICRU90Data() const
static size_t GetNumberOfMaterials()
static G4MaterialTable * GetMaterialTable()
const G4String & GetName() const