63 "Interpolation == 0");
86 "Interpolation == 0");
92 "different size for energies and data (zero case)");
100 "different size for energies and data");
139 for (
size_t i(0); i<size; i++)
143 if (
pdf != 0)
G4cout <<
" - PDF : " << (*pdf)[i];
164 "different size for energies and data (zero case)");
172 "different size for energies and data");
184 std::ifstream
in(fullFileName);
190 message <<
"G4DataSet::LoadData - data file " << fullFileName <<
" not found";
195 message.str().c_str());
202 bool energyColumn(
true);
217 energyColumn=(!energyColumn);
237 std::ofstream out(fullFileName);
243 message <<
"G4DataSet:: SaveData - cannot open " << fullFileName;
248 message.str().c_str());
258 G4DataVector::const_iterator i(
energies->begin());
259 G4DataVector::const_iterator endI(
energies->end());
260 G4DataVector::const_iterator j(
data->begin());
272 out << ((*j)/
unitData) << std::endl;
287 out << -1.f << std::endl;
297 out << -2.f << std::endl;
304 size_t lowerBound = 0;
305 size_t upperBound(
energies->size() - 1);
307 while (lowerBound <= upperBound)
309 size_t midBin((lowerBound + upperBound) / 2);
311 if (x < (*
energies)[midBin]) upperBound = midBin - 1;
312 else lowerBound = midBin + 1;
321 size_t lowerBound = 0;;
322 size_t upperBound(values->size() - 1);
324 while (lowerBound <= upperBound)
326 size_t midBin((lowerBound + upperBound) / 2);
328 if (x < (*values)[midBin]) upperBound = midBin - 1;
329 else lowerBound = midBin + 1;
338 char* path = std::getenv(
"G4PIIDATA");
343 "G4PIIDATA environment variable not set");
345 std::ostringstream fullFileName;
346 fullFileName << path <<
'/' << name <<
z <<
".dat";
348 return G4String(fullFileName.str().c_str());
363 for (i=1; i<nData; i++)
368 totalSum = totalSum +
sum;
369 pdf->push_back(totalSum);
374 if (totalSum > 0.) tot = 1. / totalSum;
375 for (i=1; i<nData; i++)
377 (*pdf)[i] = (*pdf)[i] * tot;
390 "PDF has not been created for this data set");