65 edgeMin(0.), edgeMax(0.), numberOfNodes(0),
67 dBin(0.), baseBin(0.),
98 if (&right==
this) {
return *
this; }
112 return (
this == &right);
119 return (
this != &right);
138 useSpline = vec.useSpline;
181 fOut.write((
char*)(&size),
sizeof size);
184 for(
size_t i = 0; i < size; ++i)
189 fOut.write((
char*)(value), 2*size*(
sizeof (
G4double)));
208 if (fIn.fail()) {
return false; }
212 if (fIn.fail()) {
return false; }
216 G4cerr <<
"G4PhysicsVector::Retrieve():";
226 for(
G4int i = 0; i < siz ; i++)
230 fIn >> vBin >> vData;
231 if (fIn.fail()) {
return false; }
251 fIn.read((
char*)(&size),
sizeof size);
254 fIn.read((
char*)(value), 2*size*(
sizeof(
G4double)) );
263 for(
size_t i = 0; i < size; ++i)
315 if(!SplinePossible()) {
return; }
327 - firstPointDerivative);
347 *(endPointDerivative -
354 for(
G4int k=n-1; k>0; --k)
378 if(!SplinePossible()) {
return; }
399 for(
G4int i=2; i<n-1; ++i)
414 - (2.0*sig - 1.0)*u[n-2]/
p;
422 for(
G4int k=n-2; k>1; --k)
448 if(!SplinePossible()) {
return; }
454 for(
size_t i=1; i<
n; ++i)
467 G4bool G4PhysicsVector::SplinePossible()
494 out << std::setprecision(12) << pv.
edgeMin <<
" "
499 for(
size_t i = 0; i < pv.
dataVector.size(); i++)
503 out << std::setprecision(6);
517 }
else if(theEnergy >=
edgeMax) {
518 lastIdx = numberOfNodes-1;
521 lastIdx =
FindBin(theEnergy, lastIdx);
522 y = Interpolation(lastIdx, theEnergy);
531 if(1 >= numberOfNodes) {
return 0.0; }
533 size_t n2 = numberOfNodes/2;
534 size_t n3 = numberOfNodes - 1;
538 if (y > dataVector[n2])
542 n2 = (n3 + n1 + 1)/2;
545 G4double del = dataVector[n3] - dataVector[n1];
547 res += (y - dataVector[n1])*(
binVector[n3] - res)/del;
G4PVDataVector dataVector
G4double FindLinearEnergy(G4double rand) const
void CopyData(const G4PhysicsVector &vec)
G4ThreadLocal G4Allocator< G4PhysicsVector > * fpPVAllocator
G4PhysicsVector(G4bool spline=false)
void ComputeSecondDerivatives(G4double firstPointDerivative, G4double endPointDerivative)
G4double G4NeutronHPJENDLHEData::G4double result
G4double GetLowEdgeEnergy(size_t binNumber) const
void FillSecondDerivatives()
G4int operator!=(const G4PhysicsVector &right) const
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
virtual G4bool Store(std::ofstream &fOut, G4bool ascii=false)
virtual G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
const XML_Char int const XML_Char * value
void ComputeSecDerivatives()
virtual ~G4PhysicsVector()
G4PhysicsVector & operator=(const G4PhysicsVector &)
G4GLOB_DLL std::ostream G4cerr