#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.
Definition at line 62 of file G4EMDataSet.cc.
81 }
else if (randomSet) { BuildPdf(); }
const XML_Char const XML_Char * data
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition at line 84 of file G4EMDataSet.cc.
102 if (!algorithm || !energies || !data) {
106 if (energies->size() != data->size()) {
109 }
else if (randomSet) {
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition at line 115 of file G4EMDataSet.cc.
127 log_energies(dataLogX),
135 if (!algorithm || !energies || !data || !log_energies || !log_data) {
139 if ((energies->size() != data->size()) ||
140 (energies->size() != log_energies->size()) ||
141 (energies->size() != log_data->size())) {
144 }
else if (randomSet) {
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4EMDataSet::~G4EMDataSet |
( |
| ) |
|
|
virtual |
Implements G4VEMDataSet.
Definition at line 160 of file G4EMDataSet.cc.
162 if (
energy <= (*energies)[0]) {
165 size_t i = energies->size()-1;
166 if (
energy >= (*energies)[i]) {
return (*
data)[i]; }
170 if (log_energies != 0)
virtual G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const =0
const XML_Char const XML_Char * data
G4double energy(const ThreeVector &p, const G4double m)
Implements G4VEMDataSet.
Definition at line 248 of file G4EMDataSet.cc.
256 G4String fullFileName(FullFileName(fileName));
257 std::ifstream in(fullFileName);
262 message += fullFileName;
263 message +=
"\" not found";
286 if (a != -1 && a != -2)
288 if (a==0.) { a=1e-300; }
289 if (b==0.) { b=1e-300; }
292 energies->push_back(a);
293 log_energies->push_back(std::log10(a));
295 log_data->push_back(std::log10(b));
300 if (randomSet) { BuildPdf(); }
std::vector< ExP01TrackerHit * > a
const XML_Char const XML_Char * data
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Implements G4VEMDataSet.
Definition at line 306 of file G4EMDataSet.cc.
314 G4String fullFileName(FullFileName(fileName));
315 std::ifstream in(fullFileName);
319 message += fullFileName;
320 message +=
"\" not found";
336 if (a != -1 && a != -2)
340 argEnergies->push_back(a*unitEnergies);
342 else if (k%nColumns == 1)
344 argData->push_back(a*unitData);
353 if (randomSet) BuildPdf();
std::vector< ExP01TrackerHit * > a
virtual void SetEnergiesData(G4DataVector *xData, G4DataVector *data, G4int componentId)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual size_t G4EMDataSet::NumberOfComponents |
( |
void |
| ) |
const |
|
inlinevirtual |
void G4EMDataSet::PrintData |
( |
void |
| ) |
const |
|
virtual |
Implements G4VEMDataSet.
Definition at line 178 of file G4EMDataSet.cc.
180 size_t size = energies->size();
181 for (
size_t i(0); i<size; i++)
183 G4cout <<
"Point: " << ((*energies)[i]/unitEnergies)
184 <<
" - Data value: " << ((*
data)[i]/unitData);
185 if (pdf != 0)
G4cout <<
" - PDF : " << (*pdf)[i];
const XML_Char const XML_Char * data
G4GLOB_DLL std::ostream G4cout
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");
526 size_t bin = FindLowerBound(x,pdf);
533 if (bin == 0) value = linearAlgo.
Calculate(x, bin, *pdf, *energies);
534 else value = algorithm->
Calculate(x, bin, *pdf, *energies);
G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const
virtual G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const =0
const XML_Char int const XML_Char * value
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Implements G4VEMDataSet.
Definition at line 360 of file G4EMDataSet.cc.
369 std::ofstream out(fullFileName);
374 message+=fullFileName;
384 if (energies!=0 &&
data!=0)
386 G4DataVector::const_iterator i(energies->begin());
387 G4DataVector::const_iterator endI(energies->end());
388 G4DataVector::const_iterator j(
data->begin());
395 out << ((*i)/unitEnergies) <<
' ';
400 out << ((*j)/unitData) << std::endl;
415 out << -1.f << std::endl;
425 out << -2.f << std::endl;
const XML_Char const XML_Char * data
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
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)
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()) {
238 log_energies = data_logX;
241 log_data = data_logY;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
The documentation for this class was generated from the following files:
- source/geant4.10.03.p03/source/processes/electromagnetic/lowenergy/include/G4EMDataSet.hh
- source/geant4.10.03.p03/source/processes/electromagnetic/lowenergy/src/G4EMDataSet.cc