#include <G4DataSet.hh>
|
| G4DataSet (G4int argZ, G4IInterpolator *algo, G4double xUnit=CLHEP::MeV, G4double yUnit=CLHEP::barn, G4bool random=false) |
|
| G4DataSet (G4int argZ, G4DataVector *xData, G4DataVector *data, G4IInterpolator *algo, G4double xUnit=CLHEP::MeV, G4double yUnit=CLHEP::barn, G4bool random=false) |
|
virtual | ~G4DataSet () |
|
virtual G4double | FindValue (G4double x, G4int componentId=0) const |
|
virtual void | PrintData (void) const |
|
virtual const G4IDataSet * | GetComponent (G4int) const |
|
virtual void | AddComponent (G4IDataSet *) |
|
virtual size_t | NumberOfComponents (void) const |
|
virtual const G4DataVector & | GetEnergies (G4int) const |
|
virtual const G4DataVector & | GetData (G4int) const |
|
virtual void | SetEnergiesData (G4DataVector *xData, G4DataVector *data, G4int componentId) |
|
virtual G4bool | LoadData (const G4String &fileName) |
|
virtual G4bool | SaveData (const G4String &fileName) const |
|
virtual G4double | RandomSelect (G4int componentId=0) const |
|
| G4IDataSet () |
|
virtual | ~G4IDataSet () |
|
Definition at line 54 of file G4DataSet.hh.
◆ G4DataSet() [1/4]
Definition at line 47 of file G4DataSet.cc.
64 "Interpolation == 0");
G4IInterpolator * algorithm
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
◆ G4DataSet() [2/4]
Definition at line 68 of file G4DataSet.cc.
87 "Interpolation == 0");
93 "different size for energies and data (zero case)");
97 if (
energies->size() != data->size())
101 "different size for energies and data");
G4IInterpolator * algorithm
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
◆ ~G4DataSet()
G4DataSet::~G4DataSet |
( |
| ) |
|
|
virtual |
◆ G4DataSet() [3/4]
◆ G4DataSet() [4/4]
G4DataSet::G4DataSet |
( |
const G4DataSet & |
copy | ) |
|
|
private |
◆ AddComponent()
virtual void G4DataSet::AddComponent |
( |
G4IDataSet * |
| ) |
|
|
inlinevirtual |
◆ BuildPdf()
void G4DataSet::BuildPdf |
( |
| ) |
|
|
privatevirtual |
Definition at line 353 of file G4DataSet.cc.
364 for (i=1; i<nData; i++)
369 totalSum = totalSum + sum;
370 pdf->push_back(totalSum);
375 if (totalSum > 0.) tot = 1. / totalSum;
376 for (i=1; i<nData; i++)
378 (*pdf)[i] = (*pdf)[i] * tot;
G4double IntegrationFunction(G4double x)
G4double Legendre96(T &typeT, F f, G4double a, G4double b)
◆ FindLowerBound() [1/2]
size_t G4DataSet::FindLowerBound |
( |
G4double |
energy | ) |
const |
|
private |
Definition at line 303 of file G4DataSet.cc.
305 size_t lowerBound = 0;
306 size_t upperBound(
energies->size() - 1);
308 while (lowerBound <= upperBound)
310 size_t midBin((lowerBound + upperBound) / 2);
312 if (
x < (*
energies)[midBin]) upperBound = midBin - 1;
313 else lowerBound = midBin + 1;
◆ FindLowerBound() [2/2]
Definition at line 320 of file G4DataSet.cc.
322 size_t lowerBound = 0;;
323 size_t upperBound(values->size() - 1);
325 while (lowerBound <= upperBound)
327 size_t midBin((lowerBound + upperBound) / 2);
329 if (
x < (*values)[midBin]) upperBound = midBin - 1;
330 else lowerBound = midBin + 1;
◆ FindValue()
Implements G4IDataSet.
Definition at line 114 of file G4DataSet.cc.
G4IInterpolator * algorithm
virtual G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const =0
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
size_t FindLowerBound(G4double energy) const
◆ FullFileName()
Definition at line 337 of file G4DataSet.cc.
339 char* path = getenv(
"G4PIIDATA");
344 "G4PIIDATA environment variable not set");
346 std::ostringstream fullFileName;
347 fullFileName << path <<
'/' <<
name <<
z <<
".dat";
349 return G4String(fullFileName.str().c_str());
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
◆ GetComponent()
◆ GetData()
◆ GetEnergies()
◆ IntegrationFunction()
Definition at line 411 of file G4DataSet.cc.
G4IInterpolator * algorithm
virtual G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const =0
G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const
size_t FindLowerBound(G4double energy) const
◆ LoadData()
Implements G4IDataSet.
Definition at line 176 of file G4DataSet.cc.
185 std::ifstream
in(fullFileName);
190 std::ostringstream message;
191 message <<
"G4DataSet::LoadData - data file " << fullFileName <<
" not found";
196 message.str().c_str());
203 bool energyColumn(
true);
218 energyColumn=(!energyColumn);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4String FullFileName(const G4String &fileName) const
virtual void SetEnergiesData(G4DataVector *xData, G4DataVector *data, G4int componentId)
◆ NumberOfComponents()
virtual size_t G4DataSet::NumberOfComponents |
( |
void |
| ) |
const |
|
inlinevirtual |
◆ operator=()
◆ PrintData()
void G4DataSet::PrintData |
( |
void |
| ) |
const |
|
virtual |
Implements G4IDataSet.
Definition at line 131 of file G4DataSet.cc.
140 for (
size_t i(0); i<size; i++)
144 if (
pdf != 0)
G4cout <<
" - PDF : " << (*pdf)[i];
G4GLOB_DLL std::ostream G4cout
◆ RandomSelect()
Implements G4IDataSet.
Definition at line 383 of file G4DataSet.cc.
391 "PDF has not been created for this data set");
G4IInterpolator * algorithm
virtual G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const =0
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const
size_t FindLowerBound(G4double energy) const
◆ SaveData()
Implements G4IDataSet.
Definition at line 229 of file G4DataSet.cc.
238 std::ofstream out(fullFileName);
243 std::ostringstream message;
244 message <<
"G4DataSet:: SaveData - cannot open " << fullFileName;
249 message.str().c_str());
259 G4DataVector::const_iterator i(
energies->begin());
260 G4DataVector::const_iterator endI(
energies->end());
261 G4DataVector::const_iterator j(
data->begin());
273 out << ((*j)/
unitData) << std::endl;
288 out << -1.f << std::endl;
298 out << -2.f << std::endl;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4String FullFileName(const G4String &fileName) const
◆ SetEnergiesData()
Implements G4IDataSet.
Definition at line 151 of file G4DataSet.cc.
158 if (data)
delete data;
165 "different size for energies and data (zero case)");
169 if (
energies->size() != data->size())
173 "different size for energies and data");
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
◆ algorithm
◆ data
◆ energies
◆ pdf
◆ randomSet
◆ unitData
◆ unitEnergies
The documentation for this class was generated from the following files: