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=1
e-300; }
289 if (b==0.) { b=1
e-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 = std::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");