52 : zMin(minZ), zMax(maxZ), occupancyData(isOccupancy)
58 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::iterator
pos;
61 std::vector<G4double>* dataSet = (*pos).second;
65 std::map<G4int,G4DataVector*,std::less<G4int> >::iterator pos2;
74 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::iterator pos3;
77 std::vector<G4double>* dataSet = (*pos3).second;
99 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator
pos;
100 if (Z < zMin || Z >
zMax) {
105 } pos =
idMap.find(Z);
106 std::vector<G4double>* dataSet = (*pos).second;
113 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator
pos;
116 std::vector<G4double>* dataSet = (*pos).second;
127 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator
pos;
129 if (pos!=
idMap.end())
131 std::vector<G4double> dataSet = *((*pos).second);
132 G4int nData = dataSet.size();
133 if (shellIndex >= 0 && shellIndex < nData)
135 n = (
G4int) dataSet[shellIndex];
149 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator
pos;
151 if (pos!=
idMap.end())
153 std::vector<G4double> dataSet = *((*pos).second);
154 G4int nData = dataSet.size();
155 if (shellIndex >= 0 && shellIndex < nData)
157 prob = dataSet[shellIndex];
172 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator
pos;
177 G4int nData = dataSet.size();
178 if (shellIndex >= 0 && shellIndex < nData)
180 value = dataSet[shellIndex];
191 G4cout <<
"---- Shell data for Z = "
196 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator posId;
197 posId =
idMap.find(Z);
198 std::vector<G4double>* ids = (*posId).second;
199 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator posE;
202 for (
G4int i=0; i<nSh; i++)
216 G4cout <<
id <<
" - Binding energy = "
220 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator posOcc;
222 std::vector<G4double> probs = *((*posOcc).second);
224 G4cout <<
"- Probability = " << prob;
228 G4cout <<
"-------------------------------------------------"
238 std::ostringstream ost;
240 ost << fileName <<
".dat";
244 char* path = getenv(
"G4LEDATA");
247 G4String excep(
"G4ShellData::LoadData()");
254 std::ifstream file(dirFile);
255 std::filebuf* lsdp = file.rdbuf();
257 if (! (lsdp->is_open()) )
260 G4String excep =
"G4ShellData::LoadData()";
261 G4String msg =
"data file: " + dirFile +
" not found";
272 std::vector<G4double>* ids =
new std::vector<G4double>;
288 ids =
new std::vector<G4double>;
293 if (sLocal == nColumns)
315 else if (k%nColumns == 0)
319 energies->push_back(e);
339 std::vector<G4double>* prob =
new std::vector<G4double>;
342 prob->push_back(occupancy[0] * scale);
343 for (
size_t i=1; i<occupancy.size(); i++)
345 prob->push_back(occupancy[i]*scale + (*prob)[i-1]);
365 if (Z < zMin || Z >
zMax) {
370 G4int shellIndex = 0;
380 G4int upperBound = nShellsLocal;
382 while (shellIndex <= upperBound)
384 G4int midShell = (shellIndex + upperBound) / 2;
385 if ( random < prob[midShell] )
386 upperBound = midShell - 1;
388 shellIndex = midShell + 1;
390 if (shellIndex >= nShellsLocal) shellIndex = nShellsLocal - 1;
std::map< G4int, std::vector< G4double > *, std::less< G4int > > occupancyPdfMap
G4int SelectRandomShell(G4int Z) const
G4ShellData(G4int minZ=1, G4int maxZ=100, G4bool isOccupancy=false)
G4int ShellId(G4int Z, G4int shellIndex) const
void LoadData(const G4String &fileName)
const std::vector< G4double > & ShellIdVector(G4int Z) const
G4GLOB_DLL std::ostream G4cout
G4double BindingEnergy(G4int Z, G4int shellIndex) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double ShellOccupancyProbability(G4int Z, G4int shellIndex) const
std::vector< G4int > nShells
size_t NumberOfShells(G4int Z) const
const std::vector< G4double > & ShellVector(G4int Z) const
std::map< G4int, std::vector< G4double > *, std::less< G4int > > idMap
static const G4double pos
std::map< G4int, G4DataVector *, std::less< G4int > > bindingMap