#include <G4EMDataSet.hh>
|
| G4EMDataSet (G4int argZ, G4VDataSetAlgorithm *algo, G4double xUnit=CLHEP::MeV, G4double yUnit=CLHEP::barn, G4bool random=false) |
|
| G4EMDataSet (G4int argZ, G4DataVector *xData, G4DataVector *data, G4VDataSetAlgorithm *algo, G4double xUnit=CLHEP::MeV, G4double yUnit=CLHEP::barn, G4bool random=false) |
|
| G4EMDataSet (G4int argZ, G4DataVector *xData, G4DataVector *data, G4DataVector *xLogData, G4DataVector *Logdata, G4VDataSetAlgorithm *algo, G4double xUnit=CLHEP::MeV, G4double yUnit=CLHEP::barn, G4bool random=false) |
|
virtual | ~G4EMDataSet () |
|
virtual G4double | FindValue (G4double x, G4int componentId=0) const |
|
virtual void | PrintData (void) const |
|
virtual const G4VEMDataSet * | GetComponent (G4int) const |
|
virtual void | AddComponent (G4VEMDataSet *) |
|
virtual size_t | NumberOfComponents (void) const |
|
virtual const G4DataVector & | GetEnergies (G4int) const |
|
virtual const G4DataVector & | GetData (G4int) const |
|
virtual const G4DataVector & | GetLogEnergies (G4int) const |
|
virtual const G4DataVector & | GetLogData (G4int) const |
|
virtual void | SetEnergiesData (G4DataVector *xData, G4DataVector *data, G4int componentId) |
|
virtual void | SetLogEnergiesData (G4DataVector *xData, G4DataVector *data, G4DataVector *xLogData, G4DataVector *Logdata, G4int componentId) |
|
virtual G4bool | LoadData (const G4String &fileName) |
|
virtual G4bool | LoadNonLogData (const G4String &fileName) |
|
virtual G4bool | SaveData (const G4String &fileName) const |
|
virtual G4double | RandomSelect (G4int componentId=0) const |
|
| G4VEMDataSet () |
|
virtual | ~G4VEMDataSet () |
|
Definition at line 58 of file G4EMDataSet.hh.
◆ G4EMDataSet() [1/5]
Definition at line 62 of file G4EMDataSet.cc.
G4DataVector * log_energies
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4VDataSetAlgorithm * algorithm
◆ G4EMDataSet() [2/5]
Definition at line 84 of file G4EMDataSet.cc.
106 if (
energies->size() != data->size()) {
G4DataVector * log_energies
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4VDataSetAlgorithm * algorithm
◆ G4EMDataSet() [3/5]
Definition at line 115 of file G4EMDataSet.cc.
139 if ((
energies->size() != data->size()) ||
G4DataVector * log_energies
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4VDataSetAlgorithm * algorithm
◆ ~G4EMDataSet()
G4EMDataSet::~G4EMDataSet |
( |
| ) |
|
|
virtual |
Definition at line 150 of file G4EMDataSet.cc.
G4DataVector * log_energies
G4VDataSetAlgorithm * algorithm
◆ G4EMDataSet() [4/5]
G4EMDataSet::G4EMDataSet |
( |
| ) |
|
|
private |
◆ G4EMDataSet() [5/5]
◆ AddComponent()
◆ BuildPdf()
void G4EMDataSet::BuildPdf |
( |
| ) |
|
|
privatevirtual |
Definition at line 482 of file G4EMDataSet.cc.
493 for (i=1; i<nData; i++)
498 totalSum = totalSum + sum;
499 pdf->push_back(totalSum);
504 if (totalSum > 0.) tot = 1. / totalSum;
505 for (i=1; i<nData; i++)
507 (*pdf)[i] = (*pdf)[i] * tot;
G4double Legendre96(T &typeT, F f, G4double a, G4double b)
G4double IntegrationFunction(G4double x)
◆ FindLowerBound() [1/2]
size_t G4EMDataSet::FindLowerBound |
( |
G4double |
energy | ) |
const |
|
private |
Definition at line 432 of file G4EMDataSet.cc.
434 size_t lowerBound = 0;
435 size_t upperBound(
energies->size() - 1);
437 while (lowerBound <= upperBound)
439 size_t midBin((lowerBound + upperBound) / 2);
441 if (
x < (*
energies)[midBin]) upperBound = midBin - 1;
442 else lowerBound = midBin + 1;
◆ FindLowerBound() [2/2]
Definition at line 449 of file G4EMDataSet.cc.
451 size_t lowerBound = 0;;
452 size_t upperBound(values->size() - 1);
454 while (lowerBound <= upperBound)
456 size_t midBin((lowerBound + upperBound) / 2);
458 if (
x < (*values)[midBin]) upperBound = midBin - 1;
459 else lowerBound = midBin + 1;
◆ FindValue()
Implements G4VEMDataSet.
Definition at line 160 of file G4EMDataSet.cc.
virtual G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const =0
size_t FindLowerBound(G4double energy) const
G4DataVector * log_energies
G4VDataSetAlgorithm * algorithm
◆ FullFileName()
Definition at line 466 of file G4EMDataSet.cc.
468 char* path = getenv(
"G4LEDATA");
474 std::ostringstream fullFileName;
475 fullFileName << path <<
'/' <<
name <<
z <<
".dat";
477 return G4String(fullFileName.str().c_str());
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
◆ GetComponent()
◆ GetData()
◆ GetEnergies()
◆ GetLogData()
◆ GetLogEnergies()
◆ IntegrationFunction()
Definition at line 540 of file G4EMDataSet.cc.
virtual G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const =0
size_t FindLowerBound(G4double energy) const
G4VDataSetAlgorithm * algorithm
G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const
◆ LoadData()
Implements G4VEMDataSet.
Definition at line 248 of file G4EMDataSet.cc.
257 std::ifstream
in(fullFileName);
262 message += fullFileName;
263 message +=
"\" not found";
286 if (a != -1 && a != -2)
288 if (a==0.) { a=1
e-300; }
289 if (b==0.) { b=1
e-300; }
G4String FullFileName(const G4String &fileName) const
G4DataVector * log_energies
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
◆ LoadNonLogData()
Implements G4VEMDataSet.
Definition at line 306 of file G4EMDataSet.cc.
315 std::ifstream
in(fullFileName);
319 message += fullFileName;
320 message +=
"\" not found";
336 if (a != -1 && a != -2)
342 else if (k%nColumns == 1)
virtual void SetEnergiesData(G4DataVector *xData, G4DataVector *data, G4int componentId)
G4String FullFileName(const G4String &fileName) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
◆ NumberOfComponents()
virtual size_t G4EMDataSet::NumberOfComponents |
( |
void |
| ) |
const |
|
inlinevirtual |
◆ operator=()
◆ PrintData()
void G4EMDataSet::PrintData |
( |
void |
| ) |
const |
|
virtual |
Implements G4VEMDataSet.
Definition at line 178 of file G4EMDataSet.cc.
181 for (
size_t i(0); i<size; i++)
185 if (
pdf != 0)
G4cout <<
" - PDF : " << (*pdf)[i];
G4GLOB_DLL std::ostream G4cout
◆ RandomSelect()
G4double G4EMDataSet::RandomSelect |
( |
G4int |
componentId = 0 | ) |
const |
|
virtual |
Implements G4VEMDataSet.
Definition at line 511 of file G4EMDataSet.cc.
519 "em1012",
FatalException,
"PDF has not been created for this data set");
virtual G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const =0
size_t FindLowerBound(G4double energy) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4VDataSetAlgorithm * algorithm
G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const
◆ SaveData()
Implements G4VEMDataSet.
Definition at line 360 of file G4EMDataSet.cc.
369 std::ofstream out(fullFileName);
374 message+=fullFileName;
386 G4DataVector::const_iterator i(
energies->begin());
387 G4DataVector::const_iterator endI(
energies->end());
388 G4DataVector::const_iterator j(
data->begin());
400 out << ((*j)/
unitData) << std::endl;
415 out << -1.f << std::endl;
425 out << -2.f << std::endl;
G4String FullFileName(const G4String &fileName) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
◆ SetEnergiesData()
Implements G4VEMDataSet.
Definition at line 190 of file G4EMDataSet.cc.
194 if(!dataX || !dataY) {
198 if (dataX->size() != dataY->size()) {
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
◆ SetLogEnergiesData()
Implements G4VEMDataSet.
Definition at line 214 of file G4EMDataSet.cc.
220 if(!dataX || !dataY || !data_logX || !data_logY) {
224 if (dataX->size() != dataY->size() ||
225 dataX->size() != data_logX->size() ||
226 dataX->size() != data_logY->size()) {
G4DataVector * log_energies
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
◆ algorithm
◆ data
◆ energies
◆ log_data
◆ log_energies
◆ pdf
◆ randomSet
◆ unitData
◆ unitEnergies
The documentation for this class was generated from the following files: