107 "em1012",
FatalException,
"different size for energies and data (zero case)");
128 log_energies(dataLogX),
141 "em1012",
FatalException,
"different size for energies and data (zero case)");
147 "em1012",
FatalException,
"different size for log energies and log data (zero case)");
150 "em1012",
FatalException,
"different size for log energies and log data");
176 }
else if (energy <= (*
energies)[0]) {
202 for (
size_t i(0); i<size; i++)
206 if (
pdf != 0)
G4cout <<
" - PDF : " << (*pdf)[i];
225 "em1012",
FatalException,
"different size for energies and data (zero case)");
227 }
else if (
energies == 0) {
return; }
285 "em1012",
FatalException,
"different size for log energies and data");
301 std::ifstream in(fullFileName);
306 message += fullFileName;
307 message +=
"\" not found";
330 if (a != -1 && a != -2)
332 if (a==0.) { a=1e-300; }
333 if (b==0.) { b=1e-300; }
359 std::ifstream in(fullFileName);
363 message += fullFileName;
364 message +=
"\" not found";
380 if (a != -1 && a != -2)
386 else if (k%nColumns == 1)
413 std::ofstream out(fullFileName);
418 message+=fullFileName;
430 G4DataVector::const_iterator i(
energies->begin());
431 G4DataVector::const_iterator endI(
energies->end());
432 G4DataVector::const_iterator j(
data->begin());
444 out << ((*j)/
unitData) << std::endl;
459 out << -1.f << std::endl;
469 out << -2.f << std::endl;
478 size_t lowerBound = 0;
479 size_t upperBound(
energies->size() - 1);
481 while (lowerBound <= upperBound)
483 size_t midBin((lowerBound + upperBound) / 2);
485 if (x < (*
energies)[midBin]) upperBound = midBin - 1;
486 else lowerBound = midBin + 1;
495 size_t lowerBound = 0;;
496 size_t upperBound(values->size() - 1);
498 while (lowerBound <= upperBound)
500 size_t midBin((lowerBound + upperBound) / 2);
502 if (x < (*values)[midBin]) upperBound = midBin - 1;
503 else lowerBound = midBin + 1;
512 char* path = getenv(
"G4LEDATA");
518 std::ostringstream fullFileName;
519 fullFileName << path <<
'/' << name <<
z <<
".dat";
521 return G4String(fullFileName.str().c_str());
537 for (i=1; i<nData; i++)
542 totalSum = totalSum + sum;
543 pdf->push_back(totalSum);
548 if (totalSum > 0.) tot = 1. / totalSum;
549 for (i=1; i<nData; i++)
551 (*pdf)[i] = (*pdf)[i] * tot;
563 "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)