51 : zMin(minZ), zMax(
maxZ), occupancyData(isOccupancy)
60 std::vector<G4double>* dataSet =
pos.second;
73 std::vector<G4double>* dataSet = pos3.second;
97 if (Z < zMin || Z >
zMax) {
101 std::vector<G4double>* dataSet = (*pos).second;
109 if (Z < zMin || Z >
zMax)
112 std::vector<G4double>* dataSet = (*pos).second;
127 std::vector<G4double> dataSet = *((*pos).second);
128 G4int nData = dataSet.size();
129 if (shellIndex >= 0 && shellIndex < nData)
131 n = (
G4int) dataSet[shellIndex];
148 std::vector<G4double> dataSet = *((*pos).second);
149 G4int nData = dataSet.size();
150 if (shellIndex >= 0 && shellIndex < nData)
152 prob = dataSet[shellIndex];
171 G4int nData = dataSet.size();
172 if (shellIndex >= 0 && shellIndex < nData)
174 value = dataSet[shellIndex];
187 G4cout <<
"---- Shell data for Z = "
192 auto posId =
idMap.find(
Z);
193 std::vector<G4double>* ids = (*posId).second;
196 for (
G4int i=0; i<nSh; ++i)
210 G4cout <<
id <<
" - Binding energy = "
215 std::vector<G4double> probs = *((*posOcc).second);
217 G4cout <<
"- Probability = " << prob;
221 G4cout <<
"-------------------------------------------------"
231 std::ostringstream ost;
232 ost << fileName <<
".dat";
236 char* path = std::getenv(
"G4LEDATA");
239 G4String excep(
"G4ShellData::LoadData()");
246 std::ifstream
file(dirFile);
247 std::filebuf* lsdp =
file.rdbuf();
249 if (! (lsdp->is_open()) )
252 G4String excep =
"G4ShellData::LoadData()";
253 G4String msg =
"data file: " + dirFile +
" not found";
264 std::vector<G4double>* ids =
new std::vector<G4double>;
280 ids =
new std::vector<G4double>;
285 if (sLocal == nColumns)
307 else if (k%nColumns == 0)
311 energies->push_back(e);
330 std::vector<G4double>* prob =
new std::vector<G4double>;
333 prob->push_back(occupancy[0] * scale);
334 for (
size_t i=1; i<occupancy.size(); i++)
336 prob->push_back(occupancy[i]*scale + (*prob)[i-1]);
347 if (Z < zMin || Z >
zMax)
350 G4int shellIndex = 0;
356 G4int upperBound = nShellsLocal;
358 while (shellIndex <= upperBound)
360 G4int midShell = (shellIndex + upperBound) / 2;
361 if ( random < prob[midShell] )
362 upperBound = midShell - 1;
364 shellIndex = midShell + 1;
366 if (shellIndex >= nShellsLocal) shellIndex = nShellsLocal - 1;
static const G4double pos
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
static constexpr double keV
static constexpr double MeV
G4GLOB_DLL std::ostream G4cout
std::map< G4int, G4DataVector *, std::less< G4int > > bindingMap
const std::vector< G4double > & ShellVector(G4int Z) const
G4int ShellId(G4int Z, G4int shellIndex) const
std::map< G4int, std::vector< G4double > *, std::less< G4int > > idMap
std::vector< G4int > nShells
G4double BindingEnergy(G4int Z, G4int shellIndex) const
size_t NumberOfShells(G4int Z) const
G4ShellData(G4int minZ=1, G4int maxZ=100, G4bool isOccupancy=false)
G4double ShellOccupancyProbability(G4int Z, G4int shellIndex) const
void LoadData(const G4String &fileName)
const std::vector< G4double > & ShellIdVector(G4int Z) const
std::map< G4int, std::vector< G4double > *, std::less< G4int > > occupancyPdfMap
G4int SelectRandomShell(G4int Z) const
const char * name(G4int ptype)