63 edgeMin(0.), edgeMax(0.), numberOfNodes(0),
65 dBin(0.), baseBin(0.),
90 if (&right==
this) {
return *
this; }
104 return (
this == &right);
111 return (
this != &right);
130 useSpline = vec.useSpline;
175 fOut.write((
char*)(&size),
sizeof size);
178 for(
size_t i = 0; i < size; ++i)
183 fOut.write((
char*)(value), 2*size*(
sizeof (
G4double)));
202 if (fIn.fail()) {
return false; }
206 if (fIn.fail() || siz<=0) {
return false; }
212 for(
G4int i = 0; i < siz ; i++)
216 fIn >> vBin >> vData;
217 if (fIn.fail()) {
return false; }
237 fIn.read((
char*)(&size),
sizeof size);
240 fIn.read((
char*)(value), 2*size*(
sizeof(
G4double)) );
249 for(
size_t i = 0; i < size; ++i)
307 if(!SplinePossible()) {
return; }
319 - firstPointDerivative);
339 *(endPointDerivative -
346 for(
G4int k=n-1; k>0; --k)
370 if(!SplinePossible()) {
return; }
391 for(
G4int i=2; i<n-1; ++i)
406 - (2.0*sig - 1.0)*u[n-2]/
p;
414 for(
G4int k=n-2; k>1; --k)
440 if(!SplinePossible()) {
return; }
446 for(
size_t i=1; i<
n; ++i)
459 G4bool G4PhysicsVector::SplinePossible()
482 out << std::setprecision(12) << pv.
edgeMin <<
" "
487 for(
size_t i = 0; i < pv.
dataVector.size(); i++)
491 out << std::setprecision(6);
504 }
else if(theEnergy >=
edgeMax) {
505 lastIdx = numberOfNodes-1;
508 lastIdx =
FindBin(theEnergy, lastIdx);
509 y = Interpolation(lastIdx, theEnergy);
518 if(1 >= numberOfNodes) {
return 0.0; }
520 size_t bin = std::lower_bound(dataVector.begin(), dataVector.end(), y)
521 - dataVector.begin() - 1;
522 bin =
std::min(bin, numberOfNodes-2);
524 G4double del = dataVector[bin+1] - dataVector[
bin];
526 res += (y - dataVector[
bin])*(
binVector[bin+1] - res)/del;
536 ed <<
"Vector type " <<
type <<
" length= " << numberOfNodes
537 <<
" an attempt to put data at index= " << index;
539 ed,
"Memory overwritten");
G4double G4ParticleHPJENDLHEData::G4double result
void PrintPutValueError(size_t index)
G4PVDataVector dataVector
G4double FindLinearEnergy(G4double rand) const
void CopyData(const G4PhysicsVector &vec)
void DumpValues(G4double unitE=1.0, G4double unitV=1.0) const
std::ostringstream G4ExceptionDescription
G4PhysicsVector(G4bool spline=false)
void ComputeSecondDerivatives(G4double firstPointDerivative, G4double endPointDerivative)
G4double GetLowEdgeEnergy(size_t binNumber) const
void FillSecondDerivatives()
G4bool Store(std::ofstream &fOut, G4bool ascii=false) const
G4int operator!=(const G4PhysicsVector &right) const
G4GLOB_DLL std::ostream G4cout
const XML_Char int const XML_Char * value
G4int operator==(const G4PhysicsVector &right) const
G4PVDataVector secDerivative
virtual void ScaleVector(G4double factorE, G4double factorV)
size_t FindBin(G4double energy, size_t idx) const
G4double Value(G4double theEnergy, size_t &lastidx) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
void ComputeSecDerivatives()
virtual ~G4PhysicsVector()
G4PhysicsVector & operator=(const G4PhysicsVector &)