#include <G4ShellData.hh>
Definition at line 52 of file G4ShellData.hh.
G4ShellData::G4ShellData |
( |
G4int |
minZ = 1 , |
|
|
G4int |
maxZ = 100 , |
|
|
G4bool |
isOccupancy = false |
|
) |
| |
Definition at line 51 of file G4ShellData.cc.
52 : zMin(minZ), zMax(maxZ), occupancyData(isOccupancy)
G4ShellData::~G4ShellData |
( |
| ) |
|
Definition at line 56 of file G4ShellData.cc.
58 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::iterator
pos;
59 for (pos = idMap.begin(); pos != idMap.end(); ++
pos)
61 std::vector<G4double>* dataSet = (*pos).second;
65 std::map<G4int,G4DataVector*,std::less<G4int> >::iterator pos2;
66 for (pos2 = bindingMap.begin(); pos2 != bindingMap.end(); ++pos2)
74 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::iterator pos3;
75 for (pos3 = occupancyPdfMap.begin(); pos3 != occupancyPdfMap.end(); ++pos3)
77 std::vector<G4double>* dataSet = (*pos3).second;
static const G4double pos
Definition at line 166 of file G4ShellData.cc.
170 if (
Z >= zMin &&
Z <= zMax)
172 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator
pos;
173 pos = bindingMap.find(
Z);
174 if (pos!= bindingMap.end())
177 G4int nData = dataSet.size();
178 if (shellIndex >= 0 && shellIndex < nData)
180 value = dataSet[shellIndex];
const XML_Char int const XML_Char * value
static const G4double pos
Definition at line 234 of file G4ShellData.cc.
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>;
283 bindingMap[
Z] = energies;
285 nShells.push_back(n);
288 ids =
new std::vector<G4double>;
293 if (sLocal == nColumns)
315 else if (k%nColumns == 0)
319 energies->push_back(e);
335 for (
G4int ZLocal=zMin; ZLocal <= zMax; ZLocal++)
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]);
347 occupancyPdfMap[ZLocal] = prob;
std::vector< ExP01TrackerHit * > a
const std::vector< G4double > & ShellIdVector(G4int Z) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static constexpr double MeV
size_t G4ShellData::NumberOfShells |
( |
G4int |
Z | ) |
const |
void G4ShellData::PrintData |
( |
void |
| ) |
const |
Definition at line 187 of file G4ShellData.cc.
189 for (
G4int Z = zMin;
Z <= zMax;
Z++)
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;
200 posE = bindingMap.find(
Z);
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;
221 posOcc = occupancyPdfMap.find(
Z);
222 std::vector<G4double> probs = *((*posOcc).second);
224 G4cout <<
"- Probability = " << prob;
228 G4cout <<
"-------------------------------------------------"
G4GLOB_DLL std::ostream G4cout
static constexpr double keV
G4int G4ShellData::SelectRandomShell |
( |
G4int |
Z | ) |
const |
Definition at line 363 of file G4ShellData.cc.
365 if (Z < zMin || Z > zMax) {
370 G4int shellIndex = 0;
371 std::vector<G4double> prob = ShellVector(
Z);
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;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
size_t NumberOfShells(G4int Z) const
void G4ShellData::SetOccupancyData |
( |
| ) |
|
|
inline |
Definition at line 121 of file G4ShellData.cc.
125 if (
Z >= zMin &&
Z <= zMax)
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];
static const G4double pos
const std::vector< G4double > & G4ShellData::ShellIdVector |
( |
G4int |
Z | ) |
const |
Definition at line 97 of file G4ShellData.cc.
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;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static const G4double pos
Definition at line 143 of file G4ShellData.cc.
147 if (
Z >= zMin &&
Z <= zMax)
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];
static const G4double pos
The documentation for this class was generated from the following files:
- source/geant4.10.03.p03/source/processes/electromagnetic/lowenergy/include/G4ShellData.hh
- source/geant4.10.03.p03/source/processes/electromagnetic/lowenergy/src/G4ShellData.cc