72 fOut.write((
char*) (&size),
sizeof size);
75 for (std::size_t i = 0; i < size; ++i)
80 fOut.write((
char*) (value), 2 * size * (
sizeof(
G4double)));
106 if (siz0 < 2) {
return false; }
107 std::size_t siz =
static_cast<std::size_t
>(siz0);
117 for (std::size_t i = 0; i < siz; ++i)
121 fIn >> vBin >> vData;
141 fIn.read((
char*) (&size),
sizeof size);
144 fIn.read((
char*) (value), 2 * size * (
sizeof(
G4double)));
145 if (
static_cast<G4int>(fIn.gcount()) !=
static_cast<G4int>(2 * size * (
sizeof(
G4double))))
153 for (std::size_t i = 0; i < size; ++i)
176 std::size_t idx)
const
191 return GetBin(energy);
211 if (!useSpline) {
return; }
218 G4cout <<
"### G4PhysicsVector: spline cannot be used for "
229 for (std::size_t i=0; i<=
idxmax; ++i)
235 G4cout <<
"### G4PhysicsVector: spline cannot be used, because "
237 <<
" >= E[" << i+1 <<
"]=" <<
binVector[i + 1]
253 G4cout <<
"### G4PhysicsVector:: FillSecondDerivatives N="
261 ComputeSecDerivative1();
265 ComputeSecDerivative2(dir1, dir2);
269 ComputeSecDerivative0();
274void G4PhysicsVector::ComputeSecDerivative0()
279 for (std::size_t i = 1; i < n; ++i)
292void G4PhysicsVector::ComputeSecDerivative1()
312 for(std::size_t i = 2; i <
n - 1; ++i)
333 (2.0 * sig - 1.0) * u[
n - 2] / p;
341 for (std::size_t k = n - 2; k > 1; --k)
357void G4PhysicsVector::ComputeSecDerivative2(
G4double firstPointDerivative,
370 firstPointDerivative);
377 for (std::size_t i = 1; i <
n; ++i)
402 for (std::size_t k = n - 1; k > 0; --k)
417 G4long prec = out.precision();
418 out << std::setprecision(12) << pv.
edgeMin <<
" " << pv.
edgeMax <<
" "
423 for (std::size_t i = 0; i < pv.
dataVector.size(); ++i)
466 <<
"; an attempt to put data at index= " << index
467 <<
" value= " << val <<
" in " << text;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
std::ostream & operator<<(std::ostream &out, const G4PhysicsVector &pv)
G4GLOB_DLL std::ostream G4cout
G4double GetEnergy(const G4double value) const
void PrintPutValueError(std::size_t index, G4double value, const G4String &text)
void ScaleVector(const G4double factorE, const G4double factorV)
G4bool Store(std::ofstream &fOut, G4bool ascii=false) const
std::size_t numberOfNodes
std::vector< G4double > secDerivative
G4PhysicsVector(G4bool spline=false)
G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
std::vector< G4double > dataVector
std::vector< G4double > binVector
virtual void Initialise()
void FillSecondDerivatives(const G4SplineType=G4SplineType::Base, const G4double dir1=0.0, const G4double dir2=0.0)
void DumpValues(G4double unitE=1.0, G4double unitV=1.0) const
std::size_t FindBin(const G4double energy, std::size_t idx) const