#include <G4RDShellData.hh>
Definition at line 53 of file G4RDShellData.hh.
G4RDShellData::G4RDShellData |
( |
G4int |
minZ = 1 , |
|
|
G4int |
maxZ = 100 , |
|
|
G4bool |
isOccupancy = false |
|
) |
| |
Definition at line 54 of file G4RDShellData.cc.
55 : zMin(minZ), zMax(maxZ), occupancyData(isOccupancy)
G4RDShellData::~G4RDShellData |
( |
| ) |
|
Definition at line 59 of file G4RDShellData.cc.
61 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::iterator
pos;
62 for (pos = idMap.begin(); pos != idMap.end(); ++
pos)
64 std::vector<G4double>* dataSet = (*pos).second;
68 std::map<G4int,G4DataVector*,std::less<G4int> >::iterator pos2;
69 for (pos2 = bindingMap.begin(); pos2 != bindingMap.end(); ++pos2)
77 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::iterator pos3;
78 for (pos3 = occupancyPdfMap.begin(); pos3 != occupancyPdfMap.end(); ++pos3)
80 std::vector<G4double>* dataSet = (*pos3).second;
static const G4double pos
Definition at line 169 of file G4RDShellData.cc.
173 if (
Z >= zMin &&
Z <= zMax)
175 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator
pos;
176 pos = bindingMap.find(
Z);
177 if (pos!= bindingMap.end())
180 G4int nData = dataSet.size();
181 if (shellIndex >= 0 && shellIndex < nData)
183 value = dataSet[shellIndex];
const XML_Char int const XML_Char * value
static const G4double pos
Definition at line 237 of file G4RDShellData.cc.
241 std::ostringstream ost;
243 ost << fileName <<
".dat";
247 char* path = getenv(
"G4LEDATA");
250 G4String excep(
"G4LEDATA environment variable not set!");
251 G4Exception(
"G4RDShellData::LoadData()",
"InvalidSetup",
257 std::ifstream file(dirFile);
258 std::filebuf* lsdp = file.rdbuf();
260 if (! (lsdp->is_open()) )
265 G4Exception(
"G4RDShellData::LoadData()",
"DataNotFound",
275 std::vector<G4double>* ids =
new std::vector<G4double>;
286 bindingMap[
Z] = energies;
288 nShells.push_back(n);
290 ids =
new std::vector<G4double>;
315 else if (k%nColumns == 0)
319 energies->push_back(e);
333 for (
G4int Z=zMin; Z <= zMax; Z++)
337 std::vector<G4double>* prob =
new std::vector<G4double>;
340 prob->push_back(occupancy[0] * scale);
341 for (
size_t i=1; i<occupancy.size(); i++)
343 prob->push_back(occupancy[i]*scale + (*prob)[i-1]);
345 occupancyPdfMap[
Z] = prob;
std::vector< ExP01TrackerHit * > a
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
const std::vector< G4double > & ShellIdVector(G4int Z) const
static constexpr double MeV
size_t G4RDShellData::NumberOfShells |
( |
G4int |
Z | ) |
const |
void G4RDShellData::PrintData |
( |
void |
| ) |
const |
Definition at line 190 of file G4RDShellData.cc.
192 for (
G4int Z = zMin;
Z <= zMax;
Z++)
194 G4cout <<
"---- Shell data for Z = "
199 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator posId;
200 posId = idMap.find(
Z);
201 std::vector<G4double>* ids = (*posId).second;
202 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator posE;
203 posE = bindingMap.find(
Z);
205 for (
G4int i=0; i<nSh; i++)
219 G4cout <<
id <<
" - Binding energy = "
223 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator posOcc;
224 posOcc = occupancyPdfMap.find(
Z);
225 std::vector<G4double> probs = *((*posOcc).second);
227 G4cout <<
"- Probability = " << prob;
231 G4cout <<
"-------------------------------------------------"
G4GLOB_DLL std::ostream G4cout
static constexpr double keV
G4int G4RDShellData::SelectRandomShell |
( |
G4int |
Z | ) |
const |
Definition at line 361 of file G4RDShellData.cc.
363 if (Z < zMin || Z > zMax)
364 G4Exception(
"G4RDShellData::SelectRandomShell()",
"OutOfRange",
367 G4int shellIndex = 0;
368 std::vector<G4double> prob = ShellVector(
Z);
377 G4int upperBound = nShells;
379 while (shellIndex <= upperBound)
381 G4int midShell = (shellIndex + upperBound) / 2;
382 if ( random < prob[midShell] )
383 upperBound = midShell - 1;
385 shellIndex = midShell + 1;
387 if (shellIndex >= nShells) shellIndex = nShells - 1;
size_t NumberOfShells(G4int Z) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void G4RDShellData::SetOccupancyData |
( |
| ) |
|
|
inline |
Definition at line 124 of file G4RDShellData.cc.
128 if (
Z >= zMin &&
Z <= zMax)
130 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator
pos;
132 if (pos!= idMap.end())
134 std::vector<G4double> dataSet = *((*pos).second);
135 G4int nData = dataSet.size();
136 if (shellIndex >= 0 && shellIndex < nData)
138 n = (
G4int) dataSet[shellIndex];
static const G4double pos
const std::vector< G4double > & G4RDShellData::ShellIdVector |
( |
G4int |
Z | ) |
const |
Definition at line 100 of file G4RDShellData.cc.
102 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator
pos;
103 if (Z < zMin || Z > zMax)
104 G4Exception(
"G4RDShellData::ShellIdVector()",
"OutOfRange",
107 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 146 of file G4RDShellData.cc.
150 if (
Z >= zMin &&
Z <= zMax)
152 std::map<G4int,std::vector<G4double>*,std::less<G4int> >::const_iterator
pos;
154 if (pos!= idMap.end())
156 std::vector<G4double> dataSet = *((*pos).second);
157 G4int nData = dataSet.size();
158 if (shellIndex >= 0 && shellIndex < nData)
160 prob = dataSet[shellIndex];
static const G4double pos
The documentation for this class was generated from the following files:
- source/geant4.10.03.p03/examples/advanced/eRosita/physics/include/G4RDShellData.hh
- source/geant4.10.03.p03/examples/advanced/eRosita/physics/src/G4RDShellData.cc