53 : zMin(minZ), zMax(maxZ), occupancyData(isOccupancy)
59 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::iterator
pos;
62 std::vector<G4double>* dataSet = (*pos).second;
66 std::map<G4int,G4DataVector*,std::less<G4int> >::iterator pos2;
75 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::iterator pos3;
78 std::vector<G4double>* dataSet = (*pos3).second;
100 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator
pos;
101 if (Z < zMin || Z >
zMax)
102 G4Exception(
"G4RDShellData::ShellIdVector()",
"OutOfRange",
105 std::vector<G4double>* dataSet = (*pos).second;
112 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator
pos;
113 if (Z < zMin || Z >
zMax)
114 G4Exception(
"G4RDShellData::ShellVector()",
"OutOfRange",
117 std::vector<G4double>* dataSet = (*pos).second;
128 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator
pos;
130 if (pos!=
idMap.end())
132 std::vector<G4double> dataSet = *((*pos).second);
133 G4int nData = dataSet.size();
134 if (shellIndex >= 0 && shellIndex < nData)
136 n = (
G4int) dataSet[shellIndex];
150 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator
pos;
152 if (pos!=
idMap.end())
154 std::vector<G4double> dataSet = *((*pos).second);
155 G4int nData = dataSet.size();
156 if (shellIndex >= 0 && shellIndex < nData)
158 prob = dataSet[shellIndex];
173 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator
pos;
178 G4int nData = dataSet.size();
179 if (shellIndex >= 0 && shellIndex < nData)
181 value = dataSet[shellIndex];
192 G4cout <<
"---- Shell data for Z = "
197 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator posId;
199 std::vector<G4double>* ids = (*posId).second;
200 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator posE;
203 for (
G4int i=0; i<nSh; i++)
217 G4cout <<
id <<
" - Binding energy = "
221 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator posOcc;
223 std::vector<G4double> probs = *((*posOcc).second);
225 G4cout <<
"- Probability = " << prob;
229 G4cout <<
"-------------------------------------------------"
239 std::ostringstream ost;
241 ost << fileName <<
".dat";
245 char* path = std::getenv(
"G4LEDATA");
248 G4String excep(
"G4LEDATA environment variable not set!");
249 G4Exception(
"G4RDShellData::LoadData()",
"InvalidSetup",
255 std::ifstream
file(dirFile);
256 std::filebuf* lsdp = file.rdbuf();
258 if (! (lsdp->is_open()) )
263 G4Exception(
"G4RDShellData::LoadData()",
"DataNotFound",
273 std::vector<G4double>* ids =
new std::vector<G4double>;
288 ids =
new std::vector<G4double>;
313 else if (k%nColumns == 0)
317 energies->push_back(e);
335 std::vector<G4double>* prob =
new std::vector<G4double>;
338 prob->push_back(occupancy[0] * scale);
339 for (
size_t i=1; i<occupancy.size(); i++)
341 prob->push_back(occupancy[i]*scale + (*prob)[i-1]);
361 if (Z < zMin || Z >
zMax)
362 G4Exception(
"G4RDShellData::SelectRandomShell()",
"OutOfRange",
365 G4int shellIndex = 0;
377 while (shellIndex <= upperBound)
379 G4int midShell = (shellIndex + upperBound) / 2;
380 if ( random < prob[midShell] )
381 upperBound = midShell - 1;
383 shellIndex = midShell + 1;
385 if (shellIndex >= nShells) shellIndex = nShells - 1;