127 log_energies(dataLogX),
181 for (
size_t i(0); i<size; i++)
185 if (
pdf != 0)
G4cout <<
" - PDF : " << (*pdf)[i];
194 if(!dataX || !dataY) {
198 if (dataX->size() != dataY->size()) {
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()) {
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; }
315 std::ifstream in(fullFileName);
319 message += fullFileName;
320 message +=
"\" not found";
336 if (a != -1 && a != -2)
342 else if (k%nColumns == 1)
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;
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;
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;
468 char* path = getenv(
"G4LEDATA");
474 std::ostringstream fullFileName;
475 fullFileName << path <<
'/' << name <<
z <<
".dat";
477 return G4String(fullFileName.str().c_str());
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;
519 "em1012",
FatalException,
"PDF has not been created for this data set");
G4double Legendre96(T &typeT, F f, G4double a, G4double b)
G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const
virtual void SetEnergiesData(G4DataVector *xData, G4DataVector *data, G4int componentId)
virtual G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const =0
size_t FindLowerBound(G4double energy) const
G4double IntegrationFunction(G4double x)
G4GLOB_DLL std::ostream G4cout
G4DataVector * log_energies
virtual G4double FindValue(G4double x, G4int componentId=0) const
virtual G4bool SaveData(const G4String &fileName) const
G4String FullFileName(const G4String &fileName) const
virtual void PrintData(void) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4VDataSetAlgorithm * algorithm
virtual G4bool LoadData(const G4String &fileName)
G4double energy(const ThreeVector &p, const G4double m)
virtual G4double RandomSelect(G4int componentId=0) const
virtual void SetLogEnergiesData(G4DataVector *xData, G4DataVector *data, G4DataVector *xLogData, G4DataVector *Logdata, G4int componentId)
virtual G4bool LoadNonLogData(const G4String &fileName)